lecture on advanced mathematical technques

Upload: debayan-gupta

Post on 03-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    1/39

    Numerical Methods for Partial

    Differential Equations

    CAAM 452

    Spring 2005

    ecture !

    "nstructor# $im %ar&urton

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    2/39

    Summar' of Small $heta Anal'sis

    ( $he dominant remainder term in this anal'sisrelates to a commonl' used) ph'sicall' moti*ated

    description of the shortfall of the method#

    ( )

    ( ){ }

    ( ) ( ){ }

    ( ) ( ){ }

    ( )

    33

    3

    3

    2

    5

    2

    5

    1

    2

    2

    2

    2

    0

    1

    42

    5

    4

    3!

    !

    !

    0

    0

    0

    0

    m

    m

    m

    m

    m

    m

    mtd

    tm Oi ctdxL

    m m

    tm c Oi ctdxL

    m m

    itm c Oi ctdxL

    m m

    i im c ti c

    i t

    tdx

    tdx

    m

    x

    x

    L

    d

    m

    du

    c u u u e edt

    duc u u u e e

    dt

    duc u u u e e

    dt

    du

    c u u u e edt

    +

    +

    +

    +

    +

    +

    = =

    = =

    = =

    = =

    r

    rr

    r r

    rr ( ){ }7m

    tO

    dx

    Dissipati*e

    +nsta&le

    Dispersi*e

    Dispersi*e

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    3/39

    Dissipation in Action

    ( Consider the right difference *ersion#

    ( %e are going to e,perimentall' determine ho-

    much dissipation the solution e,periences.

    ( ) ( ){ }2

    3312

    0 mm

    tm Oi ctdxL

    m m

    tdxdu c u u u e e

    dt

    +

    += =r

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    4/39

    $esting Methodolog'

    / 1educe the timestepping error to a secondar' effect &' choosing a 4

    th

    order 1unge3utta S$ timeintegrator and a small dt.

    2 6i, the method choose one of the difference operators for the spatialderi*ati*e

    7 Do a parameter stud' in M) i.e. -e as8 the questions# ho- doesincreasing the num&er of data points change the error.

    4 %e need to understand -hat questions -e are as8ing#

    / "s the computer code sta&le as predicted &' the theor'92 Does the computer code con*erge as predicted &' the theor'9

    7 %hat order of accurac' in M do -e achie*e9

    4 %e h'pothesi:e that if the theor' holds then -e should achie*e#

    5 %hat is the actual appro,imate p achie*ed9

    ( ) ( ), , pm mu T x u T x Cdx %

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    5/39

    "nitial Condition

    ( ;ecause -e do not -ish to introduce uncertaint'o*er the source of errors in the computation -e use

    an initial condition -hich is infinitel' smooth.

    ( ) ( )2

    4cos,0 with [0,2)xu x e x=

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    6/39

    Computing Appro,imate

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    7/39

    After 4 Periods

    ( $he numerical pulses are in the right place &utha*e se*erel' diminished amplitude.

    du

    c udt

    += r

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    8/39

    After 4 Periods

    M Ma,imum error at t=> ?order

    20 0.@/4/@45/!

    40 0.@/7!5747@744! 0

    >0 0.@>7240>/24>5@ 0.0/

    /@0 0.@7/@7@042/>5 0.//

    720 0.52!425@0@5040> 0.2@

    After 4 periods the solution is totall' flattened in all &ut the last 2 results. "f -e &othered

    to 8eep increasing M -e -ould e*entuall' see the error decline as /BM

    duc u

    dt+= r

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    9/39

    $he +nsta&le eft Stencil

    ( " repeated this -ith e*er'thing the same) e,cept the choice

    of instead of

    du

    c udt

    = r

    +

    ( )( )

    231 2

    2!

    2

    0 m

    mt

    d

    tm c O

    i ct dxL

    x M

    m m

    duc u u u e e

    dt

    +

    +

    = =r

    r

    %e clearl' see that there is initial gro-th

    near the pulses) &ut e*entuall' the

    dominant feature is the highl' oscillator'

    and e,plosi*e gro-th

    large m in the a&o*e red term.

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    10/39

    Cont (snapshot)

    ( )

    ( )2

    31 2

    2!

    2

    0

    m

    mt

    d

    tm c O

    i ct dxL

    x M

    m m

    du

    c u u u e edt

    +

    +

    = =

    rr

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    11/39

    Dispersion in Action

    ( Consider the central difference *ersion#

    ( %ith the same time integrator &efore) M=/00)

    ( %e note that the remainder terms are dispersi*e corrections

    i.e. the' indicate that modes of different frequenc' -ill

    tra*el -ith different speed.

    ( 6urthermore) to leading order accurac' the higher order

    modes -ill tra*el more and more slo-l' as m increases.

    ( ) ( ){ }3 52

    3!

    0 0

    mm

    itm i tc Oi ctdxL

    m mdxdu c u u u e e

    dt

    +

    = =r

    0

    duc u

    dt= r

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    12/39

    ( %e notice that the humps start to shed rear oscillations as

    the higher frequenc' 6ourier components lag &ehind the

    lo-er frequenc' 6ourier components.

    2nd

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    13/39

    Con*ergence Stud' t=>

    %hat should -e use as an error"ndicator 99

    0

    duc u

    dt= r

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    14/39

    2nd ?order

    20 0.4240>0/4!450@

    40 0.7502>>50!77 /.42

    >0 0.7>2>5/2!!@>5 0./7

    /@0 0.///>/2!4@@>!> /.00

    720 0.054!/!705244>2 /.>0

    ( %e do not see a con*incing 2ndorder accurac'

    ( " computed this &' log2errorMBerrorFM/G

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    15/39

    4th

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    16/39

    4th

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    17/39

    @th ?order

    20 0./405!5@/5520

    40 0.0457@5252@>7 /.!

    >0 0.00/@2/55@07 4.>!

    /@0 0.00002>/!24/05 5.>!

    720 0.0000004@04/4/5 5.!

    ( %e see prett' con*incing @thorder accurac'

    ( " computed this &' log2errorMBerrorFM/G

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    18/39

    Summar' of $esting Procedure

    / +nderstand -hat 'ou -ant to test

    2 3eep as man' parameters fi,ed as possi&le

    7 "f possi&le) perform an anal'sis &efore hand

    4 1un parameter s-eeps to determine if code agrees -ith anal'sis.

    5 Estimate error scaling -ith a single parameter if possi&le.

    @ "t should &e apparent here that the errors computed in the simulations

    onl' appro,imate the tid' po-er la- d,Hp in the limit of small d,large M.

    ! "t is quite common to refer to the range of M &efore the error scalingapplied as the Ipreasymptotic convergence rangeJ.

    > $he preas'mptotic range is due to the other factors in the errorestimate -hich are much larger than the d,Hp term i.e. the pKth

    deri*ati*es ma' &e *er' large) or the constant ma' &e large "n this case -e heuristicall' set dt small) using a highorder 1unge

    3utta time integrator) and then performed a parameter s-eep on M.%e could ha*e &een unluc8' and the timestepping errors ma' ha*e&een dominant -hich -ould mas8 the d, &eha*ior.

    /0 $o &e careful -e -ould tr' this e,periment -ith e*en smaller dt and

    chec8 if the scalings still hold.

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    19/39

    Summar' of our Approach to Designing

    6inite Difference Methods

    ( %e ha*e s'stematicall' created finite difference methods &'separating the treatment of space and time deri*ati*es.

    ( $hen designing a sol*er consists of choosingBtesting# a time integrator so far -e co*ered Euler6or-ard) eap6rog)

    Adams;ashford2)7)4) 1unge3utta a discreti:ation for spatial deri*ati*es a discrete differential operator -hich has all eigen*alues in the

    left half of the comple, plane assuming the PDE onl' admitsnongro-ing solutions.

    Possi&l' using LerschgorinKs theorem to locali:e theeigen*alues of the discrete differentiation operator

    dt so that dtlargest eigen*alue &' magnitude of thederi*ati*e operator sits inside the sta&ilit' region sta&ilit'.

    small d, spatial truncation anal'sis consistenc' andaccurac'.

    6ourier anal'sis for classification of the differential operator.

    %riting code and testing.

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    20/39

    Some Classical 6inite Difference Methods

    ( o-e*er) there are a num&er of classical methods-hich -e ha*e not discussed and do not quite fit

    into this frame-or8.

    ( %e include these for completeness..

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    21/39

    eap 6rog space and time

    ( %e use centered differencing for &oth space and time.

    ( %e 8no- that the leap frog time stepping method is onl'sta&le for operators -ith eigen*alues in the range#

    ( o-e*er) -e also 8no- that the centered differencederi*ati*e matri, is a s8e- s'mmetric matri, -itheigen*alues#

    ( So -e are left -ith a condition# i.e.

    1 1

    1 1

    2 2

    n n n n

    m m m mu u u ucdt dx

    + + =

    [ ]1,1dt i

    2sin

    ic m

    dx M

    1cdt

    dx

    dxdt

    c

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    22/39

    cont

    ( %e can perform a full truncation anal'sis in spaceand time#

    ( %e 8no- that dt O= d, so

    ( ) ( ) ( ) ( )

    ( ) ( )

    1 1 1 1

    3 3

    , , , ,

    2 2

    n m n m n m n m nm

    u x t u x t u x t u x t T cdt

    dx

    cdtO dt O dx

    dx

    + + =

    =

    ( ) ( )3 3nmT O dt cO dx=

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    23/39

    a,6riedrichs Method

    ( %e immediatel' conclude that the follo-ing method is notsta&le#

    ( ;ecause the Euler6or-ard time integrator onl' admits onesta&le point the origin on the imaginar' a,is) &ut thecentral differencing matri, has all eigen*alues on theimaginar' a,is.

    ( o-e*er) -e can sta&ili:e this formula &' replacing thesecond term in the timestepping formula#

    1

    0

    n nnm mm

    u uc u

    dt

    + =

    ( )1 1 10

    0.5n n nm m m nm

    u u uc u

    dt

    ++ + =

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    24/39

    cont

    ( $his formula does not quite fit into our constructi*eprocess method of lines approach.

    ( %e ha*e admitted spatial a*eraging into the

    discreti:ation of the time deri*ati*e.

    ( %e can rearrange this#

    ( )1 1 10

    0.5n n nm m m nm

    u u uc u

    dt

    ++ + =

    ( ) ( )1 1 1 1 1

    1 1

    1

    2 2

    1 11 1

    2 2

    n n n n n

    m m m m m

    n n

    m m

    dtu u u c u u

    dx

    dt dt c u c u

    dx dx

    ++ +

    +

    = + +

    = + +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    25/39

    cont

    ( %e can immediatel' determine that this is a sta&le method as

    long as cdtBd, O=/

    ( Li*en) this condition -e o&ser*e that the time updated

    solution is al-a's &ounded &et-een the *alues of the left and

    right neigh&or at the pre*ious time &ecause this is aninterpolation formula.

    1

    1 11 11 12 2

    n n nm m mdt dt u c u c u

    dx dx+

    + = + +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    26/39

    cont

    ( A formal sta&ilit' anal'sis -ould in*ol*e#

    ( %hich gi*es sta&ilit' for each mode if#

    ( ) ( ){ }

    1

    1 1

    1

    1

    1 11 1

    2 2

    1 11 1

    2 2

    1 11 1

    2 2

    cos sin

    m m

    n n n

    m m m

    n n n

    i in n n

    m m m

    n

    m m m

    dt dt u c u c u

    dx dx

    dt dt u c u c u

    dx dx

    dt dt u c e u c e u

    dx dx

    dtc i udx

    ++

    +

    +

    = + +

    = + + = + +

    = +

    R Lr r r

    % % %

    %

    ( ) ( )cos sin 1m mdt

    c idx

    +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    27/39

    cont

    ( $hus considering all the possi&le modes( %e note that the middle mode requires#

    ( $his condition gi*es a sufficient condition for all modes to &e

    &ounded.

    ( ;' the in*erti&ilit' and &oundedness of the 6ourier transform

    -e conclude that the original equation is sta&le.

    cos sin 12 2

    1

    dtc i

    dx

    dtc

    dx

    +

    2

    m

    m

    M

    =

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    28/39

    cont

    ( %e can recast the a,6riedrichs method again

    ( $his method consists of Euler 6or-ard) central

    differencing for the space deri*ati*e and an e,tra

    dissipati*e term i.e. a grid dependent ad*ection

    diffusion equation#

    ( )

    1

    1 1

    1 2 2

    0

    1 11 1

    2 2

    11

    2

    n n n

    m m m

    n n n

    m m m

    dt dt u c u c u

    dx dx

    u cdt u dx u

    ++

    +

    = + +

    = + +

    2 2

    2

    2

    u u dx uc

    t x x

    = +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    29/39

    C6 Num&er

    ( $he ratio appears repeatedl') in particular inthe estimates for the ma,imum possi&le time step.

    ( %e refer to this quantit' as the C6 Courant

    6riedrichse-' num&er.

    ( ;ounds of the form# -hich result from a

    sta&ilit' anal'sis are frequentl' referred to as C6conditions.

    dt

    dx

    =

    dtC

    dx=

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    30/39

    a,%endroff Method

    ( %e are fairl' free to choose the parameter in the sta&ili:ingterm#

    ( $he artificial viscosity term acts to shift the eigen*alues ofthe spatial operator into the left halfplane.

    ( 1ecall the Euler6or-ard sta&ilit' region is the unit circle

    centered at / in the comple, plane. So pushing theeigen*alues off the imaginar' a,is allo-s us to choose a dt

    small enough to push the eigen*alues of the discrete spatial

    operator into the sta&ilit' region

    ( )1 2 20

    11

    2

    n n n

    m m mu cdt u cdt u + = + +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    31/39

    Class E,ercise

    ( Please pro*ide a C6 condition for#

    ( "n terms of#

    ( %hat is the truncation error9

    ( ) ( )1 1 1 1 2 24 1

    3 6

    n n n n n n

    m m m m m mu u c u u c u u +

    + + = +

    dt

    dx=

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    32/39

    on Neumann Anal'sis

    ( ;' stealth " ha*e introduced the classical on

    Neumann anal'sis.

    ( $he first step is to 6ourier transform the finite

    difference equation in space.

    ( A short cut is to ma8e the follo-ing su&stitutions#

    1

    1

    2

    2

    2

    2

    ......

    m

    m

    m

    m

    n n

    m m

    in n

    m m

    in n

    m m

    in n

    m m

    in n

    m m

    u u

    u e u

    u e u

    u e u

    u e u

    +

    +

    %

    %

    %

    %

    %

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    33/39

    Anal'sis cont

    ( %e can also ma8e the su&stitutions for thedifference operators#

    ( )

    ( )

    { } ( )

    2

    2

    1

    1

    2 0

    2

    2

    22

    1 11 2 sin

    2

    1 11 2 sin

    2

    1 1sin

    2

    ......

    m

    m

    m

    mm

    m

    m m

    m

    m

    ii m

    n n

    m mi

    i min n

    m m

    in n

    m mi i

    in n m

    m m

    in n

    m m

    e iedx dx

    u ue ieu e u

    dx dx

    u e ue e i

    u e u dx dxu e u

    +

    +

    +

    + =

    = =

    %

    %

    %

    %

    %

    ( ){ }

    2

    2

    2

    14sin

    2

    2

    1 cos

    m

    m

    dx

    dx

    + =

    =

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    34/39

    Example

    ( $he a,%endroff scheme

    ( &ecomes

    ( )1 2 20

    11

    2

    n n n

    m m mu cdt u cdt u + = + +

    2 2

    1 2

    2

    1 21

    2 2

    m m m mi i i i

    n n n

    m m m

    e e e eu cdt u cdt u

    dx dx

    + += + +

    % % %

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    35/39

    Example cont

    ( So the a,%endroff scheme &ecomes a neat onestep method for each 6ourier coefficient#

    ( %e ha*e neatl' decoupled the 6ourier coefficients

    so -e are &ac8 to sol*ing a recurrence relation in n

    for each m#

    ( ence -e need to e,amine the roots of the sta&ilit'pol'nomial for the a&o*e

    2 2

    1 2

    2

    1 21

    2 2

    m m m mi i i in n n

    m m m

    e e e eu cdt u cdt u

    dx dx

    + += + + % % %

    n

    mu%

    2 2

    2

    2

    1 21

    2 2

    m m m mi i i ie e e ez cdt cdt

    dx dx

    += + +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    36/39

    E,ample cont

    ( $his case is tri*ial as -e Qust need to &ound thesingle root &' /

    ( Plot it this as a function of theta

    ( ) ( )( ){ }

    2 2

    2

    2

    2

    1 21

    2 2

    1 sin cos 2 1

    m m m mi i i i

    m

    e e e ez cdt cdt

    dx dx

    c i c

    += + +

    = + +

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    37/39

    6inal on Neuman Shortcut

    ( %e can s8ip lots of steps &' ma8ing the directsu&stitution#

    ( ere g is referred to as the amplification factor and

    imtheta is our pre*ious thetam

    n n im

    mu g e

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    38/39

    Ne,t $ime

    ( Definition of consistenc'

    ( a,1ichtm'er equi*alence theor'

    ( $reating higher order deri*ati*es

  • 8/12/2019 Lecture on Advanced Mathematical Technques

    39/39

    ome-or8 7

    R/ ;uild a finitedifference sol*er for

    R/a use 'our Cash3arp 1unge3utta time integrator from %2 for time stepping

    R/& use the 4thorder central difference in space periodic domain

    R/c perform a sta&ilit' anal'sis for the timestepping &ased on *isual inspection of

    the C3 13 sta&ilit' region containing the imaginar' a,is

    R/d &ound the spectral radius of the spatial operator

    R/e choose a dt -ell in the sta&ilit' region

    R/f perform four runs -ith initial condition use M=20)40)>0)/@0 and compute ma,imum error at t=>

    R/g estimate the accurac' order of the solution.

    R/h e,tra credit# perform adapti*e timestepping to 8eep the local truncation errorf ti t i & d d & t l

    u uc

    t x

    =

    ( ) ( )

    [ ]

    24cos

    ,0 , 0,2

    x

    u x e x

    =