快捷搜索:  汽车  科技

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)提示:未知函数总带有自变量 等号用连续键入两个等号表示 这两点由于不习惯会出错!导数符号用键盘上的撇号 连续两撇表示二阶导数。Out[1]={{y[x]→Sin[x] z[x]→Cos[x]}}案例展示Application case display答案:In[1]:=DSolve[{y’[x]==z[x] z’[x]== -y[x] y[0]==0 z[0]==1} {y[x] z[x]} x]

分享兴趣、传播快乐、增长见闻、留下美好,大家好,这里是LearningYard学苑,今天小编为大家带来文章:Mathematica学习:常微分方程、拉氏变换与级数实验。

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(1)

常微分方程组的求解Solving Ordinary Differential Equations

调用函数Call functions

Principle of two-dimensional drawing

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(2)

案例展示Application case display

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(3)

答案:

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: Unknown functions always have independent variables and the equal sign is represented by entering two equal signs in succession. These two points will make mistakes because they are not used to it! The derivative symbol uses the apostrophe on the keyboard and two consecutive primes represent the second derivative.

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(4)

答案:

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(5)

提示:式中的C[1]是通解中的任意常数。

Hint: C[1] in the formula is any constant in the general solution.

常微分方程(组)的数值解Numerical solutions of ordinary differential equations (sets)

调用函数Call functions

NDSolve[eqns {y1 y2 …} {x xmin xmax}]

求常微分方程(组)的近似解

(Find approximate solutions of ordinary differential equations (groups).

其中微分方程和初值条件的表示法如同DSolve 未知函数仍有带自变量和不带自变量两种形式 通常使用后一种更方便。初值点x0可以取在区间[xmin xmax]上的任何一点处 得到插值函数InterpolatingFunction[domain table]类型的近似解 近似解的定义域domain一般为[domain table] 也有可能缩小。

The expression of differential equations and initial value conditions is the same as DSolve. There are still two forms of unknown function with and without independent variables. It is usually more convenient to use the latter. The initial value point x0 can be taken at any point on the interval [xmin xmax] to obtain an approximate solution of the interpolation function InterpolatingFunction[domain table] type. The domain of the approximate solution is generally [domain table] which may also be reduced .

案例展示Application case display

案例1:求常微分方程y’= x^2 y^2 满足初始条件y(0)= 0的数值解。

Case 1: Find the numerical solution of ordinary differential equation y'= x^2 y^2 which satisfies the initial condition y(0)=0.

答案:

In[1]:=s1=NDSolve[{y’[x]==x^2 y[x]^2 y[0]==0} y {x -2 2}]

Out[1]={{y→InterpolatingFunction[{{-2. 2.}} < >]}}

提示:Out[1]表明返回的解放在一个表中 不便使用 实际的解就是插值函数:InterpolatingFunction[{{-2. 2.}} < >]。

Tip: Out[1] indicates that the returned liberation is in a table which is inconvenient to use. The actual solution is the interpolation function: InterpolatingFunction[{{-2. 2.}} < >].

In[2]:= y=y / . s1[[1]]

Out[2]=InterpolatingFunction[{{-2. 2.}} < >]

In[3]:=Plot[y[x] {x -2 2} AspectRatio→Automatic PlotRange→{-1.5 1.5}]

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(6)

Out[3]= -Graphics-

提示:In[2]的结果是用y表示解函数的名字 因此In[3]才能顺利画出解曲线。

Tip: The result of In[2] is to use y to represent the name of the solution function so In[3] can draw the solution curve smoothly.

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(7)

答案:

In[1]:=s1=NDSolve[{x’[t]== y[t] -(x[t]^3/3 - x[t]) y’[t]== - x[t] x[0]==0 y[0]==1} {x y} {t -15 15}]

Out[1]={{x→InterpolatingFunction[{{-15. 15.}} < >] y→InterpolatingFunction[{{-15. 15.}} < >]}}

In[2]:= x=x / . s1[[1 1]]

In[3]: = y=y / . s1[[1 2]]

Out[2]=InterpolatingFunction[{{-15. 15.}} < >]

Out[3]=InterpolatingFunction[{{-15. 15.}} < >]

In[4]:=ParametricPlot[{x[t] y[t]} {t -15 15}

AspectRatio→Automatic]

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(8)

Out[3]= -Graphics-

拉式变换Pull transform

调用函数Call functions

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(9)

案例展示Application case display

案例1:求函数t^ 4和e^t sint的拉氏变换。Find the Laplace transform of the functions t^ 4 and e^t sint.

答案:

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(10)

级数实验Series experiment

求和与求积Sum and Quadrature

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(11)

案例展示Application case display

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(12)

提示:上例中第三个级数发散 Mathematica给出提示 并在不能给出结果时将输入的式子作为输出。

Hint: In the above example the third series diverges Mathematica gives a hint and uses the input formula as the output when the result cannot be given.

将函数展开为幂级数Expand the function to a power series

调用函数Call functions

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(13)

案例展示

Application case display

将y = arcsinx展开为幂级数 只取前9项并去掉余项。Expand y = arcsinx into a power series take only the first 9 terms and remove the remaining terms.

答案:

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(14)

傅里叶级数Fourier series

傅里叶系数是一个积分表达式 所以利用积分函数Integrate就可以实现。

The Fourier coefficient is an integral expression so it can be realized by using the integral function Integrate.

案例展示

Application case display

微分方程组怎么进行拉氏变换(Mathematica学习常微分方程)(15)

今天的分享就到这里啦!

感兴趣的同学可以留言与小编交流

咱们下周见!

参考资料:网络.

英文翻译:Google翻译.

本文由learningYard学苑原创,部分资料、图片来源于网络,如有侵权请联系。

猜您喜欢: