5.4 Predictor -Corrector Methods 191 Ifn!molecules ofK2Cr207,n2molecules ofH20,andn3molecules ofSareoriginally available ,the following differential equation describes theamount x(r)ofKOH after time t: dx dt where kisthevelocity constant ofthereaction .Ifk=6.22 x10-19,nj=n2=2x103,and =3x103,usetheRunge -Kutta method oforder 4todetermine how many units ofpotassium hydroxide willhave been formed after 0.2s. 20. Show thatHeun’sMethod canbeexpressed indifference form,similar tothatoftheRunge -Kutta method oforder 4,as w0=or. *2=hf ^t,+ w,+-*|J, *3=h f +y,w,+ , w.+i=W,+\(k{+3*3), foreachi=0,1,...,N-1. 5.4 Predictor -Corrector Methods TheTaylor andRunge -Kutta methods areexamples ofone-stepmethods forapproximating thesolution toinitial -value problems .These methods usew,intheapproximation w,+i to butdonotinvolve anyoftheprior approximations WQ,w w,*_|.Generally some functional evaluations of/arerequired atintermediate points ,butthese arediscarded assoon asw,+iisobtained . Since \y(tj)-Wj|decreases inaccuracy asjincreases ,better approximation methods canbederived if,when approximating y(4+j),weinclude inthemethod some ofthe approximations prior tow,.Methods developed using thisphilosophy arecalled multistep methods .Inbrief ,one-step methods consider what occurred atonly oneprevious step; multistep methods consider what happened atmore than oneprevious step. Toderive amultistep method ,suppose thatthesolution totheinitial-value problem dy—=fit,y),fora deemed Cutanyvupprevsed content docs notmaterial yafreet theoverall teamIncexperience .Cenit ape[.cam/inroenti theright Mremove additional conceal atanytime i!vubveqjrnt nghtv restrictions require It.192 C H A P T E R 5 Numerical Solution ofInitial -Value Problems bysome ofthepreviously obtained data points (to,wo),ft,w\),...,(tj,w,).When we assume ,inaddition ,thatyft)%w,,wehave /*'I+I yft+i)^w,+/P(t)dt. J t j Ifwm+jisthefirstapproximation generated bythemultistcp method ,then weneed to supply starting values wo,w\,...,wmforthemethod .These starting values arcgenerated using aone-step Runge -Kutta method with thesame error characteristics asthemultistep method . There aretwodistinct classes ofmultistep methods .Inanexplicit method ,w,+idoes notinvolve thefunction evaluation /ft+j,w,+|).Amethod thatdoes depend inparton /ft+i,w,+i)isanimplicit method . Adams -Bashforth Explicit Methods Some oftheexplicit multistep methods ,together with their required starting values and local error terms ,aregiven next . Adams -Bashforth Two -Step Explicit Method w0=a,w!=o?i, w,+1=W|+-[3/ft,W i)-/ft— 1,W|_,)], where i=1,2,...,N— 1,with local error^y"'0z,)/i3forsome /Zjinft.j,fl+i). Adams -Bashforth Three -Step Explicit Method w0=a,wi=a i,w2=a2, w,+i=w,+— [23/ft,w,)-16/ft_i,w,_i)+5/ft_2,w,_2)] where i=2,3,...,N— 1,with local error|y(4)0z,)/i4forsome /z(inft_2ff,+i). Adams -Bashforth Four -Step Explicit Method w0=a,w\=ori,w2=a2,w3=a3, Wf+1=Wi+— [55/ft,w.)-59/ft_i,w,_i)+37/ft_2.w,_2)-9/ft_3>w,_3)] where i=3,4,...,N— 1,with local error^y(5)(/z,)/t5forsome jz,inft_3,/,+i). Copyright 2012 Cenfajc Lcarni #*.AIRighb Rocncd May ncabecopied .N.anncd .orduplicated.»whole oempan .Doc 10electronic itjhu .*wtcthird pur.ycontent may besuppreved riom theeBook and/orcClupccnM .Editorial toiew h*> deemed Cutanysuppicicd content dee>notimxttaly alTect theoverall learning experience .Ccnitasc [.cammu rexrvei thert|>httorenxyve additional contort atanytime ifwtoeqjcoi ngh*»rotrictionc require It5.4 Predictor -Corrector Methods 193 Adams -Bashforth Five -Step Explicit Method Wo=or,W!=a,,w2=a2,w3=or3,w4=a4 w,+i=w,+^[1901/ft.w,)-2774/ft_i,wl_i) +2616/(f,_2,w,_2)-1274/(f i-3,w,_3)+251/(fl_4,w,_4)] where i=4,5,.. .,N— 1,with local error^y(6,(/ij)h6forsome /x,-in(f,_4,f,+i). Adams -Moulton Implicit Methods Implicit methods use(f,+i,f(t,+1,wJ+i))asanadditional interpolation node intheapprox - imation oftheintegral r*+i f(t,y(t))dt. Some ofthemore common implicit methods arelisted next .Notice thatthelocal error ofan(m-l)-step implicit method is0(/im+I),thesame asthatofanm-step explicit method .They both usemfunction evaluations ,however ,because theimplicit methods use /(f,+1,wl+i),buttheexplicit methods donot. Adams -Moulton Two -Step Implicit Method w0=a,wi=ofi w,+i=Wi-h~[5/(fj+i,w1+I)+8/(4,w/)— w,_i)] where i=1,2,. ..,N-1,with local error-^y(4)(M,)/z4forsome /x,in f/+i). Adams -Moulton Three -Step Implicit Method w0=a,w i=a uw2=a2, w,+i=W,— [9/ft+i,wt+1)-f19/(r/,w,)-5/tt_ i,Wi_i)+/(f,_ 2,w,_ 2)],24 where i=2,3,.. .,N— 1,with local error-^y(5>(/x,)/i5forsome /xfin(/,_2,f,+1). Adams -Moulton Four -Step Implicit Method w0=Of,Wi=or,,w2=a2,w3=a3, W,-+1=W/+— [251/fc+i,w,+1)+646/(r,,wf)-264/(r,_,,w,_i) +106/(f,_ 2,w,_ 2)-19/(f,_ 3,w/_ 3)] where i=3,4,.. .,N— 1,with local error-j^jy(6>0x,)/z6forsome jxfin(/,_3,r1+i). Copyright 2012 Cc«£»fcLearn!#*.AIRighb Reversed May notbecopied ,canned ,ordaplicatod .»whole o»mpar.Doctoelectronic ilfhu.xvtic third pur.ycontent may besuppreved riom theeBook and/orcCh deemed Cutanyvuppicvvcd content doev notimxtlaly alTect theoverall Icamir .itexperience .C'cnitasc [.camme reserve*therljtlu lorenxyve additional contort atanytimeiivubveqjcnt nRhtv rotrictionv require It194 C H A P T E R 5 Numerical Solution ofInitial -Value Problems Itisinteresting tocompare anm-step Adams -Bashforth explicit method toan(m— 1)- step Adams -Moulton implicit method .Both require mevaluations of/perstep,andboth have theterms y(m+l)(iii)hm+xintheir local errors.Ingeneral ,thecoefficients oftheterms involving /intheapproximation andthose inthelocal error aresmaller fortheimplicit methods thanfortheexplicit methods .This leads tosmaller truncation andround -offerrors fortheimplicit methods . Example 1InExample 2ofSection 5.3(seeTable 5.8onpage 188)weused theRunge -Kutta method oforder 4with h=0.2toapproximate thesolutions totheinitial value problem y'=y-t2+1,0(0.2) W\=0.8292933 , >»(0.4)%W2=1.2140762 ,andy(0.6)^w$=1.6489220 .Usethese asstarting values forthefourth -order Adams -Bashforth method tocompute new approximations fory(0.8) and>(1.0),andcompare these newapproximations tothose produced bytheRunge -Kutta method oforder 4. Solution Forthefourth -order Adams -Bashforth wehave y(0.8)w4=w3+!TT(55/(0.6,w3)-59/(0.4,w2)+37/(0.2,w,)-9/(0,w0))24 =1.6489220 +— (55/(0.6,1.6489220 )-59/(0.4,1.2140762 )24 -I-37/(0.2,0.8292933 )-9/(0,0.5)) =1.6489220 +0.0083333 (55(2.2889220 )-59(2.0540762 ) +37(1.7892933 )— 9(1.5)) =2.1272892 , and y(1.0)**w5=w4+^(55/(0.8,w4)-59/(0.6,w3)+37/(0.4,w2)-9/(0.2,w,))24 =2.1272892 +^(55/(0.8,2.1272892 )-59/(0.6,1.6489220 )24 +37/(0.4,1.2140762 )-9/(0.2,0.8292933 )) =2.1272892 +0.0083333 (55(2.4872892 )-59(2.2889220 ) +37(2.0540762 )-9(1.7892933 )) =2.6410533 , Theerrors forthese approximations att=0.8andt=1.0are,respectively , 12.1272295 -2.12728921 =5.97 x10~5and12.6410533 -2.64085911 =1.94 x10~“ . Thecorresponding Runge -Kutta approximations haderrors 12.1272027 -2.12728921 =2.69x10“ 5and|2.6408227 -2.64085911 =3.64 x10“ 5. Copyright 2012 Cengage Learning .AIRighto Reversed May rotbecopied ,canned ,orduplicated .inwhole orinpar.Doctoelectronic righto.xvnc third pur.ycontent may besuppressed rrom theeBook and/oreChaptcnnl .Editorial review h*> deemed Cutanysuppressed content docs notmaterial yalTect theover4.1learning experience .Ccnitape [.camon reserves theright Mremove additional conceal atanytime i!suhvajjcM rights restrictions require It.5.4 Predictor -Corrector Methods 195 Theprogram PRCORM 53 implements theAdams Predictor -Corrector method . Example 2Theimplicit Adams -Moulton methods generally give considerably better results than theexplicit Adams -Bashforth method ofthesame order.However ,theimplicit methods have theinherent weakness offirsthaving toconvert themethod algebraically toanexplicit representation forwJ+i.That thisprocedure canbecome difficult ,ifnotimpossible ,canbe seen byconsidering theelementary initial -value problem y'=ey\ for0\theAdams -Moulton Three -Step method has w1+1=w,+^-[9e‘',+1+196“ '-5ew‘-'+ew-2]24 asitsdifference equation ,andthisequation cannot besolved explicitly forw,-+j.Wecould useNewton ’smethod ortheSecant method toapproximate w,+i,butthiscomplicates the procedure considerably . Predictor -Corrector Methods Inpractice ,implicit multistep methods arenotused alone .Rather ,they areused toim- prove approximations obtained byexplicit methods .The combination ofanexplicit and implicit technique iscalled apredictor -corrector method .The explicit method predicts anapproximation ,andtheimplicit method corrects thisprediction . Consider thefollowing fourth -order method forsolving aninitial -value problem .The first step istocalculate thestarting values wo,wj,w2,and w3fortheexplicit Adams - Bashforth Four-Step method .Todothis,weuseafourth -order one-stepmethod ,specifically , theRungc -Kutta method oforder 4.The next step istocalculate anapproximation ,w4p,to y(f4)using theexplicit Adams -Bashforth Four-Step method aspredictor : hw4p=w3+^[55/(f3,w3)-59/(r2,w2)+37/(f,,w,)-9/(f0,vv0)]. This approximation isimproved byuseoftheimplicit Adams -Moulton Three -Step method ascorrector : W4=w3+-[9/(/4,w4p)-f19/(r3,w3)-5/(r2,w2)+/(/1,w\)]. The value w4isnow used astheapproximation toy(r4).Then thetechnique ofusing the Adams -Bashforth method asapredictor andtheAdams -Moulton method asacorrector is repeated tofindw$pandw3,theinitial andfinal approximations toy(ts).This process is continued until weobtain anapproximation toy(tjv)=y(b). Program PRCORM 53isbased ontheAdams -Bashforth Four-Step method aspredictor andoneiteration oftheAdams -Moulton Three -Step method ascorrector ,with thestarting values obtained from theRunge -Kutta method oforder 4. Apply theAdams fourth -order predictor -corrector method with h=0.2andstarting values from theRunge -Kutta fourth -order method totheinitial -value problem y'=y-t2+1,0 deemed Cut artysuppressed content dees notnuxtlaly affect theoverall teamIncexperience .Cenitapc Learn xiprcsenn thenjht Mremove additional conceal atanytime i!suhvenjcni nphts restrictions require It.196 C H A P T E R 5 Numerical Solution ofInitial-Value Problems andthefourth -order Adams -Bashforth method gave >(0.8)%w4p=Wj+°'2[55/(0.6,w3)-59/(0.4,w2)+37/(0.2,w,)-9/(0,tv0)]24 =1.6489220 +^[55/(0.6,1.6489220 )-59/(0.4,1.2140762 )24 +37/(0.2,0.8292933 )-9/(0,0.5)] =1.6489220 +0.0083333 [55(2.2889220 )-59(2.0540762 ) +37(1.7892933 )— 9(1.5)] =2.1272892 . Wewill now usew4pasthepredictor oftheapproximation toy(0.8)anddetermine the corrected value W4,from theimplicit Adams -Moulton method .This gives y(0.8)^W4:=W3H-^[9/(0.8,w4p)4-19/(0.6,w3)-5/(0.4,w2)4-/(0.2,vvO] =1.6489220 4-— [9/(0.8,2.1272892 )4-19/(0.6,1.6489220 )24-5/(0.4,1.2140762 )4-/(0.2,0.8292933 )] =1.6489220 +0.0083333 (9(2.4872892 )4-19(2.2889220 ) -5(2.0540762 )+(1.7892933 )] =2.1272056 . Now weusethisapproximation todetermine thepredictor ,w5/„ fory(1.0)as V;o is IIIIIIII=+^[55/(0.8,w4)-59/(0.6,w3)+37/(0.4,w2)-9/(0.2,w,)] =2.1272056 +°'2[55/(0.8,2.1272056 )-59/(0.6,1.6489220 ) +37/(0.4,1.2140762 )-9/(0.2,0.8292933 )] =2.1272056 4-0.0083333 (55(2.4872056 )-59(2.2889220 ) 4-37(2.0540762 )-9(1.7892933 )] =2.6409314 , andcorrect thiswith y(1.0)%W5:=W«+^[9/d.O,W ip )+19/(0.8,w4)-5/(0.6,H-3)+/(0.4,w2)] =2.1272056 +— [9/(1.0,2.6409314 )+19/(0.8,2.1272892 )24 -5/(0.6,1.6489220 )4-/(0.4,1.2140762 )] =2.1272056 4-0.0083333 (9(2.6409314 )-1-19(2.4872056 ) -5(2.2889220 )4-(2.0540762 )] =2.6408286 . Copyright 2012 Cengagc Learn in*.AIRighto Reversed May n«becopied ,canned ,o*duplicated .inwhole orinpar.Doctocjectronie righto.some third pur.ycontent may besuppressed rrom theeBook and/oreChaptcnnl .Editorial review h*> deemed Cutanyvupprc"Cdcontent docs notmaterial yalTcct theover*!Ieamir .itexperience .Cenitape [.camon reserve!theright Mremove additional conceal atanytime i!subsequent rights restrictions require it5.4 Predictor -Corrector Methods 197 InExample 1wefound thatusing theexplicit Adams -Bashforth method alone produced results thatwere inferior tothose ofRunge -Kutta.However ,these approximations to>(0.8) and>(1.0)areaccurate towithin 12.1272295 -2.12720561 =2.39x10” 5and 12.6408286 -2.64085911 =3.05xllT5, respectively ,compared tothose ofRunge -Kutta ,which were accurate ,respectively ,to within 12.1272027 -2.1272892 |=2.69 x1(T5and 12.6408227 -2.6408591 |=3.64x10"5. Other multistep methods canbederived using integration ofinterpolating polynomials over intervals oftheform [tj,r,+i]forj<5)(M,)forsome /x,in(f,_3,/,+1). This method isused asapredictor foranimplicit method called Simpson ’smethod . Itsname comes from thefactthatitcanbederived using Simpson ’sruleforapproximating integrals . Simpson 'sMethod W|+1=Wj-i+j[/(fj+i*wj+i)+4/(f|,w,-)+/ft-ifw#_ i)], where 1'=1,2,...,N— 1,with local error — ^A5>(5)(Mi)forsome /x,in(/, _1,f,+i). Although thelocal error involved with apredictor -corrector method oftheMilne - Simpson type isgenerally smaller than thatoftheAdams -Bashforth -Moulton method ,the technique haslimited usebecause ofround -offerror problems ,which donotoccur with the Adams procedure . MATLAB uses methods that aremore sophisticated than thestandard Adams - Bashforth -Moulton techniques toapproximate thesolutions toordinary differential equa- tions.Anintroduction tomethods ofthistype isconsidered inSection 5.6. Copyright 2012 Cenfajc Learn in*.AIRighb Rcicfved .May notbecopied ,canned ,ocimplicated ,inwhole orinpar.Doctocjectronie rifhu.some third pur.yCOMCK may besupprc-icdrican theeBook and/orcChapccriM .Editorial review h*> deemed Cutany Mippic-cdcontent dce>notmnerlaly alTcct theoverall Icamir .itexperience .Ccnitasc l.cammuroervei theright 10remove additional eonteatatanytime ifvutoeqjcni nght »rotrk-tionv require It.198 C H A P T E R 5 Numerical Solution ofInitial -Value Problems EXERCISE SET 5.4 1. Use alltheAdams -Bashforth methods toapproximate thesolutions tothefollowing initial -value problems .Ineach case,useexact starting values andcompare theresults totheactual values . a.y'=te2‘— 2y,for0— ± eyt+± e-2t 25e*25r b.y'=l+(r— y)2,for2i+i)=n-(+i-(H-,+^(9e"*1+19ew‘-5«-'-'+ =0. Suppose thath— 0.01 andweusetheexact starting values forvv0,wi,andwi. a.Apply Newton ’smethod tothisequation with thestarting value witoapproximate W3towithin 10-6. b.Repeat thecalculations in(a)using thestarting value todetermine approximations accurate towithin 10~6foreach w(>,for 1=2,...,19. 7. UsetheMilne -Simpson Predictor -Corrector method toapproximate thesolutions totheinitial -value problems inExercise 3. 5.5Extrapolation Methods Extrapolation wasused inRomberg integration fortheapproximation ofdefinite integrals , where wefound that,bycorrectly averaging relatively inaccurate trapezoidal approxima - tions,wecould produce newapproximations thatareexceedingly accurate .Inthissection Copyright 2012 Cengagc Learn in*.AIR.(huReversed Mayr*xbecopied ,canned ,o*daplicated.»whole oezyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBAmpan .Doctoelectronic rtghtv.vomc third pony content may bevupptcved horn theeBook and/orcCh deemed Cutanyvuppicwed content dec*notmaterial yalTect theoverall learning experience .C'cngagc Learn ngre\«ve»theright loremote additional conceal atanytime i ivubveqjcni right*toirietionv require It