請(qǐng)大家?guī)兔Ψ治鲆幌挛疫@個(gè)matlab解微分方程初值的例子,到底問題出在哪里 :
m. file:
function free
options=odeset('Jacobian', @FJac)
[t,xx]=ode15s(@serr,[0 1000000],[0.01 0.8671],options);
save t t -ascii;
save xx xx -ascii;
function dx=serr(t,x)
dx=zeros(2,1);
dx(1)=exp(-(1/x(1)))*((cosh(x(2))-1)/120/x(1)-1/3);
dx(2)=4.8e-4-240*exp(-(1/x(1)))*sinh(x(2));
end
function dfdx=FJac(t,x)
dfdx=[(exp(-1/x(1))/x(1)^2*((cosh(x(2))-1)*(1/x(1)-1)/120-1/3)) (exp(-1/x(1))/x(1)/120*sinh(x(2)));
(-exp(-1/x(1))/x(1)^2*240*sinh(x(2))) (-240*exp(-1/x(1))*cosh(x(2)))]
end
end
在matlab 運(yùn)行 free,結(jié)果出現(xiàn)下列提示:
Warning: Failure at t=1.729686e+005. Unable to meet integration tolerances without
reducing the step size below the smallest value allowed (4.656613e-010) at time t.
> In ode15s at 753
In free at 3 |