MATLAB: Could anyone help me with this warning please

ode45warning

This is my code :
function RunLogOscilNumeric3
k =10;
p0 =0.1;
t =(0:0.01:10000);
omega = 1;
N0 = 1;
[t,p]=ode23(@logOscilnumeric3,t,p0,[],omega,k,N0);
Pmax = max(p)
Pmean = mean(p)
figure(1)
plot(t,p)
title('The plot of the system with time')
xlabel ('Time')
ylabel ('The system' )
1;
% function dpdt = logOscilnumeric3(t,p,omega,k,N0)
% dpdt = N0*p – (N0*sin(omega*t)*p.^2/k);
% end
Notes: 1- Warning: Failure at t=5.060889e+00. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.421085e-14) at time t.
2- I tried to change the ode solver ,,but I still got this warning.
3- I want to solve this system for the specific values of the parameters and time'' I do not want to change those at all'' ,, because I am trying to solve different systems for the same parameters and time vector.
What should I do please?
Thanks in advance.

Best Answer

The analytical solution for your ODE is given by
p(t)=20*exp(t)/(exp(t)*(cos(t)-sin(t))-201)
This function has a singularity between t=5 and t=5.5.
Best wishes
Torsten.
Related Question