资源描述:
《1 second order runge-kutta method》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、TitleDerivethemodifiedEuler’smethod(ref.Page546#4)andMidpointmethod:.Forinitialvalueproblemon[0,2]withh=0.1,giventheresultbythesetwomethods.Findthelinearinterpolationpolynomialsplinesandcomparewiththeanalyticsolution(graphcurve).Method1.SecondorderRunge-KuttaMethodletusbegi
2、nwiththeTaylorseriesfor:Fromthedifferentialequation…wherexmeansx(t),fmeansf(t,x)becausesoHence,theformulaforadvancingthesolutioniswhereandIngeneral,second-orderRunge-KuttaformulasareoftheformwhereareparametersatourdisposalBy=>ifwechoicetheresultingformulafromiscalledthemodi
3、fiedEuler’smethod:where2.Midpointmethod(FromWikipedia,thefreeencyclopedia.)Innumericalanalysis,abranchofappliedmathematics,themidpointmethodisaone-stepmethodforsolvingthedifferentialequationnumerically,andisgivenbytheformulaHere,histhestepsize—asmallpositivenumber,tn=t0+nh,
4、andynisthecomputedapproximatevalueofy(tn).Thenameofthemethodcomesfromthefactthattn+h/2isthemidpointbetweentnatwhichthevalueofy(t)isknownandtn+1atwhichthevalueofy(t)needstobefound.DerivationofthemidpointmethodThemidpointmethodisarefinementoftheEuler'smethodandisderivedinasim
5、ilarmanner.ThekeytoderivingEuler'smethodistheapproximateequalitywhichisobtainedfromtheslopeformulaandkeepinginmindthaty'=f(t,y).Forthemidpointmethod,onereplaces(3)withthemoreaccuratewheninsteadof(2)wefindOnecannotusethisequationtofindy(t+h)asonedoesnotknowyatt+h/2.Thesoluti
6、onisthentouseaTaylorseriesexpansionwhich,whenpluggedin(4),givesusandthemidpointmethod(1).★上述MidpointMethod的導法並不是題目上所需!上述所呈現的式子,可以明顯看出為 single-stepmethod ,然而題目上所用的MidpointMethod的式子為,可以看出是 multistepmethod ,所以上述的導法對於題目所用的MidpointMethod 並不適用!Because=>whereAlgorthm1.Useseparable
7、equationso(Mathematica)(Mathematica)2.ModifiedEuler’sMethod(Mathematica)3.MidpointMethod(Matlab)findthex(0.1)byFourth-OrderRunge-KuttaMethodanduseMidpointMethodfunctionfx=fxsys(t,X)%computeK1,K2,K3andK4ofRunge-Kuttamethod%fx=zeros(length(X),1);fx(1)=-X(1);fx(2)=X(1)+X(2)-t^
8、2*(4-t);typerk4sys.mfunctionrs=rk4sys(X0,a,b,m)%toreturntheapproximationvaluesofX(