Numerical Differential Equations: dattab/MATH435.2013/NUMERICAL_ODE.IVP.pdfNumerical Differential...

download Numerical Differential Equations: dattab/MATH435.2013/NUMERICAL_ODE.IVP.pdfNumerical Differential Equations: IVP ... Since numerical computation may introduce some perturbations

of 35

  • date post

    17-Mar-2018
  • Category

    Documents

  • view

    213
  • download

    1

Embed Size (px)

Transcript of Numerical Differential Equations: dattab/MATH435.2013/NUMERICAL_ODE.IVP.pdfNumerical Differential...

  • Chapter 11

    Numerical Differential Equations:

    IVP

    **** 4/16/13 EC

    (Incomplete)

    11.1 Initial Value Problem for Ordinary Differential Equations

    We consider the problem of numerically solving a differential equation of the form

    dy

    dt= f(t, y), a t b, y(a) = (given).

    Such a problem is called the Initial Value Problem or in short IVP, because the initial value

    of the solution y(a) = is given.

    Since there are infinitely many values between a and b, we will only be concerned here to find

    approximations of the solution y(t) at several specified values of t in [a, b], rather than finding

    y(t) at every value between a and b.

    The following strategy will be used:

    Divide [a, b] into N equal subintervals each of length h:

    t0 = a < t1 < t2 < < tN = b.

    491

  • 492 CHAPTER 11. NUMERICAL DIFFERENTIAL EQUATIONS: IVP

    a = t0 t1 t2 tN = b

    Set h =b a

    N(step size)

    Compute approximations yi to y(ti) at t = ti; that is, given y(0) = y0, compute, recur-

    sively, y1, y2, . . . , yn.

    y(ti) = Exact value of y(t) at t = ti.

    yi = An approximation of y(ti) at t = ti.

    The Initial Value Problem

    Given

    (i) y = f(y, t), a t b

    (ii) The initial value y(a) = y(t0) = y0 =

    (iii) The step-size h.

    Find yi (approximate value of y(ti)), i = 1, . . . , N , where N =bah

    .

    We will briefly describe here the following well-known numerical methods for solving the IVP:

    The Euler and Modified Euler Method (Taylor Method of order 1)

    The Higher-order Taylor Methods

    The Runge-Kutta Methods

    The Multistep Methods: The Adams-Bashforth and Adams-Moulton Method

    The Predictor-Corrector Methods

    Methods for Systems of IVP Differential Equations

    We will also discuss the error behavior and convergence of these methods. However, before doing

    so, we state a result without proof, in the following section on the existence and uniqueness

    of the solution for the IVP. The proof can be found in most books on ordinary differential

    equations.

  • 11.1. INITIAL VALUE PROBLEM FOR ORDINARY DIFFERENTIAL EQUATIONS 493

    11.1.1 Existence and Uniqueness of the Solution for the IVP

    Theorem 11.1 (Existence and Uniqueness Theorem for the IVP). Suppose

    (i) f(t, y) is continuous on the domain defined by R = {a t b, < y < },

    and

    (ii) the following inequality is satisfied:

    |f(t, y) f(t, y)| L|y y|,

    whenever (t, y) and (t, y) R, and L is constant.

    Then the IVP

    y = f(t, y), y(a)

    has a unique solution.

    Definition 11.2. The condition |f(t, y) f(t, y)| L|y y| is called the Lipschitz Con-

    dition. The number L is called a Lipschitz Constant.

    Definition 11.3. A set S is said to be convex if whenever (t1, y1) and (t2, y2) belong to S,

    the point ((1 )t1 + t2, (1 )y1 + y2) also belongs to S for each , 0 1.

    11.1.2 Simplification of the Lipschitz Condition for the Convex Domain

    Suppose that the domain R in Theorem 11.1 is convex set, then the The IVP has a unique

    solution if

    f

    y(t, y)

    L for all (t, y) R.

    11.1.3 Liptischitz Condition and Well-Posedness

    Definition 11.4. An IVP is said to be well-posed if a small perturbation in the data of the

    problem leads to only a small change in the solution.

    Since numerical computation may introduce some perturbations to the problem, it is important

    that the problem that is to be solved is well-posed. Fortunately, the Lipschitz condition is a

    sufficient condition for the IVP problem to be well-posed.

    Theorem 11.5 (Well-Posedness of the IVP problem). If f(t, y) satisfies the Lipschitz

    condition, then the IVP is well-posed.

  • 494 CHAPTER 11. NUMERICAL DIFFERENTIAL EQUATIONS: IVP

    11.2 The Euler Method

    One of the simplest methods for solving the IVP is the classical Euler method.

    The method is derived from the Taylor Series expansion of the function y(t).

    Recall that the function y(t) has the following Taylor series expansion of order n at t = ti+1:

    y(ti+1) = y(ti) + (ti+1 ti)y(ti) +

    (ti+1 ti)

    2!

    2

    y(ti)

    + +(ti+1 ti)

    n!

    n

    y(n)(ti) +(ti+1 ti)

    (n+ 1)!

    n+1

    yn+1(i), where i is in (ti, ti+1).

    Substitute h = ti+1 ti. Then

    Taylor Series Expansion of y(t) of order n at t = ti+1

    y(ti+1) = y(ti) + hy(ti) +

    h2

    2!y(ti) + +

    hn

    n!y(n)(ti) +

    hn+1

    (n + 1)!y(n+1)(i).

    For n = 1, this formula reduces to

    y(ti+1) = y(ti) + hy(ti) +

    h2

    2!y(i).

    The term h2

    2! y(2)(i) is called the remainder term.

    Neglecting the remainder term, we can write the above equation as:

    y(ti+1) y(ti) + hy(ti)

    Using our notations, established earlier, we then have

    yi+1 = yi + hf(ti, yi),

    since yi = f(ti, yi)

    We can then resursively generate the successive approximations yi, y2, . . . , yN to y(t1), y(t2), . . .

    and y(tN ) as follows:

  • 11.2. THE EULER METHOD 495

    y0 = (given)

    y1 = y0 + hf(t0, y0)

    y2 = y1 + hf(t1, y1)...

    yN = yN1 + hf(tN1, yN1)

    .

    These iterations are known as Eulers iterations and the method is the historical Eulers

    method.

    Figure 11.1: Geometrical Interpretation

    y(tN )

    = y(b)

    y(t2)

    y(t1)

    y(t0)

    = y(a) =

    a t1 t2 tN1 b = tN

  • 496 CHAPTER 11. NUMERICAL DIFFERENTIAL EQUATIONS: IVP

    Algorithm 11.6 (Eulers Method for IVP).

    Input: (i) The function f(t, y)

    (ii) The end points of the interval [a, b]: a and b

    (iii) The initial value: = y(t0) = y(a)

    (iv) The step size: h

    Output:Approximations yi+1 of y(ti + 1), i = 0, 1, . . . , N 1.

    Step 1. Initialization: Set t0 = a, y0 = y(t0) = y(a) = and N =bah

    .

    Step 2. For i = 0, 1, . . . , N 1 do

    Compute yi+1 = yi + hf(ti, yi)

    End

    Example 11.7

    Using Eulers method, solve numerically y = t2 + 5, 0 t 1, with h = 0.25.

    Input Data:

    f(t, y) = t2 + 5

    t0 = a = 0, t1 = t0 + h = 0.25, t2 = t1 + h = 0.50

    t3 = t2 + h = 0.75, t4 = b = t3 + h = 1.

    y0 = y(t0) = y(0) = 0.

    Find:

    y1 = approximation of y(t1) = y(0.25)

    y2 = approximation of y(t2) = y(0.50)

    y3 = approximation of y(t3) = y(0.75)

    y4 = approximation of y(t4) = y(1)

    The exact solution obtained by direct integration:

    y(t) =t3

    3+ 5t.

    Solution.

    i = 0: Compute y1 from y0 (Set i = 0 in Step 2) of Algorithm 11.6:

  • 11.2. THE EULER METHOD 497

    y1 = y0 + hf(t0, y0) = 0 + 0.25(5)

    = 1.25 (Approximate value of y(0.25))

    Actual value of y(0.25) = 1.2552.

    i = 1: Compute y2 from y1 (set i = 1 in Step 2).

    y2 = y1 + hf(t1, y1)

    = 1.25 + 0.25(t21 + 5) = 1.25 + 0.25((0.25)2 + 5)

    = 2.5156 (Approximate value of y(0.50))

    Note: of y(0.5) = 2.5417. (Four significant digits)

    i = 2 : Compute y3 from y2 (Set i = 2 in Step 2).

    y3 = y2 + hf(t2, y2)

    = 2.5156 + 0.25((0.5)2 + 5)

    = 3.8281 (Approximate value of y(0.75))

    Actual value of y(0.75) = 3.8696.

    Etc.

    Example 11.8

    y = t2 + 5, 0 t 2

    y(0) = 0, h = 0.5

    Solution.

    i = 0 : Compute y1 from y0 (Set i = 0 in Step 2 of Algorithm 11.6).

    y1 = y0 + hf(t0, y0) = y(0) + hf(0, 0) = 0 + 0.5 5

    = 2.5 (Approximate value of y(0.50))

    Note:y(0.50) = 2.5417 (four significant digists)

    i = 1 : Compute y2 from y1 (Set i = 1 in Step 2 in Algorithm 11.6).

  • 498 CHAPTER 11. NUMERICAL DIFFERENTIAL EQUATIONS: IVP

    y2 = y1 + hf(t1, y1) = 2.5 + 0.5((0.5)2 + 5)

    = 5.1250 (Approximate value of y(1))

    Note: y(1) = 5.3333 (four significant digits).

    i = 3 : Compute y3 from y2 (Set i = 2 in Step 2).

    y3 = y2 + hf(t2, y2) = 5.1250 + 0.5(t22 + 5) = 5.1250 + 0.5(1 + 5)

    = 8.1250 (Approximate value of y(1.5))

    Note: of y(1.5) = 8.6250 (four significant digits).

    Etc.

    11.2.1 The Errors in Eulers Method

    The approximations obtained by a numerical method to solve the IVP are usually subjected to

    three types of errors:

    Local Truncation Error

    Global Truncation Error

    Round-off Error

    We will not consider the round-off error for our discussions below.

    Definition 11.9. The local error is the error made at a single step due to the truncation

    of the series used to solve the problem.

    Recall that the Euler Method was obtained by truncating the Taylor series

    y(ti+1) = y(ti) + hy(ti) +

    h2

    2y(ti) +

    after two terms. Thus, in obtaining Eulers method, the first term neglected is h2

    2 y(ti).

    The local error in Eulers method is:

  • 11.2. THE EULER METHOD 499

    ELE =h2

    2y

    (i), where i lies between ti and ti+1.

    In this case, we say that the local error is of order h2, written as O(h2). Note that the local

    error ELE converges to zero as h 0. That means, the smaller h is, the better accuracy will be.

    Definition 11.10. The global error is the difference between the true solution y(ti) and the

    approximate solution yi at t = ti. Thus, Global error = y(ti) yi. Denote this by EGE .

    The following theorem shows that the global error, EGE , is of order h.

    Theorem 11.11 (Global Error Bound for the Euler Method). (i) Let y(t) be the unique

    solution of the IVP: y = f(t, y); y(a) = , where

    a t b, < y < .

    (ii) Let L and M be two numbers such that

    f(t, y)

    y

    L, and |y(t)| M in [a, b].

    Then the global error EGE at t = ti satisfies the following inequality: