+ All Categories
Home > Documents > PDEs - Slides (3)

PDEs - Slides (3)

Date post: 06-Apr-2018
Category:
Upload: scribd6289
View: 217 times
Download: 0 times
Share this document with a friend

of 120

Transcript
  • 8/3/2019 PDEs - Slides (3)

    1/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Part III

    20401

    Tony Shardlow

    1/120

  • 8/3/2019 PDEs - Slides (3)

    2/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Outline

    1 Uniqueness for reaction diffusion model

    2 Stability for diffusion model

    3 Finite differences

    4 Numerical analysis

    5 Finite differences for convection diffusion model

    2/120

  • 8/3/2019 PDEs - Slides (3)

    3/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Outline

    1 Uniqueness for reaction diffusion model

    2 Stability for diffusion model

    3 Finite differences

    4 Numerical analysis

    5 Finite differences for convection diffusion model

    3/120

  • 8/3/2019 PDEs - Slides (3)

    4/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    A model reaction diffusionproblem

    Model reaction diffusion problem

    For a constant r 0,

    u + ru = f for 0 < x < 1

    u(0) = , u(1) = .

    This is a two point Boundary Value Problem (BVP).

    It is a simple model of a system with reaction and diffusion in

    equilibrium.

    4/120

  • 8/3/2019 PDEs - Slides (3)

    5/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Example soln 1

    u = 1 for 0 < x < 1, (1.1)

    u(0) = 0; u(1) = 0.

    The solution is u(x) =1

    2(x x2) .

    0 0.5 10

    1/8

    x

    temperature

    Problem 1.1

    0 0.5 10

    1/(w^2)

    Problem 1.2

    defle

    ction

    x5/120

  • 8/3/2019 PDEs - Slides (3)

    6/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Example soln 2

    u + w2u = 1 for 0 < x < 1 (1.2)

    u(0) = 0; u(1) = 0.

    The solution is

    u(x) =1

    w2

    (exp(wx) + exp(w(1 x)))

    w2(1 + exp(w)).

    0 0.5 10

    1/8

    temperature

    Problem 1.1

    0 0.5 10

    1/(w^2)

    Problem 1.2

    deflection

    6/120

  • 8/3/2019 PDEs - Slides (3)

    7/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Uniqueness for reaction diffusionmodel

    u + ru = f for 0 < x < 1

    u(0) = , u(1) = .

    Definition (well posed)

    A boundary value problem is well posed ifexistence a solution exists

    uniqueness the solution is unique

    stability the solution depends continuously on the data.

    We know solutions exists (using SoV) .

    We now look at uniqueness .

    HOMEWORK

    You can now try Problem 17/120

  • 8/3/2019 PDEs - Slides (3)

    8/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Uniqueness for reaction diffusionmodel

    u + ru = f for 0 < x < 1

    u(0) = , u(1) = .

    Definition (well posed)

    A boundary value problem is well posed ifexistence a solution exists

    uniqueness the solution is unique

    stability the solution depends continuously on the data.

    We know solutions exists (using SoV) .

    We now look at uniqueness .

    HOMEWORK

    You can now try Problem 18/120

  • 8/3/2019 PDEs - Slides (3)

    9/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Theorem (uniqueness of soln)

    There is at most one solution u to

    u + ru = f, u(0) = , u(1) = ,

    where r 0.

    Proof.Suppose that u, v are solns.As the PDE is linear,

    the difference w(x) = u(x) v(x) satisfies

    w + r w = 0, w(0) = 0, w(1) = 0.

    9/120

  • 8/3/2019 PDEs - Slides (3)

    10/120

  • 8/3/2019 PDEs - Slides (3)

    11/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Proof ctd.

    10

    (w)2 dx 0

    +r1

    0w2 dx 0

    = 0,

    with r 0.

    The first term implies that w(x) = 0 for x (0, 1).Hence w is constant in (0, 1).

    As w(0) = 0 and is constant, we conclude that w 0.As w = u v, we see u v and the two solutions are thesame.

    We have proved uniqueness of solutions.

    HOMEWORK

    You can now try Problem 2 and 3

    11/120

  • 8/3/2019 PDEs - Slides (3)

    12/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Proof ctd.

    10

    (w)2 dx 0

    +r1

    0w2 dx 0

    = 0,

    with r 0.

    The first term implies that w(x) = 0 for x (0, 1).Hence w is constant in (0, 1).

    As w(0) = 0 and is constant, we conclude that w 0.As w = u v, we see u v and the two solutions are thesame.

    We have proved uniqueness of solutions.

    HOMEWORK

    You can now try Problem 2 and 3

    12/120

  • 8/3/2019 PDEs - Slides (3)

    13/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Proof ctd.

    10

    (w)2 dx 0

    +r1

    0w2 dx 0

    = 0,

    with r 0.

    The first term implies that w(x) = 0 for x (0, 1).Hence w is constant in (0, 1).

    As w(0) = 0 and is constant, we conclude that w 0.As w = u v, we see u v and the two solutions are thesame.

    We have proved uniqueness of solutions.

    HOMEWORK

    You can now try Problem 2 and 3

    13/120

  • 8/3/2019 PDEs - Slides (3)

    14/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Proof ctd.

    10

    (w)2 dx 0

    +r1

    0w2 dx 0

    = 0,

    with r 0.

    The first term implies that w(x) = 0 for x (0, 1).Hence w is constant in (0, 1).

    As w(0) = 0 and is constant, we conclude that w 0.As w = u v, we see u v and the two solutions are thesame.

    We have proved uniqueness of solutions.

    HOMEWORK

    You can now try Problem 2 and 3

    14/120

  • 8/3/2019 PDEs - Slides (3)

    15/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Proof ctd.

    10

    (w)2 dx 0

    +r1

    0w2 dx 0

    = 0,

    with r 0.

    The first term implies that w(x) = 0 for x (0, 1).Hence w is constant in (0, 1).

    As w(0) = 0 and is constant, we conclude that w 0.As w = u v, we see u v and the two solutions are thesame.

    We have proved uniqueness of solutions.

    HOMEWORK

    You can now try Problem 2 and 3

    15/120

  • 8/3/2019 PDEs - Slides (3)

    16/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Outline

    1 Uniqueness for reaction diffusion model

    2 Stability for diffusion model

    3 Finite differences

    4 Numerical analysis

    5 Finite differences for convection diffusion model

    16/120

  • 8/3/2019 PDEs - Slides (3)

    17/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Diffusion problem

    The third condition for a well posed problem is stability or

    continuous dependence on the problem data.For simplicity, we investigate stability for the diffusion problem(case r = 0 of the reaction diffusion model).

    Model diffusion problem

    u = f for 0 < x < 1

    u(0) = ; u(1) = .

    To establish stability, we show that u(x)

    depends continuously on boundary data ( and ).

    17/120

  • 8/3/2019 PDEs - Slides (3)

    18/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Diffusion problem

    The third condition for a well posed problem is stability or

    continuous dependence on the problem data.For simplicity, we investigate stability for the diffusion problem(case r = 0 of the reaction diffusion model).

    Model diffusion problem

    u = f for 0 < x < 1

    u(0) = ; u(1) = .

    To establish stability, we show that u(x)

    depends continuously on boundary data ( and ).

    18/120

  • 8/3/2019 PDEs - Slides (3)

    19/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Diffusion problem

    The third condition for a well posed problem is stability or

    continuous dependence on the problem data.For simplicity, we investigate stability for the diffusion problem(case r = 0 of the reaction diffusion model).

    Model diffusion problem

    u = f for 0 < x < 1

    u(0) = ; u(1) = .

    To establish stability, we show that u(x)

    depends continuously on boundary data ( and ).

    19/120

  • 8/3/2019 PDEs - Slides (3)

    20/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Maximum principle

    Our main tool is the maximum principle.

    Lemma (maximum principle)

    Suppose that f (x) < 0 for all x (0, 1).Ifu = f , then u(x) attains its maximum value at one of thetwo end points x = 0, 1.

    Proof.

    Suppose for a contradiction that (0, 1) is a local maximum.

    From calculus, u() 0 and u() = 0.Hence u() 0.But we assumed u = f < 0 for all x (0, 1).Proved by contradiction.

    20/120

  • 8/3/2019 PDEs - Slides (3)

    21/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Maximum principle

    Our main tool is the maximum principle.

    Lemma (maximum principle)

    Suppose that f (x) < 0 for all x (0, 1).Ifu = f , then u(x) attains its maximum value at one of thetwo end points x = 0, 1.

    Proof.

    Suppose for a contradiction that (0, 1) is a local maximum.

    From calculus, u() 0 and u() = 0.Hence u() 0.But we assumed u = f < 0 for all x (0, 1).Proved by contradiction.

    21/120

    ( )

  • 8/3/2019 PDEs - Slides (3)

    22/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Upper bound on soln u(x)

    Lemma

    Ifu(x) = 0 for all x (0, 1),then u(x) M for x [0, 1] and M = max{u(0), u(1)}.

    Proof.

    For > 0, letv(x) = u(x) + x

    2.

    Then v = u 2 = 2 < 0 for x (0, 1).

    By the maximum principle, v(x) max{v(0), v(1)} .

    Now u(x) = v(x) x2 v(x). Hence,

    u(x) v(x) max{v(0), v(1)} = max{u(0), u(1) + }.

    As this holds for any > 0, we are done

    22/120

    U b d l ( )

  • 8/3/2019 PDEs - Slides (3)

    23/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Upper bound on soln u(x)

    Lemma

    Ifu(x) = 0 for all x (0, 1),then u(x) M for x [0, 1] and M = max{u(0), u(1)}.

    Proof.

    For > 0, letv(x) = u(x) + x

    2.

    Then v = u 2 = 2 < 0 for x (0, 1).

    By the maximum principle, v(x) max{v(0), v(1)} .

    Now u(x) = v(x) x2 v(x). Hence,

    u(x) v(x) max{v(0), v(1)} = max{u(0), u(1) + }.

    As this holds for any > 0, we are done

    23/120

    U b d l ( )

  • 8/3/2019 PDEs - Slides (3)

    24/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Upper bound on soln u(x)

    Lemma

    Ifu(x) = 0 for all x (0, 1),then u(x) M for x [0, 1] and M = max{u(0), u(1)}.

    Proof.

    For > 0, letv(x) = u(x) + x

    2.

    Then v = u 2 = 2 < 0 for x (0, 1).

    By the maximum principle, v(x) max{v(0), v(1)} .

    Now u(x) = v(x) x2 v(x). Hence,

    u(x) v(x) max{v(0), v(1)} = max{u(0), u(1) + }.

    As this holds for any > 0, we are done

    24/120

    U b d l ( )

  • 8/3/2019 PDEs - Slides (3)

    25/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Upper bound on soln u(x)

    Lemma

    Ifu(x) = 0 for all x (0, 1),then u(x) M for x [0, 1] and M = max{u(0), u(1)}.

    Proof.

    For > 0, letv(x) = u(x) + x

    2.

    Then v = u 2 = 2 < 0 for x (0, 1).

    By the maximum principle, v(x) max{v(0), v(1)} .

    Now u(x) = v(x) x2 v(x). Hence,

    u(x) v(x) max{v(0), v(1)} = max{u(0), u(1) + }.

    As this holds for any > 0, we are done

    25/120

    L b d l ( )

  • 8/3/2019 PDEs - Slides (3)

    26/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Lower bound on soln u(x)

    Lemma

    Ifu(x) = 0 for all x (0, 1)then m u(x) for x [0, 1] and m = min{u(0), u(1)}.

    Proof.

    Define w(x) = u(x).Then w(x) = 0 for x (0, 1).By previous lemma,

    w(x) max{w(0), w(1)}.

    and using w = u

    u(x) max{u(0), u(1)} = min{u(0), u(1)}

    and so u(x) min{u(0), u(1)} 26/120

    L b d l ( )

  • 8/3/2019 PDEs - Slides (3)

    27/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Lower bound on soln u(x)

    Lemma

    Ifu(x) = 0 for all x (0, 1)then m u(x) for x [0, 1] and m = min{u(0), u(1)}.

    Proof.

    Define w(x) = u(x).Then w(x) = 0 for x (0, 1).By previous lemma,

    w(x) max{w(0), w(1)}.

    and using w = u

    u(x) max{u(0), u(1)} = min{u(0), u(1)}

    and so u(x) min{u(0), u(1)} 27/120

    Summary

  • 8/3/2019 PDEs - Slides (3)

    28/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Summary

    Theorem

    Let u be a smooth solution of

    u = 0 for 0 < x < 1

    u(0) = ; u(1) = ;

    For all x (0, 1),

    min{, } u(x) max{, }.

    HOMEWORK

    You can now try Problem 4

    We now use this to show stability with respect to changes inthe boundary data , .

    28/120

    Summary

  • 8/3/2019 PDEs - Slides (3)

    29/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Summary

    Theorem

    Let u be a smooth solution of

    u = 0 for 0 < x < 1

    u(0) = ; u(1) = ;

    For all x (0, 1),

    min{, } u(x) max{, }.

    HOMEWORK

    You can now try Problem 4

    We now use this to show stability with respect to changes inthe boundary data , .

    29/120

    Continuity with respect to

  • 8/3/2019 PDEs - Slides (3)

    30/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    boundary data

    Theorem

    Suppose that

    u = f for 0 < x < 1

    u(0) = ; u(1) = .

    (D)

    u = f for 0 < x < 1

    u(0) = + 0; u(1) = + 1.

    (D)

    Then

    supx(0,1)

    |u(x) u(x)| max{|0|, |1|}.

    Small changes (0, 1) to boundary data

    cause small changes to the solution u

    30/120

    Proof

  • 8/3/2019 PDEs - Slides (3)

    31/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Proof

    Let e = u u. Subtracting (D) from (D) gives

    e = 0 for 0 < x < 1

    e(0) = 0; e(1) = 1.

    As homogeneous, previous theorem implies the stability bound:

    min{0, 1} e(x) max{0, 1}

    This implies|e(x)| max{|0|, |1|}.

    HOMEWORK

    You can now try Problem 5

    31/120

    Proof

  • 8/3/2019 PDEs - Slides (3)

    32/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Proof

    Let e = u u. Subtracting (D) from (D) gives

    e = 0 for 0 < x < 1

    e(0) = 0; e(1) = 1.

    As homogeneous, previous theorem implies the stability bound:

    min{0, 1} e(x) max{0, 1}

    This implies|e(x)| max{|0|, |1|}.

    HOMEWORK

    You can now try Problem 5

    32/120

    Proof

  • 8/3/2019 PDEs - Slides (3)

    33/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Proof

    Let e = u u. Subtracting (D) from (D) gives

    e = 0 for 0 < x < 1

    e(0) = 0; e(1) = 1.

    As homogeneous, previous theorem implies the stability bound:

    min{0, 1} e(x) max{0, 1}

    This implies|e(x)| max{|0|, |1|}.

    HOMEWORK

    You can now try Problem 5

    33/120

    Outline

  • 8/3/2019 PDEs - Slides (3)

    34/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Outline

    1 Uniqueness for reaction diffusion model

    2 Stability for diffusion model

    3 Finite differences

    4 Numerical analysis

    5 Finite differences for convection diffusion model

    34/120

    Scientific computing

  • 8/3/2019 PDEs - Slides (3)

    35/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Scientific computing

    Scientific computing involves constructing numerical

    solution techniques for mathematical models and usingcomputers to analyse and solve models that arise inscience and engineering.

    Without computing, we could not find or even approximatesolutions to most mathematical models and PDEs.

    Numerical analysis is the mathematical theoryunderpinning the techniques used in computationalscience. It aims to show existing algorithms are efficientand accurate and develop better algorithms.

    We introduce one numerical solution technique for PDEs,known as finite differences.

    35/120

    Scientific computing

  • 8/3/2019 PDEs - Slides (3)

    36/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Scientific computing

    Scientific computing involves constructing numerical

    solution techniques for mathematical models and usingcomputers to analyse and solve models that arise inscience and engineering.

    Without computing, we could not find or even approximatesolutions to most mathematical models and PDEs.

    Numerical analysis is the mathematical theoryunderpinning the techniques used in computationalscience. It aims to show existing algorithms are efficientand accurate and develop better algorithms.

    We introduce one numerical solution technique for PDEs,known as finite differences.

    36/120

    Scientific computing

  • 8/3/2019 PDEs - Slides (3)

    37/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Sc e t c co put g

    Scientific computing involves constructing numerical

    solution techniques for mathematical models and usingcomputers to analyse and solve models that arise inscience and engineering.

    Without computing, we could not find or even approximatesolutions to most mathematical models and PDEs.

    Numerical analysis is the mathematical theoryunderpinning the techniques used in computationalscience. It aims to show existing algorithms are efficientand accurate and develop better algorithms.

    We introduce one numerical solution technique for PDEs,known as finite differences.

    37/120

    Scientific computing

  • 8/3/2019 PDEs - Slides (3)

    38/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    p g

    Scientific computing involves constructing numerical

    solution techniques for mathematical models and usingcomputers to analyse and solve models that arise inscience and engineering.

    Without computing, we could not find or even approximatesolutions to most mathematical models and PDEs.

    Numerical analysis is the mathematical theoryunderpinning the techniques used in computationalscience. It aims to show existing algorithms are efficientand accurate and develop better algorithms.

    We introduce one numerical solution technique for PDEs,known as finite differences.

    38/120

    Finite difference approximation

  • 8/3/2019 PDEs - Slides (3)

    39/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    pp

    The idea of the finite difference method is to approximate

    u(x) by uj at x = xj for xj on a grid

    Definition (grid)

    A uniform grid on [0, 1] is defined by

    xj = jh, j = 0, . . . , n, h = 1/n.

    0 = x0 x1 x2 x3 xn = 1

    h =1

    n

    h h

    39/120

    Approximating derivatives on aid

  • 8/3/2019 PDEs - Slides (3)

    40/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability for

    diffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    grid

    Definition (centered differencing)

    To approximate derivatives u

    (xj) at a grid point x = xj, write

    u(xj) 1

    hu(xj) ,

    where u(x) = u(x + h/2) u(x h/2).

    xj h

    2

    xj +h

    2

    u(xj h)

    u(xj)

    u(xj +h)

    40/120

    Error

  • 8/3/2019 PDEs - Slides (3)

    41/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Theorem (Taylors theorem)

    u(x + h) = u(x) + hu(x) +1

    2h2u(x) + +

    1

    n!hnu(n)()

    for some (x, x + h).

    Then

    u(x + h) u(x) = hu(x) +1

    2h2u()

    = hu

    (x) + O(h2

    ) ,

    where we use the notation O(h2) for short. It means anyquantity bounded by Kh2 for some constant K.

    HOMEWORK

    You can now try Problem 7 and 8 41/120

    Error

  • 8/3/2019 PDEs - Slides (3)

    42/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Theorem (Taylors theorem)

    u(x + h) = u(x) + hu(x) +1

    2h2u(x) + +

    1

    n!hnu(n)()

    for some (x, x + h).

    Then

    u(x + h) u(x) = hu(x) +1

    2h2u()

    = hu

    (x) + O(h2

    ) ,where we use the notation O(h2) for short. It means anyquantity bounded by Kh2 for some constant K.

    HOMEWORK

    You can now try Problem 7 and 8 42/120

    Error

  • 8/3/2019 PDEs - Slides (3)

    43/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Theorem (Taylors theorem)

    u(x + h) = u(x) + hu(x) +1

    2h2u(x) + +

    1

    n!hnu(n)()

    for some (x, x + h).

    Then

    u(x + h) u(x) = hu(x) +1

    2h2u()

    = hu

    (x) + O(h2

    ) ,where we use the notation O(h2) for short. It means anyquantity bounded by Kh2 for some constant K.

    HOMEWORK

    You can now try Problem 7 and 8 43/120

    Error

  • 8/3/2019 PDEs - Slides (3)

    44/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Theorem (Taylors theorem)

    u(x + h) = u(x) + hu(x) +1

    2h2u(x) + +

    1

    n!hnu(n)()

    for some (x, x + h).

    Then

    u(x + h) u(x) = hu(x) +1

    2h2u()

    = hu

    (x) + O(h2

    ) ,where we use the notation O(h2) for short. It means anyquantity bounded by Kh2 for some constant K.

    HOMEWORK

    You can now try Problem 7 and 8 44/120

    Lemma

  • 8/3/2019 PDEs - Slides (3)

    45/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Lemma

    The error in approximating u(xj) by u(xj)/h is

    ej = u(xj) 1h

    u(xj) = O(h2).

    Proof.

    By Taylors theorem,

    u(x + h/2) =u(x) +h

    2u(x) +

    h2

    8u(x) + O(h3)

    u(x h/2) =u(x) h

    2u(x) +

    h2

    8u(x) + O(h3)

    so u(xj)

    h=

    (u(xj + h/2) u(xj h/2))

    h

    =hu(xj) + O(h

    3)

    h= u(xj) + O(h

    2).

    45/120

    Lemma

  • 8/3/2019 PDEs - Slides (3)

    46/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Lemma

    The error in approximating u(xj) by u(xj)/h is

    ej = u(xj) 1h

    u(xj) = O(h2).

    Proof.

    By Taylors theorem,

    u(x + h/2) =u(x) +h

    2u(x) +

    h2

    8u(x) + O(h3)

    u(x h/2) =u(x) h

    2u(x) +

    h2

    8u(x) + O(h3)

    so u(xj)

    h=

    (u(xj + h/2) u(xj h/2))

    h

    =hu(xj) + O(h

    3)

    h= u(xj) + O(h

    2).

    46/120

    Lemma

  • 8/3/2019 PDEs - Slides (3)

    47/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Lemma

    The error in approximating u(xj) by u(xj)/h is

    ej = u(xj) 1h

    u(xj) = O(h2).

    Proof.

    By Taylors theorem,

    u(x + h/2) =u(x) +h

    2u(x) +

    h2

    8u(x) + O(h3)

    u(x h/2) =u(x) h

    2u(x) +

    h2

    8u(x) + O(h3)

    so u(xj)

    h=

    (u(xj + h/2) u(xj h/2))

    h

    =hu(xj) + O(h

    3)

    h= u(xj) + O(h

    2).

    47/120

    Approximate u(xj)

  • 8/3/2019 PDEs - Slides (3)

    48/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Definition (second centered difference)

    To approximate the second derivative, write

    1

    h22u(xj) u

    (xj)

    where

    2u(xj) =[u(xj)]

    =u(xj +h

    2) u(xj

    h

    2)

    = u(xj + h) u(xj) (u(xj) u(xj h))

    = u(xj + h) 2u(xj) + u(xj h) .

    48/120

    Approximate u(xj)

  • 8/3/2019 PDEs - Slides (3)

    49/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    Definition (second centered difference)

    To approximate the second derivative, write

    1

    h22u(xj) u

    (xj)

    where

    2u(xj) =[u(xj)]

    =u(xj +h

    2) u(xj

    h

    2)

    = u(xj + h) u(xj) (u(xj) u(xj h))

    = u(xj + h) 2u(xj) + u(xj h) .

    49/120

    Finite differences for modelreaction diffusion PDE

  • 8/3/2019 PDEs - Slides (3)

    50/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    reaction diffusion PDE

    Consider the reaction diffusion equation

    u + ru = f, u(0) = u(1) = 0.

    At the grid points xj = jh where h = 1/n, the PDE is

    u(xj) + ru(xj) = f(xj) j = 1, 2, . . . , n 1.

    Let fj = f(xj) and make approximations

    u(xj) uj , u(xj)

    2uj/h2.

    Finite difference approximationuj is soln of

    1

    h22uj + ruj = fj j = 1, 2, . . . , n 1.

    with boundary conditions u0 = un = 050/120

    Finite differences for modelreaction diffusion PDE

  • 8/3/2019 PDEs - Slides (3)

    51/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    reaction diffusion PDE

    Consider the reaction diffusion equation

    u + ru = f, u(0) = u(1) = 0.

    At the grid points xj = jh where h = 1/n, the PDE is

    u(xj) + ru(xj) = f(xj) j = 1, 2, . . . , n 1.

    Let fj = f(xj) and make approximations

    u(xj) uj , u(xj)

    2uj/h2.

    Finite difference approximation uj

    is soln of

    1

    h22uj + ruj = fj j = 1, 2, . . . , n 1.

    with boundary conditions u0 = un = 051/120

    Finite differences for modelreaction diffusion PDE

  • 8/3/2019 PDEs - Slides (3)

    52/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finite

    differences forconvectiondiffusionmodel

    reaction diffusion PD

    Consider the reaction diffusion equation

    u + ru = f, u(0) = u(1) = 0.

    At the grid points xj = jh where h = 1/n, the PDE is

    u(xj) + ru(xj) = f(xj) j = 1, 2, . . . , n 1.

    Let fj = f(xj) and make approximations

    u(xj) uj , u(xj)

    2uj/h2.

    Finite difference approximation uj

    is soln of

    1

    h22uj + ruj = fj j = 1, 2, . . . , n 1.

    with boundary conditions u0 = un = 052/120

    Finite differences for modelreaction diffusion problem

  • 8/3/2019 PDEs - Slides (3)

    53/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    p

    Definition (finite difference method)

    The finite difference method is to find uj u(xj) such that

    1

    h22uj + ruj = fj j = 1, 2, . . . , n 1, ()

    and u0 = un = 0.

    As2uj = uj1 2uj + uj+1,

    the finite difference method is

    1

    h2(uj1 2uj + uj+1) + r uj = fj j = 1, 2, . . . , n 1.

    53/120

    Finite differences for modelreaction diffusion problem

  • 8/3/2019 PDEs - Slides (3)

    54/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Definition (finite difference method)

    The finite difference method is to find uj u(xj) such that

    1

    h22uj + ruj = fj j = 1, 2, . . . , n 1, ()

    and u0 = un = 0.

    As2uj = uj1 2uj + uj+1,

    the finite difference method is

    1

    h2(uj1 2uj + uj+1) + r uj = fj j = 1, 2, . . . , n 1.

    54/120

    Linear system of eqns

  • 8/3/2019 PDEs - Slides (3)

    55/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    1h2

    (uj1 2uj + uj+1) + ruj = fj j = 1, 2, . . . , n 1.

    and rearranging

    1

    h

    2uj1 + (

    2

    h

    2+ r)uj

    1

    h

    2uj+1 = fj.

    The BCs u(0) = u(1) = 0 give u0 = 0 and un = 0 . Writeas a system of linear equations:

    ( 2h2

    + r) 1h2

    0

    . . . . . . 1

    h2( 2h2

    + r) 1h2

    . . .. . .

    0 1h2

    ( 2h2

    + r)

    u1...

    uj...

    un1

    =

    f1...fj...

    fn1

    55/120

    Example (r = 0, f(x) = 1)

  • 8/3/2019 PDEs - Slides (3)

    56/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Take n = 6, i.e. h = 1/6. The system is

    72 36 0 0 036 72 36 0 0

    0 36 72 36 00 0 36 72 36

    0 0 0 36 72

    u1u2u3u4

    u5

    =

    1111

    1

    Solve the system of equations (e.g., with MATLAB):

    u1 = u5 = 5/72;

    u2 = u4 = 1/9 = 8/72;u3 = 1/8 = 9/72.

    Note that uj = u(xj) =12 (xj x

    2j ). That is, the finite

    difference solution is exact in this example.

    56/120

    Example (r = 0, f(x) = 1)

  • 8/3/2019 PDEs - Slides (3)

    57/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    Take n = 6, i.e. h = 1/6. The system is

    72 36 0 0 036 72 36 0 0

    0 36 72 36 00 0 36 72 36

    0 0 0 36 72

    u1u2u3u4

    u5

    =

    1111

    1

    Solve the system of equations (e.g., with MATLAB):

    u1 = u5 = 5/72;

    u2 = u4 = 1/9 = 8/72;u3 = 1/8 = 9/72.

    Note that uj = u(xj) =12 (xj x

    2j ). That is, the finite

    difference solution is exact in this example.

    57/120

    Example

  • 8/3/2019 PDEs - Slides (3)

    58/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    u

    + 16u

    = 1for

    0 0 if the local error satisfies

    |Tj| = O(hk) j = 1, 2, . . . , n 1.

    Theorem (2nd order consistent)

    The method is 2nd order consistent if the local truncation errorsatisfies

    |Tj| = O(h2), j = 1, 2, . . . , n 1.

    67/120

  • 8/3/2019 PDEs - Slides (3)

    68/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Definition (kth order consistent)

    A finite difference scheme is said to be kth order consistent fork > 0 if the local error satisfies

    |Tj| = O(hk) j = 1, 2, . . . , n 1.

    Theorem (2nd order consistent)

    The method is 2nd order consistent if the local truncation errorsatisfies

    |Tj| = O(h2), j = 1, 2, . . . , n 1.

    68/120

    Proof.

  • 8/3/2019 PDEs - Slides (3)

    69/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    By Taylors theorem,

    u(x h) =u(x) hu(x) + h22

    u(x) h36

    u(x) + O(h4)

    u(x + h) =u(x) + hu(x) +h2

    2u(x) +

    h3

    6u(x) + O(h4).

    andTj = u

    (xj) 1

    h2(u(xj h) 2u(xj) + u(xj + h)).

    We can add the expansions for u(x h) and u(x + h), to find

    u(xj h) + u(xj + h) = 2u(xj) + h2u(xj) + O(h

    4).

    Rearranging givesTj = O(h

    2).

    69/120

    Global error

  • 8/3/2019 PDEs - Slides (3)

    70/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    HOMEWORK

    You can now try Problem 9 and 10

    We relate the global error ej at the grid point xj to the localtruncation error Tj

    Tj =

    1

    h2 2

    u(xj) + ru(xj) fj j = 1, 2, . . . , n 1,

    0 = 1

    h22uj + ruj fj j = 1, 2, . . . , n 1.

    Subtracting these equations and letting ej = u(xj) uj gives

    Tj = 1

    h22ej + rej j = 1, 2, . . . , n 1.

    We have a linear system of eqns for ej.70/120

    Global error

  • 8/3/2019 PDEs - Slides (3)

    71/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    HOMEWORK

    You can now try Problem 9 and 10

    We relate the global error ej at the grid point xj to the localtruncation error Tj

    Tj =

    1

    h2 2

    u(xj) + ru(xj) fj j = 1, 2, . . . , n 1,

    0 = 1

    h22uj + ruj fj j = 1, 2, . . . , n 1.

    Subtracting these equations and letting ej = u(xj) uj gives

    Tj = 1

    h22ej + rej j = 1, 2, . . . , n 1.

    We have a linear system of eqns for ej.

    71/120

    Global error

  • 8/3/2019 PDEs - Slides (3)

    72/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    HOMEWORK

    You can now try Problem 9 and 10

    We relate the global error ej at the grid point xj to the localtruncation error Tj

    Tj =

    1

    h2 2

    u(xj) + ru(xj) fj j = 1, 2, . . . , n 1,

    0 = 1

    h22uj + ruj fj j = 1, 2, . . . , n 1.

    Subtracting these equations and letting ej = u(xj) uj gives

    Tj = 1

    h22ej + rej j = 1, 2, . . . , n 1.

    We have a linear system of eqns for ej.

    72/120

    Global error

  • 8/3/2019 PDEs - Slides (3)

    73/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    HOMEWORK

    You can now try Problem 9 and 10We relate the global error ej at the grid point xj to the localtruncation error Tj

    Tj =

    1

    h2 2

    u(xj) + ru(xj) fj j = 1, 2, . . . , n 1,

    0 = 1

    h22uj + ruj fj j = 1, 2, . . . , n 1.

    Subtracting these equations and letting ej = u(xj) uj gives

    Tj = 1

    h22ej + rej j = 1, 2, . . . , n 1.

    We have a linear system of eqns for ej.

    73/120

    Stability theorem for finitedifferences

    Theorem (Stability theorem)

  • 8/3/2019 PDEs - Slides (3)

    74/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Theorem (Stability theorem)

    Suppose that {uj}nj=0 satisfy the tridiagonal system of

    equations

    auj1 + buj cuj+1 0 j = 1, 2, . . . , n 1.

    Let a, b, c denote real coefficients with

    a 0c 0

    b a + c > 0

    (S)

    then

    uj max{0, u0, un} for all j = 0, 1, 2, . . . , n.

    74/120

    Proof.

    Suppose for a contradiction there exists u 0 for

  • 8/3/2019 PDEs - Slides (3)

    75/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Suppose for a contradiction, there exists uk 0 fork = 1, . . . , n 1 such that

    uk =max{u0, u1, u2, . . . , un}

    min{uk1, uk+1} 0, this is a contradiction.

    75/120

    Proof.

    Suppose for a contradiction there exists uk 0 for

  • 8/3/2019 PDEs - Slides (3)

    76/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Suppose for a contradiction, there exists uk 0 fork = 1, . . . , n 1 such that

    uk =max{u0, u1, u2, . . . , un}

    min{uk1, uk+1} 0, this is a contradiction.

    76/120

    Proof ctd.

    W l d h i h

  • 8/3/2019 PDEs - Slides (3)

    77/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    We conclude that either

    1

    there is a maximum, which is negative (uk 0) or2 there is a maximum at the boundary uk max{u0, un}.

    .

    HOMEWORK

    You can now try Problem 11

    77/120

    Proof ctd.

    W l d th t ith

  • 8/3/2019 PDEs - Slides (3)

    78/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    We conclude that either

    1

    there is a maximum, which is negative (uk 0) or2 there is a maximum at the boundary uk max{u0, un}.

    .

    HOMEWORK

    You can now try Problem 11

    78/120

    Stability+consisitency convergence

    1 F PDE th i i i l ti

  • 8/3/2019 PDEs - Slides (3)

    79/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    1 For PDE, the maximum principle gave us continuousdependence on data and hence well posedness.

    2 For numerical method, the discrete maximum principlegives us continuous dependence of global error ontruncation error.

    3 This type of result for numerical methods is usually

    referred to as stability and

    Stability+consistency convergence

    Recall, consistency means local truncation error Tj is

    O(hk), some k > 1.convergence means global error u(xj) uj is small.

    4 No proofs given, but Theorem given next.

    79/120

    Stability+consisitency convergence

    1 For PDE the maximum principle gave us continuous

  • 8/3/2019 PDEs - Slides (3)

    80/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    1 For PDE, the maximum principle gave us continuousdependence on data and hence well posedness.

    2 For numerical method, the discrete maximum principlegives us continuous dependence of global error ontruncation error.

    3 This type of result for numerical methods is usually

    referred to as stability and

    Stability+consistency convergence

    Recall, consistency means local truncation error Tj is

    O(hk), some k > 1.convergence means global error u(xj) uj is small.

    4 No proofs given, but Theorem given next.

    80/120

    Stability+consisitency convergence

    1 For PDE the maximum principle gave us continuous

  • 8/3/2019 PDEs - Slides (3)

    81/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    1 For PDE, the maximum principle gave us continuousdependence on data and hence well posedness.

    2 For numerical method, the discrete maximum principlegives us continuous dependence of global error ontruncation error.

    3 This type of result for numerical methods is usually

    referred to as stability and

    Stability+consistency convergence

    Recall, consistency means local truncation error Tj is

    O(hk), some k > 1.convergence means global error u(xj) uj is small.

    4 No proofs given, but Theorem given next.

    81/120

    P III

    Stability+consisitency convergence

    1 For PDE the maximum principle gave us continuous

  • 8/3/2019 PDEs - Slides (3)

    82/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    1 For PDE, the maximum principle gave us continuousdependence on data and hence well posedness.

    2 For numerical method, the discrete maximum principlegives us continuous dependence of global error ontruncation error.

    3 This type of result for numerical methods is usually

    referred to as stability and

    Stability+consistency convergence

    Recall, consistency means local truncation error Tj is

    O(hk), some k > 1.convergence means global error u(xj) uj is small.

    4 No proofs given, but Theorem given next.

    82/120

    P t III

    Theorem (Stability+constistency=convergence)

  • 8/3/2019 PDEs - Slides (3)

    83/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusion

    model

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    (S y+ y g )

    Suppose that

    consistent: the finite difference method is kth order consistent.

    stable the method has the form

    auj1 + buj cuj+1 = fj

    with a, c 0 and b a + c > 0.Then, the numerical approximation converges to the exact

    solution,

    ej = |uj u(xj)| = O(hk) as h 0.

    83/120

    Part III

    Stability of finite differenceapprox

    Recall the finite difference approximation

  • 8/3/2019 PDEs - Slides (3)

    84/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Recall the finite difference approximation

    1h2

    uj1 + ( 2h2

    + r)uj 1h2

    uj+1 = fj j = 1, 2, . . . , n 1,

    To show that the approximation is stable,we apply the Stability Theorem and look at condition (S).

    a 0 1h2

    0

    c 0 1

    h2 0

    b a + c 2

    h2+ r

    2

    h2

    The centred approximation method is stable as r 0.

    84/120

    Part III

    Stability of finite differenceapprox

    Recall the finite difference approximation

  • 8/3/2019 PDEs - Slides (3)

    85/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Recall the finite difference approximation

    1h2

    uj1 + ( 2h2

    + r)uj 1h2

    uj+1 = fj j = 1, 2, . . . , n 1,

    To show that the approximation is stable,we apply the Stability Theorem and look at condition (S).

    a 0 1h2

    0

    c 0 1

    h2 0

    b a + c 2

    h2+ r

    2

    h2

    The centred approximation method is stable as r 0.

    85/120

    Part III

    Stability of finite differenceapprox

    Recall the finite difference approximation

  • 8/3/2019 PDEs - Slides (3)

    86/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    Recall the finite difference approximation

    1h2

    uj1 + ( 2h2

    + r)uj 1h2

    uj+1 = fj j = 1, 2, . . . , n 1,

    To show that the approximation is stable,we apply the Stability Theorem and look at condition (S).

    a 0 1h2

    0

    c 0 1

    h2 0

    b a + c 2

    h2+ r

    2

    h2

    The centred approximation method is stable as r 0.

    86/120

    Part III

    Stability of finite differenceapprox

    Recall the finite difference approximation

  • 8/3/2019 PDEs - Slides (3)

    87/120

    Part III

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    pp

    1h2

    uj1 + ( 2h2

    + r)uj 1h2

    uj+1 = fj j = 1, 2, . . . , n 1,

    To show that the approximation is stable,we apply the Stability Theorem and look at condition (S).

    a 0 1h2

    0

    c 0 1

    h2 0

    b a + c 2

    h2+ r

    2

    h2

    The centred approximation method is stable as r 0.

    87/120

    Part III

    1 Proof of theorem not given See written notes

  • 8/3/2019 PDEs - Slides (3)

    88/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    1 Proof of theorem not given. See written notes.

    2 It is similar to the proof of stability for the diffusionproblem.

    3 We conclude that the global error for the centereddifference approximation of the diffusion problem satisfies

    global error = |uj u(xj)| = O(h2).

    88/120

    Part III

    Outline

    1 Uniqueness for reaction diffusion model

  • 8/3/2019 PDEs - Slides (3)

    89/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    2 Stability for diffusion model

    3 Finite differences

    4 Numerical analysis

    5 Finite differences for convection diffusion model

    89/120

    Part III

    Convection diffusion problem

    The problem

  • 8/3/2019 PDEs - Slides (3)

    90/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    u + ru = f

    is known as a reaction diffusion equation, as the term u

    models diffusion and the term u models reaction.We now look at a convection diffusion equation, replacing uwith u.

    Convection-diffusionu + wu = f for 0 < x < 1

    u(0) = ; u(1) =

    for some f : (0, 1) R

    , a scalar w R

    , and boundary values, R.The scalar w is known as the wind.

    It controls the strength and direction of the convection.

    90/120

    Part III

    Problem 1.3

    u + wu = 0 for 0 < x < 1 (1.3)

    (0) 1 (1) 0

  • 8/3/2019 PDEs - Slides (3)

    91/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    u(0) = 1; u(1) = 0.

    The solution is

    u(x) =exp(w) exp(wx)

    exp(w) 1

    0 0.50

    1

    x

    temperature

    Problem 1.3

    w=0

    w=5

    w=20

    0 0.5 10

    1/8

    Problem 1.4

    w=20

    w=5

    w=0

    91/120

    Part III

    Problem

    u + wu = 1 for 0 < x < 1 (1.4)

    (0) 0 (1) 0

  • 8/3/2019 PDEs - Slides (3)

    92/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    u(0) = 0; u(1) = 0.

    The solution is

    u(x) =x

    w

    1 exp(wx)

    w(exp(w) 1)

    0 0.50

    1

    x

    temperature

    Problem 1.3

    w=0

    w=5

    w=20

    0 0.5 10

    1/8

    Problem 1.4

    w=20

    w=5

    w=0

    92/120

    Part III

    Centered finite differences

    There are two derivatives to approximate.

  • 8/3/2019 PDEs - Slides (3)

    93/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    u(xj)

    u(xj) 2u(xj)

    h2=

    u(xj + h) 2u(xj) + u(xj h)

    h2.

    u

    (xj)

    We cannot use u(xj) = u(xj + h/2) u(xj h/2) as we canonly take values on the grid.We use the averaged centered difference:

    u(xj) u(xj)

    h= 1

    2h

    u(xj + h

    2) + u(xj h

    2)

    =1

    2h(u(xj + h) u(xj h)) .

    93/120

    Part III

    Numerical approximation

    The exact solution at the grid points u(xj) satisfies

  • 8/3/2019 PDEs - Slides (3)

    94/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    u(xj) + wu(xj) = fj j = 1, 2, . . . , n 1.

    Replace derivatives by centered finite differences

    Centered finite difference method

    Find uj such that

    1

    h22uj +

    w

    huj = fj j = 1, 2, . . . , n 1.

    That is,

    1

    h2(uj+1 2uj + uj1) +

    w

    2h(uj+1 uj1) = fj.

    94/120

    Part III

    Linear system of equations

    For j = 1, . . . , n 1,

  • 8/3/2019 PDEs - Slides (3)

    95/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences for

    convectiondiffusionmodel

    1

    h2 (uj+1 2uj + uj1) +w

    2h (uj+1 uj1) = fj

    1

    h2

    w

    2h

    a

    uj1 +

    2

    h2

    b

    uj +

    1

    h2+

    w

    2h

    c

    uj+1 = fj

    To take care of the boundary conditions The BC u(0) = gives u0 = and

    a + bu1 cu2 = f0 bu1 cu2 = f0 + a.

    The BC u(1) = gives un = and

    aun2 + bun1 = fn1 + c.

    95/120

    Part III

    Linear system of equations

    For j = 1, . . . , n 1,

  • 8/3/2019 PDEs - Slides (3)

    96/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    1

    h2 (uj+1 2uj + uj1) +w

    2h (uj+1 uj1) = fj

    1

    h2

    w

    2h

    a

    uj1 +

    2

    h2

    b

    uj +

    1

    h2+

    w

    2h

    c

    uj+1 = fj

    To take care of the boundary conditions The BC u(0) = gives u0 = and

    a + bu1 cu2 = f0 bu1 cu2 = f0 + a.

    The BC u(1) = gives un = and

    aun2 + bun1 = fn1 + c.

    96/120

    Part III

    Linear system of equations

    For j = 1, . . . , n 1,

  • 8/3/2019 PDEs - Slides (3)

    97/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    1

    h2 (uj+1 2uj + uj1) +w

    2h (uj+1 uj1) = fj

    1

    h2

    w

    2h

    a

    uj1 +

    2

    h2

    b

    uj +

    1

    h2+

    w

    2h

    c

    uj+1 = fj

    To take care of the boundary conditions The BC u(0) = gives u0 = and

    a + bu1 cu2 = f0 bu1 cu2 = f0 + a.

    The BC u(1) = gives un = and

    aun2 + bun1 = fn1 + c.

    97/120

    Part III

    Linear system of equations

    Collect all the equations as a linear system.

  • 8/3/2019 PDEs - Slides (3)

    98/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    b c 0. . .

    . . .

    a b c. . .

    . . .

    0 a b

    u1...

    uj...

    un1

    =

    f1 + a...fj...

    fn1 + c

    .

    Top row comes from left hand boundary condition and thebottom rows comes from the right boundary condition.

    Also note the boundary condition affects the right hand sidevector in top/bottom entry.

    In contrast to reaction diffusion equation,the matrix is non-symmetric as a = c.

    98/120

    Part III

    Numerical analysis

    HOMEWORK

    Y t P bl 12

  • 8/3/2019 PDEs - Slides (3)

    99/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    You can now try Problem 12

    1 Is the approximation consistent? If u is smooth,

    |Tj| Ch2, j = 1, 2, . . . , n 1.

    In other words, Tj = O(h2).

    Proof by Taylors theorem.

    2 Is the approximation stable?

    99/120

    Part III

    Numerical analysis

    HOMEWORK

    Y t P bl 12

  • 8/3/2019 PDEs - Slides (3)

    100/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    You can now try Problem 12

    1 Is the approximation consistent? If u is smooth,

    |Tj| Ch2, j = 1, 2, . . . , n 1.

    In other words, Tj = O(h2).

    Proof by Taylors theorem.

    2 Is the approximation stable?

    100/120

    Part III

    Numerical analysis

    HOMEWORK

    You can now try Problem 12

  • 8/3/2019 PDEs - Slides (3)

    101/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    You can now try Problem 12

    1 Is the approximation consistent? If u is smooth,

    |Tj| Ch2, j = 1, 2, . . . , n 1.

    In other words, Tj = O(h2).

    Proof by Taylors theorem.

    2 Is the approximation stable?

    101/120

    Part III

    Apply stability theorem

    Recall the tridiagonal matrix entries ..

  • 8/3/2019 PDEs - Slides (3)

    102/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    1h2 w2h a

    uj1 + 2h2 b

    uj + 1h2 + w2h c

    uj+1 = fj

    To show that the approximation is stable we simply need tocheck that the tridiagonal coefficients satisfy (S).

    a 0 1

    h2+

    w

    2h 0 (?)

    c 0

    1

    h2

    w

    2h 0

    b a + c 2

    h2

    2

    h2()

    102/120

    Part III

    Apply stability theorem

    Recall the tridiagonal matrix entries ..

    1 2 1

  • 8/3/2019 PDEs - Slides (3)

    103/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    1h2 w2h a

    uj1 + 2h2 b

    uj + 1h2 + w2h c

    uj+1 = fj

    To show that the approximation is stable we simply need tocheck that the tridiagonal coefficients satisfy (S).

    a 0 1

    h2+

    w

    2h 0 (?)

    c 0

    1

    h2

    w

    2h 0

    b a + c 2

    h2

    2

    h2()

    103/120

    Part III

    20401

    Apply stability theorem

    Recall the tridiagonal matrix entries ..

    1 2 1

  • 8/3/2019 PDEs - Slides (3)

    104/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvectiondiffusionmodel

    1h2 w2h a

    uj1 + 2h2 b

    uj + 1h2 + w2h c

    uj+1 = fj

    To show that the approximation is stable we simply need tocheck that the tridiagonal coefficients satisfy (S).

    a 0 1

    h2+

    w

    2h 0 (?)

    c 0

    1

    h2

    w

    2h 0

    b a + c 2

    h2

    2

    h2()

    104/120

    Part III

    20401

    Apply stability theorem

    Recall the tridiagonal matrix entries ..

    1 2 1

  • 8/3/2019 PDEs - Slides (3)

    105/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    1h2 w2h a

    uj1 + 2h2 b

    uj + 1h2 + w2h c

    uj+1 = fj

    To show that the approximation is stable we simply need tocheck that the tridiagonal coefficients satisfy (S).

    a 0 1

    h2+

    w

    2h 0 (?)

    c 0

    1

    h2

    w

    2h 0

    b a + c 2

    h2

    2

    h2()

    105/120

    Part III

    20401

    Apply stability theorem

    Recall the tridiagonal matrix entries ..

    1 2 1

  • 8/3/2019 PDEs - Slides (3)

    106/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    1h2 w2h a

    uj1 + 2h2 b

    uj + 1h2 + w2h c

    uj+1 = fj

    To show that the approximation is stable we simply need tocheck that the tridiagonal coefficients satisfy (S).

    a 0 1

    h2+

    w

    2h 0 (?)

    c 0

    1

    h2

    w

    2h 0

    b a + c 2

    h2

    2

    h2()

    106/120

    Part III

    20401

    Apply stability theorem

    Recall the tridiagonal matrix entries ..

    1 w 2 1 w

  • 8/3/2019 PDEs - Slides (3)

    107/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    1h2 w2h a

    uj1 + 2h2 b

    uj + 1h2 + w2h c

    uj+1 = fj

    To show that the approximation is stable we simply need tocheck that the tridiagonal coefficients satisfy (S).

    a 0 1

    h2+

    w

    2h 0 (?)

    c 0

    1

    h2

    w

    2h 0

    b a + c 2

    h2

    2

    h2()

    107/120

    Part III

    20401

    Condition for stability

    Assume that w > 0 then

    1 w

  • 8/3/2019 PDEs - Slides (3)

    108/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    a 0 1

    h2 +w

    2h 0 ()

    c 0 1

    h2

    w

    2h 0 (?)

    The centred approximation method is stable when

    1

    h2

    w

    2h 0

    w h

    2 1 h

    2

    w.

    108/120

    Part III

    20401

    Stability

    Assume that w < 0 then

    1 w

  • 8/3/2019 PDEs - Slides (3)

    109/120

    20401

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    a 0

    1

    h2 +

    w

    2h 0 (?)

    c 0 1

    h2

    w

    2h 0 ()

    Thus, the centred approximation method is stable whenever

    1

    h2+

    w

    2h 0

    wh

    2 1 h

    2

    w.

    We deduce that a sufficient condition for stability is that

    |w|h2 1.

    The ratio |w|h2 is called the mesh Peclet number.

    Computationally, if wh2 > 1 the centred difference solution109/120

    Part III

    20401

    Stability

    Assume that w < 0 then

    1 w

  • 8/3/2019 PDEs - Slides (3)

    110/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    a 0

    1

    h2 +

    w

    2h 0 (?)

    c 0 1

    h2

    w

    2h 0 ()

    Thus, the centred approximation method is stable whenever

    1

    h2+

    w

    2h 0

    wh

    2 1 h

    2

    w.

    We deduce that a sufficient condition for stability is that

    |w|h2 1.

    The ratio |w|h2 is called the mesh Peclet number.

    Computationally, if wh2 > 1 the centred difference solutionh 110/120

    Part III

    20401

    Stability

    Assume that w < 0 then

    1 w

  • 8/3/2019 PDEs - Slides (3)

    111/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    a 0

    1

    h2 +

    w

    2h 0 (?)

    c 0 1

    h2

    w

    2h 0 ()

    Thus, the centred approximation method is stable whenever

    1

    h2+

    w

    2h 0

    wh

    2 1 h

    2

    w.

    We deduce that a sufficient condition for stability is that

    |w|h2 1.

    The ratio |w|h2 is called the mesh Peclet number.

    Computationally, if wh2 > 1 the centred difference solutionh 111/120

    Part III

    20401

    Solution of convection diffusionmodel with w = 100;

    Central differencing h = 1/n with n = 20

  • 8/3/2019 PDEs - Slides (3)

    112/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

    2

    4

    6

    8

    10

    12

    14

    16

    x

    u

    Note the oscillation: the exact solution has no oscillation

    112/120

    Part III

    20401

    Alternative method: upwindfinite difference

    Solution of convection with w = 100; h = 1/n with n = 20

    12

  • 8/3/2019 PDEs - Slides (3)

    113/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

    2

    4

    6

    8

    10

    x

    u

    There is no oscillation.The truncation error for this upwind finite differecing is O(h)

    (first order) compared to the second order central differencingmethod.Even though truncation error bigger, the solution is better.

    113/120

    Part III

    20401

    Alternative method: Upwindfinite difference method

    One sided finite difference approximation:

    u(xj +h)

  • 8/3/2019 PDEs - Slides (3)

    114/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    xj h xj xj +h

    u(xj h)

    u(xj)

    u(xj) +u(xj)

    1

    hu(xj) u

    (xj),1

    h+u(xj) u

    (xj),

    where

    u(xj) =u(xj) u(xj h)

    +u(xj) =u(xj + h) u(xj).

    114/120

    Part III

    20401

    Upwind method

    1 For u, use the centered difference: u(xj) 1h2

    2u(xj)

    2

  • 8/3/2019 PDEs - Slides (3)

    115/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    2

    u(xj) =[u(xj)]=u(xj + h) 2u(xj) + u(xj h)

    2 For u, if w > 0, approximate u(xj) 1

    h

    u(xj)

    whereu(xj) = u(xj) u(xj h).

    or, if w < 0, approximate u(xj) 1h

    +u(xj) where

    +u(xj) = u(xj + h) u(xj).

    Called the upwind difference approximation to u(x).

    115/120

    Part III

    20401

    Upwind method

    1 For u, use the centered difference: u(xj) 1h2

    2u(xj)

    2

  • 8/3/2019 PDEs - Slides (3)

    116/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    2

    u(xj) =[u(xj)]=u(xj + h) 2u(xj) + u(xj h)

    2 For u, if w > 0, approximate u(xj) 1

    h

    u(xj)

    whereu(xj) = u(xj) u(xj h).

    or, if w < 0, approximate u(xj) 1h

    +u(xj) where

    +u(xj) = u(xj + h) u(xj).

    Called the upwind difference approximation to u(x).

    116/120

    Part III

    20401

    Upwind method

    1 For u, use the centered difference: u(xj) 1h2

    2u(xj)

    2

  • 8/3/2019 PDEs - Slides (3)

    117/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    2

    u(xj) =[u(xj)]=u(xj + h) 2u(xj) + u(xj h)

    2 For u, if w > 0, approximate u(xj) 1

    h

    u(xj)

    whereu(xj) = u(xj) u(xj h).

    or, if w < 0, approximate u(xj) 1h

    +u(xj) where

    +u(xj) = u(xj + h) u(xj).

    Called the upwind difference approximation to u(x).

    117/120

    Part III

    20401

    Linear system of eqns

    When w > 0 we obtain

    1

    (u 2u + u ) +w

    (u u ) = f

  • 8/3/2019 PDEs - Slides (3)

    118/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    h2(

    j+1 j+

    j1) +

    h(

    j j1)

    j

    1

    h2

    w

    h

    auj1 +

    2

    h2+

    w

    h

    buj +

    1

    h2

    cuj+1 = fj

    Apply BCs u(0) = and u(1) = , this the following linearsystem

    b c 0. . .

    . . .

    a b c. . .

    . . .

    0 a b

    u1...

    uj...

    un1

    =

    f1 + a...fj...

    fn1 + c

    .

    118/120

    Part III

    20401

    Consistency and Stability forupwind

    HOMEWORK

    You can now try Problem 13

  • 8/3/2019 PDEs - Slides (3)

    119/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    1 You show upwind method is 1st order consistentTaylorexpansions.

    2 And the method is stable independent of h.

    We knowconsistent + stable convergent

    Hence the global erroror the error in approximating true solution u(x) is

    |u(xj) uj| = O(h).

    119/120

    Part III

    20401

    Consistency and Stability forupwind

    HOMEWORK

    You can now try Problem 13

  • 8/3/2019 PDEs - Slides (3)

    120/120

    Uniquenessfor reactiondiffusionmodel

    Stability fordiffusionmodel

    Finitedifferences

    Numericalanalysis

    Finitedifferences forconvection

    diffusionmodel

    1 You show upwind method is 1st order consistentTaylorexpansions.

    2 And the method is stable independent of h.

    We knowconsistent + stable convergent

    Hence the global erroror the error in approximating true solution u(x) is

    |u(xj) uj| = O(h).

    120/120


Recommended