Numerical Methods Solution of Equation.

Slides:



Advertisements
Similar presentations
Part 2 Chapter 6 Roots: Open Methods
Advertisements

Lecture 5 Newton-Raphson Method
CSE 330: Numerical Methods
CSE 541 – Numerical Methods
Bisection Method (Midpoint Method for Equations).
Chapter 4 Roots of Equations
PHYS2020 NUMERICAL ALGORITHM NOTES ROOTS OF EQUATIONS.
Second Term 05/061 Roots of Equations Bracketing Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 6 Roots of Equations Bracketing Methods.
Roots of Equations Bracketing Methods.
Lectures on Numerical Methods 1 Numerical Methods Charudatt Kadolkar Copyright 2000 © Charudatt Kadolkar.
NUMERICAL METHODS WITH C++ PROGRAMMING
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.
Chapter 3 Root Finding.
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
MATH 175: NUMERICAL ANALYSIS II Lecturer: Jomar Fajardo Rabajante IMSP, UPLB 2 nd Semester AY
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.
I. Finding Roots II. Integrating Functions
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 8. Nonlinear equations.
Scientific Computing Algorithm Convergence and Root Finding Methods.
Solving Non-Linear Equations (Root Finding)
Continuity ( Section 1.8) Alex Karassev. Definition A function f is continuous at a number a if Thus, we can use direct substitution to compute the limit.
Chapter 6 Finding the Roots of Equations
Numerical Methods Applications of Loops: The power of MATLAB Mathematics + Coding 1.
Lecture 3 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
1 Nonlinear Equations Jyun-Ming Chen. 2 Contents Bisection False Position Newton Quasi-Newton Inverse Interpolation Method Comparison.
Lecture 6 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.
Numerical Methods for Engineering MECN 3500
Numerical Methods.
CHAPTER 3 NUMERICAL METHODS
Numerical Methods Root Finding 4. Fixed-Point Iteration---- Successive Approximation Many problems also take on the specialized form: g(x)=x, where we.
Numerical Methods and Computational Techniques Solution of Transcendental and Polynomial Equations.
4 Numerical Methods Root Finding Secant Method Modified Secant
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
Solving Non-Linear Equations (Root Finding)
Solution of Nonlinear Equations Topic: Bisection method
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.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
MATH342: Numerical Analysis Sunjae Kim.
CSE 330: Numerical Methods. Introduction The bisection and false position method require bracketing of the root by two guesses Such methods are called.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 / Chapter 5.
Solution of Nonlinear Equations ( Root Finding Problems )
Chapter 5 Numerical Root Findings
Solution of Nonlinear Equations (Root finding Problems
Numerical Methods and Analysis
Newton’s Method for Systems of Non Linear Equations
Computational Methods EML3041
Read Chapters 5 and 6 of the textbook
MATH 2140 Numerical Methods
Numerical Analysis Lecture 7.
Computers in Civil Engineering 53:081 Spring 2003
Intermediate Value Theorem
SOLUTION OF NONLINEAR EQUATIONS
Intermediate Value Theorem
4 Numerical Methods Root Finding.
Continuity Alex Karassev.
FP1: Chapter 2 Numerical Solutions of Equations
Copyright © Cengage Learning. All rights reserved.
MATH 1910 Chapter 3 Section 8 Newton’s Method.
1 Newton’s Method.
Solutions for Nonlinear Equations
Presentation transcript:

Numerical Methods Solution of Equation

Root Finding Methods Bisection Method Fixed Point Method Secant Method Modified Secant Successive approximation Newton Raphson method Berge Vieta

Motivation Many problems can be re-written into a form such as: f(x,y,z,…) = 0 f(x,y,z,…) = g(s,q,…)

Motivation A root, r, of function f occurs when f(r) = 0. For example: f(x) = x2 – 2x – 3 has two roots at r = -1 and r = 3. f(-1) = 1 + 2 – 3 = 0 f(3) = 9 – 6 – 3 = 0 We can also look at f in its factored form. f(x) = x2 – 2x – 3 = (x + 1)(x – 3)

Finding roots / solving equations General solution exists for equations such as ax2 + bx + c = 0 The quadratic formula provides a quick answer to all quadratic equations. However, no exact general solution (formula) exists for equations with exponents greater than 4. Transcendental equations: involving geometric functions (sin, cos), log, exp. These equations cannot be reduced to solution of a polynomial.

Examples Math 685/CSI 700 Spring 08 George Mason University, Department of Mathematical Sciences

Problem-dependent decisions Approximation: since we cannot have exactness, we specify our tolerance to error Convergence: we also specify how long we are willing to wait for a solution Method: we choose a method easy to implement and yet powerful enough and general Put a human in the loop: since no general procedure can find roots of complex equations, we let a human specify a neighbourhood of a solution

Bisection Method Based on the fact that the function will change signs as it passes thru the root. Suppose we know a function has a root between a and b. (…and the function is continuous, … and there is only one root) f(a)*f(b) < 0 Once we have a root bracketed, we simply evaluate the mid-point and halve the interval.

Bisection Method f(a) . F(b) < 0 c=(a+b)/2 f(a)>0 f(c)>0

Bisection Method Guaranteed to converge to a root if one exists within the bracket. a = c f(a)>0 c b a f(c)<0 f(b)<0

Bisection method… Check if solution lies between a and b… F(a)*F(b) < 0 ? Try the midpoint m: compute F(m) If |F(m)| < ϵ select m as your approximate solution Otherwise, if F(m) is of opposite sign to F(a) that is if F(a)*F(m) < 0, then b = m. Else a = m.

Stop Conditions 1. number of iterations 2. |f(x0)| ≤ ϵ 3. | x- x0| ≤ ϵ

Bisection Method Simple algorithm: Given: a and b, such that f(a)*f(b)<0 Given: error tolerance, err c=(a+b)/2.0; // Find the midpoint While( |f(c)| > err ) { if( f(a)*f(c) < 0 ) // root in the left half b = c; else // root in the right half a = c; c=(a+b)/2.0; // Find the new midpoint } return c;

Square root program The (positive) square root function is continuous and has a single solution. c = x2 Example: F(x) = x2 - 4 F(x) = x2 - c

Example: bisection iteration Math 685/CSI 700 Spring 08 Example: bisection iteration George Mason University, Department of Mathematical Sciences

Remarks Convergence Convergence Rate Guaranteed once a nontrivial interval is found Convergence Rate A quantitative measure of how fast the algorithm is An important characteristics for comparing algorithms

we could compute exactly how many iterations we would need for a given amount of error. The error is usually measured by looking at the width of the current interval you are considering (i.e. the distance between a and b). The width of the interval at each iteration can be found by dividing the width of the starting interval by 2 for each iteration. This is because each iteration cuts the interval in half. If we let the error we want to achieve ϵ and n be the iterations we get the following:

Convergence Rate of Bisection Let: Length of initial interval L0 After k iterations, length of interval is Lk Lk=L0/2k Algorithm stops when Lk  ϵ Plug in some values… This is quite slow, compared to the other methods… Meaning of eps

How to get initial (nontrivial) interval [a,b] ? Hint from the physical problem For polynomial equation, the following theorem is applicable: roots (real and complex) of the polynomial f(x) = anxn + an-1xn-1 +…+ a1x + aο satisfy the bound:

Example Roots are bounded by Hence, real roots are in [-10,10] –1.5251, 2.2626 ± 0.8844i complex

Problem with Bisection Although it is guaranteed to converge under its assumptions, Although we can predict in advance the number of iterations required for desired accuracy (b - a)/2n <e -> n > log( (b - a ) / e ) Too slow! Computer Graphics uses square roots to compute distances, can’t spend 15-30 iterations on every one! We want more like 1 or 2, equivalent to ordinary math operation.

Examples Locate the first nontrivial root of sin x = x3 using Bisection method with the initial interval from 0.5 to 1. perform computation until error 2% 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%

Homework