Chapter 5 – Numerical Integration.pptx

  • Upload
    aben777

  • View
    239

  • Download
    0

Embed Size (px)

Citation preview

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    1/23

    CHAPTER 5 NUMERICAL INTEGRATION

    Prepared by:

    Engr. Romano A. Gabrillo

    MEngg - MfgE

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    2/23

    INTRODUCTION

    Engineers and scientist are frequently facedwith the problem of differentiating or integratingfunctions which are defined in a tabular orgraphical form rather than as explicit functions.

    Sometimes there are certain explicit functionswhich are difficult to integrate in terms ofelementary functions. One simple example is:

    v = dx/dtwhere v=velocity; x=distance; t=time

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    3/23

    METHODS FOR SOLVING NUMERICAL

    INTEGRATION

    One can resort to number integration if:

    1. F(x) is not known as a closed form but specified

    only at discrete points.

    2. F(x) is expressed analytically but cannot beintegrated in a closed form. In this chapter the

    following methods for numerical integration will

    be discussed:

    1. Trapezoidal Rule

    2. Simpsons Rule

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    4/23

    TRAPEZOIDAL RULE

    This is based on linear interpolation formula

    of Newtons forward difference using First

    order Newtons forward difference

    y = y0 + y0T + Error

    = y0+ y0T + f () h2 T(T-1)

    2

    Integrating both sides: (See Figure 1)

    1

    0

    1

    0

    2''

    00 )1(2

    )(x

    xdTTTh

    fTyyhydxI

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    5/23

    FIGURE 1

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    6/23

    Substituting fory0 as (y1 + y0) in theabove equation we get:

    )6/1(2

    )(

    2

    2

    2

    3

    3

    2

    )(

    2

    ''21

    0

    2

    00

    1

    0

    2''2

    00

    fhTyyhI

    TThfTyTyh

    ErrorLocalyyh

    I

    fhyy

    yhI

    ][2

    12

    )(

    2

    10

    ''2

    01

    0

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    7/23

    HENCE, IF WE INTEGREATE A FUNCTION BY

    TRAPEZOIDAL RULE WE GET:

    Upper and lower bound for the error can be

    found out by substituting upper and lowerbound values for f ().

    |)(|12

    ||

    ][2

    ''2

    10

    fh

    errorlocaltheand

    yyh

    I

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    8/23

    COMPOSITE INTEGRATION FORMULA

    (TRAPEZOIDAL)

    One way to reduce the error associated with alow order integration formula is to subdivide theinterval of integration a, b into smaller intervalsand to use the trapezoidal rule separately on

    each sub interval.

    Repeated application of lower order formula ispreferred to the single application of higher

    order formula, partly because of the simplicity ofthe low order formulae and partly because ofcomputational difficulties.

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    9/23

    TO GET I BY TRAPEZOIDAL RULE FROM X0XN,WE GET I FOR EACH SUBINTERVAL SUCH AS

    (x0 x1), (x1 x2)and add them.

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    10/23

    ]........2[2/:

    );(12/][2/

    );(12/][2/

    );(12/][2/

    1210

    1

    ''3

    1

    21

    ''3

    21

    10

    ''3

    10

    0

    1

    21

    10

    nnxxT

    nnnnxx

    xx

    xx

    yyyyyhII

    Adding

    XXfhyyhI

    XXfhyyhI

    XXfhyyhI

    n

    nn

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    11/23

    GLOBAL ERROR

    )()(12

    ''

    0

    2

    fxxh

    n

    The global error accumulated in n steps in

    going from x0 to xn is known as global Error nh3

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    12/23

    SIMPSONS RULE

    Simpsons Rule is based on quadratic

    interpolation function between three points.

    The quadratic interpolation function may be

    written as:

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    13/23

    In the equation above after2y0 we havewritten two terms because the fourthterm vanishes on integration.

    )3)(2)(1(24

    )2)(1(6

    )1(2

    0

    4

    0

    3

    0

    2

    00

    TTTTy

    TTTy

    TTy

    yyy

    )(

    90)0(

    6)3/2(

    222

    )3)(2)(1(

    24

    )......1(

    2

    )3)(2)(1(24

    ).....1(2

    44

    0

    3

    0

    2

    00

    2

    0

    0

    4

    0

    2

    00

    0

    4

    0

    2

    00

    2

    0

    fhyy

    yyh

    dTTTTTy

    TTy

    yyhydx

    TTTTy

    TTy

    yyy

    x

    x

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    14/23

    SUBSTITUTING FOR

    210

    210

    0120

    2

    010

    61

    64

    61

    2/

    43/

    2

    yyyLI

    LashforngSubstituti

    yyyhI

    getweyyyyandyyasy

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    15/23

    COMPOSITE INTEGRATION FORMULA

    The interval xn x0 must be divided into even

    number of intervals so as to apply Simpsons

    Rule

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    16/23

    )()(

    180

    :

    ........)(2)....(4)3/(

    :

    ;

    90

    4)3/(

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

    ;904)3/(

    ;90

    4)3/(

    0

    4

    6421310

    2

    5

    12

    42

    5

    132

    20

    5

    210

    0

    2

    42

    20

    IV

    n

    nnxxS

    nn

    IV

    nnnxx

    IV

    xx

    IV

    xx

    fxxh

    ErrorGlobal

    yyyyyyyyhII

    Adding

    xxfh

    yyyhI

    xxf

    h

    yyyhI

    xxfh

    yyyhI

    n

    nn

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    17/23

    EXAMPLE NO. 1

    Integrate using a) trapezoidal rule b)Simpsons rule and also compute error bounds

    Using trapezoidal rule where h is divided by 4parts.

    dxx2

    1/1

    ValueTruexdxxxf 6931471.0log/1)(2

    1

    2

    1

    6970238.0

    )5714285.06667.08.0(25.01225.0

    T

    I

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    18/23

    TABLE 1

    x f(x) T

    1 1 0

    1.25 0.8 1

    1.5 0.66667 2

    1.75 0.5714265 32.0 0.5 4

    Actual error

    = |true value numerically computed value|

    = 0.003876

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    19/23

    BY USING TRAPEZOIDAL RULE

    Global Error = h2/12 (xn x0) f()f(x)= 2/x3f() max = 2/13 =2f() min = 2/23 = 0.25

    Error Upper Bound= 0.252 (2-1)(2) = 0.010426

    12 Error Lower Bound

    = 0.252 (2-1)(0.25) = 0.001302

    12

    0.001302

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    20/23

    BY SIMPSONS RULE

    IS = 0.25[1+0.5+4(0.8+0.5714285)+2(0.6667)]3

    = 0.6932595

    By using Simpsons Rule the Global Error

    = h4 (xn x0) fIV ()

    180fIV(x) = 24/x5

    x=1; fIV() max = 24/15 = 24x=2; fIV() max = 24/25 = 0.75

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    21/23

    UPPER BOUND FOR THE ERROR

    = (0.25)4 x (2-1) x 24 = 0.00052

    180

    LOWER BOUND FOR THE ERROR

    = (0.25)4 x (2-1) x 0.75 = 0.0000215

    180

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    22/23

    BUT ACTUAL ERROR BYSIMPSONS RULE

    = 0.6931471 0.6932595 = 0.000107

    0.0000215 < 0.000107 < 0.00052

    lower bound error < actual error < upper bounderror

    Therefore the final answer is acceptable

  • 7/27/2019 Chapter 5 Numerical Integration.pptx

    23/23

    END OF CHAPTER 5

    End of Module

    Laboratory Experiments starts next week up toend of June

    Project submission is also at the end of June Final Exam

    June 7, 2013 (Friday Afternoon) (To be confirmed)

    Coverage Chapter 4-5

    Thanks for listening!