lectures 8, 9 and 10

97
Lectures 8, 9 and 10 Finite Difference Discretization of Hyperbolic Equations: Linear Problems

Upload: fadhila

Post on 11-Jan-2016

41 views

Category:

Documents


2 download

DESCRIPTION

Lectures 8, 9 and 10. Finite Difference Discretization of Hyperbolic Equations: Linear Problems. First Order Wave Equation. INITION BOUNDARY VALUE PROBLEM (IBVP) Initial Condition: Boundary Conditions:. Solution. First Order Wave Equation. Characteristics. General solution. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lectures 8, 9 and 10

Lectures 8, 9 and 10

Finite Difference Discretization of Hyperbolic Equations:

Linear Problems

Page 2: Lectures 8, 9 and 10

First Order Wave Equation

INITION BOUNDARY VALUE PROBLEM (IBVP)

Initial Condition:

Boundary Conditions:

Page 3: Lectures 8, 9 and 10

First Order Wave Equation

Solution

Characteristics

General solution

Page 4: Lectures 8, 9 and 10

First Order Wave Equation

Solution

Page 5: Lectures 8, 9 and 10

First Order Wave Equation

Solution

Page 6: Lectures 8, 9 and 10

First Order Wave Equation

Stability

Page 7: Lectures 8, 9 and 10

Model Problem

Initial condition:

Periodic Boundary conditions:

constant

Page 8: Lectures 8, 9 and 10

Model ProblemExample

Periodic Solution (U>0)

Page 9: Lectures 8, 9 and 10

Finite DifferenceSolution

Discretization

Discretize (0,1) into J equal intervals

And (0,T) into N equal intervals

Page 10: Lectures 8, 9 and 10

Finite DifferenceSolution

Discretization

Page 11: Lectures 8, 9 and 10

Finite DifferenceSolution

Discretization

NOTATION:• approximation to

• vector of approximate values at time ;

• vector of exact values at time ;

Page 12: Lectures 8, 9 and 10

Finite DifferenceSolution

Approximation

For example … for ( U > 0 )

Forward in Time Backward (Upwind) in Space

Page 13: Lectures 8, 9 and 10

Finite DifferenceSolution

First Order Upwind Scheme

suggests …

Courant number C =

Page 14: Lectures 8, 9 and 10

Finite DifferenceSolution

First Order Upwind Scheme

Interpretation

Use Linear Interpolation

j – 1, j

Page 15: Lectures 8, 9 and 10

Finite DifferenceSolution

First Order Upwind Scheme

Explicit Solution

no matrix inversion

exists and is unique

Page 16: Lectures 8, 9 and 10

Finite DifferenceSolution

First Order Upwind Scheme

Matrix Form

We can write

Page 17: Lectures 8, 9 and 10

Finite DifferenceSolution

First Order Upwind Scheme

Example

Page 18: Lectures 8, 9 and 10

ConvergenceDefinition

The finite difference algorithm converges if

For any initial condition .

Page 19: Lectures 8, 9 and 10

ConsistencyDefinition

For all smooth functions

when .

The difference scheme ,

is consistent with the differential equation

if:

Page 20: Lectures 8, 9 and 10

ConsistencyFirst Order Upwind Scheme

Difference operator

Differential operator

Page 21: Lectures 8, 9 and 10

ConsistencyFirst Order Upwind Scheme

First order accurate in space and time

Page 22: Lectures 8, 9 and 10

Truncation Error

Insert exact solution into difference scheme

Consistency

Page 23: Lectures 8, 9 and 10

Stability

The difference scheme is stable if:

There exists such that

for all ; and n, such that

Definition

Above condition can be written as

Page 24: Lectures 8, 9 and 10

StabilityFirst Order Upwind Scheme

Page 25: Lectures 8, 9 and 10

StabilityFirst Order Upwind Scheme

Page 26: Lectures 8, 9 and 10

Stability

Stable if

Upwind scheme is stable provided

Page 27: Lectures 8, 9 and 10

Lax EquivalenceTheorem

A consistent finite difference scheme for a partial differential equation for which the initial value problem is well-posed is convergent if and only if it is stable.

Page 28: Lectures 8, 9 and 10

Lax EquivalenceTheorem

Proof

( first order in , )

Page 29: Lectures 8, 9 and 10

Lax EquivalenceTheorem

First Order Upwind Scheme

• Consistency:• Stability: for• Convergence

or

and are constants independent of ,

Page 30: Lectures 8, 9 and 10

Lax EquivalenceTheorem

First Order Upwind Scheme

Example

Solutions for:

(left)

(right)

Convergence is slow !!

Page 31: Lectures 8, 9 and 10

CFL ConditionDomains of dependence

Mathematical Domain of Dependence of

Set of points in where the initial or boundary

data may have some effect on .

Numerical Domain of Dependence of

Set of points in where the initial or boundary

data may have some effect on .

Page 32: Lectures 8, 9 and 10

CFL ConditionDomains of dependence

First Order Upwind Scheme

Analytical Numerical ( U > 0 )

Page 33: Lectures 8, 9 and 10

CFL ConditionCFL Theorem

CFL Condition

For each the mathematical domain of de-

pendence is contained in the numerical domain of dependence.

CFL Theorem

The CFL condition is a necessary condition for the convergence of a numerical approximation of a partial differential equation, linear or nonlinear.

Page 34: Lectures 8, 9 and 10

CFL ConditionCFL Theorem

Stable Unstable

Page 35: Lectures 8, 9 and 10

Fourier Analysis

• Provides a systematic method for determining stability → von Neumann Stability Analysis

• Provides insight into discretization errors

Page 36: Lectures 8, 9 and 10

Fourier AnalysisContinuous Problem

Fourier Modes and Properties…

Fourier mode: ( integer )

• Periodic ( period = 1 )

• Orthogonality

•Eigenfunction of

Page 37: Lectures 8, 9 and 10

Fourier AnalysisContinuous Problem

…Fourier Modes and Properties

• Form a basis for periodic functions in

• Parseval’s theorem

Page 38: Lectures 8, 9 and 10

Fourier AnalysisContinuous Problem

Wave Equation

Page 39: Lectures 8, 9 and 10

Fourier AnalysisDiscrete Problem

Fourier Modes and Properties…

Fourier mode: ,

k ( integer )

Page 40: Lectures 8, 9 and 10

Fourier AnalysisDiscrete Problem

…Fourier Modes and Properties…

Real part of first 4 Fourier modes

Page 41: Lectures 8, 9 and 10

Fourier AnalysisDiscrete Problem

…Fourier Modes and Properties…

• Periodic (period = J)

• Orthogonality

Page 42: Lectures 8, 9 and 10

Fourier AnalysisDiscrete Problem

…Fourier Modes and Properties…

• Eigenfunctions of difference operators e.g.,

Page 43: Lectures 8, 9 and 10

Fourier AnalysisDiscrete Problem

Fourier Modes and Properties…

• Basis for periodic (discrete) functions

• Parseval’s theorem

Page 44: Lectures 8, 9 and 10

Fourier Analysisvon Neumann Stability Criterion

Write

Stability

Stability for all data

Page 45: Lectures 8, 9 and 10

Fourier Analysisvon Neumann Stability Criterion

First Order Upwind Scheme…

Page 46: Lectures 8, 9 and 10

Fourier Analysisvon Neumann Stability Criterion

…First Order Upwind Scheme…

amplification factor

Stability if which implies

Page 47: Lectures 8, 9 and 10

Fourier Analysisvon Neumann Stability Criterion

…First Order Upwind Scheme

Stability if:

Page 48: Lectures 8, 9 and 10

Fourier Analysisvon Neumann Stability Criterion

FTCS Scheme…

Fourier Decomposition:

Page 49: Lectures 8, 9 and 10

Fourier Analysisvon Neumann Stability Criterion

amplification factor

Unconditionally Unstable Not Convergent

…FTCS Scheme

Page 50: Lectures 8, 9 and 10

Lax-WendroffScheme

Time Discretization

Write a Taylor series expansion in time about

But …

Page 51: Lectures 8, 9 and 10

Lax-WendroffScheme

Spatial Approximation

Approximate spatial derivatives

Page 52: Lectures 8, 9 and 10

Lax-WendroffScheme

Equation

no matrix inversion

exists and is unique

Page 53: Lectures 8, 9 and 10

Lax-WendroffScheme

Interpretation

Use Quadratic

Interpolation

Page 54: Lectures 8, 9 and 10

Lax-WendroffScheme

Analysis

Consistency

Second order accurate in space and time

Page 55: Lectures 8, 9 and 10

Lax-WendroffScheme

Analysis

Truncation Error

Consistency

Insert exact solution into difference scheme

Page 56: Lectures 8, 9 and 10

Lax-WendroffScheme

Analysis

Stability

Stability if:

Page 57: Lectures 8, 9 and 10

Lax-WendroffScheme

Analysis

Convergence

• Consistency:

• Stability:

• Convergence

and are constants independent of

Page 58: Lectures 8, 9 and 10

Lax-WendroffScheme

Domains of Dependence

Analytical Numerical

Page 59: Lectures 8, 9 and 10

Lax-WendroffScheme

CFL Condition

Stable Unstable

Page 60: Lectures 8, 9 and 10

Lax-WendroffScheme

Example

Solutions for:

C = 0.5

= 1/50 (left)

= 1/100 (right)

Page 61: Lectures 8, 9 and 10

Lax-WendroffScheme

Example

= 1/100

C = 0.5

Upwind (left)

vs.

Lax-Wendroff (right)

Page 62: Lectures 8, 9 and 10

Beam-WarmingScheme

Derivation

Use Quadratic

Interpolation

Page 63: Lectures 8, 9 and 10

Beam-WarmingScheme

Consistency and Stability

• Consistency,

• Stability

Page 64: Lectures 8, 9 and 10

Method of Lines

Generally applicable to time evolution PDE’s• Spatial discretization

Semi-discrete scheme (system of coupled ODE’s

• Time discretization (using ODE techniques)

Discrete Scheme

By studying semi-discrete scheme we can better

understand spatial and temporal discretization errors

Page 65: Lectures 8, 9 and 10

Method of Lines

Notation

approximation to

vector of semi-discrete approximations;

Page 66: Lectures 8, 9 and 10

Method of LinesSpatial Discretization

Central difference … (for example)

or, in vector form,

Page 67: Lectures 8, 9 and 10

Method of LinesSpatial Discretization

Write semi-discrete approximation as

inserting into semi-discrete equation

Fourier Analysis …

Page 68: Lectures 8, 9 and 10

Method of LinesSpatial Discretization

For each θ, we have a scalar ODE

… Fourier Analysis …

Neutrally stable

Page 69: Lectures 8, 9 and 10

Method of LinesSpatial Discretization

Exact solution

Semi-discrete solution

… Fourier Analysis …

Page 70: Lectures 8, 9 and 10

Method of LinesSpatial Discretization

Fourier Analysis …

Page 71: Lectures 8, 9 and 10

Method of LinesTime Discretization

Predictor/Corrector Algorithm …

Model ODE

Predictor

Corrector

Combining the two steps you have

Page 72: Lectures 8, 9 and 10

Method of LinesTime Discretization

…Predictor/Corrector Algorithm

Semi-discrete equation

Predictor

Corrector

Combining the two steps you have

Page 73: Lectures 8, 9 and 10

Method of LinesFourier Stability Analysis

Fourier Transform

Page 74: Lectures 8, 9 and 10

Method of LinesFourier Stability Analysis

Application factor

with

Stability

Page 75: Lectures 8, 9 and 10

Method of LinesFourier Stability Analysis

PDE

Semi-discrete

Semi-discrete Fourier

Discrete

Discrete Fourier

Page 76: Lectures 8, 9 and 10

Method of LinesFourier Stability Analysis

Path B …

Semi-discrete

Fourier semi-discrete

Predictor

Corrector

Discrete

Page 77: Lectures 8, 9 and 10

Method of LinesFourier Stability Analysis

…Path B

• Give the same discrete Fourier equation

• Simpler

• “Decouples” spatial and temporal discretization For each θ, the discrete Fourier equation is the result of discretizing the scalar semi-discrete ODE for the θ Fourier mode

Page 78: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

Model equation: complex- valued

Discretization

EF

EB

CN

Page 79: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

Given and complex-valued

Absolute Stability Diagrams …

(EF) or (EB) or … ;

is defined such that

Page 80: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Absolute Stability Diagrams …

EF

EB

CN

Page 81: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Absolute Stability Diagrams

Page 82: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

Application to the wave equation…

For each

Thus,

• (and ) is purely imaginary • for

Page 83: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

EF is unconditionally unstable

EB is unconditionally stable

CN is unconditionally stable

Page 84: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

Stable schemes can be obtained by:

1) Selecting explicit time stepping algorithm which

have some stability on imaginary axis

2) Modifying the original equation by adding “artificial

viscosity”

Page 85: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

Explicit Time Stepping Scheme

Predictor/Corrector

Page 86: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

Explicit Time Stepping Scheme

4 Stage Runge-Kutta

Page 87: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

Adding Artificial Viscosity

Additional Term

EF Time First Order Upwind

EF Time Lax-Wendroff

Page 88: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

Adding Artificial Viscosity

For each Fourier mode θ,

Additional Term

Page 89: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation…

First Order Upwind Scheme

Page 90: Lectures 8, 9 and 10

Method of LinesMethods for ODE’s

…Application to the wave equation

Lax-Wendroff Scheme

Page 91: Lectures 8, 9 and 10

Dissipation andDispersion

Model Problem

with and periodic boundary conditions.

Solution

Page 92: Lectures 8, 9 and 10

Dissipation andDispersion

Model Problem

represents Decay

dissipation relation

represents Propagation

dispersion relation

For exact solution of

no dissipation

(constant) no dispersion

Page 93: Lectures 8, 9 and 10

Dissipation andDispersion

Modified Equation

First Order Upwind

Lax-Wendroff

Beam-Warming

Page 94: Lectures 8, 9 and 10

Dissipation andDispersion

Modified Equation

• For the upwind scheme dissipation dominates over dispersion Smooth solutions

• For Lax-Wendroff and Beam-Warming dispersion is the leading error effect Oscillatory solutions ( if not well resolved)

• Lax-Wendroff has a negative phase error• Beaming-Warming has (for ) a positive phase

error

Page 95: Lectures 8, 9 and 10

Dissipation andDispersion

Examples

First Order Upwind

Page 96: Lectures 8, 9 and 10

Dissipation andDispersion

Examples

Lax-Wendroff (left)

vs.

Beam-Warming (right)

Page 97: Lectures 8, 9 and 10

Dissipation andDispersion

Exact Discrete Relations

For the exact solution

, and

For the discrete solution

, and