Chapter 02 - Finite Different Method
Chapter 02 - Finite Different Method
Chapter 2
27-Oct-23 2
2.1. Approximation in FDM
* Practice in MATLAB: Roots of a Quadratic
27-Oct-23 3
2.1. Approximation in FDM
* Practice in MATLAB: Roots of a Quadratic
27-Oct-23 4
2.1. Approximation in FDM
* Practice in MATLAB: Roots of a Quadratic
27-Oct-23 5
2.1. Approximation in FDM
* Practice in MATLAB: the parachutist problem
Practice-01:
27-Oct-23 6
2.1. Approximation in FDM
* Practice in MATLAB: the parachutist problem
27-Oct-23 7
2.1. Approximation in FDM
* Practice in MATLAB: the parachutist problem
27-Oct-23 8
2.1. Approximation in FDM
* Practice in MATLAB: the parachutist problem
Practice-04:
27-Oct-23 9
2.1. Approximation in FDM
* Practice in MATLAB: the parachutist problem
27-Oct-23 10
2.1. Approximation in FDM
* Taylor series
+ In essence, the Taylor series provides a means to predict a function value at one
point in terms of the function value and its derivatives at another point.
+ In particular, the theorem states that any smooth function can be approximated as a
polynomial.
Zero-order approximation
First-order approximation
Second-order approximation
………………………..
27-Oct-23 11
2.1. Approximation in FDM
* Remainder in Taylor series
+ Remainder term:
or
Exact estimate
27-Oct-23 13
2.1. Approximation in FDM
* The Effect of Nonlinearity and Step Size on the Taylor Series Approximation
Solution:
27-Oct-23 14
2.2. Finite different method
* Introduction
+ In numerical analysis, finite-difference methods (FDM) are a class of numerical
techniques for solving differential equations by approximating derivatives with
finite differences.
+ FDM converts ordinary differential equations (ODE) or partial differential
equations (PDE), which may be nonlinear, into a system of linear equations that
can be solved by matrix algebra techniques.
+ Today, FDM are one of the most common
approaches to the numerical solution of
PDE, along with others like FEM, FVM,…
27-Oct-23
A practical example of Burger equation 15
2.2. Finite different method
* Introduction
27-Oct-23 16
2.2. Finite different method
* Basic idea in FDM
27-Oct-23 17
2.3. Difference schemes
* Let’s start with forward difference scheme
f ( xi +1 ) = f ( xi ) + f ' ( xi )( xi +1 − xi )
f ( xi +1 ) − f ( xi ) fi
f ' ( xi ) = =
xi +1 − xi h
27-Oct-23 18
2.3. Difference schemes
* Three schemes of first-order difference approximation
Forward difference Downwind scheme
f ( xi +1 ) − f ( xi )
method
fi
f ' ( xi ) = =
xi +1 − xi h
27-Oct-23 21
2.3. Difference schemes
* An example
u u − u l l u uil++11 − uil +1
x = x
i +1 i
x = x
2 2 l +1 l +1 l +1
l
− l
+ l
u u − 2u + u
u
=
ui +1 2ui ui −1 = i +1 i i −1
x 2 x 2 x 2 x 2
27-Oct-23 24
2.4. Applying FDM for 1D convection equation
* Theory
u u
+c =0 1D convection/advection equation, also called wave Eq.
t x
where u(x,t), x Є R, is scalar (wave) advected by a nonzero constant c during time t.
+ Sign of c characterizes the direction of wave propagation and magnitude of c show how
fast the wave propagates.
+ If initial value for equation is given as u0(x) = u(x,0), the exact solution of equation is:
u ( x, t ) = u0 ( x − ct )
27-Oct-23 25
2.4. Applying FDM for 1D convection equation
* Implementation
x
( ui − uin−1 )
backward difference ct
CFL = is called Courant/convection number
u uin − uin−1 x
=
x x Stability criteria: CFL <= 1
27-Oct-23 26
2.4. Applying FDM for 1D convection equation
* Solution in Matlab
N=50, ∆t=0.009
→ CFL = 0.45
N=110, ∆t=0.009
→ CFL = 0.99
27-Oct-23 27
2.4. Applying FDM for 1D convection equation
N=110, ∆t=0.01
→ CFL = 1.1
N=110, ∆t=0.009
→ CFL = 0.99
N=110, ∆t=0.003
→ CFL = 0.33
27-Oct-23 28
2.1. Approximation in FDM
* Basic Idea
27-Oct-23 30
2.1. Approximation in FDM
* A simple mathematical model
(1)
27-Oct-23 31
2.1. Approximation in FDM
* A simple mathematical model
Euler’s method
27-Oct-23 32