Top Banner

of 14

Method of Linear Interpolation

Apr 07, 2018

Download

Documents

Havend Ali
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/3/2019 Method of Linear Interpolation

    1/14

    Method of Linear Interpolation:

    This method is also known as themethod of false position, and bythe Latinized version regula falsi.It is also a very old method.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    2/14

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    3/14

    x3 = x2 f(x2) [(x2 x1)/(f(x2) f(x1)]

    Where x3 represents the intersection of

    the strait line with the x-axis. Wecalculate f(x3) and then test:

    If f(x1) * f(x3) < 0 , then set x2 = x3

    If f(x1) * f(x3) > 0 , then set x1 = x3 Repetition of this will give estimation of

    the root.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    4/14

    Algorithm:

    to determine the root of f(x) = 0, given values of x1 andx2 such that f(x1) and f(x2) are of opposite signs.

    Repeat

    Set x3 = x2 f(x2) [(x2 x1)/(f(x2) f(x1)] if f(x1) * f(x3) < 0, then Set x2 = x3 Else x1 = x3 End if Until abs(f(x3)) tolerance value

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    5/14

    Example:

    find the positive root of the cubicequation; f(x) = x3 + x2 -3x 3 = 0,starting with x1 = 1.0 and x2 = 2.0,and the tolerance equal to 0.001.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    6/14

  • 8/3/2019 Method of Linear Interpolation

    7/14

    Note that although the false positionmethod aims to improve theconvergence speed over the bisection

    method, it can not always achieve thegoal, especially when the curve of f(x)on [x1, x2] is not well approximated by

    a strait line as depicted in figurebelow.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    8/14

    f(x) = tan( x) x = 0.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    9/14

    The Secant Method:This method is used to improve the method of linearinterpolation.

    Instead of requiring that the function have opposite signs atthe two values used for interpolation, we can choose the two

    values nearest the root and interpolate or extrapolate fromthese.

    Usually the nearest values to the root will be the last twovalues calculated.

    This makes the interval under consideration shorter andhence improves the assumption that the function can berepresented by the line through the two points.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    10/14By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    11/14

    x3 = x2 [f(x2) (x2 x1) / (f(x2) f(x1))]

    Algorithm: given f(x) = 0, choose x1 andx2 close enough to the root.

    Repeat Set x3 = x2 [f(x2) (x2 x1) / (f(x2) f(x1))] if abs(f(x2)) < abs(f(x1)) then

    Set x1 = x2 End if Set x2 = x3 Until abs(f(x3)) tolerance value

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    12/14

    Example:

    find the positive root off(x) = x3 + x2 -3x 3, let

    x1 = 1.0 and x2 = 2.0,tolerance = 0.001.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    13/14

    Solution:

    #Ino. x1 x2 x3 f(x1) f(x2) f(x3)1 1.0 2.0 1.57142 -4.0 3.0 -1.364492 2.0 1.57142 1.70540 3.0 -1.36449 -0.247843 1.57142 1.70540 1.73513 -1.36449 -0.24784 -0.02924 1.70540 1.73513 1.73199 -0.24784 -0.0292 -0.000575 1.73513 1.73199 1.73205 -0.0292 -0.00057

    *The positive root is x3= 1.73205 = 3.

    By: Ouday N. Ameen

  • 8/3/2019 Method of Linear Interpolation

    14/14

    Thank you for yourlistening