Top Banner

of 30

Lecture 6 Elliptic Eq Ns Linear System

Aug 08, 2018

Download

Documents

Desh Deepak
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    1/30

    AML 811

    Lecture 6

    Elliptic Equations

    Solving a Linear System of Equations

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    2/30

    Recap of Lecture 5 : Stability of

    discretizations If the PDE is stable, i.e. its solution remains bounded, then we

    need that the finite differnce solution should also be stable

    Some methods for analyzing stability1. Discrete perturbation method

    2. Von-Neumann analysis

    3. Matrix method

    Stability analysis can normally only be done for linearequations. For non-linear equations, we linearize locally beforeanalysis and hence, only linear stability can be judged.

    Experience indicates that linear stability normally means non-linear stability as well.

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    3/30

    Recap: Explicit FTCS for the diffusion

    equation x = 0.2; t = 0.004; =1

    2

    2

    x

    u

    t

    u

    =

    FTCS

    1=

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    4/30

    Explicit FTCS for the diffusion equation

    Finer grid : x = 0.1; t = 0.004

    FTCS2

    2

    x

    u

    t

    u

    =

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    5/30

    Explicit FTCS for the diffusion equation

    Finer grid : x = 0.05; t = 0.004

    FTCS2

    2

    x

    u

    t

    u

    =

    Solution quickly

    unstable. Why?

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    6/30

    Recap: Summary of Von-Neumann Analysis

    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, at time

    step n

    Amplitude of

    Fourier waveat n

    Wave number

    Gain oramplification

    factor

    Ref Computational Fluid Dynamics 1 : Hoffmann and Chiang: pgs 124-25

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    7/30

    Recap: Summary of Von-Neumann Analysis

    Step 3 : Find region of stability

    Find the conditions on x, t under which the amplitude of the wavewill be stable, i.e. not grow. This will happen if

    Stability analysis shows that FTCS for the wave equationis stable only ift =0 i.e. FTCS is never stable for the

    wave equation: Unconditionally unstable

    FTCS for the diffusion equation

    Stable only for2

    sin41 2 dG =

    2

    12

    =

    x

    td

    Ref: Computational Fluid Dynamics -1 : Hoffmann and Chiang, pgs 124-25

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    8/30

    Recap: The Explicit Approach

    Solution at each point in the next time step

    computed from known values at previous

    time step(s)Stencil

    Example:

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    9/30

    Recap: The Implicit Approach

    Solution at a certain grid point for a time step dependson values at other grid points in the same time step

    A system of equations has to be solved to

    simultaneously obtain the solution at all grid points This is computationally more expensive than the explicit

    method as we have to solve a system of equations at

    each time step. So, are there are any advantages?

    Example:

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    10/30

    Recap: Implicit FTCS for the diffusion

    equation Von-Neumann analysis shows

    allfor1

    2cos41

    12

    +

    = Gd

    G

    Since there is no restriction on time step,unlike the explicit scheme, unconditional

    stability allows us to take much larger timesteps

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    11/30

    Recap: FTCS for diffusion equation

    These terms are computed at

    time level n : known

    Explicit FTCS

    Implicit FTCS

    These terms are computed at

    time level n + 1 : unknown

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    12/30

    Recap: Other Schemes for the diffusion

    equation

    DuFort-Frankel

    Explicit

    Crank-Nicholson

    Implicit

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    13/30

    Recap: Summary of Lecture 5

    Even if a numerical scheme is consistent, it might not bestable for all choices of the grid spacing and time step.

    Von Neumann stability analysis can be used to analyze

    the linear stability of a numerical scheme Implicit schemes are more stable (many times

    unconditionally stable) than explicit schemes and hence,

    allow larger time steps. However, they involve greatercomputational expense per computational time step

    Beta formulation for the 1D diffusion equation

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    14/30

    Elliptic Equations

    Recall Have no real characteristics

    Equilibrium problems. Oftenrepresent steady state of someparabolic problem. Example:Steady state heat-conduction

    Boundary value problems(BVP) : Value of function onthe interior of the domain iscompletely determined by

    values on the boundary. Alsoknown as jury problems forthe same reason.

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    15/30

    Examples of Elliptic Equations

    Steady state heat conduction with isotropic material

    02 = T

    02 =

    Streamfunction for 2D, incompressible, inviscid,

    irrotational flow Laplaces Equation02 =

    Creeping flow (very low speed flow) driven purely bygravity or other body forces

    fur

    r

    =2

    Poisson Equation

    ),,(2 zyxf=

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    16/30

    A simple elliptic problem 1D steady-

    state heat conduction

    02

    2

    =dx

    TdBCs

    LxTT

    xTT

    b

    a

    ==

    ==

    @

    0@

    Dirichlet

    BCs

    To numerically solve this, first discretize the 1D

    domain into N points. Greater N => greateraccuracy

    x = 0

    i = 1x = L

    i = N

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    17/30

    Dirichlet (value of function) and Neumann

    (derivative of function) BCs

    LxTT

    xTT

    b

    a

    ==

    ==

    @

    0@

    LxTT

    xT

    b

    x

    ==

    ==

    @

    0@0

    Neumann

    BC

    Dirichlet

    BC

    =

    b

    a

    T

    T

    T

    T

    T

    T

    T

    T

    0

    0

    0

    0

    100000

    121000

    012100

    001210

    000121

    000001

    6

    5

    4

    3

    2

    1

    =

    bTT

    T

    T

    T

    T

    T

    0

    0

    0

    0

    0

    100000

    121000

    012100

    001210

    000121

    000011

    6

    5

    4

    3

    2

    1

    How can we solve such equations?

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    18/30

    Direct vs Iterative Methods Direct Methods

    Solution found at one shot

    Give exact solution (to precision of machine)

    Example: Cramers rule, Gauss elimination

    Extremely expensive O(N!) for Cramerrule

    O(N3) for Gauss elimination

    Iterative methods

    Solution found by iteration. Gives approximate solution

    Example: Jacobi iteration, Gauss-Seidel, SOR, Conjugate-Gradient

    Work well forsparse linear systems: Systems which have lots ofzeros. These systems arise naturally for PDE approximations

    Often, paradoxically, simpler to implement than direct methods

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    19/30

    A 2D Diffusion problem

    BCs

    No of unknowns = ?

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    20/30

    A 2D Diffusion problem

    BCs

    No of unknowns = 16

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    21/30

    A 2D Diffusion problem Five Point Stencil

    Five Point stencil

    Second order accurate

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    22/30

    A 2D Diffusion problem Nine Point Stencil

    Nine Point stencilFourth order accurate

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    23/30

    System of equations for the second order

    method

    Note that the corner points never

    enter into the equation

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    24/30

    System of equations for the second order

    method

    Sparse, band pentadiagonal system of equations.

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    25/30

    Iterative method for solving system of

    equations: Jacobi method

    Note that no matrix

    entries are really

    stored anywhere

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    26/30

    Iterative method for solving system of

    equations: Jacobi method Start with initial assumed guess for solution

    (except at the Dirichlet boundaries) u0

    Update the values at all unknown pointsusing the equation for the diagonal term. For

    Laplaces equation this comes to

    Repeat iterations till successive iterations areclose enough

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    27/30

    Jacobi vs FTCS

    FTCS

    Jacobi

    Jacobi solves the equilibrium problem as ifit is the steady-statesolution to the corresponding parabolic problem

    This generally results in slower convergence of the iteration andsince we are not interested in the actual parabolic problem, wecan get faster solutions by modifying the Jacobi method

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    28/30

    Point Gauss-Seidel method

    Start with initial assumed guess for solution

    (except at the Dirichlet boundaries) u0

    Update using the newest values available at

    each grid point

    G S id l i i

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    29/30

    Gauss-Seidel iterationUn-updated values

    Updated values

    S f L 6

  • 8/22/2019 Lecture 6 Elliptic Eq Ns Linear System

    30/30

    Summary of Lecture 6

    Discretization of elliptic equations results in asystem ofsparse linear equations

    Direct methods are often more expensivethan iterative methods for sparse linear

    systems Jacobi for Laplace behaves similarly to the

    FTCS method for the corresponding

    parabolic problem Gauss-Seidel is a method that generally

    converges faster than Jacobi