Download presentation
Presentation is loading. Please wait.
Published byRalf Hall Modified over 9 years ago
1
Dr. Jie Zou PHY 33201 Chapter 2 Solution of Nonlinear Equations: Lecture (II)
2
Dr. Jie Zou PHY 33202 Outline Numerical methods (2) Newton-Raphson (or simply Newton’s) method
3
Dr. Jie Zou PHY 33203 Newton-Paphson method Newton’s method algorithm: x 1 : The initial guess for the root of f(x) = 0. x 2 : The next approximation to the root. The point of intersection of the tangent to the curve at x 1 with the x axis gives x 2. The iterative procedure stops when meeting a convergence criterion: |f(x i )| , |x i –x i-1 | , or |(x i -x i-1 )/x i | .
4
Dr. Jie Zou PHY 33204 Derivation of the Newton’s method Taylor’s series expansion of the function f(x) about an arbitrary point x 1 : Considering only the first two terms in the expansion: f(x) f(x 1 ) + (x – x 1 ) f ’ (x 1 ) Set f(x) f(x 1 ) + (x – x 1 ) f ’ (x 1 ) = 0, and solve for the root: To further improve the root, replace x 2 with x 1 to obtain x 3, and so on.
5
Dr. Jie Zou PHY 33205 Notes on Newton’s method Newton’s method requires the derivative of the function, f’ = df/dx; some may be quite complicated. f(x) may not be available in explicit form, in which case numerical differentiation techniques are required. Newton’s method converges very fast in most cases. However, it may not converge (see examples on the left).
6
Dr. Jie Zou PHY 33206 Example: Newton’s method Example 2.8: Find the root of the equation using the Newton-Raphson method with starting point x 1 = 0.0, and the convergence criterion, |f(x i )| with = 10 -5. Note: The derivative of tan -1 (u) is given by
7
Dr. Jie Zou PHY 33207 Plot function f(x) Let’s first plot the function f(x) from x = 0 to 1 to gain some insight on the behavior of the function. Root
8
Dr. Jie Zou PHY 33208 Flowchart x 1 =0.0, =10 -5, i=0 i=i+1 |f(x i )| x_Root=x i end T F
9
Dr. Jie Zou PHY 33209 Implement Newton’s method: by hand ixixi f(x i ) Is |f(x i )| ? f’(x i ) (answer if the previous column is No 1 2 3 4 … Show work step by step. Also, summarize the results in the Table below.
10
Dr. Jie Zou PHY 332010 Implement Newton’s method: write an M-file For the Example given on slide #6, write an M-file to compute the root of the equation using Newton-Raphson method. Follow the flowchart provided previously. Save the M-file as myNewton- Raphson.m. A copy of the M-file will be handed out later.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.