matlab求微分方程数值解ode45出错,怎么办?
建立equation.m文件,里面写入:functiondy=equation(t,y)dy=zeros(3,1);dy(1)=10^9*0.6*(pi/2+atan((...
建立equation.m文件,里面写入:
function dy =equation(t,y)
dy=zeros(3,1);
dy(1)=10^9*0.6*(pi/2+atan((0.5*y(1)+0.5*y(2)+0.5*y(3)+1)^0.3*(1.5*y(1)+1.5*y(2)+1.5*y(3)+1)^0.3*(y(1)^0.6*y(2)^0.4)^0.3-3))-y(1)*0.5*(3-(pi/2+atan((0.5*y(1)+0.5*y(2)+0.5*y(3)+1)^0.3*(1.5*y(1)+1.5*y(2)+1.5*y(3)+1)^0.3*(y(1)^0.6*y(2)^0.4)^0.3)));
dy(2)=0.25*(y(1)^0.6*y(2)^0.4)-10^(-7)*y(2)*y(3);
dy(3)=0.1*y(3)*(y(2)*1000/20-y(3));
end
然后在命令窗口输入:
[T,Y]=ode45('equation',[0 10],[1.636*10^7 13597 10^6]);
plot(T,Y(:,1),'-',T,Y(:,2),'*',T,Y(:,3),'+');
运行一段时间后,出现如下错误:
??? Error using ==> horzcatOut of memory. Type HELP MEMORY for your options.
Error in ==> ode45 at 487 yout = [yout, zeros(neq,chunk,dataType)];
Error in ==> system_dynamic at 1[T,Y]=ode45('equation',[0 10],[1.636*10^7 13597 10^6]); 展开
function dy =equation(t,y)
dy=zeros(3,1);
dy(1)=10^9*0.6*(pi/2+atan((0.5*y(1)+0.5*y(2)+0.5*y(3)+1)^0.3*(1.5*y(1)+1.5*y(2)+1.5*y(3)+1)^0.3*(y(1)^0.6*y(2)^0.4)^0.3-3))-y(1)*0.5*(3-(pi/2+atan((0.5*y(1)+0.5*y(2)+0.5*y(3)+1)^0.3*(1.5*y(1)+1.5*y(2)+1.5*y(3)+1)^0.3*(y(1)^0.6*y(2)^0.4)^0.3)));
dy(2)=0.25*(y(1)^0.6*y(2)^0.4)-10^(-7)*y(2)*y(3);
dy(3)=0.1*y(3)*(y(2)*1000/20-y(3));
end
然后在命令窗口输入:
[T,Y]=ode45('equation',[0 10],[1.636*10^7 13597 10^6]);
plot(T,Y(:,1),'-',T,Y(:,2),'*',T,Y(:,3),'+');
运行一段时间后,出现如下错误:
??? Error using ==> horzcatOut of memory. Type HELP MEMORY for your options.
Error in ==> ode45 at 487 yout = [yout, zeros(neq,chunk,dataType)];
Error in ==> system_dynamic at 1[T,Y]=ode45('equation',[0 10],[1.636*10^7 13597 10^6]); 展开
1个回答
2012-11-03
展开全部
这里面的初始值可真够大的,估计许用超出内存了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询