Consider the DE:
A numerical routine for the solution of this DE is obtained by using dsolve and the rkf45 method as follows:
The routine is then applied to a value to obtain the numerical solution at that point:
Suppose that instead we wanted to integrate out to . If we attempt to do this with the generated routine, a problem occurs.
Integrating this DE out to actually requires nearly half a million function evaluations due to the increase in the rate of change of the function on the right-hand side. This can take some time for computation, so maxfun acts like a stopcheck here.
If we really want this value, we can increase the value of maxfun from its default of to , and obtain a solution as follows:
Alternatively, we could have set maxfun to , and then the routine would proceed until it found the value at the specified point, or recognized a singularity.
The ODE IVP:
has a fast blow-up singularity just past .
If we attempt to numerically integrate this IVP to , we get:
Or implicitly using the range argument:
This error tells us that integration over this region required more than the default of evaluations of the DE. This seems to indicate that we need to increase maxfun. In doing so, we get:
we see that we still hit the maxfun barrier, though the integration does proceed a small bit further.
Since there is an actual singularity, this is a case where the singularity detection fails and maxfun set to prevents the calculation from running for an excessive time while serving no useful purpose.