lec18_roots -         Applications of root finding...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview:         Applications of root finding Graphical and brute force methods Bisection method Newton-Ralphson Method     Projects and HW07 due today! Reading for root finding on handout. University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden   Finding a root of an equation means determining a value for the independent variable for which the function is 0. f (xn ) = 0 where xn is the nth root of f (x)   Simple example: quadratic equation (2 roots) f (x) = ax + bx + c xn = 2   −b ± √ b2 − 4ac 2a In general, for an Nth order polynomial, there will be N roots. University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden   Roots are the solutions to the polynomial equation P (x) = 0     Solving optimization problems – taking derivatives of functions and setting them equal to 0. Questions like:   Given the forces on a rocket, at what point in space does the drag force equal the thrust.   Given a high order polynomial which describes the shape of a leaf, at what positions does the edge of the leaf equal the average distance from center?   Given an measure of the voltage across a synapse, what is the time duration between signal rise and fall? University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden       Sometimes simplest methods work “good enough”! It depends on how accurately you want to know the root and whether you need the process automated. Graphical method   Just plot the function and zoom on on the zero crossings.   Accuracy depends on how fine your independent variable array is. Needs human input – not good for many equations. Brute Force method   Start at some minimum value for x and step up in small increments until the function switches sign. Can then back up with smaller increment steps.   NOT very efficient – requires MANY evaluations of the function! University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden     Just like the binary search we discussed before. Initial bracket for root is between xlow and xhigh.   See if f (xlow ) · f (xhigh ) < 0   NO: even number of roots or no root   YES: test if f (xlow ) · f (xmid ) < 0 else: xlow = xmid   Repeat until some desired tolerance for the solution is achieved: |xhigh − xmid | < ￿   For an initial window of Δx , the number of iterations (n) is: log( ∆x ) ￿ n= University of Mississippi Dept. of Physics and Astronomy log(2) Phys 503, Dr. Gladden ⇒ xhigh = xmid   Makes use of Taylor series expansion. f (xi+1 ) = f (xi ) + f ￿ (xi )(xi+1 − xi ) + O(dx2 )   If xi+1 is a root, then f (xi ) + f ￿ (xi )(xi+1 − xi ) ￿ 0 xi+1 f (xi ) = xi − ￿ f (xi )   So, the next value for x is: Now let   and repeat until   xi+1 → xi |xi+1 − xi | < ￿ Can evaluate derivative using a simple Euler step. University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden   Very efficient, but there are limitations   Happen to start at (or near) an extremum so derivative is close to 0.   Function is symmetric about root – leads to infinite loop!   Make sure to set an upper limit to number of iterations University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden University of Mississippi Dept. of Physics and Astronomy Phys 503, Dr. Gladden ...
View Full Document

Ask a homework question - tutors are online