1
votes

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

1 Answers

3
votes

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.