用matlab解含绝对值项的常微分方程时所碰到的问题

来源:百度知道 编辑:UC知道 时间:2024/06/02 18:22:58
我想用matlab解这个常微分方程:y''=-(1/m)*[m*g+(Cy)*y'*(/y'/)],y(0)=0,y'(0)=Vo*sinA,Vo>0,0<A<90度
我将码写为
>> sol =dsolve('Dy1=y2','Dy2=-(1/m)*(m*g+(Cy)*Dy1*abs(Dy1))','y1(0)=0','y2(0)=Vo*sinA','t')

(m,g,Cy,Vo,A 均为常量.)

matlab 告诉我说
"??? Error using ==> dsolve
Error, (in dsolve/IC) The 'implicit' option is not available when giving Initial Conditions."

>>

我到底应该怎样输入才能得到它的理论解?
我个人认为是未知导数的绝对值存在于常微分方程中的1原因,由于matlab不知道初始条件Vo*sinA是正是负才导致它无法判断特解,但是怎样才能让MATLAB明白呢?
Note that this is a Maple error and not a MATLAB error.
The Symbolic Math Toolbox just passes your commands on to
Maple which then passes back any error messages. My error
seems to be saying "whoa...this problem is too much for
me!".

You can easily decouple these two equations to:

sol=dsolve('Dy2=-(1/m)*(m*g+(C

把绝对值去掉,可以解出来的。分两种情况:

>> y=dsolve('D2y=-(1/m)*(m*g+(Cy)*Dy*(Dy))','y(0)=0','Dy(0)=Vo*sin(A)','t')

y =

1/2*log(1/m/g*(Cy^2*Vo^2*sin(A)^2*sin(1/m^(1/2)*g^(1/2)*Cy^(1/2)*t)^2+2*Cy^(3/2)*Vo*sin(A)*sin(1/m^(1/2)*g^(1/2)*Cy^(1/2)*t)*cos(1/m^(1/2)*g^(1/2)*Cy^(1/2)*t)*m^(1/2)*g^(1/2)+Cy*cos(1/m^(1/2)*g^(1/2)*Cy^(1/2)*t)^2*m*g)/Cy)*m/Cy

>> y=dsolve('D2y=-(1/m)*(m*g+(Cy)*Dy*(-Dy))','y(0)=0','Dy(0)=Vo*sin(A)','t')

y =

1/2*(2*g^(1/2)*Cy^(1/2)*t*m^2-log(1/4*Cy*(RootOf(Cy*_Z^2*m*g-m^2*g^2-2*m^(3/2)*g^(3/2)*Vo*sin(A)*Cy^(1/2)-m*g*Vo^2*sin(A)^2*Cy)*(-m^(1/2)*g^(1/2)+Vo*sin(A)*Cy^(1/2))/(m^(1/2)*g^(1/2)+Vo*sin(A)*Cy^(1/2))*exp(2/m^(1/2)*g^(1/2)*Cy^(1/2)*t)-RootOf(Cy*_Z^2*m*g-m^2*g^2-2*m^(3/2)*g^(3/2)*Vo*sin(A)*Cy^(1/2)-m*g*Vo^2*sin(A)^2*Cy))^2/m/g)*m^(5/2))/m^(3/2)/Cy

教授不是已经给你答案了吗?我认为教授的意思是说:matlab做符号计算时是调用maple模块。你的程序是把二阶微分方程拆分为了两个一阶方程,而matlab做的时候先要把