You are on page 1of 70

CFD Computational Fluid Dynamics

Finite Difference
Approximations-II
CFD Computational Fluid Dynamics
Outline
2

• The linear advection-diffusion equation


• Finite difference approximations
• Finite difference approximation of the linear advection-
diffusion equation
• Accuracy
• Stability
• Consistency
• Higher order finite difference approximations in space
• Time integration: implicit versus explicit and higher
accuracy
CFD Computational Fluid Dynamics

Solving
Partial Differential
Equations
CFD Computational Fluid Dynamics
Model Equations
4

We will use the model equation:

∂f ∂f ∂ f 2
+U =D 2
∂t ∂x ∂x
to demonstrate how to solve a partial differential equation
numerically.
Although this equation is much simpler than the full
Navier Stokes equations, it has both an advection term
and a diffusion term.
Before attempting to solve the equation, it is useful to
understand how the analytical solution behaves.
CFD Computational Fluid Dynamics
Model Equations
5

For initial conditions of the form:


f ( x, t = 0) = A sin(2πkx)
It can be verified by direct substitution that the solution
is given by:
− D ( 2πk ) 2 t
f ( x, t ) = Ae sin( 2πk ( x − Ut ))

which is a decaying k = 1.0


traveling wave U = 1.0
D = 0.05
A = 1.0
CFD Computational Fluid Dynamics

Finite Difference
Approximations of
the Derivatives
CFD Computational Fluid Dynamics
Finite Difference Approximations
7

Derive a numerical approximation to the governing


equation, replacing a relation between the derivatives by
a relation between the discrete nodal values.

The time derivative is found using a forward EULER


method. The approximation can be found by using a
Taylor series.
f (t + 2∆t)
∆t f(t+∆t,x)
f (t + ∆t)
∆t f(t,x-h) f(t,x) f(t,x+h)
f (t)
h h
CFD Computational Fluid Dynamics
Finite Difference Approximations
8

Time derivative

∂f (t ) ∂ 2 f (t ) ∆t 2
f (t + ∆t ) = f (t ) + ∆t + +⋯
∂t ∂t 2
2

Solving this equation for the time derivative gives:

∂f (t ) f (t + ∆t ) − f (t ) ∂ 2 f (t ) ∆t
= − +⋯
∂t ∆t ∂t 2
2
CFD Computational Fluid Dynamics
Finite Difference Approximations
9

∂f ( x)
Spatial first-order derivative:
∂x
When using FINITE DIFFERENCE approximations,
the values of f are stored at discrete points.

f(x-h) f(x) f(x+h)

h h

The spatial derivatives of the function are


approximated using a Taylor series.
CFD Computational Fluid Dynamics
Finite Difference Approximations
10

Start by expressing the value of f(x+h) and f(x-h) in terms of f(x)

∂f ( x) ∂ 2 f ( x) h 2 ∂ 3 f ( x) h 3 ∂ 4 f ( x) h 4
f ( x + h) = f ( x ) + h+ + + +⋯
∂x ∂x 2
2 ∂x 3
6 ∂x 24
4

∂f ( x) ∂ 2 f ( x) h 2 ∂ 3 f ( x) h 3 ∂ 4 f ( x) h 4
f ( x − h) = f ( x ) − h+ − + −⋯
∂x ∂x 2
2 ∂x 3
6 ∂x 24
4

Subtracting the second equation from the first:

∂f ( x) ∂ 3 f ( x) h 3
f ( x + h) − f ( x − h) = 2 h+2 +⋯
∂x ∂x 3
6
CFD Computational Fluid Dynamics
Finite Difference Approximations
11

The result is:


∂f ( x) ∂ 3 f ( x) h 3
f ( x + h) − f ( x − h) = 2 h+2 +⋯
∂x ∂x 3
6

Rearranging this equation to isolate the first derivative:

∂f ( x) f ( x + h) − f ( x − h) ∂ f ( x) h
3 2
= − +⋯
∂x 2h ∂x 3
6
⇒ Second order central differencing
CFD Computational Fluid Dynamics
Finite Difference Approximations
12

Spatial second-order derivative:


∂ f ( x)
2

∂x 2

Repeat the same Taylor expansion as in the first-


order derivative

f(x-h) f(x) f(x+h)

h h
CFD Computational Fluid Dynamics
Finite Difference Approximations
13

Start by expressing the value of f(x+h) and f(x-h) in terms of f(x)

∂f ( x) ∂ 2 f ( x) h 2 ∂ 3 f ( x) h 3 ∂ 4 f ( x) h 4
f ( x + h) = f ( x ) + h+ + + +⋯
∂x ∂x 2
2 ∂x 3
6 ∂x 24
4

∂f ( x) ∂ 2 f ( x) h 2 ∂ 3 f ( x) h 3 ∂ 4 f ( x) h 4
f ( x − h) = f ( x ) − h+ − + −⋯
∂x ∂x 2
2 ∂x 3
6 ∂x 24
4

Adding the second equation to the first:

∂f 2 ( x) h 2 ∂ 4 f ( x) h 4
f ( x + h) + f ( x − h) = 2 f ( x ) + 2 +2 +⋯
∂x 2
2 ∂x 24
4
CFD Computational Fluid Dynamics
Finite Difference Approximations
14

The result is:

∂f 2 ( x) h 2 ∂ 4 f ( x) h 4
f ( x + h) + f ( x − h) = 2 f ( x ) + 2 +2 +⋯
∂x 2
2 ∂x 24
4

Rearranging this equation to isolate the second derivative:

∂ 2 f ( x ) f ( x + h) − 2 f + f ( x − h) ∂ 4 f ( x ) h 2
= − +⋯
∂x 2
h 2
∂x 12
4

⇒ Second order central differencing


CFD Computational Fluid Dynamics
Finite Difference Approximations
15

Solving Partial
Differential Equations
CFD Computational Fluid Dynamics
Finite Difference Approximations
16

A numerical approximation to
∂f ∂f ∂2 f
+U =D 2
∂t ∂x ∂x
is found by replacing the derivatives by the following
approximations
n
 ∂f   ∂f  ∂ f
n n 2

  + U   = D 2 
 ∂t  j  ∂x  j  ∂x j
n+1
fj

f jn−1 f jn f jn+1 ∆t
h h
CFD Computational Fluid Dynamics
Finite Difference Approximations
17

Using the shorthand


gives
notation
 ∂f 
n
f jn +1 − f jn
f j = f (t, x j )
n   = + O(∆t )
 ∂t  j ∆t
= f (t + ∆t, x j )
n+1
fj
 ∂f 
n
f jn+1 − f jn−1
f jn+1 = f (t, x j + h)   = + O(h 2 )
 ∂x  j 2h
f jn−1 = f (t, x j − h)
f jn+1 − 2 f jn + f jn−1
n
∂ f
2

 2  = + O(h 2 )
 ∂x j h2
CFD Computational Fluid Dynamics
Finite Difference Approximations
18

Substituting these approximations into:


∂f ∂f ∂2 f
+U =D 2
∂t ∂x ∂x
gives

f jn +1 − f jn f jn+1 − f jn−1 f jn+1 − 2 f jn + f jn−1


+U =D + O(∆t , h 2 )
∆t 2h h2

Solving for the new value and dropping the error terms yields

n +1 U∆t n D∆t n
f j = f −j
n
( f j +1 − f j −1 ) + 2 ( f j +1 − 2 f jn + f jn−1 )
n

2h h
CFD Computational Fluid Dynamics
Finite Difference Approximations
19

Thus, given f at one time level, f at the next time


level is given by:

n +1 U∆t n D∆t n
f j = f −
j
n
( f j +1 − f j −1 ) + 2 ( f j +1 − 2 f jn + f jn−1 )
n

2h h
The value of every point at level n+1 is given
explicitly in terms of the values at the level n.

f jn+1
Forward in Time,
f n
fj n
f n ∆t Central in Space
j −1 j +1
(FTCS)
h h
CFD Computational Fluid Dynamics

20

Example:
A short MATLAB program
The model equation is computed by the spatial
differencing and time integration.

Domain length = 2
Two waves (wavelength = 1)
Periodic boundary conditions.

Compare the numerical results with the exact solution.


CFD Computational Fluid Dynamics

21

% one-dimensional advection-diffusion by the FTCS scheme


n=21; nstep=100; length=2.0; h=length/(n-1); dt=0.05; D=0.05;
f=zeros(n,1); y=zeros(n,1); ex=zeros(n,1); time=0.0;
for i=1:n, f(i)=0.5*sin(2*pi*h*(i-1)); end; % initial conditions
for m=1:nstep, m, time
for i=1:n, ex(i)=exp(-4*pi*pi*D*time)*...
0.5*sin(2*pi*(h*(i-1)-time)); end; % exact solution
hold off; plot(f,'linewidt',2); axis([1 n -2.0, 2.0]); % plot solution
hold on; plot(ex,'r','linewidt',2);pause; % plot exact solution
y=f; % store the solution
for i=2:n-1,
f(i)=y(i)-0.5*(dt/h)*(y(i+1)-y(i-1))+...
D*(dt/h^2)*(y(i+1)-2*y(i)+y(i-1)); % advect by centered differences
end;
f(n)=y(n)-0.5*(dt/h)*(y(2)-y(n-1))+...
D*(dt/h^2)*(y(2)-2*y(n)+y(n-1)); % do endpoints for
f(1)=f(n); % periodic boundaries
time=time+dt;
end;
CFD Computational Fluid Dynamics

22

Evolution
for
U=1;
D=0.05;
k=1

N=21
∆t=0.05

Exact

Numerical
CFD Computational Fluid Dynamics

23

Accuracy
CFD Computational Fluid Dynamics

24

Although the numerical solution shows a


qualitatively similar trend as the analytical solution,
there are significant quantitative differences.

The derivation of the numerical approximations for


the derivatives showed that the error depends on
the size of h and ∆t.

First we test for different ∆t.

Number of time steps= T/ ∆t


CFD Computational Fluid Dynamics
Accuracy
25

Evolution m = 10, time = 0.50


for 1
U=1;
D=0.05; 0.5
k=1 f(x,t)
0
N=21
∆t=0.05 -0.5

-1
Exact
0 0.5 1 1.5 2
Numerical x
CFD Computational Fluid Dynamics
Accuracy
26

Repeat with
m = 20, time = 0.50
a smaller 1
time-step
∆t=0.025 0.5
f(x,t)
0

-0.5

-1
Exact
0 0.5 1 1.5 2
Numerical x
CFD Computational Fluid Dynamics
Accuracy
27

Repeat with
m = 40, time = 0.50
a smaller 1
time-step
∆t=0.0125 0.5
f(x,t)
0

-0.5

-1
Exact
0 0.5 1 1.5 2
Numerical x
CFD Computational Fluid Dynamics
Accuracy
28

Very fine spatial


resolution and a m = 1000, time = 0.50
small time step 1
U=1;
D=0.05; 0.5
k=1 f(x,t)
0
N=201
-0.5
∆t=0.0005
-1
Exact
0 0.5 1 1.5 2
Numerical x
CFD Computational Fluid Dynamics

29

Quantifying the Error


I. Order of Accuracy
CFD Computational Fluid Dynamics
Order of Accuracy
30

Exact
time=0.50
Numerical
n=11; E = 0.1633
n=21; E = 0.0403
n=41; E = 0.0096
n=61; E = 0.0041
n=81; E = 0.0022
n=101; E = 0.0015
N n=121; E = 0.0011
E=h ∑( f
j =1
j − fexact )
2
n=161; E = 9.2600e-04
CFD Computational Fluid Dynamics
Order of Accuracy
31

time=0.50
0
10
Accuracy. Effect of
spatial resolution 10
-1

dt = 0.0005
-2
N = 11 to N = 161 E 10

10-3

10-4 0
10 101 102
1/ h
CFD Computational Fluid Dynamics
Order of Accuracy
32

If the error is of second order:


2
L −2
E = Ch = C   = CL N
2 2

N
~ −2
E = CN

(
~ −2
)~
ln E = ln C N = ln C − 2 ln N

On a log-log plot, the E versus N (or 1/h) curve


should therefore have a slope −2
CFD Computational Fluid Dynamics
Order of Accuracy
33

time=0.50
0
Accuracy. Effect of 10
spatial resolution
-1
10
dt = 0.0005
-2
E 10 2
?
N = 11 to N = 161 1
10-3

10-4 0
10 101 102
1/ h
CFD Computational Fluid Dynamics

34

Why is does the error deviate from the line for the
highest values of N?

Total
Error

Roundoff

Truncation

Number of Steps, N = 1/h


CFD Computational Fluid Dynamics

35

Quantifying the Error


II. Modified Wave Number
CFD Computational Fluid Dynamics
Modified Wave Number
36

Order of Accuracy

- How mesh refinement improves the accuracy

Modified Wave Number

- How the difference scheme maintains accuracy


at high wave numbers
CFD Computational Fluid Dynamics
Modified Wave Number
37

Consider a pure harmonic of period L

f ( x) = e ikx

The exact derivative is



f ( x) = ike ikx

where k can take on any of the following values



k= n n = − N / 2 + 1,− N / 2 + 2, ⋯ N / 2
L
We now ask how the second order central difference
computes the derivative of f
CFD Computational Fluid Dynamics
Modified Wave Number
38

Discretize the x axis with a uniform mesh


L
xj = j, j = 0,1,2, ⋯ N − 1.
N
Finite-difference approximation:

δf f j +1 − f j −1
= , ∆ = L/ N
δx j 2∆

Substituting f ( x) = e ikx = ei 2πnj / N ,


CFD Computational Fluid Dynamics
Modified Wave Number
39

δf ei 2πn ( j +1) / N − ei 2πn ( j −1) / N


=
δx j 2∆
i 2πn / N − i 2πn / N
e −e
= fj
2∆
sin( 2πn / N )
=i f j = ik ′f j

Modified Wave Number:

sin( 2πn / N )
k′ =

CFD Computational Fluid Dynamics
Modified Wave Number
40

Summary:

2π 2π n
k= n; k∆ =
L N
sin(2π n / N ) 2π n
k′ = ; k ′∆ = sin( )
∆ N
CFD Computational Fluid Dynamics
Modified Wave Number
41

3 Exact
2nd Order Central
4th Order Central
6th Order Central
4th Order Pade
6th Order Pade
2
k'∆

0
0 1 2 3
k∆
CFD Computational Fluid Dynamics
Enhancing Accuracy - Padé Scheme
42

2nd Order Central Difference:


2
1 h
f j′ = ( f j +1 − f j −1 ) − f j′′′
2h 6
4th Order Central Difference:
1
f j′ = ( f j − 2 − 8 f j −1 + 8 f j +1 − f j + 2 ) + O(h )
4

12h
4th Order Padé Scheme:
4
3 h
f j′+1 + 4 f j′ + f j′−1 = ( f j +1 − f j −1 ) +
v
fj
h 30
Tridiagonal system of equations for f j′
CFD Computational Fluid Dynamics

43

Stability
CFD Computational Fluid Dynamics
Stability
44

As long as accuracy is reasonable, integration at


larger time steps is more efficient and desirable.

Can we increase the time step indefinitely?

Let’s repeat the 1-D advection-diffusion equation


with large time steps.
CFD Computational Fluid Dynamics
Stability
45

Evolution
for
U=1;
D=0.05;
k=1

N=21
∆t=0.2

Exact

Numerical
CFD Computational Fluid Dynamics
Stability
46

Instead of decaying as it should, the


amplitude of the numerical solution keeps
increasing.

Indeed, if we continued the calculations, we


would eventually produce numbers larger
than the computer can handle. This results
in an “overflow” or “NaN” (not a number).
CFD Computational Fluid Dynamics
Stability
47

Stability Analysis of
1st Order ODE
(Euler Method)
CFD Computational Fluid Dynamics
Stability
48

Consider a differential equation

y ' = f ( y, t ), y (0) = y0
Stability analysis seeks the conditions (of stepsize h)
for which the numerical solution remains bounded.

Taylor Expansion:
f ( y, t ) = f ( y0 , t0 ) + ( y − y0 ) f ′( y0 , t0 )
′ [
+(t − t0 ) f ( y0 , t0 ) + O ( y − y0 ) , (t − t0 )
2 2
]
y′ = λy + α + βt + ⋯
CFD Computational Fluid Dynamics
Stability
49

A Linearized Model Equation

y ' = λy, y (0) = y0


where λ = λ R + iλ I
For the Euler Method

yn +1 = yn + λhyn = yn (1 + λh)
Solution at time step n

yn = y0 (1 + λh) n
CFD Computational Fluid Dynamics
Stability
50

The numerical solution is stable (bounded) if

1 + λh ≤ 1 ( λ = λ R + iλ I )
λI h
Stability boundary
(1 + λR h) + λI h = 1
2 2 2
1

If λ is real and negative, Stable

h≤
2 −1 λR h
λ −1
CFD Computational Fluid Dynamics
Stability
51

Stability Analysis of
Advection-Diffusion Equation:
Von Neumann Method
CFD Computational Fluid Dynamics
Stability
52

Stability analysis of the full nonlinear system of equations


is in general too complicated.

We study a model problem that in some way mimics the


full equations.

The linear advection-diffusion equation is one such model


equation, and we will apply von Neumann's method to
check the stability of a simple finite difference
approximation to that equation.
CFD Computational Fluid Dynamics
Stability
53

Consider the 1-D advection-diffusion equation:

∂f ∂f ∂2 f
+U =D 2
∂t ∂x ∂x
In finite-difference form:

f jn +1 − f jn f jn+1 − f jn−1 f jn+1 − 2 f jn + f jn−1


+U =D
∆t 2h h2
CFD Computational Fluid Dynamics
Stability
54

Substitute
f jn = f j,exact
n
+ ε nj

into the finite difference equation

(f n +1
j ,exact ) (
+ ε nj +1 − f jn,exact + ε nj )+
∆t

U
( f n
j +1,exact ) (
+ ε nj+1 − f jn−1,exact + ε nj−1 )=
2h

D
( ) ( ) (
f jn+1,exact + ε nj+1 − 2 f jn,exact + ε nj + f jn−1,exact + ε nj−1 )
h2
CFD Computational Fluid Dynamics
Stability
55
n
f
Since j ,exact satisfies the equation, we get

ε nj +1 − ε nj ε nj+1 − ε nj−1 ε nj+1 − 2ε nj + ε nj−1


+U =D
∆t 2h h2
Write the error as a wave:

ε = ε (x j ) =
n
j
n
∑ε
k = −∞
n ikx j
ke

Dropping the subscript

ε =ε e
n
j
n ikx j
CFD Computational Fluid Dynamics
Stability
56

The error at node j is:


n ikx j
ε nj =ε e

The error at j+1 and j -1 can be written as

n ikx j +1 n ik (x j + h) n ikx j ikh


ε jn+1 =ε e =ε e =ε e e
n ik (x j −h) −ikh
ε n
j −1 =ε e
n ikx j −1
=ε e =ε e
n ikx j
e
ikx j
Substituting and canceling e yields:

ε n+1 − ε n εn − ikh εn −ikh


+U −e )=D −2 + e
ikh ikh
(e (e )
∆t 2h h 2
CFD Computational Fluid Dynamics
Stability
57

Substituting

ε =ε e
n
j
n ikx j
ε n
j +1 =ε e n ikx j
e ikh
ε n
j −1 =ε e
n ikx j
e
−ikh

into
ε nj +1 − ε nj ε nj+1 − ε nj−1 ε nj+1 − 2ε nj + ε nj−1
+U =D
∆t 2h h2
yields

ε n +1e − ε ne εn
ikx j ikx j

+U − e −ikh e )=
ikx j ikx j
(e ikh e
∆t 2h
εn
− 2e + e −ikh e
ikx j ikx j ikx j
D 2
(eikh e )
h
CFD Computational Fluid Dynamics
Stability
58

Dividing by the error amplitude at n:


amplification factor

ε n +1
U∆t ikh −ikh D∆t ikh −ikh
= 1 − ( e − e ) + ( e − 2 + e )
ε n
2h h 2

U∆t D∆t
=1− 2i sin kh + 2 2(cos kh − 1)
2h h
or
D∆t 2 h U∆t
= 1 − 4 2 sin k − i sin kh
h 2 2h
CFD Computational Fluid Dynamics
Stability
59

The ratio of the error amplitude at n+1 and n is:


ε n+1 D∆t 2 h U∆t
n = 1− 4 2 sin k −i sin kh
ε h 2 2h
Stability requires that
ε n+1
n ≤1
ε
Since the amplification factor is a complex number, and k,
the wave number of the error, can be anything, the
determination of the stability limit is slightly involved.

We will look at two special cases: (a) U = 0 and (b) D = 0


CFD Computational Fluid Dynamics
Stability
60

(a) Consider first the case when U = 0, so the problem


reduces to a pure diffusion

ε n+1 D∆t 2 h
n = 1− 4 2 sin k
ε h 2
Since sin () ≤ 1 the amplification factor is always
2

less than 1, and we find that it is bigger than -1 if


D∆t
−1 ≤ 1 − 4 2 ≤ 1
h

D∆t 1
2

h 2
CFD Computational Fluid Dynamics
Stability
61

(b) Consider now the other limit where D = 0 and


we have a pure advection problem.
ε n+1 U∆t
n = 1− i sin kh
ε 2h

Since the amplification ε n+1


factor has the form 1+i() ε n

the absolute value of this


complex number is always U∆t
larger than unity and the i sin kh
2h
method is unconditionally
unstable for this case.
1
CFD Computational Fluid Dynamics
Stability
62

(c) For the general case (Hirsch v.1, pp. 403-408)


Recall amplification factor
G = 1 − iσ sin kh + 2 β (cos kh − 1)
∆t ∆t Im(G)
σ =U , β =D 2
h h
Stability Condition
G σ Re(G)
σ ≤ 2β ≤ 1
2
0 1

CFD Computational Fluid Dynamics
Stability
63

In summary, the stability condition for a general 1-D


convection-diffusion equation becomes:

D∆t 1 U 2
∆t
2
≤ and ≤2
h 2 D

or

 2D h2 
∆t ≤ Min  2 , 
 U 2D 

Notice that high velocity and low viscosity lead to


instability according to the second restriction.
CFD Computational Fluid Dynamics
Stability
64

For a two-dimensional problem, assume an error of the form


n i(kxi +ly j )
ε i, j
n
=ε e
A stability analysis gives:

D∆t 1 (| U | + | V |) 2
∆t
2
≤ and ≤4
h 4 D

For a three-dimensional problem we get:

D∆t 1 (| U | + | V | + | W |) 2 ∆t
2
≤ and ≤6
h 6 D
CFD Computational Fluid Dynamics
Stability
65

Stability – Now you know!


Convergence – the solution to the finite-difference
equation approaches the true solution to the PDE having
the same initial and boundary conditions as the mesh is
refined.

Lax’s Equivalence Theorem


Given a properly posed initial value problem and a finite-
difference approximation to it that satisfies the consistency
condition, stability is the necessary and sufficient condition
for convergence.
CFD Computational Fluid Dynamics

66

Consistency
Does the error always
go to zero?
CFD Computational Fluid Dynamics
Consistency
67

Modified Equation (Finite Difference Equation):


Using the finite difference approximation, we are
effectively solving for equations that are slightly different
from the original partial differential equations.

Does the finite difference equation approach


the partial differential equation in the limit of
zero ∆t and h?
CFD Computational Fluid Dynamics
Consistency
68

Consider the 1-D advection-diffusion equation

∂f ∂f ∂2 f
+U =D 2
∂t ∂x ∂x
and its finite-difference approximation

f jn +1 − f jn f jn+1 − f jn−1 f jn+1 − 2 f jn + f jn−1


+U =D
∆t 2h h2
The discrepancy between the two equations can be
found by deriving the modified equation.
CFD Computational Fluid Dynamics
Consistency
69

Substituting
f jn +1 − f jn ∂f (t ) ∂ 2 f (t ) ∆t
= − +⋯
∆t ∂t ∂t 2
2
f n
j +1 −f n
j −1 ∂f ( x) ∂ f ( x) h
3 2
= − +⋯
2h ∂x ∂x 3
6
f jn+1 − 2 f jn + f jn−1 ∂ 2 f ( x) ∂ 4 f ( x) h 2
= − +⋯
h 2
∂x 2
∂x 12
4

into the finite difference equation


f jn +1 − f jn f jn+1 − f jn−1 f jn+1 − 2 f jn + f jn−1
+U =D
∆t 2h h2
CFD Computational Fluid Dynamics

70

∂f ∂f ∂2 f
+U −D 2 =
∂t ∂x ∂x
∂ 2 f (t ) ∆t ∂ 3 f ( x) h 2 ∂ 4 f ( x) h 2
+ + U − D + ⋯ = O ( ∆t , h 2
)
∂t 2
2 ∂x 3
6 ∂x 12
4

Therefore, the finite-difference scheme is effectively


solving the above modified equation.
In this case, the error goes to zero as h → 0 and ∆t → 0,
so the approximation is said to be consistent.
Although most finite difference approximations are
consistent, innocent-looking modifications can
sometimes lead to approximations that are not!

You might also like