Root Finding UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

Differential Equations Brannan Copyright © 2010 by John Wiley & Sons, Inc. All rights reserved. Chapter 08: Series Solutions of Second Order Linear Equations.
ROOTS OF EQUATIONS Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Chapter 6 Open Methods.
Second Term 05/061 Roots of Equations Bracketing Methods.
Roots of Equations Bracketing Methods.
Notes, part 5. L’Hospital Another useful technique for computing limits is L'Hospital's rule: Basic version: If, then provided the latter exists. This.
Systems of Non-Linear Equations
Nonlinear Algebraic Systems 1.Iterative solution methods 2.Fixed-point iteration 3.Newton-Raphson method 4.Secant method 5.Matlab tutorial 6.Matlab exercise.
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.
FP1: Chapter 2 Numerical Solutions of Equations
Fin500J: Mathematical Foundations in Finance Topic 3: Numerical Methods for Solving Non-linear Equations Philip H. Dybvig Reference: Numerical Methods.
Solving ODEs UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
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.
Numerical Integration UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
Solving Non-Linear Equations (Root Finding)
Solving Linear Equations UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
Bell Work: Find the values of all the unknowns: R T = R T T + T = 60 R = 3 R =
CMPSC 200 Spring 2013 Lecture 38 November 18 or 20, 2013 (depending on section)
Chapter 6 Finding the Roots of Equations
Time Complexity UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Regression UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Recursion and Induction UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
Solving Quadratic Equations by Factoring. Solution by factoring Example 1 Find the roots of each quadratic by factoring. factoring a) x² − 3x + 2 b) x².
Newton’s Method Other Recursive Methods Modified Fixed Point Method.
Sorting UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
EE:211 Computational Techniques in Electrical Engineering Lecture#2
Script Files UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Numerical Methods.
Numerical Differentiation UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under.
CHAPTER 3 NUMERICAL METHODS
Searching UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Example Ex. Find Sol. So. Example Ex. Find (1) (2) (3) Sol. (1) (2) (3)
Newton’s Method, Root Finding with MATLAB and Excel
linear  2.3 Newton’s Method ( Newton-Raphson Method ) 1/12 Chapter 2 Solutions of Equations in One Variable – Newton’s Method Idea: Linearize a nonlinear.
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
Polynomials UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Solution of Nonlinear Equations Topic: Bisection method
Numerical Methods Solution of Equation.
More Functions in MATLAB. Functions that operate on other functions A function F() can take another function G() as an argument by using a notation:
§3.6 Newton’s Method. The student will learn about
4 Numerical Methods Root Finding Secant Method Modified Secant
Linearization, Newton’s Method
Get/Set Methods UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Solving Quadratic Functions by Factoring. Factoring Review.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
Solution of Nonlinear Equations ( Root Finding Problems )
Chapter 5 Numerical Root Findings
4 Numerical Methods Root Finding Secant Method Modified Secant
5-3 Solving Quadratic Equations by Graphing and Factoring Warm Up
~ Roots of Equations ~ Bracketing Methods Chapter 5
CS B553: Algorithms for Optimization and Learning
Chapter 7 Functions and Graphs.
Read Chapters 5 and 6 of the textbook
Part 2 / Chapter 5.
Solution of Equations by Iteration
Computers in Civil Engineering 53:081 Spring 2003
Bisection Method.
Solving Quadratic Equations by Factoring
Roots: Bracketing Methods
Section 4.8: Newton’s Method
3.8 Newton’s Method How do you find a root of the following function without a graphing calculator? This is what Newton did.
Function Handles UC Berkeley Fall 2004, E Copyright 2005, Andy Packard
Some Comments on Root finding
Roots: Bracketing Methods
Comp 208 Computers in Engineering Yi Lin Winter, 2007
Copyright © Cengage Learning. All rights reserved.
MATH 1910 Chapter 3 Section 8 Newton’s Method.
EE, NCKU Tien-Hao Chang (Darby Chang)
Solutions for Nonlinear Equations
Presentation transcript:

Root Finding UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Solving Algebraic Equations From linearity, it is easy to solve the equation or even the system of equations But what about an equation like

Solving Algebraic Equations In general, given a continuous function f, how do you find the (any, all) solutions to Graph of f(x) versus x x f(x) “ roots ” of f

Iterative Methods Iterative methods start with a “guess”, labeled x 0 and through “easy” calculations, generate a sequence x 1, x 2, x 3, … Goal is that sequence satisfies and convergence to a limit, x* x* is a solution

Rate of Convergence Suppose {x n } is a sequence, converging to a limit x*. Let e n denote the difference x*-x n If there is a constant C, and positive exponent  such that for large n then the sequence {x n } converges with order  to x*. –“linear” convergence is  =1 The sequence 3, 2.5, 2.25, 2.125, , … converges linearly to 2 (here C = ½) The sequence 3, 2.1, 2.01, 2.001, ,… converges linearly to 2 (here C=0.1) –“quadratic” convergence is  =2 The sequence converges quadratically to 2 (here C=1)

Stopping Criteria Suppose {x n } is a sequence, converging to a limit x*. The limit x* has the property f(x*)=0. Let tol be a positive number Absolute (in x) |x n – x*| < tol Relative (in x) |x n – x*| < tol × |x*| Absolute in f |f(x n )| < tol But we don ’ t know x* “ Absolute ” |x n – x n-1 | < tol “ Relative ” |x n – x n-1 | < tol × |x n | Sometimes (in bisection, for example) we can bound this, even without knowing x*.

Bisection Method, basic idea Suppose f is continuous, There must be a root x* between x L and x R. Let x M be the midpoint. |x M -x*|≤0.5|x R -x L | Based on sign of replace either x L or x R with x M, and repeat. Intermediate value theorem

Simple pseudo-code: Bisection % Start with xL, xR, fL = f(xL); fR = f(xR); while StoppingCriteriaNotMet xM = 0.5*(xL+xR); yM = f(xM); if fL*fM<0 % replace R with M xR = xM; else xL = xM; end

Examples: Bisection

Newton’s Method: motivation graph of f(x) Graph of h(x), the straight-line approximation to f at x 0 functions are equal at x 0 slope of h (everywhere) equals the slope of f at x 0 graph of h is straight line

Newton’s Method: motivation graph of f(x) Graph of h(x), the straight-line approximation to f at x 0 Approximation to f, near x 0 Approximate solving f(x)=0 by solving (easier) h(x)=0

Newton’s Method: iteration graph of f(x) Graph of h(x), the straight-line approximation to f at x 0 Algorithm: Repeat, using x* app as the “ initial ” point. General form of the iteration

Newton’s Method: iteration General form of the iteration Facts about Newton ’ s method to solve f(x) = 0 At each step, need to evaluate the function and its derivative at a single point Not guaranteed to converge. It might “ cycle ”, and it might diverge. If it does converge, the convergence is quadratic. More complicated than bisection, can work better. Generalizes to N equations in N unknowns

Function handles and feval Several Matlab functions solve your problem by repeatedly calling functions that you supply –finding zeros of a function ( fzero ) –Integrating a function ( trapz, quad ) –Integrating a differential equation ( ode45 ) –minimizing a function ( fminbnd, fminsearch ) For example, in calling fzero, you must pass a reference- to-the-function (called a function handle) that you want fzero to find the zeros of. Use operator to get the reference. >> shan >> class(shan) >> feval(shan,linspace(0,pi,5)) New data type: add to list with double, cell, char, struct. Any function (built-in, mfile, etc)

Function handles and feval General syntax for feval is [out1,out2,…] = feval(FuncH,arg1,arg2,…) Output argument list function handle Input argument list