lecture9 hyperbolic equation

Upload: desh-deepak

Post on 08-Aug-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/22/2019 Lecture9 Hyperbolic Equation

    1/31

    AML 811Lecture 9

    Approximate Factorization

    Hyperbolic Equations: Leapfrog, FTBS

  • 8/22/2019 Lecture9 Hyperbolic Equation

    2/31

    Recap : Implicit iterative method

    Line Gauss-Seidel

    Line Gauss-Seidel

    Values at each line are updated simultaneously based on latest available values

  • 8/22/2019 Lecture9 Hyperbolic Equation

    3/31

    Recap : Line Gauss-Seidel example

    =

    4

    2,54,5

    2,44,4

    2,34,3

    2,24,2

    2

    3,6

    3,5

    3,4

    3,3

    3,2

    3,1

    100000

    141000

    014100001410

    000141

    000001

    u

    uu

    uu

    uu

    uu

    u

    u

    u

    u

    u

    u

    u

    Update

    direction

    System of tridiagonal

    equations

  • 8/22/2019 Lecture9 Hyperbolic Equation

    4/31

    Recap : Line Gauss-Seidel Method

    Algorithm1. Initialize guess

    2. Choose a direction for

    sweeping (rows or columns)3. Sweep through lines

    updating all points in eachline simultaneously to thek+1th level using the Gauss-Seidel update. This involvessolving a system oftridiagonal equations

    4. After one sweep through the

    domain check error.5. If error too high, repeat steps

    3 and 4

    Any efficient way of solving tridiagonal systems?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    5/31

    Recap : Solving Tridiagonal systems :

    Thomas algorithm

    Forward Sweep. Making the matrix upper-diagonal

    Back-substitution to obtain x

    iiiiiii dxcxbxa =++ + 11

  • 8/22/2019 Lecture9 Hyperbolic Equation

    6/31

    Recap : Line SOR

    Values at each line are updated simultaneously based on latest available values

    ( )SeidelGaussLine

    k

    ji

    k

    jiSORLine

    k

    ji uuu ++ += 1,,

    1

    , 1

  • 8/22/2019 Lecture9 Hyperbolic Equation

    7/31

    Recap : Crank-Nicholson as a multi-step

    methodStep 1: Explicit Update Step 2: Implicit Update

    Total effect of explicit and implicit steps : Crank Nicholson

  • 8/22/2019 Lecture9 Hyperbolic Equation

    8/31

    Recap : 2D parabolic equations

    Use 1D parabolic equation methods as stepping stone for 2Dmethods

    Explicit FTCS Implicit FTCS (same as BTCS)

    Crank-Nicholson

    As usual, we need to analyze consistency and stability for these

    It turns out that all these schemes are consistent. Stability?

    Example

  • 8/22/2019 Lecture9 Hyperbolic Equation

    9/31

    Recap : Summary of Von-Neumann Analysis in

    2D Step 1 : Fourier Decomposition:

    Assume that solution is composed of a sum of waves of

    the form

    Step 2: Obtain evolution equation for the amplitude

    Substitute Fourier decomposition in the original Finite

    Difference equation and write it in the formnn GUU =+

    1

    Soln at grid

    point i,j at

    time step n

    Gain oramplification

    factor

  • 8/22/2019 Lecture9 Hyperbolic Equation

    10/31

    Recap : Summary of Von-Neumann 2D Analysis

    Step 3 : Find region of stabili ty

    Find the conditions on x, y, t under which the amplitude of the

    wave will be stable, i.e. not grow. This will happen if

    Explicit FTCS for the diffusion equation

    2sin4

    2sin41 22

    yx ddG =

    2

    122

    +

    =+

    y

    t

    x

    tdd yx

    Stable only if Why not use FTCSimplicit instead?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    11/31

    Recap : Implicit formulation for 2D

    parabolic equation

    Banded, pentadiagonal system of equations to be solved at each time step

  • 8/22/2019 Lecture9 Hyperbolic Equation

    12/31

    Recap : Implicit formulation for 2D

    parabolic equation

    Banded, pentadiagonal system of equations to be solved at each time step

  • 8/22/2019 Lecture9 Hyperbolic Equation

    13/31

    Recap : Implicit formulation for 2D

    parabolic equation for a 5x5 system

    Banded, pentadiagonal system of equations to be solved at each time step

    Very expensive. Is there a cheaper, equally stable alternative?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    14/31

    Recap : Alternate Direction Implicit (ADI)

    Scheme

    Update in two steps

    Each step involves implicit space derivatives in only one direction This results in only a tridiagonal system of equations being solved in each step

    Unconditionally stable. Second order in space and time

    What is ADIs relationship to the 2D Crank-Nicholson scheme? Are theyidentical?

    x sweep

    y sweep

  • 8/22/2019 Lecture9 Hyperbolic Equation

    15/31

    Summary of Lecture 8 Line Methods : Sweep through rows or columns updating all

    values in a line simultaneously : Line Gauss Seidel, LSOR

    Crank-Nicholson as a multi-step method involving separateexplicit and an implicit steps.

    Von-Neumann stability analysis with 2 spatial dimensions Implicit schemes for 2D parabolic equations too expensive,

    explicit schemes too restrictive on time step

    Option :Alternate direction implicit scheme

    Update in two steps with each step having an implicit update inone spatial direction

    Unconditionally stable, second order accurate in time and space

    Whats its relation to Crank-Nicholson?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    16/31

    Recall : Alternate Direction Implicit (ADI)

    Scheme

    Update in two steps

    Each step involves implicit space derivatives in only one direction This results in only a tridiagonal system of equations being solved in each step

    Unconditionally stable. Second order in space and time

    What is ADIs relationship to the 2D Crank-Nicholson scheme? Are theyidentical?

    x sweep

    y sweep

  • 8/22/2019 Lecture9 Hyperbolic Equation

    17/31

    ADI and Crank-Nicholson methods in 2D

    CN involves inverting a pentadiagonal matrix : P ADI involves inverting two tridiagonal matrices : T1 and T2

    Whats the relation between P, T1 and T2?

    Crank-Nicholson

    ADI

    x sweep

    y sweep

  • 8/22/2019 Lecture9 Hyperbolic Equation

    18/31

    ADI and Crank Nicholson: Approximate

    Factorization Methods

    Since ADI treats each direction successively at a time lag compared to the other directionit is still an approximation of the Crank-Nicholson scheme

    However, since the difference between the two methods is less than the truncation error, it

    is a valid approximation and retains consistency and the overall order of convergence Methods such as ADI which approximate a more computationally intensive matrix inversion

    by a less intensive one (typically involving tridiagonal systems) are known asApproximateFactorization Methods.

    Crank Nicholson

    ADI

    Difference between the two

  • 8/22/2019 Lecture9 Hyperbolic Equation

    19/31

    Another approximate factorization :

    Fractional Step Method

    Treat each direction separately by Crank Nicholson.

    Unlike ADI, which approximates the full 2D equation in each step, the fractionalstep method approximates only one 1D component in each step.

    This method is also unconditionally stable and second order accurate in timeand space

    Approximate factorization methods can be used for elliptic equations also

    Step 1 : x update

    Step 2 : y update

  • 8/22/2019 Lecture9 Hyperbolic Equation

    20/31

    Hyperbolic Equations

    Recall Have as many real characteristics as

    order of PDE Information travels at a finite speed. The

    effects of an action somewhere will befelt elsewhere after a time lag.Convection predominates in suchproblems

    Marching Problems: Initial solution orcondition needs to be marched in timeto get solution at a later time

    Domain of dependence : The region inspace and time on which the solution ata point depends on

    Range of influence: The region in spaceand time which the value at a point willinfluence

    The compressible, inviscid fluid dynamicequations are hyperbolic

  • 8/22/2019 Lecture9 Hyperbolic Equation

    21/31

    Recall : A preliminary scheme to solve the

    wave equation

    Let us try and numerically solve the wave

    equation with some given initial condition

    ( ) )][,( 2111 xtOuux

    tauu

    n

    i

    n

    i

    n

    i

    n

    i +

    = +

    +

    Use a forward difference scheme in time and

    central difference scheme in space (FTCS

    scheme)

    0=

    +

    x

    ua

    t

    u

    Stencil

  • 8/22/2019 Lecture9 Hyperbolic Equation

    22/31

    Numerically solving the wave equation.

    Let the initial condition be u(x,0) = u0(x)

  • 8/22/2019 Lecture9 Hyperbolic Equation

    23/31

    Exact Solution

    Wave moving towards right at speed c

  • 8/22/2019 Lecture9 Hyperbolic Equation

    24/31

    Recall : FTCS for wave equation. Using FTCS results in the following behavior irrespective

    of time step and grid size

    FTCS is unconditionally unstable.

    What about FTFS,CTCS, BTCS, FTBS?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    25/31

    Leapfrog (CTCS) method

    Some problems with Leapfrog

    Need to give some initial condition for n =1 apartfrom the usual condition for n = 0

    Odd and even time steps are decoupled. i.e. The

    solution at the even time steps never depends onthe solution at odd time steps. Often, twoindependent solutions develop over time (Exercise)

    Stability condition

    1xta

  • 8/22/2019 Lecture9 Hyperbolic Equation

    26/31

    FTBS for the wave equation

    First order in space and time

    Also known as the first order upwind

    method

    x

    uua

    t

    uun

    i

    n

    i

    n

    i

    n

    i

    =

    +

    1

    1

    Stable for 1

    =

    x

    tac Courant condition

  • 8/22/2019 Lecture9 Hyperbolic Equation

    27/31

    FTBS for wave equation with CFL = 1

    Gives the exact solution! Why?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    28/31

    FTBS for wave equation with CFL = 0.5

    Why is the solution somewhat diffusive?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    29/31

    FTBS for wave equation with CFL = 0.9

    Why is the solution somewhat diffusive but less diffusive than CFL = 0.5?

    Is FTBS consistent?

  • 8/22/2019 Lecture9 Hyperbolic Equation

    30/31

    Artificial viscosity

    FTBS can be rewritten as

    2

    1111

    1 2

    x

    uuu

    x

    uua

    t

    uun

    i

    n

    i

    n

    i

    n

    i

    n

    i

    n

    i

    n

    i

    +=

    +

    +++

    Here the coefficient artificial viscosity goes

    down as the grid size becomes smaller and

    hence the scheme is consistent

    However, the solution behaves as if it is the

    solution to a convection-diffusion equation

  • 8/22/2019 Lecture9 Hyperbolic Equation

    31/31

    Summary

    ADI is an approximate factorization of the

    Crank-Nicholson method Fractional Step Methods are another way of

    reducing computational costs for parabolic

    equations Hyperbolic equations

    Stability analysis of Leapfrog method

    Leapfrog can lead to odd-even decoupling FTBS is a stable method for hyperbolic equations

    but it is first order accurate and can be diffusive