matlab程序求助(有关ode15s解微分方程的)
来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/05/23 02:19:36
matlab程序求助(有关ode15s解微分方程的)
主程序:
xO=[0.3\x050,3\x050.4 325];
tf=13;
opts = odeset('Mass','M','MassSingular','yes');
[t,x] = ode15s('residu',[0 tf],xO,opts);
x1=x(:,1);
x2=x(:,2);
plot(x1,x2,'k')
A=x(:,1:3);
tf=30;
[t,x] = ode15s('residu2',[0 tf],xO,opts);
x1=x(:,1);
x2=x(:,2);
plot(x1,x2,'k')
B=x(:,1:3);
n=length(x);
C=zeros(n,3);
for i=1:n
C(n-i+1,:)=B(i,:);
end
C(n,:)=[];
D=[C;A];
结果:
Error using ==> odearguments at 117
Solving RESIDU requires an initial condition vector of length 5.
Error in ==> ode15s at 228
[neq,tspan,ntspan,next,t0,tfinal,tdir,y0,f0,odeArgs,odeFcn,...
Error in ==> calresd at 47
[t,x] = ode15s('residu',[0 tf],xO,opts);
本人matlab小白一名啊!
主程序:
xO=[0.3\x050,3\x050.4 325];
tf=13;
opts = odeset('Mass','M','MassSingular','yes');
[t,x] = ode15s('residu',[0 tf],xO,opts);
x1=x(:,1);
x2=x(:,2);
plot(x1,x2,'k')
A=x(:,1:3);
tf=30;
[t,x] = ode15s('residu2',[0 tf],xO,opts);
x1=x(:,1);
x2=x(:,2);
plot(x1,x2,'k')
B=x(:,1:3);
n=length(x);
C=zeros(n,3);
for i=1:n
C(n-i+1,:)=B(i,:);
end
C(n,:)=[];
D=[C;A];
结果:
Error using ==> odearguments at 117
Solving RESIDU requires an initial condition vector of length 5.
Error in ==> ode15s at 228
[neq,tspan,ntspan,next,t0,tfinal,tdir,y0,f0,odeArgs,odeFcn,...
Error in ==> calresd at 47
[t,x] = ode15s('residu',[0 tf],xO,opts);
本人matlab小白一名啊!
第一行
xO=[0.30,30.4 325];
这你写错了吧?是不是把小数点写成逗号了?
先改了试试.
另外你的residu函数得贴出来看看.
再问: 好像真的是这样也,太不小心了我~~后续出现问题,可以再麻烦你吧~~我再试试~~会不会出现其他问题~~
xO=[0.30,30.4 325];
这你写错了吧?是不是把小数点写成逗号了?
先改了试试.
另外你的residu函数得贴出来看看.
再问: 好像真的是这样也,太不小心了我~~后续出现问题,可以再麻烦你吧~~我再试试~~会不会出现其他问题~~
有关matlab程序的求助.
matlab画二阶常微分方程的具体程序
求matlab程序,用matlab解微分方程,并且画出两个小车的位移,加速度的图像,
求助正则化算法的Matlab程序
求助 :leslie 数学建模程序 (MATLAB)
用matlab的ode45求解如下微分方程的程序
求助过路的matlab大神,老师留作业:用两种欧拉方法解常微分方程
大家帮我看看这段MATLAB解微分方程的程序
有限元法解常微分方程的程序(最好用MATLAB编)
matlab的解微分方程问题
一个matlab简单程序求助
求matlab程序,用matlab求解微分方程,并画出两个小车的位移,速度,加速度曲线,