Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.

Slides:



Advertisements
Similar presentations
Chapter 6: Roots: Open Methods
Advertisements

Lecture 5 Newton-Raphson Method
Part 2 Chapter 6 Roots: Open Methods
Roundoff and truncation errors
CSE 330: Numerical Methods
Roots of Equations Our first real numerical method – Root finding
Open Methods Chapter 6 The Islamic University of Gaza
ROOTS OF EQUATIONS Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 61.
Open Methods Chapter 6 The Islamic University of Gaza
Open Methods Chapter 6 The Islamic University of Gaza
Chapter 4 Roots of Equations
PHYS2020 NUMERICAL ALGORITHM NOTES ROOTS OF EQUATIONS.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 51.
Roots of Equations Open Methods (Part 2).
A few words about convergence We have been looking at e a as our measure of convergence A more technical means of differentiating the speed of convergence.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 6 Roots of Equations Bracketing Methods.
Open Methods (Part 1) Fixed Point Iteration & Newton-Raphson Methods
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 9 Roots of Equations Open Methods.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Martin Mendez UASLP Chapter 61 Unit II.
Systems of Non-Linear Equations
Open Methods Chapter 6 The Islamic University of Gaza
Dr. Marco A. Arocha Aug,  “Roots” problems occur when some function f can be written in terms of one or more dependent variables x, where the.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open Methods.
Bracketing Methods Chapter 5 The Islamic University of Gaza
Roots of Equations Open Methods Second Term 05/06.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Solving ODE.
Roots of Equations Chapter 3. Roots of Equations Also called “zeroes” of the equation –A value x such that f(x) = 0 Extremely important in applications.
Solving Non-Linear Equations (Root Finding)
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 Roots of Equations Why? But.
Chapter 6 Finding the Roots of Equations
Introduction This chapter gives you several methods which can be used to solve complicated equations to given levels of accuracy These are similar to.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Lecture 3 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Open Methods Chapter 6 Credit:
Lecture 6 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
1 Solution of Nonlinear Equation Dr. Asaf Varol
Numerical Methods for Engineering MECN 3500
Numerical Methods.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Bracketing Methods Chapter 5.
Newton’s Method, Root Finding with MATLAB and Excel
Today’s class Roots of equation Finish up incremental search
MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
4 Numerical Methods Root Finding Secant Method Modified Secant
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods.
Solving Non-Linear Equations (Root Finding)
Numerical Methods Solution of Equation.
Today’s class Numerical differentiation Roots of equation Bracketing methods Numerical Methods, Lecture 4 1 Prof. Jinbo Bi CSE, UConn.
4 Numerical Methods Root Finding Secant Method Modified Secant
SOLVING NONLINEAR EQUATIONS. SECANT METHOD MATH-415 Numerical Analysis 1.
4 Numerical Methods Root Finding.
CSE 330: Numerical Methods. What is true error? True error is the difference between the true value (also called the exact value) and the approximate.
Lecture 4 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Numerical Methods and Optimization C o u r s e 1 By Bharat R Chaudhari.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 / Chapter 5.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
~ Roots of Equations ~ Bracketing Methods Chapter 5
Part 2 Chapter 6 Roots: Open Methods
Chapter 6.
Part 2 / Chapter 5.
Computers in Civil Engineering 53:081 Spring 2003
SOLUTION OF NONLINEAR EQUATIONS
4 Numerical Methods Root Finding.
Chapter 6.
Part 2 Chapter 6 Roots: Open Methods
1 Newton’s Method.
Presentation transcript:

Chapter 3 Roots of Equations

Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine a root graphically Knowing how to solve a root problem with bracketing method Understand the open method and recognize the difference between the open and bracketing methods Knowing how to use MATLAB built-in function

Content Introduction Graphical method Bracketing method (Bisection and false position) Open method (Newton Raphson and secant methods) MATLAB built-in function Conclusion

Introduction Many engineering and science problems predict dependent variable(s) as a function of independent variables Heat balance : time : time&space Mass balance : mass concen. : time&space Kirchoff’s law: current/voltage : time

Introduction (cont’d) See the previous assignment you encountered 1 km What is the ground velocity ? Says that u know the velocity t=0, v = 0;

Introduction (cont’d) from Find the distant hence Find t 1km that s = 1000 m from

Introduction (cont’d) So solve t 1km from Can u solve the above equation for t 1km ? Of course, the equation is nonlinear and t 1km is an implicit variable !!

Introduction (cont’d) If we are solving a simple nonlinear equation, it’s piece of cake. But what about these Yes, it’s time for numerical methods !!!

Introduction (cont’d) Nonlinear Equation Solvers Bracketing Bisection False Position (Regula-Falsi ) GraphicalOpen Methods Newton Raphson Secant All Iterative

Graphical… Graphical method means that we plot graph from the target nonlinear equation and observe the zero of it !! Very simple but too iterative. Here try with parachutist problem…..

Graphical… (cont’d) Start with the distant equation Find t 1km such that is satisfied. Plot f(t 1km ) from t 1km = {0,T} make sure that the zero of f(t 1km ) falls within this interval.

Graphical… (cont’d) Try with MATLAB to plot the function from t=0,..,50 Utilize the command “inline” zero Around 12.7, more accurate result can attained if u zoom in the figure !!

Bisection

Bracketing… Sometimes called two-point method Underline principle Root of f (x) is bounded by {x L,x U } where f(x L )f(x U ) < 0

Bisection (cont’d) How many iterations will it take? Length of the first IntervalΔx 0 =b-a After 1 iterationε a (1)=Δx 0 /2 After 2 iterationsε a (2) =Δx 0 /4 After k iterations ε a (n) =Δx 0 /2 n

Bracketing:Bisection For the arbitrary equation of one variable, f(x)=0 1. Pick x l and x u such that they bound the root of interest, check if f(x l ).f(x u ) <0. 2. Estimate the root by evaluating f[(x l +x u )/2]. 3. Find the pair If f(x l ). f[(x l +x u )/2]<0, root lies in the lower interval, then x u =(x l +x u )/2 and go to step 2.

Bisection (cont’d) If f(x l ). f[(x l +x u )/2]>0, root lies in the upper interval, then x l = [(x l +x u )/2, go to step 2. If f(x l ). f[(x l +x u )/2]=0, then root is (x l +x u )/2 and terminate. 4. Compare  s with  a 5. If  a <  s, stop. Otherwise repeat the process.

Bisection (cont’d)

Evaluation of Method Pros Easy Always find root Number of iterations required to attain an absolute error can be computed a priori. Cons Slow Know a and b that bound root Multiple roots No account is taken of f(x l ) and f(x u ), if f(x l ) is closer to zero, it is likely that root is closer to x l.

Bisection (cont’d) If the absolute magnitude of the error ε s = 1e-4 and L o =2, how many iterations will you have to do to get the required accuracy in the solution? Try with simple example : f=sin(10x)+cos(3x) [x=3.7,3.9] e s = 10 -5

Bisection (cont’d) MATLAB: Try with the parachutist problem in Chapter 1 Find t 1km for m = 68.1 kg, c = 12.5 kg/s given that L 0 = 60s and ε s = Plot approximation error and true error

False position If a real root is bounded by x l and x u of f(x)=0, then we can approximate the solution by doing a linear interpolation between the points [x l, f(x l )] and [x u, f(x u )] to find the x r value such that l(x r )=0, where l(x) is the linear approximation of f(x).

False position (cont’d) 1. Find a pair of values of x, x l and x u such that f l =f(x l ) Estimate the value of the root from the following formula and evaluate f(x r ). Procedure

False position (cont’d) Procedure (cont’d) 3. Use the new point to replace one of the original points, keeping the two points on opposite sides of the x axis. If f(x r ) f l =f(x r ) If f(x r )>0 then x u =x r == > f u =f(x r ) If f(x r )=0 then you have found the root and need go no further!

False position (cont’d) Procedure (cont’d) 4. See if the new x l and x u are close enough for convergence to be declared. If they are not go back to step 2. Now u may wonder how good of this technique is? Comparing with the bisection method, which one is better ? I would like u try this method with parachutist problem.

False position… (cont’d) Why this method? Faster Always converges for a single root. Pitfalls of the False-Position Method. Method applied to some curvature functions may slowly converge.

Open methods Open methods are based on formulas that require only a single starting value of x or two starting values that do not necessarily bracket the root.

Fixed-point…(cont’d) Bracketing methods are “convergent”. Fixed-point methods may sometime “diverge”, depending on the stating point (initial guess) and how the function behaves. Rearrange the function so that x is on the left side of the equation:

Fixed-point…(cont’d) Convergence x=g(x) can be expressed as a pair of equations: y 1 =x y 2 =g(x) (component equations) Plot them separately.

Fixed-point…(cont’d) Fixed-point iteration converges if When the method converges, the error is roughly proportional to or less than the error of the previous step, therefore it is called “linearly convergent.”

Fixed-point…(cont’d) Example Rearrange x = g(x)

Newton-Raphson Most widely used method. Based on Taylor series expansion: Newton-Raphson formula Solve for

Newton-Raphson… (cont’d) A convenient method for functions whose derivatives can be evaluated analytically. It may not be convenient for functions whose derivatives cannot be evaluated analytically.

Newton-Raphson… (cont’d)

Secant method A slight variation of Newton’s method for functions whose derivatives are difficult to evaluate. For these cases the derivative can be approximated by a backward finite divided difference.

Secant method(cont’d) Requires two initial estimates of x, e.g, x o, x 1. However, because f(x) is not required to change signs between estimates, it is not classified as a “bracketing” method. The scant method has the same properties as Newton’s method. Convergence is not guaranteed for all x o, f(x).

Secant method(cont’d)