Summary wth Eamples or Root ndng Methods -Bsecton -Newton Raphson -Secant
Nonlnear Equaton Solvers Bracketng Graphcal Open Methods Bsecton False Poston (Regula-Fals) Newton Raphson Secant All Iteratve
Bracketng Methods (Or, two pont methods or ndng roots) Two ntal guesses or the root are requred. These guesses must bracket or be on ether sde o the root. == > Fgure I one root o a real and contnuous uncton, ()=0, s bounded by values = l, = u then ( l ). ( u ) <0. (The uncton changes sgn on opposte sdes o the root)
Bass o Bsecton Method Theorem An equaton ()=0, where () s a real contnuous uncton, has at least one root between l and u ( l ) ( u ) < 0. () u At least one root ests between the two ponts the uncton s real, contnuous, and changes sgn. 4
Algorthm or Bsecton Method Step Choose and u as two guesses or the root such that ( ) ( u ) < 0, or n other words, () changes sgn between and u. Ths was demonstrated n Fgure. () u 5
Step Estmate the root, m o the equaton () = 0 as the md pont between and u as () m = u m u Estmate o m 6
Step Now check the ollowng 0 a) I l m, then the root les between and m ; then = ; u = m. 0 b) I l m, then the root les between m and u ; then = m ; u = u. 0 c) I l m ; then the root s m. Stop the algorthm ths s true. 7
Step 4 Fnd the new estmate o the root m = u Fnd the absolute relatve appromate error where a old m m new new m old m 00 prevousestmateo root new m current estmateo root 8
Step 5 Compare the absolute relatve appromate error error tolerance. s a wth the pre-speced Is a s? Yes No Go to Step usng new upper and lower guesses. Stop the algorthm Note one should also check whether the number o teratons s more than the mamum number o teratons allowed. I so, one needs to termnate the algorthm and noty the user about t. 9
Eample In the dagram shown the loatng ball has a specc gravty o 0.6 and has a radus o 5.5 cm. You are asked to nd the depth to whch the ball s submerged when loatng n water. Dagram o the loatng ball 0
Eample Cont. The equaton that gves the depth to whch the ball s submerged under water s gven by 0.65.990 4 0 a) Use the bsecton method o ndng roots o equatons to nd the depth to whch the ball s submerged under water. Conduct three teratons to estmate the root o the above equaton. b) Fnd the absolute relatve appromate error at the end o each teraton, and the number o sgncant dgts at least correct at the end o each teraton.
Eample Cont. From the physcs o the problem, the ball would be submerged between = 0 and = R, that s where R = radus o the ball, 0 0 0 R 0.055 0. Dagram o the loatng ball
Eample Cont. Soluton To ad n the understandng o how ths method works to nd the root o an equaton, the graph o () s shown to the rght, where -4 065. 99. 0 Graph o the uncton ()
Eample Cont. Let us assume u 0.00 0. Check the uncton changes sgn between and u. Hence 4 4 l 0 0 0.650.990.990 4 4 0. 0. 0.650..990.660 u 4 4 0 0..990.660 0 l u So there s at least on root between and u, that s between 0 and 0. 4
Eample Cont. Graph demonstratng sgn change between ntal lmts 5
Eample Cont. Iteraton The estmate o the root s m 0.055 0.055 0.650.055 m u 0 0..990 0.055 4 5 0 0.055.990 6.6550 0 l m 4 6.6550 5 Hence the root s bracketed between m and u, that s, between 0.055 and 0.. So, the lower and upper lmts o the new bracket are l 0.055, 0. u At ths pont, the absolute relatve appromate error calculated as we do not have a prevous appromaton. a cannot be 6
Eample Cont. Estmate o the root or Iteraton 7
Eample Cont. m 0.085 0.085 0.650.085 m u 0.055 0. 0.085.990 4 5 0.055 (0.085).6 0 6.655 0 0 l Iteraton The estmate o the root s m 4.6 0 4 Hence the root s bracketed between and m, that s, between 0.055 and 0.085. So, the lower and upper lmts o the new bracket are l 0.055, 0.085 u 8
Eample Cont. Estmate o the root or Iteraton 9
Eample Cont. The absolute relatve appromate error a at the end o Iteraton s a new m new m old m 00 0.085 0.055 0.085.% 00 None o the sgncant dgts are at least correct n the estmate root o m = 0.085 because the absolute relatve appromate error s greater than 5%. 0
Eample Cont. m 0.06875 0.06875 0.650.06875 m u 0.055 0.085.990 5 5 0.055 0.06875 6.6550 5.560 0 l Iteraton The estmate o the root s m 4 0.06875 5.560 5 Hence the root s bracketed between and m, that s, between 0.055 and 0.06875. So, the lower and upper lmts o the new bracket are l 0.055, 0.06875 u
Eample Cont. Estmate o the root or Iteraton
Eample Cont. The absolute relatve appromate error a at the end o Iteraton s a new m new m old m 00 0.06875 0.085 0.06875 0% 00 Stll none o the sgncant dgts are at least correct n the estmated root o the equaton as the absolute relatve appromate error s greater than 5%. Seven more teratons were conducted and these teratons are shown n Table.
Table Cont. Table Root o ()=0 as uncton o number o teratons or bsecton method. Iteraton u m a % ( m ) 0.00000 0. 0.055 ---------- 6.655 0 5 0.055 0. 0.085..6 0 4 0.055 0.085 0.06875 0.00 5.56 0 5 4 0.055 0.06875 0.0688. 4.484 0 6 5 0.0688 0.06875 0.065 5.6.59 0 5 6 0.0688 0.065 0.0659.70.0804 0 5 7 0.0688 0.0659 0.067.70.76 0 6 8 0.0688 0.067 0.06 0.6897 6.497 0 7 9 0.06 0.067 0.065 0.46.65 0 6 0 0.06 0.065 0.064 0.7.0768 0 7 4
5 Most wdely used method. Based on Taylor seres epanson: ) ( ) ( ) ( 0 Rearrangn g, 0 ) when ( the value o The root s! ) ( ) ( ) ( ) ( ) ( ) ( O Newton-Raphson ormula Solve or Newton-Raphson Method
A convenent method or unctons whose dervatves can be evaluated analytcally. It may not be convenent or unctons whose dervatves cannot be evaluated analytcally. 6
Newton-Raphson Method () ( ), = - ( ) ( ) ( - ) + + X 7 Geometrcal llustraton o the Newton-Raphson method. http://numercalmethods.eng.us.edu
Dervaton () ( ) B tan( AB AC '( ) ( ) C + A X ( ) ( ) Dervaton o the Newton-Raphson method. http://numercalmethods.eng.us.edu 8
Algorthm or Newton - Raphson Method Step Evaluate () symbolcally. Step Use an ntal guess o the root,, as = -, to estmate the new value o the root, Step Fnd the absolute relatve appromate error a as - a = 00 9 http://numercalmethods.eng.us.edu
Step 4 Compare the absolute relatve appromate error wth the pre-speced relatve error tolerance. s Is a s? Yes No Go to Step usng new estmate o the root. Stop the algorthm Also, check the number o teratons has eceeded the mamum number o teratons allowed. I so, one needs to termnate the algorthm and noty the user. 0 http://numercalmethods.eng.us.edu
Step Eample ' Solve Eample usng Newton-Raphson Methods. Solve or ' -065. -0. + 99. 0 Let us assume the ntal guess o the root o s. Ths s a reasonable guess! and 0 0.m are not good choces) as the etreme values o the depth would be 0 and the dameter (0. m) o the ball. -4 0 0.05 0 m
Eample Cont. Step Iteraton The estmate o the root s 0 0.05 0 ' 0 0.05 0.650.05 0.05 0.0.05.80 0.05 90 0.05 0.04 0.064 4.990 4
Eample Cont. Estmate o the root or the rst teraton.
Eample Cont. Step The absolute relatve appromate error a at the end o Iteraton s a 0 00 0.064 0.05 0.064 9.90% 00 The number o sgncant dgts at least correct s 0, as you need an absolute relatve appromate error o 5% or less or at least one sgncant dgts to be correct n your result. 4
Eample Cont. Iteraton The estmate o the root s ' 0.068 0.064 0.650.064 0.064 0.0.064 0.064 0.064 0.064.97780 8.90970 5 4.46460 7.990 4 5
Eample Cont. Estmate o the root or the Iteraton. 6
Eample Cont. The absolute relatve appromate error a at the end o Iteraton s a 00 0.068 0.064 0.068 0.076% 00 m The mamum value o m or whch a 0.50 s.844. Hence, the number o sgncant dgts at least correct n the answer s. 7
Eample Cont. Iteraton The estmate o the root s ' 0.068 0.068 0.068 0.068 0.650.068 0.068 0.0.068 0.068 4.440 8.970 4.980 9.990 4 8
Eample Cont. Estmate o the root or the Iteraton. 9
Eample Cont. The absolute relatve appromate error a at the end o Iteraton s a 00 0.068 0.068 0.068 00 0% The number o sgncant dgts at least correct s 4, as only 4 sgncant dgts are carred through all the calculatons. 40
Secant Method-Dervaton () ( ) ( - ) + + Geometrcal llustraton o Newton-Raphson method., the X Newton s Method ( ) = - ( ) ( ) ( ) ( ( ( )( ) ) ( () Appromate the dervatve () Substtutng Equaton () nto Equaton () gves the Secant method ) ) 4
Secant Method Dervaton The secant method can also be derved rom geometry: () ( ) ( - ) C E D A + - B X The Geometrc Smlar Trangles AB DC AE DE can be wrtten as ( ) ( ) On rearrangng, the secant method s gven as Geometrcal representaton o Secant method. the ( ( )( ) ( ) ) 4
4 Step 00 - = a Calculate the net estmate o the root rom two ntal guesses Fnd the absolute relatve appromate error ) ( ) ( ) )( ( Algorthm or Secant Method
Step Fnd the absolute relatve appromate error s greater than the prespeced relatve error tolerance. I so, go back to step, else stop the algorthm. Also check the number o teratons has eceeded the mamum number o teratons. 44
Eample In Eample, the equaton that gves the depth to whch the ball s submerged under water s gven by -4-065. + 99. 0 Use the Secant method o ndng roots o equatons to nd the depth to whch the ball s submerged under water. Conduct three teratons to estmate the root o the above equaton. Fnd the absolute relatve appromate error and the number o sgncant dgts at least correct at the end o each teraton. 45
Eample Cont. Step Let us assume the ntal guesses o the root o as 0.0and 0.05. 0 0 0 Iteraton The estmate o the root s 0.0646 0 0 0 4 0.05 0.650.05.990 0.05 0.0 4 0.05 0.650.05.990 0.0 0.65 0.0 0.05.990 4 46
Eample Cont. Step The absolute relatve appromate error Iteraton s a 0 00 0.0646 0.05 0.0646.6% 00 a at the end o The number o sgncant dgts at least correct s 0, as you need an absolute relatve appromate error o 5% or less or one sgncant dgts to be correct n your result. 47
Eample Cont. Graph o results o Iteraton. 48
Eample Cont. Step Iteraton The estmate o the root s 0.064 0 0 4 0.0646 0.650.0646.990 0.0646 0.05 4 0.650.0646.990 0.05 0.65 0.05 0.0646 0.0646.990 4 49
Eample Cont. The absolute relatve appromate error Iteraton s a 00 0.064 0.0646 0.064.55% 00 a at the end o The number o sgncant dgts at least correct s, as you need an absolute relatve appromate error o 5% or less. 50
Eample Cont. Graph o results o Iteraton. 5
Eample Cont. Iteraton The estmate o the root s 0.068 4 0.064 0.650.064.990 0.064 0.0646 4 0.650.064.990 0.05 0.65 0.0646 0.064 0.064.990 4 5
Eample Cont. The absolute relatve appromate error Iteraton s a 00 0.068 0.064 0.068 0.0595% 00 a at the end o The number o sgncant dgts at least correct s 5, as you need an absolute relatve appromate error o 0.5% or less. 5