matlab求微分方程数值解ode45出错,怎么办?建立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-
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 15:21:08
matlab求微分方程数值解ode45出错,怎么办?建立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-
matlab求微分方程数值解ode45出错,怎么办?
建立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]);
matlab求微分方程数值解ode45出错,怎么办?建立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-
这里面的初始值可真够大的,估计许用超出内存了