1 / 8

Chapter 2

Chapter 2. Solution of Nonlinear Equations: Lecture (III). Outline. Numerical methods (3) Secant method. Secant method. Secant method algorithm: An approximation to the derivative: 1. Start with two initial guesses x 1 and x 2 and . set i = 2. 2. Find the new approximation, x i+1 .

hung
Télécharger la présentation

Chapter 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2 Solution of Nonlinear Equations: Lecture (III)

  2. Outline • Numerical methods (3) Secant method

  3. Secant method • Secant method algorithm: An approximation to the derivative: 1. Start with two initial guesses x1 and x2 and . set i = 2. 2. Find the new approximation, xi+1. 3. Verify the convergence. If |f(xi+1)|, stop the process by taking xi+1 as the root. Otherwise, set i=i+1 and go to step 2.

  4. Notes on Secant method • Secant method is similar to Newton’s method but uses a back-ward finite-difference approximation for the derivative, f’(x). • Secant method may not converge (see an example on the left).

  5. Example: Secant method • Example 2.14: Find the root of the equation using Secant method with two initial guesses xl = 0.0 and x2 = 0.5 and the convergence criterion, |f(xi)|   with  = 10-5.

  6. x1=0.0, x2=0.5, =10-5, i=2 i=i+1 F |f(xi+1)|   T x_Root=xi+1 end Secant Method Flowchart

  7. Implement Secant method: by hand • Show work step by step. Keep up to 8 decimal places in your calculations. • Also, summarize the results in the Table below.

  8. Implement Secant method: write an M-file • For the Example given on slide #5, write an M-file to compute the root of the equation using Secant method. • Follow the flowchart provided previously. • Save the M-file as mySecant.m. • A copy of the M-file will be handed out later.

More Related