下载

0下载券

加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 实验四 求微分方程的解(Experiment four solution of differen…

实验四 求微分方程的解(Experiment four solution of differential equation).doc

实验四 求微分方程的解(Experiment four sol…

问我通传机
2017-09-18 0人阅读 举报 0 0 0 暂无简介

简介:本文档为《实验四 求微分方程的解(Experiment four solution of differential equation)doc》,可适用于领域

实验四求微分方程的解(Experimentfoursolutionofdifferentialequation)实验四求微分方程的解(Experimentfoursolutionofdifferentialequation)ExperimentfoursolutionofdifferentialequationIbackgroundandpurposeoftheexperimentThepracticalproblemsthroughmathematicalmodelinginductionandtheequation,thevastmajorityaredifferentialequations,realalgebraicequationscangetlittlechanceOntheotherhand,todifferentialequationisverylimited,especiallyhighorderequationsandpartialdifferentialequations(Group)Thisrequiresustostudythedifferentialequation(Group)method,itisnecessarytostudythedifferentialequation(Group)analyticalsolution(exactsolution),butalsotothestudyofdifferentialequation(Group)numericalsolution(approximate)Thedifferentialequation(Group)analyticsolution(exactsolution),Matlabhasaspecialfunctioncanbeused,thisexperimentwillbeacertainintroductionThisexperimentwillmainlystudythenumericalsolution(approximatesolution)ofdifferentialequations(groups),withemphasisontheEulerfoldlinemethodTwo,correlationfunction(command)andbriefintroductiondsolve('equ','equ'),(:Matlab)analyticsolutionsfordifferentialequationsEqu,equ,Forequations(orconditions)Whenwritingequations(orconditions),DyisusedtorepresentY'sfirstderivativeofanindependentvariable,andDyisusedtorepresentY'stwoorderderivativesoftheindependentvariable,andsoonsimplify(s):theexpressionsissimplifiedusingthesimplifiedrulesofmapleSuchas:SymsxSimplify(sin(x)^cos(x)^)Ans=r,how=simple(s):theMatlabprovidesavarietyofsimplificationrules,thesimplecommandisontheexpressionofswithvariousrulesforsimplification,andthenusetheRtoreturntothemostsimpleform,howreturnsformedinthisformofrulesSuchas:Symsxr,how=simple(COS(x),^sin(x)^)R=cos(*x)How=combineT,Y=Solver(odefun,tspan,Y)fornumericalsolutionsofdifferentialequationsExplain:()thesolveramongthemisoneofcommandsode,ode,ode,odes,odes,odet,odetb()odefunisanexplicitordinarydifferentialequation:EMBED,Equation()ontheintegralintervaltspan=,EMBED,Equation,fromEMBEDEquationtoEMBEDEquation,theinitialconditionEMBEDEquationisusedtosolve()toobtainthesolutionatEMBEDEquationatotherspecifiedtimes,thentspan=EMBEDEquation(requirementismonotonic)()becausenoneofthealgorithmscansolveallODEproblemseffectively,MatlabprovidesavarietyofsolverSolver,andusesdifferentSolverfordifferentODEproblemsSolverSolverODEfeaturesodetypenonrigidsinglestepalgorithm,theorderRungeKuttaequationtruncatederrorcumulativeodealgorithmEMBEDEquationpreferredinmostcasesofnonrigidsinglestepalgorithmtheandorderRungeKuttaequationthecumulativeerrorofEMBEDtruncatedEquationuseinlowprecisionodenonrigidmethodAdamsalgorithmthelevelofaccuracycanbeEMBEDtoEquationcalculationtimeshorterthanodeodetwithmoderaterigidtrapezoidalalgorithmodesmoderaterigidrigidmultistepGear'sreversenumericaldifferentiationmediumaccuracyifodefails,tryusingodesrigidsinglestepmethodorderRosebrockalgorithmlowprecisionwhentheprecisionislow,thecomputationtimeisshorterthantheodesodetbrigidtrapezoidalalgorithmlowprecisionwhentheprecisionislowThecomputationtimeisshorterthanodes()tobeparticular,odeandodeareverycommonlyusedproceduresforthesolutionoftheinitialvalueproblemofthefirstorderordinarydifferentialequations(groups)ofnonrigidcanonicalform,Matlab:OdeadoptsRungeKuttaorderalgorithm,andusestheorderformulatoestimatethestepsizebyerrorestimation,andhaslowprecisionOdeusesRungeKuttaorderalgorithm,andusesorderformulatomaketheerrorestimatetoadjustthestepsize,withmediumprecisionezplot(x,y,tmin,tmax):thedrawingcommandofsymbolicfunctionX,yisthesymbolicfunctionofparametert,tmin,andtmaxistherangeofTinline():establishaninlinefunctionFormat:inline('expr','var','var'),)notethattheexpressionsinparenthesesshouldbeputinquotationmarksExample:Q=dblquad(inline('y*sin(x)),PI,*pi,,PI)Three,experimentalcontent,severalcanbeuseddirectlyMatlabdifferentialequationsforaccuratesolutionexamples:Example:solvingdifferentialequationsEMBED,Equation,andtoverifyTheMatlabprocedureforsolvingthisproblemis:SymsxylineY=dsolve('Dy*x*y=x*exp(x^)','x')lineDiff(y,x)*x*yx*exp(x^)lineSimplify(diff(y,x)*x*yx*exp(x^))lineExplain:()lineLinedefinesxwithacommand,andYisthesymbolicvariableHereitcannotbewritten,buttoensurecorrectness,writeit()rowlineisthesolutionofthedifferentialequationorderedbythecommand:*exp(x^)*x^exp(x^)*C()rowLineusestheobtainedsolutionHereisthesolutiontotheoriginaldifferentialequation,andtheresultshouldbe,buthereistheresult:x^*exp(x^),*x*exp(x^),*C*x*(*exp(x^),*x^exp(x^),*C)()rowlineissimplifiedbyusingsimplify()function,andtheresultisItshowsthatEMBEDEquationisindeedthesolutionofdifferentialequationExample:fordifferentialequationsEMBED,EquationintheinitialconditionsEMBED,Equationunderthespecialsolution,anddrawthegraphofthesolutionfunctionTheMatlabprocedureforsolvingthisproblemis:SymsxyY=dsolve('x*Dyyexp(x)=','y()=*exp()','x')Ezplot(y)Thespecialsolutionsofdifferentialequationsare:y=x*exp(x),x*,exp()(Matlab),thatis,EMBED,Equation,graphsofsolutionfunctions,asshowninfigure:FigureExample:solvingdifferentialequationsEMBED,EquationintheinitialconditionsEMBEDEquationunderthespecialsolution,anddrawthegraphofthesolutionfunctionTheMatlabprocedureforsolvingthisproblemis:Symsxytx,y=dsolve('Dx*xy=exp(T)),'Dyx*y=','x()=','y()=','t')Simple(x)Simple(Y)Ezplot(x,y,,)axisAutoThesolutionofdifferentialequations(especiallyformulalong)andgraphicalsolutionfunctionareslightly,thenumericalsolution(approximatesolution)ofinitialvalueproblemsforthefirstorderordinarydifferentialequations(Group)ofnonrigidstandardformisobtainedbyusingodeandodeExample:solvingdifferentialequationsinitialvalueproblem,EMBED,Equationnumericalsolution,thesolutionrangefortheinterval,Fun=inline('*y*x^*x','x','y')x,y=ode(fun,,,)X'Y'Plot(x,y,'o')"X'=ans,,,,,,,,,,"Y'=ans,,,,,,,,,,ThegraphresultsareshowninfigureFigureExample:theclassicalVer,der,PoldifferentialequationsforsolvingoscillatorsaredescribedEMBEDEquationAnalysis:makeEMBEDEquationEMBEDEquationFirstwritethefunctionfileverderpolm:Functionxprime=verderpol(T,x)globalitxprime=x()*(x)^)*x()x()再编写命令文件vdpm:globalitmu=y=,y,x=ode("verderpol",,y)x=x(:)x=x(:,)plot(t,x)图形结果为图图用euler折线法求解前面讲到过,能够求解的微分方程也是十分有限的下面介绍用euler折线法求微分方程的数值解(近似解)的方法euler折线法求解的基本思想是将微分方程初值问题embedequation化成一个代数方程,即差分方程,主要步骤是用差商embedequation替代微商embedequation,于是:embedequation记embedequation,从而embedequation,则有embedequation例:用euler折线法求解微分方程初值问题embedequation的数值解(步长h取),求解范围为区间,解:本问题的差分方程为embedequation相应的matlab程序见附录数据结果为:图形结果见图:图特别说明:本问题可进一步利用四阶rungekutta法求解,读者可将两个结果在一个图中显示,并和精确值比较,看看哪个更"精确"(相应的matlab程序参见附录)四、自己动手求微分方程embedequation的通解求微分方程embedequation的通解求微分方程组embedequation在初始条件embedequation下的特解,并画出解函数embedequationdsmt的图形分别用ode、ode求上述第题中的微分方程初值问题的数值解(近似解),求解区间为embedequationdsmt利用画图来比较两种求解器之间的差异用euler折线法求解微分方程初值问题embedequation的数值解(步长h取),求解范围为区间,用四阶rungekutta法求解微分方程初值问题embedequation的数值解(步长h取),求解范围为区间,四阶rungekutta法的迭代公式为(euler折线法实为一阶rungekutta法):embedequation相应的matlab程序参见附录试用该方法求解第题中的初值问题用ode方法求上述第题的常微分方程初值问题的数值解(近似解),从而利用画图来比较两者间的差异五、附录附录:(fulum)clearf=i(y*xy^)a=b=h=n=(ba)hx=y=szj=x,yfori=:ny=yh*subs(f{'x','y'},{x,y})x=xhszj=x,yszjendszjplot(szj(:),szj(:,))附录:(fulum)clearfi(y=exp(x)*cos(x))a=b=h=n=(ba)hx=y=szj=x,yfori=:nl=subs(f{'x','y'},{x,y})l=subs(f{'x','y'},{xh,yl*h})l=subs(f{'x','y'},{xh,yl*h})l=subs(f(x,y){xh,y,*h})y=yh*(*ll*ll)x=xhszj=x,yszjendszjplot(szj(,),szj(,))pagepage***jimisoft:unregisteredsoftwareonlyconvertpartofthefilereadhelptoknowhowtoregister***

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/12

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利