发布网友 发布时间:2022-03-25 19:59
共2个回答
热心网友 时间:2022-03-25 21:28
对于相对简单的微分方程或微分方程组,可以dsolve()函数得到解析值(精确解)。
例①:
>>syms x(t) a
>>dsolve(diff(x) == -a*x)
ans =
C2*exp(-a*t)
>>dsolve(diff(x) == -a*x, x(0) == 1)
ans =
exp(-a*t)
例②:
syms y(t) a
>> Dy = diff(y); D2y = diff(y,2);
>> y=dsolve(D2y == -a^2*y, y(0) == 1, Dy(pi/a) == 0)
y =
exp(-a*t*i)/2 + exp(a*t*i)/2
例③:
>> syms w(t)
>> Dw = diff(w); D2w = diff(w,2);
>> w = dsolve(diff(D2w) == -w, w(0)==1, Dw(0)==0, D2w(0)==0)
w =
exp(-t)/3 + (2*exp(t/2)*cos((3^(1/2)*t)/2))/3
热心网友 时间:2022-03-25 22:46
何其难哉,利用符号工具箱看看