微分方程d^2y/dt^2-dy/dt+y=1,y0=0,y1=0.怎么用matlab求解啊
问题描述:
微分方程d^2y/dt^2-dy/dt+y=1,y0=0,y1=0.怎么用matlab求解啊
答
书写格式有问题,少了一个逗号.
dsolve('D2y-Dy+y=1','y(0)=0','y(1)=0')
ans =
exp(1/2*t)*sin(1/2*3^(1/2)*t)*(-1+cos(1/2*3^(1/2))*cosh(1/2)+cos(1/2*3^(1/2))*sinh(1/2))/sin(1/2*3^(1/2))/(cosh(1/2)+sinh(1/2))-exp(1/2*t)*cos(1/2*3^(1/2)*t)+1