Solutions of Equations in One Variable. Secant & Regula Falsi Methods

Similar documents
Solution of Equations

Numerical Analysis Math 370 Spring 2009 MWF 11:30am - 12:25pm Fowler 110 c 2009 Ron Buckmire

Numerical Differentiation & Integration. Romberg Integration

lecture 31: The Secant Method: Prototypical Quasi-Newton Method

CS 3331 Numerical Methods Lecture 2: Functions of One Variable. Cherung Lee

February 2 Math 2335 sec 51 Spring 2016

Feb. 4 Math 2335 sec 001 Spring 2014

Makinde, V. 1,. Akinboro, F.G 1., Okeyode, I.C. 1, Mustapha, A.O. 1., Coker, J.O. 2., and Adesina, O.S. 1.

69

CS227-Scientific Computing. Lecture 6: Nonlinear Equations

Golden-Section Search for Optimization in One Dimension

Chapter 7 One-Dimensional Search Methods

The method of false position is also an Enclosure or bracketing method. For this method we will be able to remedy some of the minuses of bisection.

Week 1 Quantitative Analysis of Financial Markets Distributions B

Confidence Intervals for Paired Means with Tolerance Probability

Math Lab 5 Assignment

Figure (1) The approximation can be substituted into equation (1) to yield the following iterative equation:

Finding Roots by "Closed" Methods

EGR 102 Introduction to Engineering Modeling. Lab 09B Recap Regression Analysis & Structured Programming

This method uses not only values of a function f(x), but also values of its derivative f'(x). If you don't know the derivative, you can't use it.

Lecture Quantitative Finance Spring Term 2015

NUMERICAL MATHEMATICS & COMPUTING, 7 Ed. 4.3 Estimating Derivatives and Richardson Extrapolation

The Impact of Computational Error on the Volatility Smile

Two-Sample Z-Tests Assuming Equal Variance

Richardson Extrapolation Techniques for the Pricing of American-style Options

Chapter 3 Mathematics of Finance

Principles of Financial Computing

Some derivative free quadratic and cubic convergence iterative formulas for solving nonlinear equations

9.2 Secant Method, False Position Method, and Ridders Method

On the use of time step prediction

Finding Zeros of Single- Variable, Real Func7ons. Gautam Wilkins University of California, San Diego

Accurate estimates of current hotel mortgage costs are essential to estimating

Answers are on next slide. Graphs follow.

Answers are on next slide. Graphs follow.

PRMIA Exam 8002 PRM Certification - Exam II: Mathematical Foundations of Risk Measurement Version: 6.0 [ Total Questions: 132 ]

Confidence Intervals for the Difference Between Two Means with Tolerance Probability

Computing Derivatives With Formulas (pages 12-13), Solutions

Nominal and Effective Interest Rates

Numerical Evaluation of Multivariate Contingent Claims

Chapter 5 Finite Difference Methods. Math6911 W07, HM Zhu

3.1 Introduction. 3.2 Growth over the Very Long Run. 3.1 Introduction. Part 2: The Long Run. An Overview of Long-Run Economic Growth

Group-Sequential Tests for Two Proportions

COPYRIGHTED MATERIAL. Time Value of Money Toolbox CHAPTER 1 INTRODUCTION CASH FLOWS

Week 2 Quantitative Analysis of Financial Markets Hypothesis Testing and Confidence Intervals

Version A. Problem 1. Let X be the continuous random variable defined by the following pdf: 1 x/2 when 0 x 2, f(x) = 0 otherwise.

Socio-economic Series Changes in Household Net Worth in Canada:

1/12/2011. Chapter 5: z-scores: Location of Scores and Standardized Distributions. Introduction to z-scores. Introduction to z-scores cont.

Third-order iterative methods. free from second derivative

ESG Yield Curve Calibration. User Guide

4 Reinforcement Learning Basic Algorithms

Confidence Intervals for Pearson s Correlation

3.1 Simple Interest. Definition: I = Prt I = interest earned P = principal ( amount invested) r = interest rate (as a decimal) t = time

Appendix A Financial Calculations

CHAPTER 8. Consumer Mathematics and Financial Management Pearson Prentice Hall. All rights reserved.

Time value of money-concepts and Calculations Prof. Bikash Mohanty Department of Chemical Engineering Indian Institute of Technology, Roorkee

Short-time-to-expiry expansion for a digital European put option under the CEV model. November 1, 2017

x f(x) D.N.E

Queens College, CUNY, Department of Computer Science Computational Finance CSCI 365 / 765 Spring 2018 Instructor: Dr. Sateesh Mane. September 16, 2018

Homework Assignments

UNIT 5 COST OF CAPITAL

Interest Compounded Annually. Table 3.27 Interest Computed Annually

Computational Finance. Computational Finance p. 1

Investment 3.1 INTRODUCTION. Fixed investment

Relations between Prices, Dividends and Returns. Present Value Relations (Ch7inCampbell et al.) Thesimplereturn:

1, are not real numbers.

Investment and Taxation in Germany - Evidence from Firm-Level Panel Data Discussion

Lecture Slides. Elementary Statistics Tenth Edition. by Mario F. Triola. and the Triola Statistics Series

Comment Does the economics of moral hazard need to be revisited? A comment on the paper by John Nyman

MATH 104 Practice Problems for Exam 3

Percentage Change and Elasticity

Self-Fulfilling Inflationary Expectations

Analysing and computing cash flow streams

Topic 3: Endogenous Technology & Cross-Country Evidence

KING FAHAD UNIVERSITY OF PETROLEUM & MINERALS COLLEGE OF ENVIROMENTAL DESGIN CONSTRUCTION ENGINEERING & MANAGEMENT DEPARTMENT

Simulation. Decision Models

Web Extension 25A Multiple Discriminant Analysis

MATH 104 Practice Problems for Exam 3

Active Scottish Economy in recession over 2016

F A S C I C U L I M A T H E M A T I C I

Point Estimation. Copyright Cengage Learning. All rights reserved.

(Refer Slide Time: 2:56)

Mortality Rates Estimation Using Whittaker-Henderson Graduation Technique

MAC Learning Objectives. Learning Objectives (Cont.)

Descriptive Statistics

THE COST VOLUME PROFIT APPROACH TO DECISIONS

Estimating the Distortionary Costs of Income Taxation in New Zealand

The Impact of Tax Policies on Economic Growth: Evidence from Asian Economies

Structured RAY Risk-Adjusted Yield for Securitizations and Loan Pools

MA Macroeconomics 11. The Solow Model

Tolerance Intervals for Any Data (Nonparametric)

Math Analysis Midterm Review. Directions: This assignment is due at the beginning of class on Friday, January 9th

Part 3: Trust-region methods for unconstrained optimization. Nick Gould (RAL)

Econ 582 Nonlinear Regression

Advanced Topic 7: Exchange Rate Determination IV

Regression Review and Robust Regression. Slides prepared by Elizabeth Newton (MIT)

Risk management methodology in Latvian economics

Productivity Trends of New Zealand Electricity Distributors

V(0.1) V( 0.5) 0.6 V(0.5) V( 0.5)

Dynamic Programming: An overview. 1 Preliminaries: The basic principle underlying dynamic programming

Introduction to Numerical Methods (Algorithm)

Transcription:

Solutions of Equations in One Variable Secant & Regula Falsi Methods Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011 Brooks/Cole, Cengage Learning

Outline 1 Secant Method: Derivation & Algorithm 2 Comparing the Secant & Newton s Methods 3 The Method of False Position (Regula Falsi) Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 2 / 25

Outline 1 Secant Method: Derivation & Algorithm 2 Comparing the Secant & Newton s Methods 3 The Method of False Position (Regula Falsi) Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 3 / 25

Rationale for the Secant Method Problems with Newton s Method Newton s method is an extremely powerful technique, but it has a major weakness: the need to know the value of the derivative of f at each approximation. Frequently, f (x) is far more difficult and needs more arithmetic operations to calculate than f(x). Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 4 / 25

Derivation of the Secant Method f (p n 1 ) = f(x) f(p n 1 ) lim. x p n 1 x p n 1 Circumvent the Derivative Evaluation If p n 2 is close to p n 1, then f (p n 1 ) f(p n 2) f(p n 1 ) p n 2 p n 1 = f(p n 1) f(p n 2 ) p n 1 p n 2. Using this approximation for f (p n 1 ) in Newton s formula gives p n = p n 1 f(p n 1)(p n 1 p n 2 ) f(p n 1 ) f(p n 2 ) This technique is called the Secant method Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 5 / 25

Secant Method: Using Successive Secants y y 5 f (x) p 3 p 0 p 2 p p 1 p 4 x Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 6 / 25

The Secant Method p n = p n 1 f(p n 1)(p n 1 p n 2 ) f(p n 1 ) f(p n 2 ) Procedure Starting with the two initial approximations p 0 and p 1, the approximation p 2 is the x-intercept of the line joining (p 0, f(p 0 )) and (p 1, f(p 1 )). The approximation p 3 is the x-intercept of the line joining (p 1, f(p 1 )) and (p 2, f(p 2 )), and so on. Note that only one function evaluation is needed per step for the Secant method after p 2 has been determined. In contrast, each step of Newton s method requires an evaluation of both the function and its derivative. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 7 / 25

The Secant Method: Algorithm To find a solution to f(x) = 0 given initial approximations p 0 and p 1 ; tolerance TOL; maximum number of iterations N 0. 1 Set i = 2, q 0 = f(p 0 ), q 1 = f(p 1 ) 2 While i N 0 do Steps 3 6: 3 Set p = p 1 q 1 (p 1 p 0 )/(q 1 q 0 ). (Compute p i ) 4 If p p 1 < TOL then OUTPUT (p); (The procedure was successful.) STOP 5 Set i = i + 1 6 Set p 0 = p 1 ; (Update p 0, q 0, p 1, q 1 ) q 0 = q 1 ; p 1 = p; q 1 = f(p) 7 OUTPUT ( The method failed after N 0 iterations, N 0 =, N 0 ); (The procedure was unsuccessful) STOP Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 8 / 25

Outline 1 Secant Method: Derivation & Algorithm 2 Comparing the Secant & Newton s Methods 3 The Method of False Position (Regula Falsi) Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 9 / 25

Comparing the Secant & Newton s Methods Example: f(x) = cos x x Use the Secant method to find a solution to x = cos x, and compare the approximations with those given by Newton s method with p 0 = π/4. Formula for the Secant Method We need two initial approximations. Suppose we use p 0 = 0.5 and p 1 = π/4. Succeeding approximations are generated by the formula p n = p n 1 (p n 1 p n 2 )(cos p n 1 p n 1 ), for n 2. (cos p n 1 p n 1 ) (cos p n 2 p n 2 ) Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 10 / 25

Comparing the Secant & Newton s Methods Newton s Method for f(x) = cos(x) x, p 0 = π 4 n p n 1 f (p n 1 ) f (p n 1 ) p n p n p n 1 1 0.78539816-0.078291-1.707107 0.73953613 0.04586203 2 0.73953613-0.000755-1.673945 0.73908518 0.00045096 3 0.73908518-0.000000-1.673612 0.73908513 0.00000004 4 0.73908513-0.000000-1.673612 0.73908513 0.00000000 An excellent approximation is obtained with n = 3. Because of the agreement of p 3 and p 4 we could reasonably expect this result to be accurate to the places listed. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 11 / 25

Comparing the Secant & Newton s Methods Secant Method for f(x) = cos(x) x, p 0 = 0.5, p 1 = π 4 n p n 2 p n 1 p n p n p n 1 2 0.500000000 0.785398163 0.736384139 0.0490140246 3 0.785398163 0.736384139 0.739058139 0.0026740004 4 0.736384139 0.739058139 0.739085149 0.0000270101 5 0.739058139 0.739085149 0.739085133 0.0000000161 Comparing results, we see that the Secant Method approximation p 5 is accurate to the tenth decimal place, whereas Newton s method obtained this accuracy by p 3. Here, the convergence of the Secant method is much faster than functional iteration but slightly slower than Newton s method. This is generally the case. Order of Convergence Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 12 / 25

The Secant Method Final Remarks The Secant method and Newton s method are often used to refine an answer obtained by another technique (such as the Bisection Method). Both methods require good first approximations but generally give rapid acceleration. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 13 / 25

Outline 1 Secant Method: Derivation & Algorithm 2 Comparing the Secant & Newton s Methods 3 The Method of False Position (Regula Falsi) Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 14 / 25

The Method of False Position Bracketing a Root Unlike the Bisection Method, root bracketing is not guaranteed for either Newton s method or the Secant method. The method of False Position (also called Regula Falsi) generates approximations in the same manner as the Secant method, but it includes a test to ensure that the root is always bracketed between successive iterations. Although it is not a method we generally recommend, it illustrates how bracketing can be incorporated. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 15 / 25

The Method of False Position Construction of the Method First choose initial approximations p 0 and p 1 with f(p 0 ) f(p 1 ) < 0. The approximation p 2 is chosen in the same manner as in the Secant method, as the x-intercept of the line joining (p 0, f(p 0 )) and (p 1, f(p 1 )). To decide which secant line to use to compute p 3, consider f(p 2 ) f(p 1 ), or more correctly sgn f(p 2 ) sgn f(p 1 ): If sgn f(p 2 ) sgn f(p 1 ) < 0, then p 1 and p 2 bracket a root. Choose p 3 as the x-intercept of the line joining (p 1, f(p 1 )) and (p 2, f(p 2 )). If not, choose p 3 as the x-intercept of the line joining (p 0, f(p 0 )) and (p 2, f(p 2 )), and then interchange the indices on p 0 and p 1. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 16 / 25

The Method of False Position Construction of the Method (Cont d) In a similar manner, once p 3 is found, the sign of f(p 3 ) f(p 2 ) determines whether we use p 2 and p 3 or p 3 and p 1 to compute p 4. In the latter case, a relabeling of p 2 and p 1 is performed. The relabelling ensures that the root is bracketed between successive iterations. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 17 / 25

Secant Method & Method of False Position Secant method Method of False Position y y 5 f (x) y y 5 f (x) p 2 p 3 p 2 p 3 p 0 p 4 p 1 x p 0 p4 p 1 x In this illustration, the first three approximations are the same for both methods, but the fourth approximations differ. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 18 / 25

The Method of False Position: Algorithm To find a solution to f(x) = 0, given the continuous function f on the interval [p 0, p 1 ] (where f(p 0 ) and f(p 1 ) have opposite signs) tolerance TOL and maximum number of iterations N 0. 1 Set i = 2; q 0 = f(p 0 ); q 1 = f(p 1 ). 2 While i N 0 do Steps 3 7: 3 Set p = p 1 q 1 (p 1 p 0 )/(q 1 q 0 ). (Compute p i ) 4 If p p 1 < TOL then OUTPUT (p); (The procedure was successful): STOP 5 Set i = i + 1; q = f(p) 6 If q q 1 < 0 then set p 0 = p 1 ; q 0 = q 1 7 Set p 1 = p; q 1 = q 8 OUTPUT ( Method failed after N 0 iterations, N 0 =, N 0 ); (The procedure was unsuccessful): STOP Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 19 / 25

The Method of False Position: Numerical Calculations Comparison with Newton & Secant Methods Use the method of False Position to find a solution to x = cos x, and compare the approximations with those given in a previous example which Newton s method and the Secant Method. To make a reasonable comparison we will use the same initial approximations as in the Secant method, that is, p 0 = 0.5 and p 1 = π/4. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 20 / 25

The Method of False Position: Numerical Calculations Comparison with Newton s Method & Secant Method False Position Secant Newton n p n p n p n 0 0.5 0.5 0.7853981635 1 0.7853981635 0.7853981635 0.7395361337 2 0.7363841388 0.7363841388 0.7390851781 3 0.7390581392 0.7390581392 0.7390851332 4 0.7390848638 0.7390851493 0.7390851332 5 0.7390851305 0.7390851332 6 0.7390851332 Note that the False Position and Secant approximations agree through p 3 and that the method of False Position requires an additional iteration to obtain the same accuracy as the Secant method. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 21 / 25

The Method of False Position Final Remarks The added insurance of the method of False Position commonly requires more calculation than the Secant method,... just as the simplification that the Secant method provides over Newton s method usually comes at the expense of additional iterations. Numerical Analysis (Chapter 2) Secant & Regula Falsi Methods R L Burden & J D Faires 22 / 25

Questions?

Reference Material

Order of Convergence of the Secant Method Exercise 14, Section 2.4 It can be shown (see, for example, Dahlquist and Å. Björck (1974), pp. 228 229), that if {p n } n=0 are convergent Secant method approximations to p, the solution to f(x) = 0, then a constant C exists with p n+1 p C p n p p n 1 p for sufficiently large values of n. Assume {p n } converges to p of order α, and show that α = (1 + 5)/2 (Note: This implies that the order of convergence of the Secant method is approximately 1.62). Return to the Secant Method Dahlquist, G. and Å. Björck (Translated by N. Anderson), Numerical methods, Prentice-Hall, Englewood Cliffs, NJ, 1974.