Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Finite-Difference Method Taylor Series Expansion Suppose we have a continuous function f(x), its value in the vicinity of can be approximately expressed.

Similar presentations


Presentation on theme: "The Finite-Difference Method Taylor Series Expansion Suppose we have a continuous function f(x), its value in the vicinity of can be approximately expressed."— Presentation transcript:

1 The Finite-Difference Method Taylor Series Expansion Suppose we have a continuous function f(x), its value in the vicinity of can be approximately expressed using a Taylor series as (2.1) Using (2.1), we have derive the discrete expression for the first order derivative as (2.2)

2 f(x) x i-2 i-1 i i+1 i+2 Backward Central Forward Replacing x by x i+1 or x i-1, in (2.2) or substracting Taylor expansion equation for x i-1 from x i+1, we can get Expressing ; we obtain

3 The order of the higher-order terms that are deleted from the right-hand sides of the discrete equation. In numerical method, they are called “truncation errors”. General forms: FDS: The first order accurate BDS: The first order accurate CDS: The second order accurate Exercise: Derive CDS and determine its truncation error

4 For the second order derivative, we also can use the same approach. Example: Use the uniform grid (2.3) (2.4) Eq. (2.3) + Eq. (2.4) Then, we have Centered Difference Scheme (CDS) with second order accuracy

5 i,j i,j +1 i,j- 1 i+ 1,j i- 1,j X: i=1, 2, 3….N Y: j=1,2,3…...M Fig. 2.2: Uniform rectangular grids. Example of constructing the difference equation Select the CDS The basic idea for the finite-difference method is to replace the derivatives using the discrete approximation and convert the differential equation to a set of algebraic equations.

6 The time derivatives n-1nn+1 FDS BDS CDS

7 2.2. Numerical Schemes Explicit scheme: A numerical scheme in which the numerical value at time step (n+1) is calculated directly from its previous value at the time step n. This means that once the values at the time step n are known, we can “predict” a new value at the time step (n+1) by a direct time integration. Implicit scheme: A numerical scheme in which the numerical value at the time step (n+1) is not explicitly obtained from its previous value at the time step n. This value must be solved from an algebraic equation formed at the time step n+1. Example: C x g Fig. 2.3: Schematic of a propagation of a blob. It is solvable, with a general form

8 a) Leapfrog Scheme Truncation error: for time derivative for space derivative (2.5) Then, the difference equation is

9 b). Forward Time/Central Space Scheme (Euler Scheme). Truncation error: First-order accurate Second-order accurate

10 c). Forward Time/Backward Space Scheme First-order accurate Truncation errors: Sometime, it is also called the upwind scheme for the case C > 0.

11 d). Forward Time/Implicit Central Space Scheme First-order accurate Second-order accurate This is a fully-implicit scheme!

12 e). Crank-Nicolson Scheme—Semi-implicit Scheme First-order accurate Second-order accurate Truncation errors:

13 f). Lax-Wendroff Scheme n+1 n+1/2 n t x i-1 ii+1i-1/2 i+1/2 Fig. 2.5: The space-time stencil used to construct the Lax-Wendroff scheme Then Truncation errors:

14 QS: How could we know which scheme is better? Or How do we evaluate these schemes? Next ! Note: The next Wed is the exercise class to work on modeling project #1 Dr. Huang will be supervisor for that in-class lab work.


Download ppt "The Finite-Difference Method Taylor Series Expansion Suppose we have a continuous function f(x), its value in the vicinity of can be approximately expressed."

Similar presentations


Ads by Google