Lecture 6 Single Variable Problems - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Lecture 6 Single Variable Problems

Description:

Regula Falsi Method. x1 f(x1) x2 f(x2) x2-x1 f(x2)-f(x1) x3 f(x3) ... Regula Flasi (linear interpolation) - need to know the function and two bounds. ... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 29
Provided by: San59
Category:

less

Transcript and Presenter's Notes

Title: Lecture 6 Single Variable Problems


1
Lecture 6 - Single Variable Problems
  • CVEN 302
  • September 8, 2001

2
Lectures Goals
  • Introduction of Solving Equations of 1 Variable
  • Linear Interpolation
  • Secant Method
  • Newtons Method
  • Mullers Method
  • Fixed Point Iteration

3
Linear Interpolation
  • The bisection method is not very efficient. We
    would like to converge to the root at a faster
    rate with a different algorithm.
  • One of these method is linear interpolation
    method or the method of false position (Latinized
    version Regula Falsi )

4
Method of Linear InterpolationRegula Falsi
  • Do while x2 - x1 gt tolerance value 1
  • or f(x3)gt tolerance value 2
  • Set x3 x2 - f(x2)(x2 - x1)/(f(x2)-f(x1))
  • IF f(x3) of opposite sign of f(x1)
  • Set x2 x3
  • ELSE
  • Set x1 x3
  • ENDIF
  • END loop

5
Regula Flasi or Linear Interpolation
  • The program uses the slope
  • of the two points to find the
  • intersection. However, the
  • upper bound is kept constant.
  • The program uses a similar
  • triangle to estimate the
  • location of the root.

6
Linear Interpolation
  • Same example problem
  • f(x) x5 x3 4x2 - 3x - 2
  • roots are between (-1.7,-1.3), (-1,0), (0.5,1.5)

7
Regula Falsi Method
  • x1 f(x1) x2 f(x2)
    x2-x1 f(x2)-f(x1) x3 f(x3)
  • -1.7000 -4.4516 -1.3000 2.75007 0.4000
    7.2016 -1.45275 1.2635
  • -1.7000 -4.4516 -1.4528 1.2635 0.2472
    5.7143 -1.50743 0.40265
  • -1.7000 -4.4516 -1.5074 0.40265 0.1926
    4.8547 -1.52339 0.11307
  • -1.7000 -4.4516 -1.5234 0.11293 0.1766
    4.5645 -1.52777 0.03052
  • etc. etc. etc. etc. etc.
    etc. etc. etc.

8
Secant Method
  • The algorithm is similar to the linear
    interpolation method but it oscillates from one
    side to the next.
  • The method converges quickly with well behaved
    functions.

9
Secant Method
  • Do while x2 - x1 gt tolerance value 1
  • or f(x3)gt tolerance value 2
  • Set x3 x2 - f(x2)(x2 - x1)/(f(x2)-f(x1))
  • Set x1 x2
  • Set x2 x3
  • END loop

10
Comparison between Linear Interpolation and
Secant Method
  • The secant can be faster method, because it does
    not
  • have a large slope at the root.

11
Problems with the Secant Method
  • The convergence condition is
  • x3 x2 - f(x2)
  • (x2-x1)/(f(x2)-f(x1))
  • It is tempting to rewrite the
  • convergence condition.
  • x3 (f(x2)x1-f(x1) x2 )
  • /(f(x2)-f(x1))

12
Problems with the Secant Method
  • This method can be
  • catastrophic if the points
  • are near a point where the
  • first derivative is zero.
  • Example SecantProb
  • Try for the interval (1,3)

13
Secant Method
  • The Secant method is the same as the linear
    interpolation method, but you do not do a
    comparison between /- values and do the
    substitution.
  • Problem if the points are on opposite ends of a
    peak or trough.

14
Secant Method
  • x1 f(x1) x2 f(x2)
    x2-x1 f(x2)-f(x1) x3 f(x3)
  • -1.7000 -4.4516 -1.3000 2.7501 0.4000
    7.2016 -1.45275 1.2635
  • -1.4528 1.2635 -1.7000 -4.4516 -0.2472
    -5.7143 -1.50743 0.40265
  • -1.5074 0.4031 -1.4528 1.2635 0.0546
    0.8596 -1.53300 -0.07000
  • -1.5330 -0.0700 -1.5074 0.4031 0.0256
    0.4731 -1.52921 -0.00297
  • etc. etc. etc. etc. etc.
    etc. etc. etc.

15
Newtons Method
  • This method is one of the most widely used
    methods to solve equations also known as the
    Newton-Raphson.
  • The idea for the method comes from a Taylor
    series expansion, where you know the function and
    its first derivative.
  • f(xk1) f(xk) (xk1 - xk)f (xk) ...

16
Newtons Method
  • The goal of the calculations is to find a f(x)0,
    so set f(xk1) 0 and rearrange the equation.
    f (xk) is the first derivative of f(x).
  • 0 f(xk) (xk1 - xk)f (xk)
  • xk1 _at_ xk - f(xk) / f (xk)

17
Newton-Raphson Method
  • The method uses the
  • slope of the line to
  • project to the x axis and
  • find the root. The
  • method converges on the
  • solution quickly.

18
Newtons Method
  • Do while x2 - x1 gt tolerance value 1
  • or f(x2)gt tolerance value 2
  • or f(x1) 0
  • Set x2 x1 - f(x1)/f(x1)
  • Set x1 x2
  • END loop

19
Newtons Method
  • Same example problem
  • f(x) x5 x3 4x2 - 3x - 2
  • and
  • f(x) 5x4 3x2 8x - 3
  • roots are between (-1.7,-1.3), (-1,0), (0.5,1.5)

20
Newtons Method
  • x1 f(x1) f(x1) f(x1)/f(x1)
    x2
  • -2.0000 -20.0000 73.0000 -0.27397
    -1.7260
  • -1.7260 -5.3656 36.5037 -0.14699
    -1.5790
  • -1.5790 -1.0423 22.9290 -0.04546
    -1.5335
  • -1.5335 -0.0797 19.4275 -0.00410
    -1.5294
  • -1.5294 -0.0005 19.1381 -0.00003
    -1.5294
  • etc. etc. etc.
    etc. etc.

21
Mullers Method
  • Mullers method is an interpolation method that
    uses quadratic interpolation rather than linear.
  • A second degree polynomial is used to fit three
    points in the vicinity of the root.

22
Mullers Method
  • Do while x2 - x1 gt tolerance value 1
  • or f(x3) gt tolerance value 2
  • c1 (f(x2)-f(x1))/(x2 - x1)
  • c2 (f(x3)-f(x2))/(x3 - x2)
  • d1 (c2-c1)/(x3 - x1)
  • s c2 d1 (x3 - x2)
  • x4 x3 - 2f(x3)/
  • s sign(s)sqrt( s2
    -4f(x3)d1
  • Set x1 x2
  • Set x2 x3
  • Set x3 x4
  • END loop

23
Mullers Method
  • This method uses a Newton form of an
    interpolating polynomials.

24
Example Problem
  • f(x) x5 x3 4x2 - 3x - 2
  • The roots are around (-2,-1),(-1,0) and (0,1)
  • Look at (1,0) choice three points, 1.5, 0.5, 0.25

25
Mullers Method
  • x1 f(x1) x2 f(x2) x3
    f(x3) c1 c2 d1
    s1 x4
  • 1.5000 13.4688 0.2500 -2.4834 0.5000 -2.3438
    12.7617 0.5586 12.2031 3.6094 0.8145
  • 0.2500 -2.4834 0.5000 -2.3438 0.8145 -0.8900
    0.5586 4.6205 7.1938 6.8839 0.9300
  • 0.5000 -2.3438 0.8145 -0.8900 0.9300 0.1698
    4.6205 9.1854 10.6157 10.4101 0.9134
  • 0.8145 -0.8900 0.9300 0.1698 0.9134 -0.0049
    9.1854 10.5319 13.6309 10.3057 0.9139
  • etc. etc. etc. etc. etc. etc.
    etc. etc. etc. etc. etc.

26
Summary
  • Regula Flasi (linear interpolation) - need to
    know the function and two bounds.
  • Secant - need to know f(x) and two bounds.
  • Newtons - need to know f(x) and f(x) and an
    initial guess.

27
Summary
  • Mullers method -need to know the f(x) and 3
    values.

28
Homework
  • Check the Homework webpage
Write a Comment
User Comments (0)
About PowerShow.com