Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Chapter 6 Open Methods Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis Applied Numerical Method for Engineers
Review of previous method In the previous chapter, the root is located within an interval Lower bound Upper bound Repeated application if these methods always result in closer estimates of true value of the root These methods are said to be CONVERGENT because they move closer to the truth as computation progresses
Open Methods In contrast, the open methods are based on formulas that require only a single or two of x. Do not bracket the root. It is called as diverge or move away from the true root as the computation progresses. Fig (b) However, when it is converge (Fig. c), they do not so much more quickly than the bracketing method
Simple Fixed-Point Iteration This method also called as, simple fixed-point iteration, or one point iteration or successive substitution method Open methods employ formula to predict the root. The formula can be developed by rearranging the function f(x) = 0 so that x is on the left-hand side of the equation: Example: can be rearranged to:
Simple Fixed-Point Iteration The utility of is to provides a formula to predict a new value of x as function of an old value of x Thus given an initial guess at the root xi, it can be used to compute a new estimate xi+1 as expressed by the iterative formula: Thus the approximation error (as in the previous chapters) can be calculated as
Ex. 6.1 Simple Fixed-Point Iteration Use simple fixed-point iteration to locate the root of Solution The function can be separated directly and expressed in the form of With an initial guess of x0 =0, then the iterative equation can be calculated as
Ex. 6.1 Simple Fixed-Point Iteration an initial guess of x0 =0, true root: 0.56714329
Convergence Why this result can be called as convergence? Reading assignment: Read section 6.1.1 pp. 135
Ex. 6.2 Two-curve graphical method Separate the equation into two parts and determine its root graphically Solution Reformulate the equation as: and
In graphical methods The intersection of the two curves indicates a root estimate of approximately x =0.57
Exercise Use simple fixed-point iteration to locate the root of Use an initial guess of x0 = 0.5
Solution The first iteration is
Solution The remaining iterations are
The Newton-Raphson Methods The most widely used of all root-locating formula is the Newton-Raphson equation. If the initial guess at the root is xi, a tangent can be extended from the point [xi, f(xi)] The point where this tangent crosses the x axis usually represents an improved estimate of the root.
The Newton-Raphson Methods The Newton-Raphson method can be derived on the basis of this geometrical interpretation The first derivative at x is equivalent to the slope: which can be rearranged to yield
Ex. 6.3 Newton-Raphson Method Use the Newton-Raphson method to estimate the root of Employing an initial guess of x0 = 0 Solution The first derivative of the function can be evaluated as Which can be substituted along with the original function
Ex. 6.3 Newton-Raphson Method Starting with an initial guess of x0 = 0, this iterative equation can be applied to compute: The approach rapidly converges on the true root. Faster that by using simple fixed-point iteration
Termination Criteria and Error Estimates The approximate percent relative error can also be used as a termination criterion. Other criteria can also be obtained such as discussed in Example 6.4
Pitfalls of the Newton-Raphson Method Although the Newton-Raphson method is often very efficient, there are situations where it performs poorly. A special case – multiple roots – will be addressed later However, even when dealing with simple roots, difficulties can also arise, as in the following example
Ex. 6.5 Slowly Converging Function with Newton-Raphson Determine the positive root of f(x) = 1010-1 using the Newton-Raphson method and an initial guess of x = 0.5 Solution The Newton-Raphson formula for this case is Which can be used to compute:
Iteration results
Pitfalls of the Newton-Raphson Method
Pitfalls of the Newton-Raphson Method
The Secant Method A potential problem in implementing the Newton-Raphson method is the evaluation of the derivative. For polynomials and many other function this is not convenient There are certain function the derivative may be extremely difficult or inconvenient to evaluate
The Secant Method For these cases, the derivative can be approximated by a backward finite divided difference The secant method can be formulated as:
Graphical depiction of the secant method
Ex. 6.6 Use the secant method to estimate the root of f(x) = e-x – x. Start with the estimates of xi-1 = 0 and x0 = 1.0. Solution (true root = 0.56714329…) First iteration Xi-1 = 0 f(xi-1)=1.0 X0 = 1 f(x0) = -0.63212 Calculate t = 8.0%
Ex. 6.6 Solution (true root = 0.56714329…) Second iteration X0 = 1 f(x0)= - 0.63212 X1 = 0.61270 f(x1) = - 0.07081
Ex. 6.6 Solution (true root = 0.56714329…) Third iteration X0 = 0.61270 f(x1)= - 0.07081 X1 = 0.56384 f(x1) = 0.00518
Ex. 6.6x Use the secant method to estimate the root of f(x) = e-x – 2x. Start with the estimates of xi-1 = 0 and x0 = 1.0. Solution (true root = xxxx) First iteration Xi-1 = 0 f(xi-1)=xx X0 = 1 f(x0) = xxxx Calculate t = 8.0%
Next week Reading assignment: Read pp. 146 – 157 Read pp. 160 – 174
Quiz (60 Minutes) What do you know about mathematical model in solving engineering problem? (10 marks) Use zero through third order Taylor series expansions to predict f(2.5) for f(x) = ln x using a base point at x = 1. Compute the true percent relative error for each approximation. (15 marks) Determine the real root of f(x)= 5x3-5x2+6x-2 using bisection method. Employ initial guesses of xl = 0 and xu = 1. iterate until the estimated error a falls below a level of s = 15% (20 marks)
The difference between the Secant and False-Position Methods Similarity of Secant and False-Position Methods The approximate root equation are identical on a term by term basis Both of them use two initial estimates to compute an approximation of the slope. Critical difference: How in both methods the new estimate replaces the initial value False Position Method Secant Method
The false-position method Ex. 6.7 Use the false-position and secant methods to estimate the root of f(x) = ln x. Start the computation with value of xl = xi-1 = 0.5 xu = xi = 5.0 Solution The false-position method The secant method
Modified Secant Method Original Secant Method Modified Secant Method
Ex. 6.8 Use the secant method to estimate the root of f(x) = e-x – x. Use a value of 0.01 for and start with x0 = 1.0. Solution (true root = 0.56714329…) First iteration x0 = 1 f(x0) = -0.63212 x1+ x0 = 1.01 f(x1+ x0) = -0.64578 Calculate t = 5.3%
Ex. 6.8 Solution (true root = 0.56714329…) Second iteration x0 = 0.537263 f(x0) = -0.047083 x1+ x0 = 0.542635 f(x1+ x0) = -0.038579 Calculate t = 0.0236%
Ex. 6.8 Solution (true root = 0.56714329…) Third iteration x0 = 0.56701 f(x0) = 0.000209 x1+ x0 = 0.572680 f(x1+ x0) = -0.00867 Calculate t = 2.365x10-5 %
Multiple Roots
Multiple Roots
Modified Newton-Raphson A modifications have been proposed by Ralston and Rabinowitz (1978) Original Newton-Raphson Modified Newton-Raphson
Ex. 6.9 Original Newton-Raphson Use both the standard ad modified Newton-Raphson methods to evaluate the multiple root of f(x) = (x-3)(x-1)(x-1) with initial guess of x0 = 0. Solution (true value: 1.0) First derivative: f’(x) = 3x2 - 10x + 7 Second derivative f’’(x) = 6x - 10 Modified Newton-Raphson
Original Newton-Raphson Method
Modified Newton-Raphson Method
Ex. 6.9 For both methods to search for single root at x = 3 using initial guess of x0 = 4 Both methods converge quickly, with the standard method being somewhat more efficient
Modified secant method For multiple root secant method can be modified as:
System of Nonlinear Equations We have discussed on the determination of roots of single equation How about locating roots of a set of simultaneous equations Nonlinear equations is algebraic and transcendental equations that do not fit following format
By Fixed-Point Iteration Non linear equations: Two simultaneous nonlinear equation with two unknown, x and y.
6.10 Use fixed-point iteration to determine the root of Eq. (6.16). Note that a correct pair of roots is x = 2 and y = 3. Initiate the computation with guesses of the x = 1.5 and y = 3.5. Solution
6.10 Solution On the basis of the initial value x = 1.5 and y = 3.5
6.10 Solution On the basis of the initial value x = 1.5 and y = 3.5
6.10 Solution On the basis of the initial value x = 1.5 and y = 3.5
6.10
By Newton-Raphson
Assignment Solve problem 6.2