MATLAB- ode solver: Unable to meet integration tolerances

左心房为你撑大大i 提交于 2019-12-11 09:06:09

问题


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:

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.

First script:

% 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       

Second script=function:

% 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;

Thank you.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/30273756/matlab-ode-solver-unable-to-meet-integration-tolerances

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!