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/06/30 00:04:27
![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](/uploads/image/z/12683039-23-9.jpg?t=matlab%E7%A8%8B%E5%BA%8F%E6%B1%82%E5%8A%A9%EF%BC%88%E6%9C%89%E5%85%B3ode15s%E8%A7%A3%E5%BE%AE%E5%88%86%E6%96%B9%E7%A8%8B%E7%9A%84%EF%BC%89%E4%B8%BB%E7%A8%8B%E5%BA%8F%EF%BC%9AxO%3D%5B0.3%5Cx050%2C3%5Cx050.4+325%5D%3Btf%3D13%3Bopts+%3D+odeset%28%27Mass%27%2C%27M%27%2C%27MassSingular%27%2C%27yes%27%29%3B%5Bt%2Cx%5D+%3D+ode15s%28%27residu%27%2C%5B0+tf%5D%2CxO%2Copts%29%3Bx1%3Dx%28%3A%2C1%29%3Bx2%3Dx%28%3A%2C2%29%3Bplot%28x1%2Cx2%2C%27k%27%29A%3Dx%28%3A%2C1%3A3%29%3Btf%3D30%3B%5Bt%2Cx%5D+%3D+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应该有五个元素