MATLABode求解器:无法满足集成公差 [英] MATLAB- ode solver: Unable to meet integration tolerances
问题描述
我在MATLAB中的 ode求解器遇到了问题.我使用了所有ode求解器,例如ode23s,ode23,ode15s,ode45等.而且由于警告错误,我的代码无法计算:
I have a problem with ode solver in MATLAB. I used all ode solver like ode23s, ode23, ode15s, ode45 and so on. And my code can not be calculated, because of error-warning:
警告:在t = 8.190397e + 01时失败.无法满足整合 公差不降低步长小于最小值 在时间t允许(2.273737e-13).
Warning: Failure at t=8.190397e+01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (2.273737e-13) at time t.
我想计算它,请直接在我的代码中帮助我.谢谢.
I would like to calculate it, please help me directly in my code. Thank you.
第一个脚本:
% floq.m
global c_alpha c_beta c_gama om ms ks bs mii
% Parameters
c_alpha=1;
c_beta=1.1;
c_gama=1.1;
ms=1;
ks=1;
D=0.01;
OM=sqrt(ks/ms);
bs=2*D*ms*OM;
% Solver
sourad = 0.1:0.13:10;
for pom = 1:length(sourad)
eta= sqrt(1/sourad(pom));
om=eta*OM;
T=2*pi/(eta*OM);
for mii=-10*(eta^2):0.13:10*(eta^2)
tspan=0:0.01:T;
[tt,x1]=ode23(@fun,tspan,[1; 0]);
end
end
第二个脚本=功能:
% fun.m
function v=fun(tt,x1);
global c_alpha c_beta c_gama om ms ks bs mii
mt=ms*cos(om*tt);
bt=bs*cos(2*om*tt);
kt=ks*cos(2*om*tt);
% Matrix A
A=[(-bs+mii*c_beta*bt)/(ms-mii*c_gama*mt) (-ks+mii*c_alpha*kt)/(ms-mii*c_gama*mt); 1 0];
% Method
v=A*x1;
谢谢.
推荐答案
您正在通过ODE函数的一个极点进行集成.在极点,所有解决方案都结束了.极点左右的轨迹不能合并成一个更大的轨迹.
You are integrating over a pole of the ODE function. At the pole, every solution ends. Trajectories to the left and right of the pole can not joined into one larger trajectory.
极点是1 = mii*c_gama*cos(om*t)
的第一个正解t
.如果mii*c_gama >= 1
总是有这样的解决方案.
The pole is the first positive solution t
of 1 = mii*c_gama*cos(om*t)
. If mii*c_gama >= 1
there is always such a solution.
这篇关于MATLABode求解器:无法满足集成公差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!