Abstract
Finite difference is a simple approximation which can solve many mathematical problems such as ordinary differential equation (ODE) or partial differential equation (PDE). Exact solutions for ODE or PDE are difficult to find out and been restricted in certain condition some time, that is why we need approximate solution for these equations.
Demo P-SV wave propagation
Method(ODE)
A simple example for ODE is y'(x)-y(x)=0, by the concept of finite difference, y'(x) can be substituted by first order differential term and put in discrete: y'(xi)~(y(xi+1)-y(xi))/dh, notice that this approximation is true if and only if dh close to zero. ODE becomes (y(xi+1)-y(xi))/dh-y(xi)=0, re-arranged this equation, we get:
(1) Iteration method
This is a iterative and numerical solution of original ODE, given the initial value of y(0)=1 at i=1, we can then solve this ODE numerically.
Actually, we already know that this ODE had a exact solution of u(x)=exp(x) which satisfy exp'(x)=exp(x). We can easily check our FD approximation by this exact solution.
The dh in above examples are set as 0.1, if dh close enough to zero, FD solution can almost represent the exact solution.
(2) Matrix method
Another method solving this ODE is the matrix form, because the repetition characteristic of discrete FD equation, we can solve this problem by simultaneous equation:
Method(PDE)
Partial differential equation is much complicate than ODE because the function y is no longer dependent on one variable x. Wave equation (utt=c2uxx ,for 1-D) is a common example which u is the function of position x and time t. This equation can be solved by finite difference method with below two approximations:
These approximation are derived from difference again the first order differential equation. We can replace above wave equation by these approximation and solve the u(x,t) step by step.
For 1-D case, consider the material is continuous and homogeneous and ignore the attenuation on the material, from RHS(Right Hand Side) of 1-D wave equation, we know the central point ui is related to its nearby grids (that is why potential propagate). From LHS, we get the update form of the equation:
c=100 grids/sec
1-D wave equation can easily derive to 2-D or 3-D case with augmenting the dimension of u(x,t) matrix to u(xi,t); i=1~3, and differential of each u in space becomes gradient. Beginning of this page shows a 2-D P-SV wave demo of finite difference simulation, which solved the classical equation of motion in Seismology:
By Newton's Second law F=ma,
ro and Adx denotes density and unit volume of a small material, F is the force acting in this system(e.g. earthquake). Notices that stress tensor is proportional to strain if we assume this is a elastic material,
Also, definition of strain is the difference of u (for infinitesimal displacement), thus, above equation can be solved by the finite difference with balance of LHS and RHS as the function of u.