You are on page 1of 11

CHAPTER 4

STABILITY, CONSISTENCY AND CONVERGENCE

4.1 INTRODUCTION
Finite differences solutions of differential equations have certain numerical properties that characterize them,
namely, the properties of stability, consistency, and convergence. In general, stability refers to the ability of a
numerical scheme to inhibit that generation of error growth. Consistency refers to the property of a scheme to
produce a solution that approaches the analytical solution as the discretization is made exceedingly small.
Convergence is a measure of the smallness of the error in the numerical solution due to improper discretization.
The understanding of these properties and their interrelationship is vital to a successful numerical modeling effort.
For instance, stability is often achieved by reducing the order of approximation of a scheme, say, from second to
first order. The result is scheme that is more stable but less convergent, i.e., it requires higher spatial resolution
to provide accuracy comparable to that of the second order scheme.

4.2 DEFINITIONS
Continuum: A relationship between physical variables possessing continuous derivatives throughout their
domains.
Discrerization: The process of dividing the continuum domain into a finite number of intervals.
Grid System: A discrete representation of the continuum domain of the independent variables with the
purposes of the identifying the values of dependent variables at the specific locations (nodes).
Numerical Scheme: An algebraic relationship between the values of variables at discrete points in a grid
system.
Analytical Solution: The solution of the analytical problem which the numerical scheme purports to
represent.
Numerical Solutions: The solution of the finite difference scheme
Space Interval: The size of the space step in the discretized continuum domain.
Discretization made Exceedingly Small: The process of reducing the discrete intervals with the purpose of
testing consistency ( Δx 0 , Δt 0).
Error: Any deviation introduced in the numerical solution which causes it to depart from the analytical
solution.
Error Growth: The generation of errors in the numerical solutions which causes it to considerably deviate
from the analytical solution eventually spoiling the calculations.
Runoff Error: Error introduced in the numerical solution due to computer’s inability to carry on the
computations to an infinite number of decimal places.
Discretization Error: (Convergence Error) Error introduced in the numerical solution due to the grid
system’s inability to properly resolve the continuum domain.
Numerical Dispersion: The aggregate result of numerical errors resulting in a dispersion type of effect in the
numerical solution.
Numerical Accuracy: A measure of closeness of the numerical solutions to the analytical solution.(akin to
convergence)
Improper Discretization: A poor representation of the continuum by discrete intervals, leading to
measurable discreteization errors.
Leading Error Term of a Scheme: The largest term in the Taylor series expansion of the continuum function,
after the finite difference scheme has been subtracted.
Scheme Order: The exponent of the discrete interval of the leading error term (i.e. Δx2=second order)
Characteristic length: A typical spatial measure of the continuum problem (wavelength), L.
Characteristic time: A typical temporal measure of the continuum problem (waveperiod),T.
Spatial Resolution: The ratio between the characteristic length and the space interval (L/Δx).
Temporal Resolution: The ratio between the characteristic time and the time interval (T/Δt).
Amplitude Portrait: A plot of the ratio of numerical and analytical amplitudes of sinusoidal waves vs. the
spatial resolution.
Phase Portrait: A plot of the ratio of numerical and analytical phase velocities of sinusoidal waves vs. the
spatial resolution.
Weighting Factor: A parameter of a numerical scheme which is used weigh the function and its derivatives
according to the needs of a particular problem.

4.3 STABILITY
In general, stability refers to the ability of a numerical scheme to provide solutions encompassed within the
continuum domain. An unstable scheme is one which a certain type of a numerical error is permitted to grow
unbounded until it eventually spoils the calculations. The causes of instability can be traced back to the type of
continuum system of equations (elliptic, parabolic, or hyperbolic) and its finite difference analog (explicit, implicit).
Explicit numerical analogs of parabolic and hyperbolic system are usually subject to a necessary condition for
stability: that the domains of every point of the difference equations encompass the domain of dependence of the
corresponding differential equation (Figure 1). This is called the Courant-Friedrichs-Lewy stability condition, and it
is expressed as

(4.1)
in which c is the phase velocity of an elementary wave, is the time interval, and is the space interval.
Often the necessary condition for the stability of explicit schemes is too restrictive, resulting in a smaller value of
than that which would be normally required from the standpoint of accuracy. Therefore, explicit schemes are
limited in the size of for stability reasons, and this usually leads to inefficient computation.
In implicit schemes, on the other hand, the domain of dependence equations constitutes the domain of
dependence of the entire solution to the differential equations, and thus, the necessary condition is always
satisfied. Therefore, implicit schemes are regarded as unconditionally stable (at least with respect Courant-
Friedrichs-Lewy condition), allowing for the use of the use of time steps larger than those possible with explicit
schemes. However, the size of the time step cannot be set arbitrarily. There is a practical upper limit dictated by
the grid resolution above which accuracy would be considerably impaired. Therefore, implicit schemes, not being
limited on the size of the time step for stability reasons are restricted to a practical upper limit for accuracy
considerations.
Implicit schemes are by no means free from stability problems. While the questions of stability in explicit schemes
is closely related to the Courant-Friedrichs-Lewy necessary condition, the stability of implicit schemes has
additional complications. Several authors have linked the instability of implicit schemes to roundoff error (O’Brien
Hyman and Kaplan (3)), while others attribute it to nonlinear effects (Phillips (4)). The matter remains unresolved at
the time of this writing. It suffices here to say, however, that implicit schemes may also exhibit instabilities and that
the reference to the ‘unconditional stability’ of implicit schemes is probably an unfortunate choice of words. A
more precise description such as ‘stable regardless of the Courant condition’ is proposed.

Domain Limit for the j+1, n+1


Difference Equation

Domain Limit for the 1 Stability Condition:


Difference Equation c
C. Δt ≤ Δx
or

Δ𝑋
j,n c j+1,n C. ≤1
Δ𝑇

Figure 4.1. Illustration of the necessary condition for stability of Explicit Schemes (Courant-Friedrichs-Lewy)
In general, implicit schemes are more difficult to program than explicit schemes, but are much faster to run. A
certain tradeoff is always involved in the choice between explicit and implicit schemes.

4.4 CONSISTENCY AND CONVERGENCE


Consistency refers to the property of the numerical scheme to produce a solution that approaches the analytical
solution as the discretization is made exceedingly small. Convergence is measure of the smallness of the error in
the numerical solution due to improper discretization.
Consistency is an absolute property; a scheme is either consistent with the related differential equation (i.e. ,
schemes A and B in Figure 2), or inconsistent (i.e. scheme C). On the other hand, convergence refers to the rate at
which the numerical solution approaches the analytical solution. For instance, schemes A and B , when used with
comparable grid solutions have different convergence properties: scheme A being more accurate than scheme B by
virtue of its smaller discretization error. Scheme A is said to have ‘better convergence properties’ than scheme B.
Of course the accuracy of scheme B can be improved by increasing the grid resolution, but this is at he expense of
increased computational effort.
In explicit schemes, convergence is usually associated with a certain specified grid configuration which is a
function of the properties of the continuum problem. For instance, in the upstream differencing scheme (forward
in time, backward in space), optimum convergence is achieved when the computational time step Δt equals the
characteristic time step Δtc = Δx/c . Since this is precisely the upper limit of the necessary condition for stability, it
is common practice to use a Δt = 0.9 Δtc. This is guarantees the stability of the scheme while adequate
convergence properties.

Figure 4.2 Illustration of the Concept of Consistency and Convergence

In implicit schemes, convergence is associated with a certain combination of weighting factor and grid resolution.
The purpose of the weighting factor is to place different weights on the values of the function and its derivatives at
neighboring grid points in time and space. A forward scheme has a weighting factor θ = 0 a centered scheme has a
weighting factor θ = 0.5; a backward scheme has a weighting factor θ = 1.0. The necessary condition for stability of
implicit schemes (stability regardless of the Courant condition), is that the weighting factor θ ≥0.5.
In theory the centered scheme (θ = 0.5) is neutrally stable. In practice, however, this is not always sufficient is
imposed (θ ≥ 0.6). The increase in the weighting factor θ introduces a certain amount of numerical dispersion
which has the effect of counteracting the numerical instability. Of course, care has to taken to ensure that the
added amount of dispersion does not appreciably affect numerical solution. Otherwise, the modeler may be
trading a stability problem for a convergence problem.
In general, the higher the weighting factor, the less rapidly convergent the scheme. Therefore, a scheme with a
high weighting factor (θ →0.5) requiring a lower grid resolution.
4.5 VON NEUMANN ANALYSIS
The von Neumann Analysis is a powerful tool for the study of stability and convergence of numerical schemes.
While originally developed for analyzing stability only, it has later been shown to be also applicable to the study of
convergence by using the concept of complex propagation factor. This factor allows for the calculation of the
amplitude and phase portraits of the numerical scheme, from which quantitative measures of numerical dispersion
can be obtained.
In the von Neumann analysis, the behavior of a single Fourier component of the solution is studied with the aim
of determining whether it tends to decay or amplify. Usually, this leads to the establishment of a necessary
condition for stability, either as a ratio of celerities or diffusivities depending on the problem. The ration of
celerities is referred to as Courant number C, defined as

(4.2)

in which c is a physical wave celerity. The ratio of diffusivities is referred to as cell Reynolds number Rc, defined as

(4.3)

in which µ is the coefficient of diffusivity.

4.6 HIRT’S STABILITY ANALYSIS


In Hirt’s stability analysis (1), the terms of the finite difference equation are expanded in a Taylor series in order
to develop a continuum partial differential equation. The stability criterion is then obtained from the known
properties of the continuum equations. To illustrate, assume that the convection-diffusion equation is discretized
by using an explicit forward- in- time, centered-in-space scheme. The application of Hirt’s stability analysis leads to
numerical diffusion coefficient

(4.4)
For non-growing, stable solutions, it is necessary that μn ≥ 0 which leads to

μ ≥ (4.5)

as the stability condition of the explicit scheme.

Von Neumann Stability Analsis


In numerical analysis, Von Neumann stability analysis (also known as Fourier stability analysis) is a
procedure used to check the stability of finite difference schemes as applied to linear partial differential
equations

Consider first , the linear model equation with diffusion only , again using the FTCS

=α (1)

= α( )(2)
= +d( + –2 (3)

whereis d= α (Δt/Δx2 ) , each Fourier component of the solution is written

= (4)

Where is the amplitude function at time level n of the particular component whose wave number is ( wave
length λ = 2π / ) and =

Define the phase angle θ = . Δx , giving

= (5)

Similarly, = (6)

Substituting these into (3) gives : = +d[ + –2 ] (7)

Cancelling the common term gives,

= [1+d( + -2 ) ](8)

where[ 1 + d ( + -2 ) ]is amplification factor G. We use the identity

+ =2 (9)

and define the amplification factor G from the equation

=G (10)

From(8) we evaluate G as

G = 1 - 2d ( 1 - ) (11)

Note that G=G(θ), i.e. , the amplitude factor varies for each Fourier component in this case.

Equation (10) shows clearly that , if solutions are to remain bounded, we must have

|G|1 (12)

For all θ. This is the stability criteria for the diffusion equation (3)

From (11) and (12) , we have

-1  1- 2d ( 1 - )1 (13)

which must be satisfied for all possible θ , that is, all possible Fourier modes. The right-hand inequality is satisfied
for all θ. The left-hand inequality is critical at the maximum value of ( 1 - ) = 2 which this gives the stability
requirement on d of d  ½ or Δt ½ (14)
Chapter 2

A FIRST ORDER NUMERICAL SOLUTION

2.1 DEFINITION OF THE SCHEME

The forward time and centered space scheme, which is a first order explicit numerical method, is based on the
following equations ( see figure 2.1) .

f(r,t)= fjk(2.1)

= (2.2)

= (2.3)

İn which f is anyindependentvariable, j thespaceindex, k the time index, Δrthespaceinterval, andΔtthe time interval.

2.1 DERIVATION OF THE SCHEME

Thekinematicflowequation, equation (1.3) , can be writtenfor a constant α as

+ αn hn-1 + α = q(r,t) (2.4)

Using equations (2.1) , (2.2) and (2.3) intoequation (2.4) gives,

+ αn(hjk)n-1 +α = qjk (2.5)

Solving explicity for unknownvalue hjk+1,

hjk+1=hjk + Δt [ qjk– αn(hjk)n-1 –α ] , j= 1,2,…..,M– 1 (2.6)

where M is thenumber of gridpoints in spacespecifically , j=M denotesthedownstreamboundary.


Thisfinitedifferencescheme is explicitandsingle step. At thedownstreamboundarywe can not useequation (2.6)
becausewe do not havethevalue hM+1k.

Thedepth of flow at thedownstreamboundary ( j = M) can be computedby

= + Δt [ – αn( )n-1 –α ] (2.7)

2.3 STABILITY ANALYSIS

A linearstabilityanalysis is given for equation of diverging flow with forward time and centered space
differences. Equation (2.4) can be written in a linearizedforas :
+ αn +α = q (r,t) (2.8)

Whereho is constant depth about which the equation is linearized .Introducing a disturbance ɛ , the erro rterm,
equation (2.8) gives

+ αn +α =0 (2.9)

Setting αn = K , and α /r = F(r) , thenthequestion (2.9) becomes

+ K + F(r) ɛ = 0 (2.10)

Then the followin gexpressions can be derivedfromequation (2.10) :

= - K - F(r) ɛ (2.11)

= K2 +K ɛ + 2KF(r) + (F(r))2 ɛ (2.12)

Expanding it bythe Taylor series gives :

= + Δt + (Δt)2 + o (Δt3) (2.13)

Where o (Δt3) denotes 3rd andhigher-orderterms.

Substitutingequations (2.11) and (2.12) intoequation (2.13) , usingforward time


andcenteredspacedifferencesandsimplifying,

= + K [ -Δt + (Δt)2 F(r) ][ ( - / (2Δr) ]

+ [ ( ( Δt2/2) K F’(r) - F(r) Δt + (Δt)2/2 (F(r))2]

+ (Δt)2/2 K2[ ( -2 + ) / (Δr)2 ](2.14)

We can consider the error term in terms of Fourier component. Let us define σ as the wave number and ɛo the
amplitude associated with the Fourier component. We obtain :

= ɛo (2.15)

= ɛoeiσΔr (2.16)

= ɛoe-iσΔr (2.17)

=ɛoeiγΔt (2.18)

Here σ is thewavenumber in space, γ is thewavenumber in time and i= (-1)0.5.

Substitutingequations (2.15) – (2.18) in equation (2.14) anddividingbyɛoyields :


eiγΔt = 1 + K [ - Δt + (Δt)2 F(r) ][ ( eiσΔr - e-iσΔr) / (2Δr) ]

+( Δt2/2 )K F’(r) + ΔtF(r)+ ((Δt)2/2)(F(r) )2

+ (Δt)2/2 K2[ ( eiσΔr + e-iσΔr- 2 ) / (Δr)2 ](2.19)

Using the trigonometric identities, i. e. , eiθ - e-iθ = 2 i , eiθ + e-iθ =2 , equation (2.19) can be
rearranged as

eiγΔt = 1 + K [ - Δt + (Δt)2 F(r) ] [i / (Δr) ]

+ ( Δt2 ) K2 ( – 1 ) / (Δr)2 + ( ( Δt )2 / 2 )KF’(r)

+ F(r) Δt + ((Δt)2/2)(F(r) )2 (2.20)

where θ = σΔr.

Forstability, eiγΔtmustliewithintheunit circle on the complex plane. Seperating equation (2.20) into its real and
imaginary parts respectively,

1 + ( Δt)2 K2 ( – 1 ) / (Δr)2 + ((Δt)2/2)[ KF’(r) + (F(r) )2]+ F(r) Δt (2.21)

K [-Δt + (Δt)2 F(r) ] / (Δr) (2.22)

Squaringtherealandimaginarycomponentsanddroppingthesmallmagnitudetermsgives :

|[K (Δt / Δr) ]2 + [ 1 + (Δt / Δr)2 K2( – 1)]2 | 1 (2.23)

Equation (2.23) gives the stability criterion. Table 2-1 shows the most critical conditions for different θ
values.

Thus, the stability criterion for forward time and centered space difference scheme is :

 (2.24)

TABLE 2-1 STABILITY CRITERIA

θ Criterion

0 0 1 |1|  1

π/2 1 0 |1-(Δt/Δr)2 K2 + (Δt/Δr)4 K4|  1

π 0 -1 |1-4(Δt/Δr)2 K2 + 4(Δt/Δr)4 K4|  1

3π/2 -1 0 |1-(Δt/Δr)2 K2 + (Δt/Δr)4 K4|  1

4.7 SOLVED PROBLEM

1. Find the minimum time interval for stability condition.?


EXAMPLE: (HOMEWORK I)
The space between two parallel horizontal plates infilled with liquid of kinematic viscosity coefficient equal to ν =1
cm2/s. The distance between the plates is 1 cm. The upper plate is linearly accelerated from a zero initial velocity to
10 cm/s in 0,1 s. The change with time of the velocity profile of the liquid is to be computed.

The change in u with time


(Elements of Computational Hydraulics) p.29
The conservation of momentum in the horizontal direction x, according to the notation of Fig.1, taking into
consideration that there is no variation in the x, y directions, i.e. one dimensional case, is expressed by the
parabolic equation w.r.t the velocity function. u(z,t)

The flow domain is bounded between z=0 cm and z=1 cm. The initial condition has the form u(z,0)=0 cm/s. The
boundary conditions are,

=0 = U cm/s.

where u is the upper plate velocity, the change in U with time is shown in Fig. 1.
(ν = kinematic viscosity = 1x10-6 m2/s for water)
The numerical integration is performed by means of the explicit finite differences scheme described in the
following equation.
=v

This is written as Forward in Time and Centered in Space (FTCS) form.


Δt: in the time step (ti= n. Δt)
Δz: in the space step (zi= i Δz)
Data :
Space interval Time interval
First Second
Student name calculation calculation
Δz Δt (sec) Δt (sec)
A 0,1 cm 0,0010 0,060
B 0,1 cm 0,0015 0,065
C 0,1 cm 0,0020 0,070
D 0,1 cm 0,0025 0,075
E 0,1 cm 0,0030 0,080
F 0,1 cm 0,0035 0,085
G 0,1 cm 0,0040 0,090

FORTRAN PROGRAM
Numerical solution of parabolic equation using explicit scheme
DIMENSION U(100, U0(100)
READ (5,1) DX, DT, IMAX
1 FORMAT (2F7.0, I4)
IMAX1=IMAX-1
DO 2 I=1, IMAX
U(I) = 0.
2 U0 (I)=0.
T=0.
N=0
100 T= T+DT
N=N+1
IF (T. LT. 0.1) GO TO 22
U( IMAX) =10.
GO TO 23
22 U(IMAX)=T*100.
23 CONTINUE
DO 3 I=2, IMAX1
3 U(I)=U0(I)+DT*1./DXxx2x ( U0(I+1) + U0(I-1)
2-2.*U0(I))
DO 4 I=1, IMAX
4 U0(I)=U(I)
WRITE (6,5) (U0(I), I=1, IMAX)
5 FORMAT (10F10.4)
IF(N.LT.1000) GO TO 100
STOP
END

Find the velocity function solution by computer (prepare the program)


(The change with time of the velocity profile)
Show the findings on a graph.
Solution:

1- Prepare a program for solving the problem


2- Find the solution by using your data
3- Show the findings on a graph
(The change with time of the velocity profile)

A parameter

=
If 0,5, the schema is stable.

Variables:
U(t), U0(I) : Recent and past velocity values
DX: Space step
DT: Time step
IMAX: Max value of space index I
T: Time
N: Time index
DX=0,1=DZ, DT=...
IMAX=11. (i=1,...11)

The change with time of the velocity profile for DT= 0,001 is shown in Fig.2
By comparing the change of velocity values Z=0,0,0, for DT=0,001 and DT=0,01, corresponding to
parameter.

=
equal to 0,1 and 1,0 respectively.
It is evident that the solution is unstable in the second case. Numerical experiments and theoretical
analysis show that the explicit scheme is stable for
<0,5 so,

0,5 = =0,1
2
0,5 1x v = 1cm /s
0,5 x 0,01 = 0,005

You might also like