matlab求解常微分方程,matlab 求解常微分方程式 | 您所在的位置:网站首页 › 微分方程式求解 › matlab求解常微分方程,matlab 求解常微分方程式 |
MATLAB解常微分方程式的语法是dsolve('equation','condition'),其中equation代表常微分方程式即y'=g(x,y),且须以Dy代表一阶微分项y' D2y代表二阶微分项y'' , condition则为初始条件。 假设有以下三个一阶常微分方程式和其初始条件 y'=3x2, y(2)=0.5 y'=2.x.cos(y)2, y(0)=0.25 y'=3y+exp(2x), y(0)=3 对应上述常微分方程式的符号运算式为: >> soln_1 = dsolve('Dy = 3*x^2','y(2)=0.5') soln_1 = 3*t*x^2 - 6*x^2 + 1/2 >>ezplot(soln_1,[2,4]) % 看看这个函数的长相 >> soln_2 = dsolve('Dy = 2*x*cos(y)^2','y(0) = pi/4') soln_2 = atan(2*t*x + 1) >> soln_3 = dsolve('Dy = 3*y + exp(2*x)',' y(0) = 3') soln_3 = (exp(3*t)*(exp(2*x) + 9))/3 - exp(2*x)/3 非线性方程式的实根 要求任一方程式的根有三步骤: < |
CopyRight 2018-2019 实验室设备网 版权所有 |