MATLAB怎么看程序运行了多少次呢?
%%ODE45_fun解方程tspan=[0,1e-5];x0=[2.1e+10,1,1,1,1];[t,x]=ode45('ODE45_fun',tspan,x0);a...
%%ODE45_fun解方程
tspan=[0,1e-5];
x0=[2.1e+10,1,1,1,1];
[t,x]=ode45('ODE45_fun',tspan,x0);
a1=1;a2=1;e1=9;e2=7;f1=56;f2=98;g1=76;g2=665;
a=a1+a2;
e=e1+e2;
f=f1+f2;
g=g1+g2;
[n,m]=size(x);
for i=1:n
x(i,6)=x(i,4)*x(i,5)+x(i,2)*x(i,3)+e*f+e*g;
end
data=[t,x];
save ODE45_data.txt data -ascii
subplot(2,3,1),plot(t,x(1))
subplot(2,3,2),plot(t,x(2))
subplot(2,3,3),plot(t,x(3))
subplot(2,3,4),plot(t,x(4))
subplot(2,3,5),plot(t,x(5))
subplot(2,3,6),plot(t,x(6))
Warning: Failure at t=1.075809e-007. Unable to meet integration tolerances
without reducing the step size below the smallest value allowed (2.117582e-022) at
time t.
> In ode45 at 355 展开
tspan=[0,1e-5];
x0=[2.1e+10,1,1,1,1];
[t,x]=ode45('ODE45_fun',tspan,x0);
a1=1;a2=1;e1=9;e2=7;f1=56;f2=98;g1=76;g2=665;
a=a1+a2;
e=e1+e2;
f=f1+f2;
g=g1+g2;
[n,m]=size(x);
for i=1:n
x(i,6)=x(i,4)*x(i,5)+x(i,2)*x(i,3)+e*f+e*g;
end
data=[t,x];
save ODE45_data.txt data -ascii
subplot(2,3,1),plot(t,x(1))
subplot(2,3,2),plot(t,x(2))
subplot(2,3,3),plot(t,x(3))
subplot(2,3,4),plot(t,x(4))
subplot(2,3,5),plot(t,x(5))
subplot(2,3,6),plot(t,x(6))
Warning: Failure at t=1.075809e-007. Unable to meet integration tolerances
without reducing the step size below the smallest value allowed (2.117582e-022) at
time t.
> In ode45 at 355 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询