160 likes | 288 Views
Solving Mathematical Equations Using Numerical Analysis Methods Bisection Method, Fixed Point Iteration, Newton’s Method Prepared by Parag Jain~Mohamed Toure Dowling College, Oakdale, NY For Research Topics in Computer Science ---The Computer Science Lyceum--- Spring 2002. CONTENTS. Notice
E N D
Solving Mathematical Equations Using Numerical Analysis MethodsBisection Method, Fixed Point Iteration, Newton’s MethodPrepared byParag Jain~Mohamed ToureDowling College, Oakdale, NYFor Research Topics in Computer Science---The Computer Science Lyceum---Spring 2002
CONTENTS • Notice • Abstract • Introduction • Bisection Method • Fixed-Point Iteration Method • Newton’s Method • Conclusion • Acknowledgements • References
NOTICE • This project and the contents herein are provided as a convenience to the user. The contents of this project are provided on "as is" and "as available" basis. We have done this work in good faith. This material is purely for educational purpose and the user of this document should have no commercial intention. We are not responsible for any damage this material might cause. • NO WARRANTY OF ANY KIND IS MADE IN RELATION TO THE AVAILABILITY, ACCURACY, RELIABILITY OR CONTENT OF THIS MATERIAL. • Suggestions related to how to improve this material are welcome. Email us at: Fausto09@yahoo.com or Jain9164@dowling.edu
ABSTRACT • In our daily life we encounter several problems that need to be analyzed and solved. In Mathematics, it is usually impossible to solve to exactitude real world problems. It is therefore useful to have an idea about what the solution to the problem would look like. • We, have been working in Numerical Analysis since long, and the challenge involved motivated us to implement a nice GUI for the user to help him solve problems using certain methods of approximation such as: • Bisection Method • Fixed Point Iteration Method • Newton’s Method
INTRODUCTION • Our program aims at finding the roots of mathematical equations utilizing the three methods – Bisection Method, Fixed Point Iteration Method, and Newton’s Method. • The idea is to use a library of equations from which the user chooses one, selects the method that he/she wants to utilize for solving that equation, defines an interval or initial guess (as the case might be), and defines the accuracy. • The program then finds the solution to the equation to the defined accuracy (say 1*10-10) and to achieve that performs iterations of the chosen method. • The program displays the roots for the equation and the number of iterations performed.
INTRODUCTION CONTD… • A slightly different approach is used while solving an equation using Fixed Point Iteration and Newton’s Method. This approach is called ‘Sampling’. • We utilize the Bisection Method to determine those regions in the interval where the function has a root, and we look for the root in these semi-intervals only using Fixed Point Iteration or Newton’s Method. • This expedites the root finding process and reduces the probability of failure of these two methods. • The failure happens when we start looking for roots in an interval that is not continuous, has no roots, function not self-mapped (in Fixed-Point Iteration Method), or the initial guess leads to a critical point (in Newton’s Method).
BISECTION METHOD • The Bisection Method gives a proof of the Intermediate Value Theorem and provides a practical method to find roots of equations at the same time. • Recalling the Intermediate Value Theorem, we have that if f(x) be a continuous function on the interval [a,b] and if d belongs to [f(a),f(b)], then there is a point c in [a,b] such that f(c) = d. • By replacing f(x) by [f(x) – d], we may assume that d = 0; it then suffices to obtain the following version as a rule for the Bisection Method - let f(x) be a continuous function on the interval [a,b]. If f(a) and f(b) have opposite signs, then there is a point c in [a,b] such that f(c) = 0.
BISECTION METHOD CONTD… • We illustrate Bisection Method by considering the following polynomial p(x) = x7 + 9x5 - 13x - 17 • Note that p(0)=-17 and p(2)=373. Therefore, since p(x) is a continuous function (i.e., its graph has no “breaks”), we know that there must be a root, say r, in the interval (0,2) by the Intermediate Value Theorem. • To shrink the interval in on r, we now evaluate p at the midpoint of (0,2) which is 1. p(1)=-20. Now we see that r must actually lie in the interval (1,2) since p switches signs from negative to positive as x ranges from 1 to 2. So we have reduced the interval under consideration from (0,2) to (1,2). We have cut the length of our interval in half, or bisected it. • We look next at the midpoint of (1, 2), namely 1.5, and p(1.5)=48.929. Thus, r must be in the interval (1, 1.5). We continue this procedure until a desired accuracy has been achieved. Thetable summarizes the results of iterating this technique several times. • A plot of these values follows a general pattern shown in thegraph. • This is how ourapplet works.
FIXED POINT ITERATION METHOD • This method is based on a different principle than that of bisection. In this case, one seeks the roots of the equation x = g(x). • By definition, a fixed point for a function g(x) is the number x that verifies g(x) = x. Note that if one defines f(x) = x - g(x) = 0 one is reduced to seeking the zero of the function f(x) = 0. One gets an idea of the zero’s location by using the Bisection Method through ‘Sampling’ as discussed earlier. • This method works only if g(x) is continuous and self-mapped. • We assume that we are seeking the zeros of f(x) = 0. This problem can be transformed to the fixed point g(x) = x form in several ways: • g(x) = f(x) + x = x • g(x) = h(x)f(x) + x = x (h(x) != 0 in the interval of x we are considering the solution to lie in.) • When solving the equation x = g(x) we start with an initial guess and perform iterations with subsequent values of g(x) for x. • Example
NEWTON’S METHOD • Newton’s Method is a very efficient way to approximate the roots of equations of the type f(x) = 0, where f is a given function. • Suppose that you start at a point x0 you think is close to the root. The tangent line at the point x0 is pretty close to the curve. Hence, the intersection point of the tangent line and the x-axis should be closer to the root. • Since the slope of the tangent line is f’(x0), that point of intersection is x1 = x0 – f(x0)/f’(x0). So x1 is a better approximation than x0 • If the result is not up to the expected approximation then the same iteration is used with x1 as the initial guess to generate x2
NEWTON’S METHOD CONTD… • As you have noticed, Newton’s Method is based on iteration and uses f’(x) in addition to f(x). • It also gives a fixed-point function g(x) given f(x) as follow: • xn = xn-1 - f(xn-1)/f’(xn-1) where n=1, 2, 3, … • x0 is the starting point • xn =g(xn-1) • The previous algorithm is used to generate a sequence of points {xn}n=0 that converges to x, where x is the true, exact root of f. • For a lot of functions, this iterative method works very well. But not for all functions. For instance, it doesn't work for any function that doesn't have a root. How could it? And it doesn't always work for some functions that do have roots, for instance, the cube root function. • Let’s examine the following graphs
NEWTON’S METHOD CONTD… • How can one implement such a nice algorithm bounded by chances of failure? • The final approach that we have adopted is to use an already defined method that confirmed the existence of a root. • The idea is to use the Bisection Method in order to sample the values of the given function, and determine whether or not there is a change in sign. If yes, we use Newton’s Method with the initial guess at a point chosen in that interval that generated the change in sign. • This ensures that there is a root, and this process will accelerate Newton’s Method.
NEWTON’S METHOD CONTD… • However, there might be more than one solution to the problem. The next approach will be to divide the initial function by (x-previous root), and regenerate the process previously described. • If the solution goes to the same root as the previous, then that root has an order of multiplicity. • Repeat the process until there is no more root (i.e. f(x) = constant or an equation with imaginary roots). • It is easy to show that Newton’s Method fails infinitely many times depending on the point chosen as the initial guess. • The sampling actually avoids those fatalities (i.e. it reduces the probability of failure by choosing the initial point as close as possible to a critical point of the function). • If this algorithm works, it is one of the most efficient in approximation theory.
CONCLUSION • The project demonstrated how we could find roots of equations using suitable techniques. • The heuristic that we implement in the program for Fixed-Point Iteration and Newton’s Method makes these methods faster and workable even in situations in which they would have otherwise failed. • Having a predefined library of equations limits the applicability of the program so we are still working on the implementation of a parser in our project. • We are still in a process of exploring how we could make our root-finding methods better, more user-friendly, and more efficient. It is an unending quest.
ACKNOWLEDGEMENTS We acknowledge the support and encouragement that we got from Professor Herbert J. Bernstein throughout this semester. He was a pathfinder to us and his guidance was really invaluable. Also we acknowledge Professor Raymond Grinnell for the masterminded mathematical help that we got from him. Thanks to all our colleagues and friends for their camaraderie.
REFERENCES • Richard L. Burden & J. Douglas Faires, Numerical Analysis (Boston, MA: PWS Publishing Company, 1993). • http://archives.math.utk.edu/topics/ • http://perso.wanadoo.fr/jean-pierre.moreau/index.html • http://www.ifi.uio.no/~pde/examples/doc/AllNames.html • http://members.tripod.com/~showing/VisualMath.html • http://www.csulb.edu/~wziemer/FixedPoint/FixedPoint.html • http://www.dgp.toronto.edu/people/JamesStewart/applets/roots/roots.html • http://delphi.about.com/library/bluc/blrtlmain.htm?iam=dpile&terms=oepn+source+for+math+function • http://donald.phast.umass.edu/kicons/greek.html • http://mss.math.vanderbilt.edu/~pscrooke/toolkit.html • http://www.cs.colorado.edu/~main/ds/daybyday.html