I am integrating a series of ODEs and I run into the following warning that stops the integration:
Warning: Failure at t=3.252486e+02. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (9.094947e-13) at time t.
I googled the problem and from what I read I see it could be do to a singularity or discontinuity and it was advised to plot the solution, which I did (see Figure, plotted from 290 to the end of the integration for visibility). I still can't pinpoint what the problem is exactly and how to solve it. I'm guessing it's related to the fact that at time 300 there is a significant change in the values of the variables, as for example the variable in blue here goes from 0 to 0.9 in 3s. However the warning occurs 25s later where the values seem to have stabilized.
Any help is appreciated, thank you