Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
547 views

Properties of Numerical Methods

The key properties that are crucial for the performance of a numerical algorithm are consistency, stability, convergence, conservation, and boundedness. Consistency requires that the discretization becomes exact as the mesh size tends to zero. Stability ensures that numerical errors do not grow unboundedly. Convergence means the numerical solution approaches the exact solution as the mesh is refined. Conservation means the underlying physical conservation laws are respected in the discrete formulation. Boundedness requires quantities like densities to remain positive. These properties must be verified for each component of a numerical scheme.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
547 views

Properties of Numerical Methods

The key properties that are crucial for the performance of a numerical algorithm are consistency, stability, convergence, conservation, and boundedness. Consistency requires that the discretization becomes exact as the mesh size tends to zero. Stability ensures that numerical errors do not grow unboundedly. Convergence means the numerical solution approaches the exact solution as the mesh is refined. Conservation means the underlying physical conservation laws are respected in the discrete formulation. Boundedness requires quantities like densities to remain positive. These properties must be verified for each component of a numerical scheme.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Properties of numerical methods

The following criteria are crucial to the performance of a numerical algorithm: 1. Consistency 2. Stability 3. Convergence 4. Conservation 5. Boundedness The discretization of a PDE should become exact as the mesh size tends to zero (truncation error should vanish) Numerical errors which are generated during the solution of discretized equations should not be magnied The numerical solution should approach the exact solution of the PDE and converge to it as the mesh size tends to zero Underlying conservation laws should be respected at the discrete level (articial sources/sinks are to be avoided) Quantities like densities, temperatures, concentrations etc. should remain nonnegative and free of spurious wiggles

These properties must be veried for each (component of the) numerical scheme

Consistency
Relationship: discretized equation dierential equation

Truncation errors should vanish as the mesh size and time step tend to zero Example. Pure convection equation CDS in space, FE in time: Taylor series expansions: un i 1 Hence, = un i x +
u n x i u t

+ v u x = 0 discretized by

+1 n un un un i+1 ui1 i i +v = O[(t)q , (x)p ] t 2x +1 un i

un i

+ t
n i

u n t i

(t)2 2 3u x3 n i

2u t2

n i

+ ...

(x)2 2

2u x2 u t

(x)3 6 n i

+ ... where

+1 un un i i t

n un i+1 ui1 v 2x

+ v u x

+ = 0
n

t = 2

2u t2

n i

(x)2 v 6

3u x3

+ O[(t)2 , (x)4 ]
i

residual of the dierence scheme for the exact nodal values um j = u(j x, mt)

Stability
Relationship: numerical solution of discretized equations exact solution of discretized equations

Denition 1 Denition 2

Numerical errors (roundo due to nal precision of computers) should not be allowed to grow unboundedly The numerical solution itself should remain uniformly bounded

Stability analysis: can only be performed for a very limited range problems Matrix method: Aun+1 = Bun un+1 = Cun , where C = A1 B

is assumed to be a linear operator. In practice un = u n + en so that un+1 = Cun u n+1 = C u n en+1 = Cen for the numerical solution un of the discretized equations for the exact solution u n of the discretized equations for the roundo error en incurred in the solution process

Matrix method for stability analysis


In the linear case un+1 = Cun = . . . = C n u0 , en+1 = Cen = . . . = C n e0

i.e., the error evolves in the same way as the solution and is bounded by ||e|| ||C ||n ||e0 ||, ||C || (C ) = maxi |i | spectral radius of C

Unstable schemes: if (C ) > 1 then ||C || 1 and the errors may grow Example. Convection-diusion equation CDS in space, FE in time: or
+1 un = un i i
+1 un un i i t

u t

u + v u = d x x2 discretized by

n un i+1 ui1 v 2x

n n un i1 2ui +ui+1 d (x)2

n n n n (ui+1 un i1 ) + (ui1 2ui + ui+1 ) 2

t t where = v x is the Courant number, = d (x)2 is the diusion number

Matrix method for stability analysis


a b c C= a b c a b c Eigenvectors Eigenvalues j
(m)

a=+

b = 1 2 c=
2

= cos m j + i sin m j = eim j ,


(m)

, m = m N

i2 = 1 = eim j

aj +1 + bj

(m)

+ cj 1 = m j

(m)

(m)

divide by j m = 1, . . . , N

(m)

m = 1 + 2 (cos m 1) + i2 sin m ,

Stability condition pure convection:

|m |2 = [1 + 2 (cos m 1)]2 + 4 2 sin2 m 1 =0 |m | 1 unconditionally unstable :-(


1 2

pure diusion: = 0

|m | 1 if

conditionally stable

Von Neumanns stability analysis


Objective: to investigate the propagation and amplication of numerical errors Assumptions: linear PDE, constant coecients, periodic boundary conditions Continuous error representation e(x, t) =
m

am (t)eikm x

Fourier series
lmax = 2L lmin = 2x

i2 = 1,

eikm x = cos km x + i sin km x


L

i.e. the error is a superposition of harmonics 2 characterized by their wave number km = l m (for wave length lm ) and amplitide am (t) Discretization x =
L N

0 x0

x xi1 xi xi+1

L xN x

km = m L =

m N x ,

m = km x = m N

Here m is the phase angle, m is the number of waves tted into the interval (L, L) and x determines the highest frequency resolvable on the mesh

Von Neumanns stability analysis


Representation of numerical error (trigonometric interpolation) e0 j =
m im j a0 me

en j =
m

im j an , me

where

0 n an m = an m

Due to linearity, the error satises the discretized equation and so does each n im j , m harmonic. Hence, it suces to check stability for en j = am e Amplication factor Gm
+1 an m = n = m am

Stability condition |Gm | 1, m

the enhancement of the mth harmonic during one time step

guarantees that the error component n 0 en j = (Gm ) ej remains bounded

Remark. The accuracy of approximation can be assessed by analyzing phase errors i.e. the actual speed of harmonics as compared to the exact speed

Example: pure convection equation in 1D


1. Let
u t

+ v u x = 0 be discretized by CDS in space, FE in time


n ij and substitute en j =a e

+1 n un un un j j j +1 uj 1 +v =0 t 2x

The resulting dierence equation for the error can be written as (an+1 an )eij + Divide by eij n i(j +1) a (e ei(j 1) ) = 0, 2 =v t x

n i i an+1 = an ) 2 a (e e

and note that

ei ei = cos + i sin cos + i sin = 2i sin Amplication factor G=


an+1 an

= 1 i sin

is responsible for stability

|G|2 = 1 + 2 sin2 1

the scheme is unconditionally unstable :-(

Example: pure convection equation in 1D


2. Let
u t

+ v u x = 0 be discretized by BDS in space, FE in time


n ij and substitute en j =a e t = v x 2

+1 n un un un j j j u j 1 +v =0 t x

which yields

(an+1 an )eij + an (eij ei(j 1) ) = 0,

G = 1 + ei = 1 + (cos i sin ) = 1 2 sin2 Re(G) = 1 + cos , Im(G) = sin

i sin

Stability restriction |G|2 1 means that G must lie within the unit circle in the complex plane. This leads to the CFL condition v>0 v<0 01
x v

upwind scheme, stable for t

downwind scheme, unconditionally unstable

Example: pure convection equation in 1D


The numerical domain of dependence should contain the analytical one: if > 1, then the data at some grid point may aect the true solution but not the numerical one on the other hand, for < 1 some grid points inuence the solution although they should not

for accuracy reasons it is desirable to have 1; some schemes are exact for = 1 (unit CFL property) 3. Let
u t

00000000000 11111111111 11111111111 00000000000 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111 00000000000 11111111111

+ v u x = 0 be discretized by CDS in space, BE in time


n ij and substitute en j =a e

+1 +1 n+1 un un un j j j +1 uj 1 +v =0 t 2x

n+1 i (j +1) (e ei(j 1) ) = 0 (an+1 an )eij + 2a

G=

1 1+i sin

It follows that

= |G|2 = G G

1+ 2

1 sin2

unconditional stability

Spectral analysis of numerical errors


Consider
u t u + v u x = d x2
2

convection-diusion equation
2

Exact solution:

u(x, t) = eik(xvt)k

dt

= a(t)eikx ,

a(t) = eikvtk

dt

a wave with exponentially decaying amplitude traveling at constant speed Amplication factor |Gex | = e , Amplitude error Phase error = Gex =
a(tn+1 ) a(tn )

e(ikv+k d)(n+1)t e(ikv+k2 d)nt

= e(+i)

= k 2 dt,
|Gnum | |Gex |

= kv t = arg(Gex ) numerical damping

= |Gnum |e

arg(Gnum ) arg(Gnum ) = =v numerical dispersion = arg(G v ex ) arg(Gnum ) where v = k is the numerical propagation speed t Harmonics travel too fast if > 1 (leading phase error) and too slow in the case < 1 (lagging phase error)

Convergence
Relationship: numerical solution of discretized equations exact solution of the dierential equation

Denition: A numerical scheme is said to be convergent if it produces the exact solution of the underlying PDE in the limit h 0 and t 0 Lax equivalence theorem: stability + consistency = convergence

For practical purposes, convergence can be investigated numerically by comparing the results computed on a series of successively rened grids The rate of convergence is governed by the leading truncation error of the discretization scheme and can also be estimated numerically: u = uh + e(u)hp + . . . = u2h + e(u)(2h)p + . . . = u4h + e(u)(4h)p + . . . u2h uh e(u)hp (1 2p ) u4h u2h e(u)h (1 2 )2
p p p

log p

u4h u2h u2h uh

log 2

Conservation
Physical principles should apply at the discrete level: if mass, momentum and energy are conserved, they can only be distributed improperly Integral form of a generic conservation law u dV + t V accumulation f n dS =
S V

q dV,

f = v u d u ux function

inux

source/sink

Caution: nonconservative discretizations may produce reasonably looking results which are totally wrong (e.g. shocks moving with a wrong speed) even nonconservative schemes can be consistent and stable correct solutions are recovered in the limit of very ne grids Problem: it is usually unclear whether or not the mesh is suciently ne

Discrete conservation
1. Any nite volume scheme is conservative by construction both locally (for every single control volume) and globally (for the whole domain) 2. A nite dierence scheme is conservative if it can be written in the form
+1 fi+1/2 fi1/2 un un i i + =q t x

which is equivalent to a vertex-centered nite volume discretization 3. Any nite element scheme is conservative, at least globally
N

i 1,
i=1 V

uh + fh qh dV = 0, t

i = 1, . . . , N

Summation over i yields a discrete counterpart of the integral conservation law


V uh t

+ fh qh dV = 0

uh dV +

f S h

n dS =

qh dV

Boundedness
Convection-dominated / hyperbolic PDEs P e 1, Re 1

spurious undershoots and overshoots occur in the vicinity of steep gradients quantities like densities, temperatures and concentrations become negative the method may become unstable or converge to a wrong weak solution
1 1

low-order
0.8 0.8 0.6 0.6

0.4

0.4

0.2

0.2

high-order
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Idea: make sure that important properties of the exact solution (monotonicity, positivity, nonincreasing total variation) are inherited by the numerical one

Design of nonoscillatory methods


Monotone methods H (un ; i) 0, un j Example. Let
u t u t

f x

=0

+1 un = H (un ; i) i

such that i

i, j

Then

n vi un i,

n+1 +1 vi un , i

+ v u x = 0 be discretized by UDS in space, FE in time H (un ; i) = un i v = , where t n (ui un i 1 ) x

+1 n un un un i u i 1 i i +v = 0, t x

Derivatives

H (un ;i) un i

= 1 ,

H (un ;i) un i1

t = v x

monotone under the CFL condition 1 (cf. stability analysis)

Lax-Wendro theorem: If a monotone consistent and conservative method converges, then it converges to a physically acceptable weak solution

Design of nonoscillatory methods


Godunovs theorem: Monotone method are at most rst-order accurate Monotonicity-preserving methods
0 u0 i ui+1 ,

(monotone if linear)
n un i ui+1 ,

i, n

If the initial data u0 is monotone, then so is the solution un at all times

It is known that the total variation dened as

T V (u) =

u x

dx

is a

nonincreasing function of time for any physically admissible weak solution Total variation diminishing methods T V (un+1 ) T V (un ), Classication monotone (monotone if linear) where TVD T V (un ) =
i n |un i u i 1 |

monotonicity-preserving

Total variation diminishing methods


Hartens theorem: An explicit nite dierence scheme of the form

+1 un un i n n n i = ci1/2 (un i1 ui ) + ci+1/2 (ui+1 ui ) t

is total variation diminishing (TVD) provided that the coecients satisfy ci1/2 0, Semi-discrete problem ci+1/2 0,
dui dt

ci1/2 + ci+1/2 1 =0 conservation form

fi+1/2 fi1/2 x

Idea: switch between high- and low-order ux approximations depending on the local smoothness of the solution so as to enforce Hartens conditions:
L H fi+1/2 = fiL +1/2 + i+1/2 [fi+1/2 fi+1/2 ]

where 0 i+1/2 2 is a solution-dependent correction factor (ux limiter)

TVD discretization of convective terms


Example. Pure convection equation Linear ux approximations fiL +1/2 = vui
ui+1 +ui = v fiH +1/2 2 u t

+ v u x = 0,

v > 0,

f = vu

Smoothness indicator
upwind dierence central dierence

ri =

u i u i 1 ui+1 ui

Nonlinear TVD ux Hartens coecients

fi+1/2 = vui + v 2 (ri )(ui+1 ui ) ci1/2 =


v 2x

2+

(ri ) ri

(ri1 ) ,

ci+1/2 = 0 1D stencil
ui u i+1 u i1

Standard ux limiters:

(r) =

r +|r | 1+|r |

Van Leer minmod

(r) = max{0, min{1, r}} (r) = max{0, min


1+r 2 , 2, 2r

MC superbee
x i1 xi x i+1

(r) = max{0, min{1, 2r}, min{2, r}}

You might also like