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] = ode1

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 14:36:35
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] = ode1

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] = ode1
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小白一名啊!

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] = ode1
第一行
xO=[0.30,30.4 325];
这你写错了吧?是不是把小数点写成逗号了?
先改了试试.
另外你的residu函数得贴出来看看.

x0应该有五个元素