COMPUTER ORIENTED NEUMARICAL METHODS

download COMPUTER ORIENTED NEUMARICAL METHODS

of 8

Transcript of COMPUTER ORIENTED NEUMARICAL METHODS

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    1/19

    CHAPTER 5

    Ordinary Differential Equations

    function , its derivatives, and the variable upon which they depend. The most generalform of an ordinary differential equation is given by

    (6.1)

    Where m represents the highest order derivative, and y and its derivatives are functions

    0),.....,,,( )(1 =mn y y y yt φ

    of t. The order of the differential equation is the order of its highest derivative and its

    degree is the degree of the derivative of the highest order after the equation has been

    rationalized in derivatives. If no roduct of the de endent ariable t with itself or

    any one of its derivatives occur, then the equation is said to be linear, otherwise it is

    nonlinear. A linear differential equation of order m can be expressed in the form

    (6.2))()()( )(0

    t r t yt pm

    p p =∑= φ

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    2/19

    t . .

    of order m can be written as (6.3)

    Then the equation (6.3) is called a canonical representation of the differential equation

    ),.....,,,( )1(1)( −= mnm y y y yt F y

    (6.1). In a such form ,the highest order derivative is expressed in terms of the lower

    order derivatives and he independent variable.

    A general solution of an ordinary differential equation such as(6.1) is a relation between y,

    t and m arbitrary constants , which satisfies the equation, but which contains no

    derivatives. The solution may be an implicit relation of the form

    (6.4)0),...,,,( 21 =mccc yt wr an exp c t unct on o t o t e orm .

    The m arbitrary constants can be determined by prescribing m conditions of

    the form 6.6

    .,...,, 21 mcccw y =

    mccc ,..., 21

    1,.....,2,1,0,)( −== mvt v

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    3/19

    At on point t = , which are called initial conditions. The point is called the initial

    point. The differential equation (6.1) together with the initial conditions (6.6) is called an

    0t 0t

    m th order initial value problem.

    If the m conditions are prescribed at more than one point to determine the m arbitrary

    .

    the boundary value problem .

    3

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    4/19

    EULER METHOD:

    we write as (6.58)

    where This is called the Euler method. Applying the method at the mesh

    1,......,2,1,0,1 −=+=+ N jhf uu j j j).,( j j j ut f f =

    , jt ),(1 j j j j ut f huu =−+

    points j=0,1,2,….,N-1 , we obtain the numerical solution of (6.8) as

    001 += hf uu

    11

    112

    ....................

    −− +=

    +=

    N N N hf uu

    hf uu

    Choosing a suitable value of h and the initial condition, is obtained from the first

    equation , is obtained from the second equation and so on. The method (6.58) is called

    1u

    2u

    an explicit method , since using and we can calculate directly. The

    Euler method is the simplest method to solve (6.8).

    hu j , j f 1+ ju

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    5/19

    The truncation error in the method is given by)( 111 ut uT j j j −= +++

    )(2

    )],()([)( ''2

    1 ξ uh

    ut hf t ut u j j j j =+−= +

    Where If we denote.1+

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    6/19

    The local truncation error is of O ( h .

    Example 6.9:

    )2h 0→

    Use the Euler method to solve numerically the initial value problem.

    With h=0.2,0.1 and 0.05 on the interval [0.1].Neglecting the round off errors, determine the bound for

    1)0(,2 2' =−= utuu

    the error. Applying Richardson’s extrapolation to improve the counted value u(1.0 .We have

    With h=0.2 . The initial condition gives4,3,2,1,0;2

    21 =−=+ juht uu j j j j

    .10 =uFor j=0:U(0.2)

    For j=1:

    1,0 00 == ut .0.12 20001 =−=≈ uht uu

    1,2.0 11 == ut

    For j=2 :.92.0)1)(2.0)(2.0(21

    2)4.0(2

    21112

    =−=−=≈ uht uuu

    92.0,4.0 22 == ut

    Similarly , we get

    .78458.0)92.0)(4.0)(2.0(292.0

    2)6.0(2

    22223

    =−=−=≈ uht uuu

    .50706.0)1(,63684.0)8.0( 54 =≈=≈ uuuu

    en = . , we getFor j=0 :

    0.12)1.0(

    1,020001

    10

    =−=≈==

    uht uuu

    ut

    6

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    7/19

    22.0

    1,1.02

    11

    −=≈==

    uht uuu

    ut For j=1 :

    .98.0)1)(1.0)(1.0(21 2 =−=For j=2 :

    23.0

    98.0,2.02

    22

    −=≈==

    uht uuu

    ut

    Similarly, we get.94158.0)98.0)(2.0)(1.0(298.0 2 =−=

    .82525.0)5.0(,88839.0)4.0( 54 =≈=≈ uuuu

    .50364.0)0.1(

    ,56011.0)9.0(,62202.0)8.0(

    ,68835.0)7.0(,75715.)6.0(

    10

    98

    76

    =≈

    =≈=≈=≈=≈

    uu

    uuuu

    uuouu

    or = . , we ge

    ,92906.0)3.0(,9517.0)25.0(

    ,97054.0)2.0(,9851.0)15.0(

    ,995.0)1.0(,0.1)05.0(

    ≈≈

    ≈≈≈≈

    ≈≈

    uu

    uu

    uu

    ,67928.0)7.0(,71225.0)65.0(

    ,74561.0)6.0(,77899.0)55.0(

    ,81195.0)5.0(,84401.0)45.0(,..,..

    ≈≈≈≈≈≈

    uu

    uu

    uu

    .50179.0)0.1(,52831.0)95.0(

    ,55615.0)9.0(,58527.0)85.0(,61559.0)8.0(,64698.0)75.0(

    ≈≈≈≈≈≈

    uu

    uuuu

    7

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    8/19

    The truncation error in the Euler method is given by

    ''2

    uh

    TE =

    .)(2

    )(2

    2

    max10

    22

    t uh

    uh

    TE nt

    n

    ≤≤≤= ξ

    2 .u =

    232

    2

    10

    2

    2)1(

    )31(22 max ht t hTE t ≤+−≤ ≤≤

    As the absolute maximum of in[0,1] is 2.

    The error in Euler method is of the form

    )31( 2t −

    Richardson’s extrapolation gives....)()( 321 +++=− hchchchut u j j

    2/2)1()1(

    − −− k k k

    huhu12

    )( −=

    k u

    8

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    9/19

    Backward Euler Method:

    −The equation at the mesh point may be written as 6.60

    where . This is called the Backward Euler Method . The solution values

    are determined from the following equations

    11 ++ += j j j uu

    1321 ,....,, + juuuu

    ),( 111 +++ = j j j ut f f ),( j j ut f

    h

    =−1+= jt t

    hf uu

    hf uu

    +=

    +=

    212

    101

    The method (6.60) involves the unknown value on both sides of the equation and hence N N N hf uu += −1

    ...................

    1+ ju 1+ juimp icit y. Suc a met o is ca e an mp c t met o .Since f(t,u) is nonlinear,(6.60)produces a nonlinear algebraic equation for the solution of . For thesolution of this nonlinear equation, we can use the Newton ‐RAPHSON METHOD . Applying the Newton ‐Raphson method to (6.60). We get

    1+ ju

    Or after rearrangement as ∂

    −++= ++

    ++++

    +u

    uuut f huu s j s

    j s

    j j j s

    j )(),()(1

    )1(1

    )(11

    )1(1

    .),()(1 11111 s

    j j

    s

    j j

    s

    j

    s

    j ut hf uuuuuh +++++

    + +−=− ∂−

    9

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    10/19

    Where is the sth iterate of and is evaluated at ( ) . We iterate (6.61) until

    (6.62)

    )(1

    s ju + 1+ ju

    u f

    ∂∂ )(

    11 , s j j ut ++

    TOLuu s s ≤−+ )()1(

    Where TOL is a specified absolute error tolerance. Since the solution u(t) ofVaries continuously, we may take the initial approximation as The local truncation error at thepoint in the method(6.60) is given by

    00 )(),,( η == t uut f dt du

    j j uu =+0

    1=1+ j

    ))](,()([)(

    )(

    2

    111

    111

    +++

    +++

    +−=−=

    j j j j

    j j j

    t ut hf t ut u

    ut uT

    (6.63)

    It may be noted that the truncation errors of Euler and backward Euler methods are equal but are ofopposite signs.

    .),(''2 1

    +

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    11/19

    We have 8.01)(')(

    111 += +++ ut u F

    s

    j j j

    Taking , we obtain from (6.64), for

    )64.6,.....(2,1,0)(' )( 111

    1 =−=

    +

    +

    +

    +

    + su F uu s j j j

    0 j j uu =+

    )0(1

    ,

    ,93070332.0,14896552.1)(',00038050.0)(,93103448.0,16.1)(',08.0)(

    ,,.

    3272

    )2(1

    )1(1

    )1(1

    )1(

    1

    )0(

    1

    )0(

    1

    011

    ======

    ===

    uu F u F uu f u F

    uu

    Therefore , u(0.2) 93070331.01 =≈ u,.,.,. 111 === uuu

    ,93070331.0,4.0:1 1)0(

    22 ==== uut j

    ,82247016.0,26319054.1)(',00000034.0)(

    ,82247043.0,26365260.1)(',00182463.0)(

    ,82391436.0,29782506.01)(',13859338.0)(

    )3(2

    )2(2

    )2(2

    )2(2

    )1(2

    )1(2

    )1(2

    )0(2

    )0(2

    ======

    ===

    uu F u F

    uu F u F

    uu F u F

    Therefore , u(0.4) = =0.82247016.The exact values are u(0.2)=0.96153846,u(0.4)=0.86206897.

    2u

    ..,.'. 22,

    2 ==−= − uuu

    11

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    12/19

    MID – POINT METHOD:

    The equation may be written as (6.65)

    This is called the mid ‐point method. The solution values are given by

    ),(2

    11 j j

    j j ut f huu =− −+ .1...,2,1,0,211 −=+= −+ N jhf uu j j j

    213

    102

    ....................2

    2

    +=

    +=

    hf uu

    hf uu

    (6.66)The value is known from the initial condition. The value is unknown and has to be determined

    by some other method after which (6.66) is used to determine successively .

    11 2 −− += N N N hf uu1u 1u

    N uuu ,...., 32

    The local truncation error is given by

    3

    11

    111

    ))](,(2[)(

    )(

    −+

    +++

    +−=−=

    j j j j

    j j j

    h

    t ut hf ut u

    ut uT

    .

    The bound on the truncation error is given by (6.68)

    .11,3 +−

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    13/19

    Example 6.13: Solve the initial value problem

    1)0(,2' 2 =−= utuu

    , . , , .

    compute u(0,2). Determine the percentage relative error at t=1.The mid ‐point method gives

    (6.69)4,3,2,1,8.04 212

    11 =−=−= −−+ jut uuht uu j j j j j j j

    We calculate from the Taylor series method of second order. We have1u

    )0(''2

    )0(')0()(2

    1 uh

    huuhuu ++=≈

    ''' .

    We obtain

    ,, −===

    .96.0)2(2

    04.001)2.0(1 =−++=≈ uu

    , . , ,.,,, 5432

    ,4.0,852544.0,96.0:2

    .852544.0)96.0)(2.0)(8.0(1

    .8.0)4.0(

    ,.,.,:

    221

    2

    21102

    110

    =====−=

    −=≈====

    t uu j

    ut uuu

    uu

    8.0)8.0(

    6.0,7274139.0,858544.0:3

    .7274139.0)852544.0)(4.0)(8.0(96.0

    ...

    23324

    332

    2

    2213

    −=≈====

    =−=−=≈

    ut uuu

    t uu j

    ut uuu

    134981176.0)5985611.0)(8.0)(8.0(7274139.0

    8.0)0.1(

    ,8.0,5985611.0,7274139.0:4

    .5985611.0)7274139.0)(6.0)(2.0(4852544.0

    2

    24435

    443

    =−=−=≈

    =====−

    ut uuu

    t uu j

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    14/19

    The exact solution is Therefore , u(1)=0.5.).1/(1)( 2t t u +=

    *The percentage error is defined as

    Where u is the exact solution and is the approximate solution. Therefore:

    100*. ue p

    =

    *u

    %.38.0100*5.0

    4981176.05.0. =

    −=e p

    14

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    15/19

    6.4 SINGLESTEP METHODS:

    (6.70)Can be classified mainly into two types. They are (1) single step methods and (2) multistep methods.

    ],[,)(),,(' 000 bt t t uut f u == η

    , .Thus, a general single step method can be written as

    (6.71)),,,,( 111 huut t huu j j j j j j +++ += φ huut t .

    . This function is called the increment function . If can be obtained simply by evaluatingthe right hand side of (6.71) , then the method is called an explicit method . In this case , the method is

    of the form

    ),,( hut φ φ 1+ ju

    (6.72)

    If the right hand side of (6.71) depends on also, then it is called an implicit method. The general

    ).,,(1 hut huu j j j j φ +=+

    1+ ju

    15

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    16/19

    Taylor Series Method:

    The fundamental numerical method for the solution of 6.70 is the Ta lor series method.

    We assume that the function u(t) can be expanded in Taylor series about any point ,that is jt

    11

    ....)('')(!2

    1)(')()()( 2 t ut t t ut t t ut u j j j j j +−+−+=

    (6.75)

    This expansion holds for and

    ( ).

    !1!t ut t

    pt ut t

    p j j j j +−

    ++−+

    ],[ 0 bt t .10

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    17/19

    Denote by , the value obtained from by using an approximate valueIn place of the exact value . Neglecting the error term, we have the method

    )),(,( ht ut h j jφ ),,( hut h j jφ ju)( jt u

    .

    to approximate . The error or the truncation error of the method is given by

    ....,,,,,,1 −==+ uuu j j j j

    )( 1+ jt u

    )(1 11

    1 ht uhT p p θ += +++ .

    The method (6.67) is called the Taylor series method of the order p . Substituting p=1 , in (6.76) we get p +

    ),('1 j j j j j ut hf uhuuu +=+=+ . ,

    order 1 .To apply (6.76) , it is necessary to know If and are known, then

    the derivatives can be calculated as follows :

    ).(),.....('),( )( j p

    j j t ut ut u jt )( jt u

    t u,Next , the differential equation u’=f(t,u) is differentiated to obtain expressions for the

    higher order derivatives of u(t) .Thus , we have

    j)).(,()(' j j j t ut f t u =

    ),(' ut f u =

    ..........................................................

    )(2''' 2 ut uuututt

    ut

    ff f f f f ff f u

    u

    ++++=+=

    17

    Where represents the partial derivatives of f with respect to t and u and so on. The values....., ut f f

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    18/19

    can be computed by substituting Therefore, if and are known exactly ,then (6.76) can be compute with an error

    . jt t = jt )( jt uu

    The number of terms to be included in (6.76) is fixed by the permissible error. If this error is and the

    ( ))(

    !1)1(1 ht u

    ph

    j p p θ ++

    ++

    ε series is truncated at the term then

    Or (6.78)

    )()( j p t u

    ε θ ε θ

    )!1()()!1()(

    )(1

    )1(1

    +

  • 8/9/2019 COMPUTER ORIENTED NEUMARICAL METHODS

    19/19

    Example 6.15 :

    Given the initial value ro ram u 0 =0' 22

    Determine the first three non ‐zero terms in the Taylor series for u(t) and hence obtain the value for u(1) .Also determine t when the error in u(t) obtained from the first two non ‐zero terms is to be less than

    after roundin .

    ,

    6−

    We have u(0)=0,u’(0)=0u’’=2t+2uu’,u’’(0)=0u’’’=2+2 uu’’+ u’’’ 0 =22)'(u

    0)0(),'''''10'5(2

    0)0(],)''(3''''4[2

    0)0(),'''3'''(2

    )6()4()5()6(

    )5(2)4()5(

    )4()4(

    =++=

    =++==+=

    uuuuuuuu

    uuuuuuu

    uuuuuu

    '''120''45'10[2

    0)0()0()0(

    80)0(),)'''(10''15'6(2

    )11(2)5()6()4(

    )7()8()9()10()11(

    )10()9()8(

    +++====

    =+++=

    uuuuuuuuu

    uuu

    uuuuuuuuu

    Thus , the Taylor series for u(t) becomes . The approximate value of u(1) is givenby . If only the first two terms are used , then the value of t is obtained from

    ,

    1172

    20792

    631

    31

    )( t t t t u ++=350168.0

    20792

    631

    31

    )1( ≈++=u

    19

    .solving we get .711 10*5.02079

    2 −