Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

download Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

of 30

Transcript of Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    1/30

    Numerical Methods

    - An Introduction -

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    2/30

    Chapter 1 2

    Mathematical Modeling and

    Engineering Problem Solving

    • Requires understanding of engineeringsystems –By observation and experiment

     – Theoretical analysis and generalization

    Computers are great tools, hoever, ithoutfundamental understanding of engineeringproblems, they ill be useless!

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    3/30

    "

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    4/30

    Chapter 1 #

    • $ mathematical model is represented as a functionalrelationship of the form

      Dependent  independent forcing

      Variable  %f  variables, parameters, functions

    • Dependent variable& Characteristic that usually re'ects thestate of the system

    • Independent variables& (imensions such as time and spacealong hich the systems behavior is being determined

    • Parameters& re'ect the system)s properties or composition

    • Forcing functions& external in'uences acting upon thesystem

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    5/30

    Chapter 1 *

    Newton’s 2nd law of Motion

    • +tates that the time rate change ofmomentum of a body is equal to the resultingforce acting on it !-

    •  The model is formulated as

    F = m a

    F %net force acting on the body ./0m%mass of the obect .g0

    a %its acceleration .m3s20

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    6/30

    4

     D U 

     D

    dv F dt m

     F F F 

     F mg 

     F cv

    dv mg cv

    dt m

    =

    = +

    =

    = −

    −=

    ample, modeling of a falling parachutist&

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    7/30

    Chapter 1 5

    •  This is a di6erential equation and is rittenin terms of the di6erential rate of changedv3dt of the variable that e are interested

    in predicting!• 7f the parachutist is initially at rest .v %8 at

    t %80, using calculus

    vm

    c g 

    dt 

    dv−=

    ( )t mc

    ec

     gm

    t v)/(

    1)(−

    −=

    7ndependentvariable

    (ependentvariable 9arameters:orcing

    function

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    8/30

    ;

    Approximations and Round!ff Errors

    • :or many engineering problems, ecannot obtain analytical solutions!

    • /umerical methods yield

    approximate results, results that areclose to the exact analytical solution!

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    9/30

    Chapter " =

    • $ccuracy! >o close is a computed or

    measured value to the true value• 9recision .or reproducibility 0! >o close

    is a computed or measured value to

    previously computed or measuredvalues!

    • 7naccuracy .or bias0! $ systematic

    deviation from the actual value!• 7mprecision .or uncertainty 0! ?agnitude

    of scatter!

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    10/30

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    11/30

    Significant "igures

    /umber of signifcant fgures indicates precision!+igni@cant digits of a number are those that can be used ith condence, e!g!, the number of certain digits plus oneestimated digit!

    *",;88 >o many signi@cant @guresA

    *!"; x 18# "*!";8 x 18# #*!";88 x 18# *

    eros are sometimes used to locate the decimal point notsigni@cant @gures!

    8!888815*" #8!88815*" #

    8!8815*" #

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    12/30

    Error #efinitions

    True Value = Approximation + Error 

     E t = True value – Approximation (+/-)

     valuetrue

    error true errorrelativefractionalTrue =

    %100 valuetrue

    error true error,relative percentTrue

    t×=ε 

    True error 

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    13/30

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    14/30

    Chapter " 1#

    • Computations are repeated until stopping criterion is

    satis@ed!

    7f the folloing criterion is met

    you can be sure that the result is correct to at least n

    signi@cant @gures!

     sa   ε ε    〈 9respeci@ed D tolerancebased on the noledge ofyour solution

    )%10(0#$ n)-("   ×=ε 

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    15/30

    Roundoff Errors•

    /umbers such asπ, e, or cannot beexpressed by a @xed number of

    signi@cant @gures!

    • Computers use a base2 representation,

    they cannot precisely represent certainexact base18 numbers!

    • :ractional quantities are typicallyrepresented in computer using 'oatingpoint- form, e!g!,

    &

    em#'exponent

    Base of the numbersystem used

    mantissa

    7ntegerpart

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    16/30

    Chapter "14

    iure *#*

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    17/30

    Chapter " 15

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    18/30

    Chapter " 1;

    :igure "!*

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    19/30

    Chapter "1=

    1*4!5; 8!1*45;x18" in a 'oating pointbase18 system

    +uppose only #decimal places to be stored

    • /ormalized to remove the leading zeroes!?ultiply the mantissa by 18 and loer theexponent by 1

    8!2=#1 x 181

    1

    1100#0

    011&$#0*

    1

    0

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    20/30

    Chapter "28

     Thereforefor a base18 system 8!1 EmF1

    for a base2 system 8!* EmF1

    • :loating point representation allos bothfractions and very large numbers to beexpressed on the computer! >oever, – :loating point numbers tae up more room!

     – Tae longer to process than integer numbers!

     – Roundo6 errors are introduced because mantissaholds only a @nite number of signi@cant @gures!

    11m

    b≤ <

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    21/30

    Chapter " 21

    $hoppingExample%

    π %"!1#1*=24*"*; to be stored on a base18 systemcarrying 5 signi@cant digits!

    π %"!1#1*=2 chopping error et%8!8888884*

    7f rounded

    π %"!1#1*=" et%8!888888"*

    • +ome machines use chopping, because rounding

    adds to the computational overhead! +ince numberof signi@cant @gures is large enough, resultingchopping error is negligible!

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    22/30

     Truncation Grrors and the Taylor

    +eries• /onelementary functions such as

    trigonometric, exponential, and others are

    expressed in an approximate fashion using Taylor series hen their values, derivatives,and integrals are computed!

    • $ny smooth function can be approximated as

    a polynomial! Taylor series provides a meansto predict the value of a function at one pointin terms of the function value and itsderivatives at another point!

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    23/30

    Chapter #2"

    :igure #!1

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    24/30

    2#

    Example%

    To et t.e cos(x) for "mall x

    f x=0#$cos(0#$) =1-0#1$+0#0001-0#00001&+

    =0#2&&$2

    rom t.e "upportin t.eor3, for t.i" "erie", t.e error i"

    no reater t.an t.e fir"t omitte4 term#

    +−+−=555

    1co"  x x x

     x

    0000001#0$#0

    52

    2

    ==∴  x for  x

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    25/30

    Chapter # 2*

    • An3 "moot. function can 'e approximate4 a" a

     pol3nomial# f ( xi+1) 6 f ( xi)  zero order  approximation, onl3

    true if xi+1 an4 xi are ver3 clo"e to eac. ot.er#

      f ( xi+1) 6 f ( xi) + f 7( xi) ( xi+1- xi) first order  

    approximation, in form of a "trai.t line

      n

    n

    ii

    i

    n

    iii

    iiiii

     R x xn

     x f 

     x x x f 

     x x x f  x f  x f 

    +−+

    +−′′

    +−′+≅

    +

    +++

    )(5

    )(

    )(

    5%

    )())(()()(

    1

    )(

    %

    111  

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    26/30

    Chapter # 24

    n

    n

    ii

    n

    iiiiiii

     R x xn

     f 

     x x f 

     x x x f  x f  x f 

    +−+

    +−′′

    +−′+≅

    +

    +++

    )(5

    )(

    5

    ))(()()(

    1

    )(

    111  

    ( xi+1- xi)= h step size (4efine fir"t)

    )1()1(

    )51(

    )( ++

    +

    =n

    n

    n   hn

     f   R

      ε 

    • 8emin4er term, Rn, account" for all term" from

    (n+1) to infinit3#

    nth order  approximation

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    27/30

    Chapter # 25

    •  ε i" not 9no:n exactl3, lie" "ome:.ere

     'et:een xi+1;ε ; xi #

    •  

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    28/30

    Chapter #2;

    • Truncation error i" 4ecrea"e4 '3 a44ition of term" to

    t.e Ta3lor "erie"#

    • f h i" "ufficientl3 "mall, onl3 a fe: term" ma3 'e

    reBuire4 to o'tain an approximation clo"e enou. to

    t.e actual value for practical purpo"e"#

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    29/30

    Chapter # 2=

    • @verflo: An3 num'er larer t.an t.e lare"t num'er t.atcan 'e expre""e4 on a computer :ill re"ult in an overflo:#

    • Cn4erflo: (?ole) An3 po"itive num'er "maller t.an t.e

    "malle"t num'er t.at can 'e repre"ente4 on a computer :illre"ult an un4erflo:#

    • Dta'le Alorit.m n exten4e4 calculation", it i" li9el3 t.atman3 roun4-off" :ill 'e ma4e# Eac. of t.e"e pla3" t.e role

    of an input error for t.e remain4er of t.e computation,impactin t.e eventual output# Alorit.m" for :.ic. t.ecumulative effect of all "uc. error" are limite4, "o t.at au"eful re"ult i" enerate4, are calle4 "ta'leF alorit.m"#G.en accumulation i" 4eva"tatin an4 t.e "olution i"over:.elme4 '3 t.e error, "uc. alorit.m" are calle4un"ta'le#

  • 8/17/2019 Catatan Pemrograman Dan Metode Numerik - 7 (Numeric Method).pptx

    30/30

    Chapter # "8

    iure #2