{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 10 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 1 20 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 272 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 276 "" 1 16 0 0 0 0 0 0 1 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times " 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 } {PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output " -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 } 3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Plot" -1 13 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "AC - Title" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 1 2 258 1 }{PSTYLE "A C - Author" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 259 1 }{PSTYLE "AC - Note" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "AC - Normal Text" -1 259 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "AC - Section Heading" -1 260 1 {CSTYLE "" -1 -1 "Times " 1 16 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 12 0 1 0 1 0 2 2 260 1 } {PSTYLE "AC - Disclaimer" -1 261 1 {CSTYLE "" -1 -1 "Times" 1 9 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 12 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 262 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "AC - Author" -1 263 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 1 1 1 1 }3 1 0 0 4 4 1 0 1 0 2 2 259 1 }{PSTYLE "Normal" -1 264 1 {CSTYLE "" -1 -1 "Times" 1 10 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "AC - No rmal Text" -1 265 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 266 1 {CSTYLE "" -1 -1 "Helvetica" 1 14 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 256 "" 0 "" {TEXT -1 43 "Oscillation around a local maxi ma of minima" }{TEXT 261 25 "--Newton-Raphson Method. " }{TEXT 257 0 " " }}{PARA 263 "" 0 "" {TEXT 256 7 "\251 2003 " }{TEXT -1 144 "Nathan C ollier, Autar Kaw, Jai Paul , Michael Keteltas, University of South Fl orida , kaw@eng.usf.edu , http://numericalmethods.eng.usf.edu/mws " }} {PARA 258 "" 0 "" {TEXT -1 184 "NOTE: This worksheet demonstrates the \+ use of Maple to illustrate a pitfall of the Newton-Raphson method wher e one is getting oscillation around a local maxima or minima of a func tion.." }}{SECT 0 {PARA 260 "" 0 "" {TEXT 258 12 "Introduction" } {TEXT -1 0 "" }}{PARA 259 "" 0 "" {TEXT 259 33 "Although, Newton-Raphs on method [" }{URLLINK 17 "text notes" 4 "http://numericalmethods.eng. usf.edu/mws/gen/03nle/mws_gen_nle_txt_newton.pdf" "" }{TEXT 270 2 "][ " }{URLLINK 17 "PPT" 4 "http://numericalmethods.eng.usf.edu/mws/gen/03 nle/mws_gen_nle_ppt_newton.ppt" "" }{TEXT 271 381 "] converges faster \+ than any other method it still has a few drawbacks.One of them is Osci llations near local maximum and minimum. Results obtained from Newton- Raphson method may oscillate about the local maximum or minimum withou t converging on a root but converging on the local maximum or minimum. Eventually, it may lead to division to a number close to zero and ma y diverge. " }{TEXT -1 155 "The following simulation illustrates a pi tfall of the Newton-Raphson method where one is getting oscillation ar ound a local maxima or minima of a function." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}} {PARA 260 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT 262 17 "Section I : Data." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "Function \+ in f(x)=0" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "f(x):=x^2+2:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 13 "Initial guess" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "x0:=-1.0:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "Upper bound of range of 'x' that is desired" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "uxrange:=3.0:" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 43 "Lower bound of range of 'x' that is desired" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "lxrange:=-3.0:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 28 "Maximum number of iterations" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "nmax:=100:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 0 "" }{TEXT 263 29 "Section II: Before you start." }} {PARA 259 "" 0 "" {TEXT -1 235 "Because the method uses a line tangent to the function at the initial guess, we must calculate the derivativ e of the function to find the slope of the line at this point. Here we will define the derivative of the function f(x) as g(x)." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "g(x):=diff(f(x),x);" }{TEXT -1 0 " " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%\"gG6#%\"xG,$*&\"\"#\"\"\"F'F+F +" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 259 "" 0 "" {TEXT -1 226 " We now plot the data. The following function determines the upper and \+ lower ranges on the Y-axis. This is done using the upper and lower ran ges of the X-axis specified, and the value of the original functional \+ at these values." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 343 "yranger:=proc(uxrange,lxrange)\nlocal i,maxi, mini,tot;\nmaxi:=eval(f(x),x=lxrange);\nmini:=eval(f(x),x=lxrange);\nf or i from lxrange by (uxrange-lxrange)/10 to uxrange do\nif eval(f(x), x=i)maxi th en maxi:=eval(f(x),x=i) end if;\nend do;\ntot:=maxi-mini;\n-0.1*tot+mi ni..0.1*tot+maxi;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "yrange:=yranger(uxrange,lxrange):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "xrange:=lxrange..uxrange:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 55 "The following calls are needed \+ to use the plot function" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " with(plots):" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name changec oords has been redefined\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(plottools):" }}{PARA 7 "" 1 "" {TEXT -1 43 "Warning, the name arrow has been redefined\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 104 "plot(f(x),x=xrange,y=yrange,title=\"Entered function on given int erval\",legend=[\"Function\"],thickness=3);" }}{PARA 13 "" 1 "" {GLPLOT2D 549 549 549 {PLOTDATA 2 "6'-%'CURVESG6%7S7$$!\"$\"\"!$\"#6F* 7$$!3!******\\2<#pG!#<$\"3XbrMi1CB5!#;7$$!3#)***\\7bBav#F0$\"39hJyY*eB f*F07$$!36++]K3XFEF0$\"3!\\%\\?xy\\.*)F07$$!3%)****\\F)H')\\#F0$\"35!o s[,^JC)F07$$!3#****\\i3@/P#F0$\"3mH'Qh7'*)=wF07$$!3;++Dr^b^AF0$\"3KiUC \"F0$\"3)z@1*4%)=[NF07$$!3-++DhkaI6F0$\"3q(*[/,`8yKF07$$!3s******\\XF` **!#=$\"33xnnUnn!*HF07$$!3u*******>#z2))Fgp$\"3g3QQM?xvFF07$$!3S++]7RK vuFgp$\"3EVz'fn/)eDF07$$!3s,+++P'eH'Fgp$\"3Kx(*G(**yjR#F07$$!3q)***\\7 *3=+&Fgp$\"3QW;(R#4=]AF07$$!3[)***\\PFcpPFgp$\"3([[>B.'4U@F07$$!3;)*** *\\7VQ[#Fgp$\"3U(4'pmZph?F07$$!32)***\\i6:.8Fgp$\"3,^K_H?)p,#F07$$!3Wb +++v`hH!#?$\"36kVqq(3++#F07$$\"3]****\\(QIKH\"Fgp$\"33M:N[Ws;?F07$$\"3 8****\\7:xWCFgp$\"3]:L[x!p(f?F07$$\"3E,++vuY)o$Fgp$\"3uG89Bz/O@F07$$\" 3!z******4FL(\\Fgp$\"3sVfVC)RtC#F07$$\"3A)****\\d6.B'Fgp$\"3Y*y:K#y;)Q #F07$$\"3s****\\(o3lW(Fgp$\"3mH,L;\\]aDF07$$\"35*****\\A))oz)Fgp$\"3UO 9VCC&Qx#F07$$\"3e******Hk-,5F0$\"3,W&eN\"R0-IF07$$\"36+++D-eI6F0$\"3e] 5;X;@yKF07$$\"3u***\\(=_(zC\"F0$\"3u4ThY@WdNF07$$\"3M+++b*=jP\"F0$\"3% HH#*e'QD%*QF07$$\"3g***\\(3/3(\\\"F0$\"3slIE](\\7C%F07$$\"33++vB4JB;F0 $\"3?zg;b$Q^j%F07$$\"3u*****\\KCnu\"F0$\"3#\\qYv'e/^]F07$$\"3s***\\(=n #f(=F0$\"3SS,7a55>bF07$$\"3P+++!)RO+?F0$\"3aT9[_gX,gF07$$\"30++]_!>w7# F0$\"3l(*4cKGwElF07$$\"3O++v)Q?QD#F0$\"3)G?XZM1(zqF07$$\"3G+++5jypBF0$ \"32$[FF0$\"3[`(R=ngKb*F07$$\"37++D6EjpGF0$\" 3V\\\\NK\"zM-\"F37$$\"\"$F*F+-%'COLOURG6&%$RGBG$\"#5!\"\"$F*F*F`[l-%'L EGENDG6#Q)Function6\"-%+AXESLABELSG6$Q\"xFe[lQ\"yFe[l-%&TITLEG6#QCEnte red~function~on~given~intervalFe[l-%*THICKNESSG6#Fhz-%%VIEWG6$;$!#IF_[ l$\"#IF_[l;$\"%+6F)$\"&+>\"F)" 1 2 0 1 10 3 2 9 1 4 2 1.000000 45.000000 45.000000 0 1 "Function" }}}}}{PARA 4 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 0 "" }{TEXT 264 25 "Section III: It eration 1." }}{PARA 259 "" 0 "" {TEXT -1 214 "The Newton Raphson Metho d works by taking a tangent line at the value of the function at the i nitial guess, and seeing where that tangent line crosses the x-axis. \+ This value will be the new estimate for the root.." }}{PARA 0 "" 0 "" {TEXT -1 34 "The first estimate of the root is," }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 39 "x1:=x0-eval(f(x),x=x0)/eval(g(x),x=x0);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x1G$\"*++++&!\"*" }}}{PARA 0 "" 0 " " {TEXT -1 79 "How good is that answer? Find the absolute relative app roximate error to judge." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 " epsilon:=abs((x1-x0)/x1)*100;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(ep silonG$\"+++++I!\"(" }}}{PARA 0 "" 0 "" {TEXT -1 111 "While not necesa ry to the method, for graphing purposes we define the equation of the \+ tangent line touching x0." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "tanline(x):=eval(g(x),x=x0)*x+eval(f(x),x=x0)-eval(g(x),x=x0)*x0:" } {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 280 "plot([f(x),[x0,t,t=yrange],[x1,t,t=yrange],tanl ine(x)],x=xrange,y=yrange,title=\"Entered function on given interval w ith current and next root\\n and tangent line of the curve at the curr ent root\",legend=[\"Function\", \"x0, Current root\", \"x1, New root \", \"Tangent line\"],thickness=3);" }}{PARA 13 "" 1 "" {GLPLOT2D 549 549 549 {PLOTDATA 2 "6*-%'CURVESG6%7S7$$!\"$\"\"!$\"#6F*7$$!3!******\\ 2<#pG!#<$\"3XbrMi1CB5!#;7$$!3#)***\\7bBav#F0$\"39hJyY*eBf*F07$$!36++]K 3XFEF0$\"3!\\%\\?xy\\.*)F07$$!3%)****\\F)H')\\#F0$\"35!os[,^JC)F07$$!3 #****\\i3@/P#F0$\"3mH'Qh7'*)=wF07$$!3;++Dr^b^AF0$\"3KiUC\"F0$\"3)z@1*4% )=[NF07$$!3-++DhkaI6F0$\"3q(*[/,`8yKF07$$!3s******\\XF`**!#=$\"33xnnUn n!*HF07$$!3u*******>#z2))Fgp$\"3g3QQM?xvFF07$$!3S++]7RKvuFgp$\"3EVz'fn /)eDF07$$!3s,+++P'eH'Fgp$\"3Kx(*G(**yjR#F07$$!3q)***\\7*3=+&Fgp$\"3QW; (R#4=]AF07$$!3[)***\\PFcpPFgp$\"3([[>B.'4U@F07$$!3;)****\\7VQ[#Fgp$\"3 U(4'pmZph?F07$$!32)***\\i6:.8Fgp$\"3,^K_H?)p,#F07$$!3Wb+++v`hH!#?$\"36 kVqq(3++#F07$$\"3]****\\(QIKH\"Fgp$\"33M:N[Ws;?F07$$\"38****\\7:xWCFgp $\"3]:L[x!p(f?F07$$\"3E,++vuY)o$Fgp$\"3uG89Bz/O@F07$$\"3!z******4FL(\\ Fgp$\"3sVfVC)RtC#F07$$\"3A)****\\d6.B'Fgp$\"3Y*y:K#y;)Q#F07$$\"3s**** \\(o3lW(Fgp$\"3mH,L;\\]aDF07$$\"35*****\\A))oz)Fgp$\"3UO9VCC&Qx#F07$$ \"3e******Hk-,5F0$\"3,W&eN\"R0-IF07$$\"36+++D-eI6F0$\"3e]5;X;@yKF07$$ \"3u***\\(=_(zC\"F0$\"3u4ThY@WdNF07$$\"3M+++b*=jP\"F0$\"3%HH#*e'QD%*QF 07$$\"3g***\\(3/3(\\\"F0$\"3slIE](\\7C%F07$$\"33++vB4JB;F0$\"3?zg;b$Q^ j%F07$$\"3u*****\\KCnu\"F0$\"3#\\qYv'e/^]F07$$\"3s***\\(=n#f(=F0$\"3SS ,7a55>bF07$$\"3P+++!)RO+?F0$\"3aT9[_gX,gF07$$\"30++]_!>w7#F0$\"3l(*4cK GwElF07$$\"3O++v)Q?QD#F0$\"3)G?XZM1(zqF07$$\"3G+++5jypBF0$\"32$[FF0$\"3[`(R=ngKb*F07$$\"37++D6EjpGF0$\"3V\\\\NK\"zM- \"F37$$\"\"$F*F+-%'COLOURG6&%$RGBG$\"#5!\"\"$F*F*F`[l-%'LEGENDG6#Q)Fun ction6\"-F$6%7S7$$F_[lF*$\"33+++++++6F07$Fj[l$\"3,+++l#4aL\"F07$Fj[l$ \"3=++v2wBS:F07$Fj[l$\"3C++],&)eq&R(F07$Fj[l$\"3 .++]$3c9i(F07$Fj[l$\"3m++vj:PSyF07$Fj[l$\"3G++]!))RM3)F07$Fj[l$\"3&*** ***RdZ=I)F07$Fj[l$\"3s+++0W/N&)F07$Fj[l$\"3;***\\PRbju)F07$Fj[l$\"3E++ +>TPx*)F07$Fj[l$\"3g***\\dtWZ>*F07$Fj[l$\"3'****\\Fmf>U*F07$Fj[l$\"3l) ****\\y.Tk*F07$Fj[l$\"3?++v$4om()*F07$Fj[l$\"34++S;b155F37$Fj[l$\"30++ XH9(H.\"F37$Fj[l$\"35+](*pwob5F37$Fj[l$\"3)*****zN:cw5F37$Fj[l$\"3'*** *\\;M&[+6F37$Fj[l$\"3+++!)yI)=7\"F37$Fj[l$\"31+]dHvpW6F37$Fj[l$\"3/+]- qQ`m6F37$Fj[l$\"3/++++++!>\"F3-Fjz6&F\\[lF`[lF][lF`[l-Fb[l6#Q1x0,~Curr ent~rootFe[l-F$6%7S7$$\"3++++++++]FgpF[\\l7$FfelF^\\l7$FfelFa\\l7$Ffel Fd\\l7$FfelFg\\l7$FfelFj\\l7$FfelF]]l7$FfelF`]l7$FfelFc]l7$FfelFf]l7$F felFi]l7$FfelF\\^l7$FfelF_^l7$FfelFb^l7$FfelFe^l7$FfelFh^l7$FfelF[_l7$ FfelF^_l7$FfelFa_l7$FfelFd_l7$FfelFg_l7$FfelFj_l7$FfelF]`l7$FfelF``l7$ FfelFc`l7$FfelFf`l7$FfelFi`l7$FfelF\\al7$FfelF_al7$FfelFbal7$FfelFeal7 $FfelFhal7$FfelF[bl7$FfelF^bl7$FfelFabl7$FfelFdbl7$FfelFgbl7$FfelFjbl7 $FfelF]cl7$FfelF`cl7$FfelFccl7$FfelFfcl7$FfelFicl7$FfelF\\dl7$FfelF_dl 7$FfelFbdl7$FfelFedl7$FfelFhdl7$FfelF[el-Fjz6&F\\[lF][lF][lF`[l-Fb[l6# Q-x1,~New~rootFe[l-F$6%7S7$F($\"\"(F*7$F.$\"3z******\\TVQnF07$F5$\"3l* ***\\-r%3^'F07$F:$\"3A+++l;!\\D'F07$F?$\"3o*****\\lfs*fF07$FD$\"3%)*** *\\s@%3u&F07$FI$\"3J++]U.6.bF07$FN$\"3')****\\-G&pD&F07$FS$\"3(*****\\ AjP-]F07$FX$\"3i****\\sih[ZF07$Fgn$\"3I+++qGf([%F07$F\\o$\"3_*****\\J$ odUF07$Fao$\"3y******4'f))*RF07$Ffo$\"33+++]J(*QPF07$F[p$\"3#)*******Q C&)[$F07$F`p$\"3/++]AH4hKF07$Fep$\"3%*******4\\l!*HF07$F[q$\"3'******* R%e:w#F07$F`q$\"33++]#yk]\\#F07$Feq$\"3M+++SFF07$F`w$!3;++]Z=iYAF07$Few$!3[******\\'[M\\#F07$Fj w$!3W****\\PM&=v#F07$F_x$!3v+++gzs+IF07$Fdx$!35+++0\"Q_D$F07$Fix$!3q++ ]x2k2NF07$F^y$!3d+++?EdRPF07$Fcy$!3M+++&o#R0SF07$Fhy$!3++++?`9VUF07$F] z$!3G++]<#Rm\\%F07$Fbz$!3F++]A_ERZF07$Fgz$!\"&F*-Fjz6&F\\[lF`[lF`[lF][ l-Fb[l6#Q-Tangent~lineFe[l-%+AXESLABELSG6$Q\"xFe[lQ\"yFe[l-%&TITLEG6#Q [rEntered~function~on~given~interval~with~current~and~next~root|+~and~ tangent~line~of~the~curve~at~the~current~rootFe[l-%*THICKNESSG6#Fhz-%% VIEWG6$;$!#IF_[l$\"#IF_[l;$\"%+6F)$\"&+>\"F)" 1 2 0 1 10 3 2 9 1 4 2 1.000000 45.000000 45.000000 0 1 "Function" "x0, Current root" "x1, Ne w root" "Tangent line" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 4 " " 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 0 "" }{TEXT 272 24 "Section IV: Iteration 2." }}{PARA 0 "" 0 "" {TEXT -1 119 "The \+ same method is used in iterations to calculate the next estimation of \+ the root. The second estimate of the root is," }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "x2:=x1-eval(f(x),x=x1)/eval(g(x),x=x1);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x2G$!++++] " 0 "" {MPLTEXT 1 0 29 " epsilon:=abs((x2-x1)/x2)*100;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(ep silonG$\"+'G9dG\"!\"(" }}}{PARA 0 "" 0 "" {TEXT -1 111 "While not nece sary to the method, for graphing purposes we define the equation of th e tangent line touching x0." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "tanline(x):=eval(g(x),x=x1)*x+eval(f(x),x=x1)-eval(g(x),x=x1)*x1: " }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 280 "plot([f(x),[x1,t,t=yrange],[x2,t,t=yrange],ta nline(x)],x=xrange,y=yrange,title=\"Entered function on given interval with current and next root\\n and tangent line of the curve at the cu rrent root\",legend=[\"Function\", \"x1, Current root\", \"x2, New roo t\", \"Tangent line\"],thickness=3);" }}{PARA 13 "" 1 "" {GLPLOT2D 549 549 549 {PLOTDATA 2 "6*-%'CURVESG6%7S7$$!\"$\"\"!$\"#6F*7$$!3!**** **\\2<#pG!#<$\"3XbrMi1CB5!#;7$$!3#)***\\7bBav#F0$\"39hJyY*eBf*F07$$!36 ++]K3XFEF0$\"3!\\%\\?xy\\.*)F07$$!3%)****\\F)H')\\#F0$\"35!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+++5jypBF0$\"32$[FF0$\"3[`(R=ngKb*F07$$\"37++D6EjpGF0$\"3V\\\\NK\"zM -\"F37$$\"\"$F*F+-%'COLOURG6&%$RGBG$\"#5!\"\"$F*F*F`[l-%'LEGENDG6#Q)Fu nction6\"-F$6%7S7$$\"3++++++++]Fgp$\"33+++++++6F07$Fj[l$\"3,+++l#4aL\" F07$Fj[l$\"3=++v2wBS:F07$Fj[l$\"3C++],&)eq&R(F07$ Fj[l$\"3.++]$3c9i(F07$Fj[l$\"3m++vj:PSyF07$Fj[l$\"3G++]!))RM3)F07$Fj[l $\"3&******RdZ=I)F07$Fj[l$\"3s+++0W/N&)F07$Fj[l$\"3;***\\PRbju)F07$Fj[ l$\"3E+++>TPx*)F07$Fj[l$\"3g***\\dtWZ>*F07$Fj[l$\"3'****\\Fmf>U*F07$Fj [l$\"3l)****\\y.Tk*F07$Fj[l$\"3?++v$4om()*F07$Fj[l$\"34++S;b155F37$Fj[ l$\"30++XH9(H.\"F37$Fj[l$\"35+](*pwob5F37$Fj[l$\"3)*****zN:cw5F37$Fj[l $\"3'****\\;M&[+6F37$Fj[l$\"3+++!)yI)=7\"F37$Fj[l$\"31+]dHvpW6F37$Fj[l $\"3/+]-qQ`m6F37$Fj[l$\"3/++++++!>\"F3-Fjz6&F\\[lF`[lF][lF`[l-Fb[l6#Q1 x1,~Current~rootFe[l-F$6%7S7$$!3+++++++]6 F07$F5$!3#)***\\7bBa+\"F07$F:$!35,++D$3Xx)Fgp7$F?$!3W)****\\F)H'[(Fgp7 $FD$!3?****\\i3@/iFgp7$FI$!3a,+]7q0DFgp7$Ffo$\"3h******\\U80QFgp7$F[p$\"3'4+++ 0yt0&Fgp7$F`p$\"3w****\\(QNX>'Fgp7$Fep$\"3G+++]asYvFgp7$F[q$\"3C++++y? #p)Fgp7$F`q$\"3'****\\(3wY-5F07$Feq$\"3$)******HOT?6F07$Fjq$\"39++v3\" >)\\7F07$F_r$\"39++DEP/t8F07$Fdr$\"3=++](o:;]\"F07$Fir$\"3>++v$)[o>;F0 7$F^s$\"3%*****\\i%Qqu\"F07$Fds$\"3%****\\(QIKz=F07$Fis$\"3#****\\7:xW *>F07$F^t$\"38++]Zn%)=@F07$Fct$\"3!)******4FLZAF07$Fht$\"3#)****\\d6.t BF07$F]u$\"3)****\\(o3l%\\#F07$Fbu$\"3\"*****\\A))oHEF07$Fgu$\"3e***** *Hk-^FF07$F\\v$\"35+++D-e!)GF07$Fav$\"3s***\\(=_(z*HF07$Ffv$\"3N+++b*= j7$F07$F[w$\"3g***\\(3/3ZKF07$F`w$\"33++vB4JtLF07$Few$\"3u*****\\KCn\\ $F07$Fjw$\"3s***\\(=n#fi$F07$F_x$\"3Q+++!)RO]PF07$Fdx$\"3/++]_!>w(QF07 $Fix$\"3N++v)Q?Q+%F07$F^y$\"3H+++5jy>TF07$Fcy$\"3=++]Ujp_UF07$Fhy$\"3+ +++gEdrVF07$F]z$\"39++v3'>$)\\%F07$Fbz$\"38++D6Ej>YF07$Fgz$\"3+++++++] ZF0-Fjz6&F\\[lF`[lF`[lF][l-Fb[l6#Q-Tangent~lineFe[l-%+AXESLABELSG6$Q\" xFe[lQ\"yFe[l-%&TITLEG6#Q[rEntered~function~on~given~interval~with~cur rent~and~next~root|+~and~tangent~line~of~the~curve~at~the~current~root Fe[l-%*THICKNESSG6#Fhz-%%VIEWG6$;$!#IF_[l$\"#IF_[l;$\"%+6F)$\"&+>\"F) " 1 2 0 1 10 3 2 9 1 4 2 1.000000 45.000000 45.000000 0 1 "Function" " x1, Current root" "x2, New root" "Tangent line" }}}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 0 "" }{TEXT 273 23 "Section V: Iteration 3." }}{PARA 0 "" 0 "" {TEXT -1 118 "The same method is used in iterations to calculate \+ the next estimation of the root. The third estimate of the root is," } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "x3:=x2-eval(f(x),x=x2)/eval (g(x),x=x2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x3G$!*H9d.$!\"*" }} }{PARA 0 "" 0 "" {TEXT -1 79 "How good is that answer? Find the absolu te relative approximate error to judge." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "epsilon:=abs((x3-x2)/x3)*100;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(epsilonG$\"+ueqkZ!\"(" }}}{PARA 0 "" 0 "" {TEXT -1 111 "While not necesary to the method, for graphing purposes we define the equation of the tangent line touching x0." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "tanline(x):=eval(g(x),x=x2)*x+eval(f(x),x=x2)-ev al(g(x),x=x2)*x2:" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 286 "plot([f(x),[x2,t,t=-100..10 0],[x3,t,t=-100..100],tanline(x)],x=xrange,y=yrange,title=\"Entered fu nction on given interval with current and next root\\n and tangent lin e of the curve at the current root\",legend=[\"Function\", \"x2, Curre nt root\", \"x3, New root\", \"Tangent line\"],thickness=3);" }}{PARA 13 "" 1 "" {GLPLOT2D 549 549 549 {PLOTDATA 2 "6*-%'CURVESG6%7S7$$!\"$ \"\"!$\"#6F*7$$!3!******\\2<#pG!#<$\"3XbrMi1CB5!#;7$$!3#)***\\7bBav#F0 $\"39hJyY*eBf*F07$$!36++]K3XFEF0$\"3!\\%\\?xy\\.*)F07$$!3%)****\\F)H') \\#F0$\"35!os[,^JC)F07$$!3#****\\i3@/P#F0$\"3mH'Qh7'*)=wF07$$!3;++Dr^b ^AF0$\"3KiUC\"F0$\"3)z@1*4%)=[NF07$$!3-++DhkaI6F0$\"3q(*[/,`8yKF07$$!3s ******\\XF`**!#=$\"33xnnUnn!*HF07$$!3u*******>#z2))Fgp$\"3g3QQM?xvFF07 $$!3S++]7RKvuFgp$\"3EVz'fn/)eDF07$$!3s,+++P'eH'Fgp$\"3Kx(*G(**yjR#F07$ $!3q)***\\7*3=+&Fgp$\"3QW;(R#4=]AF07$$!3[)***\\PFcpPFgp$\"3([[>B.'4U@F 07$$!3;)****\\7VQ[#Fgp$\"3U(4'pmZph?F07$$!32)***\\i6:.8Fgp$\"3,^K_H?)p ,#F07$$!3Wb+++v`hH!#?$\"36kVqq(3++#F07$$\"3]****\\(QIKH\"Fgp$\"33M:N[W s;?F07$$\"38****\\7:xWCFgp$\"3]:L[x!p(f?F07$$\"3E,++vuY)o$Fgp$\"3uG89B z/O@F07$$\"3!z******4FL(\\Fgp$\"3sVfVC)RtC#F07$$\"3A)****\\d6.B'Fgp$\" 3Y*y:K#y;)Q#F07$$\"3s****\\(o3lW(Fgp$\"3mH,L;\\]aDF07$$\"35*****\\A))o z)Fgp$\"3UO9VCC&Qx#F07$$\"3e******Hk-,5F0$\"3,W&eN\"R0-IF07$$\"36+++D- eI6F0$\"3e]5;X;@yKF07$$\"3u***\\(=_(zC\"F0$\"3u4ThY@WdNF07$$\"3M+++b*= jP\"F0$\"3%HH#*e'QD%*QF07$$\"3g***\\(3/3(\\\"F0$\"3slIE](\\7C%F07$$\"3 3++vB4JB;F0$\"3?zg;b$Q^j%F07$$\"3u*****\\KCnu\"F0$\"3#\\qYv'e/^]F07$$ \"3s***\\(=n#f(=F0$\"3SS,7a55>bF07$$\"3P+++!)RO+?F0$\"3aT9[_gX,gF07$$ \"30++]_!>w7#F0$\"3l(*4cKGwElF07$$\"3O++v)Q?QD#F0$\"3)G?XZM1(zqF07$$\" 3G+++5jypBF0$\"32$[FF0$\"3[`(R=ngKb*F07$$\"37+ +D6EjpGF0$\"3V\\\\NK\"zM-\"F37$$\"\"$F*F+-%'COLOURG6&%$RGBG$\"#5!\"\"$ F*F*F`[l-%'LEGENDG6#Q)Function6\"-F$6%7S7$$!3+++++++]s%HaF37$Fj[l$!3'*)*****\\$*4)*\\F37$Fj[l$!3))**** **\\_&\\c%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+++J/!Q-\"F37$F]z$!3'**\\iI'=; o5F37$Fbz$!3++v$RT@16\"F37$Fgz$!3++++++Dc6F3-Fjz6&F\\[lF`[lF`[lF][l-Fb [l6#Q-Tangent~lineFe[l-%+AXESLABELSG6$Q\"xFe[lQ\"yFe[l-%&TITLEG6#Q[rEn tered~function~on~given~interval~with~current~and~next~root|+~and~tang ent~line~of~the~curve~at~the~current~rootFe[l-%*THICKNESSG6#Fhz-%%VIEW G6$;$!#IF_[l$\"#IF_[l;$\"%+6F)$\"&+>\"F)" 1 2 0 1 10 3 2 9 1 4 2 1.000000 45.000000 45.000000 0 1 "Function" "x2, Current root" "x3, Ne w root" "Tangent line" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {PARA 3 "" 0 "" {TEXT -1 0 "" }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT 275 24 " Section VI: Iteration 4." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " x4:=x3-eval(f(x),x=x3)/eval(g(x),x=x3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x4G$\"+H>LUJ!\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "epsilon:=abs((x4-x3)/x4)*100;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#> %(epsilonG$\"+aqg'4\"!\"(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "tanline(x):=eval(f(x),x=x3)+(0-eval(f(x),x=x3))/(x4-x3)*(x-x3):" } }}{EXCHG {PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 280 "plot([f(x),[x3,t,t=yrange],[x4,t,t=yrange],tanline(x )],x=xrange,y=yrange,title=\"Entered function on given interval with c urrent and next root\\n and tangent line of the curve at the current r oot\",legend=[\"Function\", \"x2, Current root\", \"x4, New root\", \" Tangent line\"],thickness=3);" }}{PARA 13 "" 1 "" {GLPLOT2D 549 549 549 {PLOTDATA 2 "6*-%'CURVESG6%7S7$$!\"$\"\"!$\"#6F*7$$!3!******\\2<#p G!#<$\"3XbrMi1CB5!#;7$$!3#)***\\7bBav#F0$\"39hJyY*eBf*F07$$!36++]K3XFE F0$\"3!\\%\\?xy\\.*)F07$$!3%)****\\F)H')\\#F0$\"35!os[,^JC)F07$$!3#*** *\\i3@/P#F0$\"3mH'Qh7'*)=wF07$$!3;++Dr^b^AF0$\"3KiUC\"F0$\"3)z@1*4%)=[N F07$$!3-++DhkaI6F0$\"3q(*[/,`8yKF07$$!3s******\\XF`**!#=$\"33xnnUnn!*H F07$$!3u*******>#z2))Fgp$\"3g3QQM?xvFF07$$!3S++]7RKvuFgp$\"3EVz'fn/)eD F07$$!3s,+++P'eH'Fgp$\"3Kx(*G(**yjR#F07$$!3q)***\\7*3=+&Fgp$\"3QW;(R#4 =]AF07$$!3[)***\\PFcpPFgp$\"3([[>B.'4U@F07$$!3;)****\\7VQ[#Fgp$\"3U(4' pmZph?F07$$!32)***\\i6:.8Fgp$\"3,^K_H?)p,#F07$$!3Wb+++v`hH!#?$\"36kVqq (3++#F07$$\"3]****\\(QIKH\"Fgp$\"33M:N[Ws;?F07$$\"38****\\7:xWCFgp$\"3 ]:L[x!p(f?F07$$\"3E,++vuY)o$Fgp$\"3uG89Bz/O@F07$$\"3!z******4FL(\\Fgp$ \"3sVfVC)RtC#F07$$\"3A)****\\d6.B'Fgp$\"3Y*y:K#y;)Q#F07$$\"3s****\\(o3 lW(Fgp$\"3mH,L;\\]aDF07$$\"35*****\\A))oz)Fgp$\"3UO9VCC&Qx#F07$$\"3e** ****Hk-,5F0$\"3,W&eN\"R0-IF07$$\"36+++D-eI6F0$\"3e]5;X;@yKF07$$\"3u*** \\(=_(zC\"F0$\"3u4ThY@WdNF07$$\"3M+++b*=jP\"F0$\"3%HH#*e'QD%*QF07$$\"3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gelF^]l7$FgelFa]l7$FgelFd]l7$FgelFg]l7 $FgelFj]l7$FgelF]^l7$FgelF`^l7$FgelFc^l7$FgelFf^l7$FgelFi^l7$FgelF\\_l 7$FgelF__l7$FgelFb_l7$FgelFe_l7$FgelFh_l7$FgelF[`l7$FgelF^`l7$FgelFa`l 7$FgelFd`l7$FgelFg`l7$FgelFj`l7$FgelF]al7$FgelF`al7$FgelFcal7$FgelFfal 7$FgelFial7$FgelF\\bl7$FgelF_bl7$FgelFbbl7$FgelFebl7$FgelFhbl7$FgelF[c l7$FgelF^cl7$FgelFacl7$FgelFdcl7$FgelFgcl7$FgelFjcl7$FgelF]dl7$FgelF`d l7$FgelFcdl7$FgelFfdl7$FgelFidl7$FgelF\\el-Fjz6&F\\[lF][lF][lF`[l-Fb[l 6#Q-x4,~New~rootFe[l-F$6%7S7$F($\"3-+++iHFHPF07$F.$\"3=+z8V!p)\\OF07$F 5$\"3oMk!z6!y!e$F07$F:$\"33H&)p&R#3.NF07$F?$\"3B(R_Dkp[U$F07$FD$\"3A*G p4iGqM$F07$FI$\"3'[S<'H+'[F$F07$FN$\"3uz/WLO8+KF07$FS$\"3k*3^IQkD:@#F07$F_r$\"3:0cQ(p5n8#F07$Fdr $\"3?:OP\\\"\\'e?F07$Fir$\"35F17!Gkp)>F07$F^s$\"3;C=MkCk4>F07$Fds$\"3Q !3['GoKH=F07$Fis$\"3wwVnJ=Tfn&*HWnb;Fgp7$Fgz$\"3(z******R\"eT')!#>-Fjz6&F\\[lF`[lF`[lF][l-Fb[l6# Q-Tangent~lineFe[l-%+AXESLABELSG6$Q\"xFe[lQ\"yFe[l-%&TITLEG6#Q[rEntere d~function~on~given~interval~with~current~and~next~root|+~and~tangent~ line~of~the~curve~at~the~current~rootFe[l-%*THICKNESSG6#Fhz-%%VIEWG6$; $!#IF_[l$\"#IF_[l;$\"%+6F)$\"&+>\"F)" 1 2 0 1 10 3 2 9 1 4 2 1.000000 45.000000 45.000000 0 1 "Function" "x2, Current root" "x4, New root" " Tangent line" }}}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT 276 28 "Section VII: Val ue of Roots." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 16 "Root Calculation" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 193 "xr:=proc(n)\n local \+ p, q, i;\n p:=x0;\n q:=x0;\n for i from 1 to n do\n \+ p:=q-eval(f(x),x=q)/eval(g(x),x=q);\n q:=p;\n end do;\n \+ \n p; \nend proc:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "nrange:=1..nmax: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Absolute approximate error" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 100 "Ea:=proc(n)\n if n=1 th en\n abs(xr(n)-x0);\n else\n abs(xr(n)-xr(n-1));\n end if; \nend proc:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Absolute relative \+ approximate error" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "ea:=pr oc(n)\nabs(Ea(n)/xr(n))*100;\nend proc: " }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 130 "plot(ea,nrange,0..1000,title=\"Absolute relative a pproximate error as a function of number of iterations\",thickness=3,c olor=green);" }}{PARA 13 "" 1 "" {GLPLOT2D 549 549 549 {PLOTDATA 2 "6( -%'CURVESG6#7^[l7$\"\"\"$\"+++++I!\"(7$$\"+$yR(p7!\"*F)7$$\"+m&z%R:F/F )7$$\"+e%\\Vn\"F/F)7$$\"+\\$>#4=F/F)7$$\"+%Ham(=F/F)7$$\"+S#*3W>F/F)7$ $\"+'=C:,#F/$\"+'G9dG\"F+7$$\"+J\"f*y?F/FB7$$\"+9*)p[BF/FB7$$\"+(pQ%=E F/F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x/UA5F+7$$\"+7u9g*)FitFhbn7$$\"+) =)zp!*Fit$\"+lY*\\4\"F+7$$\"+l*[%z\"*Fit$\"+8/#p\\\"F+7$$\"+*)[fv$*Fit $\"+%yOO-\"F+7$$\"+ats%e*Fit$\"+xf'\\`\"F+7$$\"+4Q*[y*Fit$\"+N%yy/\"F+ 7$\"$+\"$\"+^*=JK\"F+-%+AXESLABELSG6$Q!6\"F]en-%&TITLEG6#QdoAbsolute~r elative~approximate~error~as~a~function~of~number~of~iterationsF^en-%' COLOURG6&%$RGBG$\"\"!Fhen$\"*++++\"FitFgen-%*THICKNESSG6#\"\"$-%%VIEWG 6$;$F(Fhen$FgdnFhen;Fgen$\"%+5Fhen" 1 2 0 1 10 3 2 6 1 4 2 1.000000 45.000000 45.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 257 "As can be noted with the above graph, the solution does not conve rge (which is good because tthere is no root at that location). What i s worse is the fact that the estimated roots will stay in this vicinit y of the function thus never finding a realy answer." }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 " " 0 "" {TEXT -1 0 "" }{TEXT 265 0 "" }{TEXT 266 23 "Section VI: Conclu sion." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 265 "Maple helped us to apply our knowledge of numerical methods of findin g roots of a nonlinear equation using the Newton-Raphson method to und erstand a pitfall of the Newton-Raphson method where one is getting os cillation around a local maxima or minima of a function." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{PARA 4 "" 0 "" {TEXT 267 10 "References" }} {PARA 0 "" 0 "" {TEXT -1 4 "[1] " }{TEXT 269 174 "Nathan Collier, Auta r Kaw, Jai Paul , Michael Keteltas, Holistic Numerical Methods Institu te, See http://numericalmethods.eng.usf.edu/mws/gen/03nle/mws_gen_nle_ txt_newton.pdf" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 264 "" 0 "" {TEXT -1 0 "" }{TEXT 260 10 "Disclaimer" }{TEXT 268 1 ":" }{TEXT -1 248 " While every effort has been made to validate the solutions in th is worksheet, University of South Florida and the contributors are not responsible for any errors contained and are not liable for any damag es resulting from the use of this material." }}}{MARK "0 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }