Simple FD Gerard T. Schuster.

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Finite Difference Discretization of Hyperbolic Equations: Linear Problems Lectures 8, 9 and 10.
Formal Computational Skills
Computational Modeling for Engineering MECN 6040
Chapter 8 Elliptic Equation.
P. Venkataraman Mechanical Engineering P. Venkataraman Rochester Institute of Technology DETC2013 – 12269: Continuous Solution for Boundary Value Problems.
Point-wise Discretization Errors in Boundary Element Method for Elasticity Problem Bart F. Zalewski Case Western Reserve University Robert L. Mullen Case.
Lecture 18 - Numerical Differentiation
Session: Computational Wave Propagation: Basic Theory Igel H., Fichtner A., Käser M., Virieux J., Seriani G., Capdeville Y., Moczo P.  The finite-difference.
Numerical Integration of Partial Differential Equations (PDEs)
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
PART 7 Ordinary Differential Equations ODEs
Lecture 2: Numerical Differentiation. Derivative as a gradient
Atms 4320 Lab 2 Anthony R. Lupo. Lab 2 -Methodologies for evaluating the total derviatives in the fundamental equations of hydrodynamics  Recall that.
Fourier: ApplicationsModern Seismology – Data processing and inversion 1 Fourier Transform: Applications Seismograms Eigenmodes of the Earth Time derivatives.
Introduction to Numerical Methods I
Finite Difference Time Domain Method (FDTD)
Numerical Methods for Partial Differential Equations
Spectral analysis: Foundations
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Finite element method 1 Finite Elements  Basic formulation  Basis functions  Stiffness matrix  Poisson‘s equation  Regular grid  Boundary conditions.
Pseudospectral Methods
Function approximation: Fourier, Chebyshev, Lagrange
Numerical methods Specific methods:
1 The Spectral Method. 2 Definition where (e m,e n )=δ m,n e n = basis of a Hilbert space (.,.): scalar product in this space In L 2 space where f * :
Finite Differences Finite Difference Approximations  Simple geophysical partial differential equations  Finite differences - definitions  Finite-difference.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Lecture 22 MA471 Fall Advection Equation Recall the 2D advection equation: We will use a Runge-Kutta time integrator and spectral representation.
Scientific Computing Partial Differential Equations Poisson Equation.
Finite Element Method.
Lecture 3.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Fourier Series. Introduction Decompose a periodic input signal into primitive periodic components. A periodic sequence T2T3T t f(t)f(t)
To Dream the Impossible Scheme Part 1 Approximating Derivatives on Non-Uniform, Skewed and Random Grid Schemes Part 2 Applying Rectangular Finite Difference.
7. Introduction to the numerical integration of PDE. As an example, we consider the following PDE with one variable; Finite difference method is one of.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
1 Complex Images k’k’ k”k” k0k0 -k0-k0 branch cut   k 0 pole C1C1 C0C0 from the Sommerfeld identity, the complex exponentials must be a function.
Forward modelling The key to waveform tomography is the calculation of Green’s functions (the point source responses) Wide range of modelling methods available.
Engineering Analysis – Computational Fluid Dynamics –
Engineering Analysis – Computational Fluid Dynamics –
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
1 EEE 431 Computational Methods in Electrodynamics Lecture 8 By Dr. Rasime Uyguroglu
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
The story so far… ATM 562 Fovell Fall, Convergence We will deploy finite difference (FD) approximations to our model partial differential equations.
Solving Partial Differential Equation Numerically Pertemuan 13 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
Math for CS Fourier Transforms
1 EEE 431 Computational Methods in Electrodynamics Lecture 13 By Dr. Rasime Uyguroglu
Chapter 4 Dynamical Behavior of Processes Homework 6 Construct an s-Function model of the interacting tank-in-series system and compare its simulation.
EEE 431 Computational Methods in Electrodynamics
Chapter 4 Dynamical Behavior of Processes Homework 6 Construct an s-Function model of the interacting tank-in-series system and compare its simulation.
Lecture 4: Numerical Stability
Introduction to Numerical Methods I
Chapter 30.
Modeling of Traffic Flow Problems
Boundary Element Analysis of Systems Using Interval Methods
ივანე ჯავახიშვილის სახელობის
Control Systems With Embedded Implementation (CSEI)
ივანე ჯავახიშვილის სახელობის
UNIT II Analysis of Continuous Time signal
Interpolation.
17-Nov-18 Parallel 2D and 3D Acoustic Modeling Application for hybrid computing platform of PARAM Yuva II Abhishek Srivastava, Ashutosh Londhe*, Richa.
Finite Elements Basic formulation Basis functions Stiffness matrix
Finite Volume Method for Unsteady Flows
Chapter 5 DT System Analysis : Z Transform Basil Hamed
topic4: Implicit method, Stability, ADI method
topic4: Implicit method, Stability, ADI method
topic11_shocktube_problem
topic4: Implicit method, Stability, ADI method
An optimized implicit finite-difference scheme for the two-dimensional Helmholtz equation Zhaolun Liu Next, I will give u an report about the “”
Presentation transcript:

Simple FD Gerard T. Schuster

Outline Basics Accuracy Stability Dispersion Fourier Finite Difference

Basics of Finite Differences The discretization of differential operators is not unique 1st-order approximations are one-sided approximations, full lines in figure: 2nd-order difference has higher accuracy but does not involve values at grid point xj dotted line in figure Demands on numerical stability as well as numerical accuracy can not be satisfied in all cases

Explicit Methods Advance numerical solution in time from the old time level t(n) to t(n+1) with spatial difference operator H Explicit methods: Spatial derivatives are calculated using the values at the old time level U(n) Extrapolating the solution into the future Time step t is restricted, e.g. CFL-condition Easy to implement, parallelization possible Most numerical methods, operator splitting

Outline Basics Accuracy Stability Dispersion Fourier Finite Difference

Accuracy I The accuracy of difference approximations can be tested by simple Taylor-series expansion For the right-sided approximation we obtain Adding the two expressions we see the more accurate central differences

central difference on a non-equidistant grid Accuracy II right-sided, 1st - order left-sided, 1st - order central difference, 2nd - order central difference on a non-equidistant grid

2nd Derivatives A simple approximation of the 2nd-derivative on an equidistant grid can be obtained by summing up the left- an right-sided finite difference expressions, subtract 2fj Higher order approximations involve more grid points, e.g. 4-order expression Higher order: Be careful with the corresponding boundary conditions

Accuracy of 2nd Derivatives Simplest approximation of the 2nd-derivative on an equidistant grid Again, simple test function: f = C eikx and same procedure as before See again 2x0, when x0 Approximation is 2nd-order, waves are dispersive with ~k2 Such difference scheme for diffusion problems, Laplace and Poisson equation

Accuracy of waves Compare finite difference expression with differential operator, e.g. central difference and 1st-derivative Simple test function: f = C eikx Only small values of kx are well represented by sin(kx) k has to be small or the wavelength 2/k has to large The smaller k the less diffusion, transport of waves is dispersive Errors are always seen on the smallest scales, zigzag-pattern

Outline Basics Accuracy Stability Dispersion Fourier Finite Difference

Stability The stability of any numerical method is measured by the amplification of numerical errors in time n is the error at time step tn and g is the so-called amplification factor (or amplification matrix for systems of equations): Numerical stability requires that the amplification of errors remains limited, i.e. Only for simple, linear discretizations allow a rigorous analysis of the amplification matrix, non-linear systems yield to non-linear numerical schemes

Calculation of Stability Taking a 1-dimensional interval X = [X1,X2], dividing it into (J-1)-subintervals where a function f(x) is defined on this interval X at distinct grid points xj with 1j J and f(xj)=fj Fourier decomposition of f(x) on X, assume an equidistant grid with x Fourier modes are orthogonal, therefore single modes can be analyzed to calculate stability of the numerical scheme

Example: Von Neumann Calculation of Instability ∂P/∂t=-c∂P/∂x (1) ∂^2P/∂t^2=-c∂(∂P/∂t)/∂x = c^2∂^2P/∂x^2 (2) ∂P/∂t = (P - P )/dt ;∂P/∂x=(P - P )/(2dx) (3) j j j+1 j-1 t+1 t t t Substitute (3) into (1) we get P = P -cdt/(2dx)(P - P ) (4) j j j+1 j-1 t+1 t t t Substitute P = e e into (3) we get ikjdx -iwt e e = e -cdt/(2dx)(e - e )e (5) ikjdx -iw(t+dt) ikjdx -iwt ik(j+1)dx ik(j-1)dx -iwt Divide by e we get ikjdx – iwt g= e = 1 - icdt/(dx)sin{kdx} ; |g|=sqrt{1+(cdt/dxsin{kdx})^2} Stability demands |g|<1, which is impossible. Above is unstable because errors grow with time – iwdt Amplification factor because Pjn=gnPj0

Example: Von Neumann Calculation of Stability ∂P/∂t=-c∂P/∂x (1) ∂^2P/∂t^2=-c∂(∂P/∂t)/∂x = c^2∂^2P/∂x^2 (2) ∂P/∂t = (P - P )/dt ;∂P/∂x=(P - P )/(2dx) (3) j j j+1 j-1 t+1 t t t Substitute (3) into (1) we get t+1 t t t P = 0.5(P + P ) j j +1 j-1 t t t P = P -cdt/(2dx)(P - P ) ; (4) j j j+1 j-1 Substitute P = e e into (4) we get ikjdx -iwt eikjdx-iw(t+dt)= {cos(kdx) - icdt/(dx)sin[kdx] }eikjdx-iwt; or dividing by eikjdx-iwt g= e = cos(kdx) - icdt/(dx)sin[kdx] ; Stability demands |g|<1, which it is if cdt/dx<1. Above is conditionally stable because errors damps with time if CFL holds (a necessary but not suficient condition for stability). As along as accuracy of FD does not exceed highest order derivative, CFL for symmetric stencils is both sufficient and necessary. – iwdt Amplification factor because Pjn=gnPj0 |g|=sqrt{cos(kdx)^2 +(cdt/dxsin{kdx})^2}

Example: Von Neumann Calculation of Stability t+1 t t t P = 0.5(P + P ) j j +1 j-1 t t t P = P -cdt/(2dx)(P - P ); (4) j j j+1 j-1 j j j+1 j-1 j+1 j j-1 P = P -cdt/(2dx)(P - P ) + 0.5dx^2(P -2P + P )/dx^2 t+1 t t t t t t This is a Laplacian, and emulates a diffusion term that damps errors; this is why Lax worked. Less accuracy but better stability

Outline Basics Accuracy Stability Dispersion Fourier Finite Difference

Problems: Dispersion Dispersion: The numerical approximation has artificial dispersion, in other words, the wave speed becomes frequency dependent. You have to find a frequency bandwidth where this effect is small. The solution is to use a sufficient number of grid points per wavelength. True velocity

Snapshot Example

Seismogram Dispersion

Outline Basics Accuracy Stability Dispersion Pseudo-Spectral or Fourier Finite-Difference Modeling

What is a Pseudo-spectral Method? Numerical Methods in Geophysics Spectral solutions to time-dependent PDEs are formulated in the frequency-wavenumber domain and solutions are obtained in terms of spectra (e.g. seismograms). This technique is particularly interesting for geometries where partial solutions in the -k domain can be obtained analytically (e.g. for layered models). In the pseudo-spectral approach - in a finite-difference like manner - the PDEs are solved pointwise in physical space (x-t). However, the space derivatives are calculated using orthogonal functions (e.g. Fourier Integrals, Chebyshev polynomials). They are either evaluated using matrix-matrix multiplications or the fast Fourier transform (FFT). Numerical Methods in Geophysics The Fourier Method

MATLAB Code FD Approx. to 1-D Acoustic Wave Equation a = (c*dt/dx)^2; for t=1:nt f = force(:,:,t); dfuture = dpres - 2* dpast + a*del(dpres); dfuture = dfuture + f; dpast=dpresent; dpresent=dfuture; Dp2=fft(p);Dp2=k^2*Dp2;dp2=ifft(Dp2); dp2 end

Fourier Derivatives .. let us recall the definition of the derivative using Fourier integrals ... ... we could either ... 1) perform this calculation in the space domain by convolution 2) actually transform the function f(x) in the k-domain and back Numerical Methods in Geophysics The Fourier Method

The Fast Fourier Transform Numerical Methods in Geophysics ... the latter approach became interesting with the introduction of the Fast Fourier Transform (FFT). What’s so fast about it ? The FFT originates from a paper by Cooley and Tukey (1965, Math. Comp. vol 19 297-301) which revolutionised all fields where Fourier transforms where essential to progress. The discrete Fourier Transform can be written as Numerical Methods in Geophysics The Fourier Method

The Fast Fourier Transform ... this can be written as matrix-vector products ... for example the inverse transform yields ... .. where ... Numerical Methods in Geophysics The Fourier Method

The Fast Fourier Transform ... the FAST bit is recognising that the full matrix - vector multiplication can be written as a few sparse matrix - vector multiplications (for details see for example Bracewell, the Fourier Transform and its applications, MacGraw-Hill) with the effect that: Number of multiplications full matrix FFT N2 2Nlog2N this has enormous implications for large scale problems. Note: the factorisation becomes particularly simple and effective when N is a highly composite number (power of 2). Numerical Methods in Geophysics The Fourier Method

The Fast Fourier Transform Number of multiplications Problem full matrix FFT Ratio full/FFT 1D (nx=512) 2.6x105 9.2x103 28.4 1D (nx=2096) 94.98 1D (nx=8384) 312.6 .. the right column can be regarded as the speedup of an algorithm when the FFT is used instead of the full system. Numerical Methods in Geophysics The Fourier Method

Acoustic Wave Equation - Fourier Method let us take the acoustic wave equation with variable density the left hand side will be expressed with our standard centered finite-difference approach ... leading to the extrapolation scheme ... Numerical Methods in Geophysics The Fourier Method

Acoustic Wave Equation - Fourier Method where the space derivatives will be calculated using the Fourier Method. The highlighted term will be calculated as follows: multiply by 1/ ... then extrapolate ... Numerical Methods in Geophysics The Fourier Method

Acoustic Wave Equation - 3D .. where the following algorithm applies to each space dimension ... Numerical Methods in Geophysics The Fourier Method

... with the usual Ansatz we obtain ... leading to Fourier Method - Dispersion and Stability ... with the usual Ansatz we obtain ... leading to Numerical Methods in Geophysics The Fourier Method

What are the consequences? Fourier Method - Dispersion and Stability What are the consequences? a) when dt << 1, sin-1 (kcdt/2) kcdt/2 and w/k=c -> practically no dispersion b) the argument of asin must be smaller than one. Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - 10Hz Example of acoustic 1D wave simulation. FD 3 -point operator red-analytic; blue-numerical; green-difference Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - 10Hz Example of acoustic 1D wave simulation. FD 5 -point operator red-analytic; blue-numerical; green-difference Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - 10Hz Example of acoustic 1D wave simulation. Fourier operator red-analytic; blue-numerical; green-difference Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - 20Hz Example of acoustic 1D wave simulation. FD 3 -point operator red-analytic; blue-numerical; green-difference Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - 20Hz Example of acoustic 1D wave simulation. FD 5 -point operator red-analytic; blue-numerical; green-difference Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - 20Hz Example of acoustic 1D wave simulation. Fourier operator red-analytic; blue-numerical; green-difference Numerical Methods in Geophysics The Fourier Method

Fourier Method - Comparison with FD - Table Difference (%) between numerical and analytical solution as a function of propagating frequency Simulation time 5.4s 7.8s 33.0s Numerical Methods in Geophysics The Fourier Method