Mathematica学习常微分方程拉氏变换与级数实验
分享兴趣、传播快乐、增长见闻、留下美好,大家好,这里是LearningYard学苑,今天小编为大家带来文章:Mathematica学习:常微分方程、拉氏变换与级数实验。
常微分方程组的求解SolvingOrdinaryDifferentialEquations
调用函数Callfunctions
Principleoftwodimensionaldrawing
案例展示Applicationcasedisplay
答案:
In〔1〕:DSolve〔{y’〔x〕z〔x〕,z’〔x〕y〔x〕,y〔0〕0,z〔0〕1},{y〔x〕,z〔x〕},x〕
Out〔1〕{{y〔x〕Sin〔x〕,z〔x〕Cos〔x〕}}
提示:未知函数总带有自变量,等号用连续键入两个等号表示,这两点由于不习惯会出错!导数符号用键盘上的撇号,连续两撇表示二阶导数。
Tip:Unknownfunctionsalwayshaveindependentvariables,andtheequalsignisrepresentedbyenteringtwoequalsignsinsuccession。Thesetwopointswillmakemistakesbecausetheyarenotusedtoit!Thederivativesymbolusestheapostropheonthekeyboard,andtwoconsecutiveprimesrepresentthesecondderivative。
答案:
提示:式中的C〔1〕是通解中的任意常数。
Hint:C〔1〕intheformulaisanyconstantinthegeneralsolution。常微分方程(组)的数值解Numericalsolutionsofordinarydifferentialequations(sets)
调用函数Callfunctions
NDSolve〔eqns,{y1,y2,},{x,xmin,xmax}〕
求常微分方程(组)的近似解
(Findapproximatesolutionsofordinarydifferentialequations(groups)。
其中微分方程和初值条件的表示法如同DSolve,未知函数仍有带自变量和不带自变量两种形式,通常使用后一种更方便。初值点x0可以取在区间〔xmin,xmax〕上的任何一点处,得到插值函数InterpolatingFunction〔domain,table〕类型的近似解,近似解的定义域domain一般为〔domain,table〕,也有可能缩小。
TheexpressionofdifferentialequationsandinitialvalueconditionsisthesameasDSolve。Therearestilltwoformsofunknownfunctionwithandwithoutindependentvariables。Itisusuallymoreconvenienttousethelatter。Theinitialvaluepointx0canbetakenatanypointontheinterval〔xmin,xmax〕toobtainanapproximatesolutionoftheinterpolationfunctionInterpolatingFunction〔domain,table〕type。Thedomainoftheapproximatesolutionisgenerally〔domain,table〕,whichmayalsobereduced。
案例展示Applicationcasedisplay
案例1:求常微分方程y’x2y2,满足初始条件y(0)0的数值解。
Case1:Findthenumericalsolutionofordinarydifferentialequationyx2y2,whichsatisfiestheinitialconditiony(0)0。
答案:
In〔1〕:s1NDSolve〔{y’〔x〕x2y〔x〕2,y〔0〕0},y,{x,2,2}〕
Out〔1〕{{yInterpolatingFunction〔{{2。,2。}},〕}}
提示:Out〔1〕表明返回的解放在一个表中,不便使用,实际的解就是插值函数:InterpolatingFunction〔{{2。,2。}},〕。
Tip:Out〔1〕indicatesthatthereturnedliberationisinatable,whichisinconvenienttouse。Theactualsolutionistheinterpolationfunction:InterpolatingFunction〔{{2。,2。}},〕。
In〔2〕:yy。s1〔〔1〕〕
Out〔2〕InterpolatingFunction〔{{2。,2。}},〕
In〔3〕:Plot〔y〔x〕,{x,2,2},AspectRatioAutomatic,PlotRange{1。5,1。5}〕
Out〔3〕Graphics
提示:In〔2〕的结果是用y表示解函数的名字,因此In〔3〕才能顺利画出解曲线。
Tip:TheresultofIn〔2〕istouseytorepresentthenameofthesolutionfunction,soIn〔3〕candrawthesolutioncurvesmoothly。
答案:
In〔1〕:s1NDSolve〔{x’〔t〕y〔t〕(x〔t〕33x〔t〕),y’〔t〕x〔t〕,x〔0〕0,y〔0〕1},{x,y},{t,15,15}〕
Out〔1〕{{xInterpolatingFunction〔{{15。,15。}},〕,yInterpolatingFunction〔{{15。,15。}},〕}}
In〔2〕:xx。s1〔〔1,1〕〕
In〔3〕:yy。s1〔〔1,2〕〕
Out〔2〕InterpolatingFunction〔{{15。,15。}},〕
Out〔3〕InterpolatingFunction〔{{15。,15。}},〕
In〔4〕:ParametricPlot〔{x〔t〕,y〔t〕},{t,15,15},
AspectRatioAutomatic〕
Out〔3〕Graphics拉式变换Pulltransform
调用函数Callfunctions
案例展示Applicationcasedisplay
案例1:求函数t4和etsint的拉氏变换。FindtheLaplacetransformofthefunctionst4andetsint。
答案:
级数实验Seriesexperiment
求和与求积SumandQuadrature
案例展示Applicationcasedisplay
提示:上例中第三个级数发散,Mathematica给出提示,并在不能给出结果时将输入的式子作为输出。
Hint:Intheaboveexample,thethirdseriesperges,Mathematicagivesahintandusestheinputformulaastheoutputwhentheresultcannotbegiven。将函数展开为幂级数Expandthefunctiontoapowerseries
调用函数Callfunctions
案例展示
Applicationcasedisplay
将yarcsinx展开为幂级数,只取前9项并去掉余项。Expandyarcsinxintoapowerseries,takeonlythefirst9termsandremovetheremainingterms。
答案:
傅里叶级数Fourierseries
傅里叶系数是一个积分表达式,所以利用积分函数Integrate就可以实现。
TheFouriercoefficientisanintegralexpression,soitcanberealizedbyusingtheintegralfunctionIntegrate。
案例展示
Applicationcasedisplay
今天的分享就到这里啦!
感兴趣的同学可以留言与小编交流,
咱们下周见!
参考资料:网络。
英文翻译:Google翻译。
本文由learningYard学苑原创,部分资料、图片来源于网络,如有侵权请联系。