zwicker-group/py-pde

Extract result from last successful timestep when simulation fails to converge

OliverPaulin opened this issue · 0 comments

When running a simulation via eq.solve, the solver may fail if it cannot advance the solution without reducing the timestep to below the minimum allowable timestep. This gives the error message RuntimeError: Time step below 1e-10. To aid bug fixing, it would be helpful to be able to extract the solution at the last acceptable timestep before the simulation fails.

A method which almost achieves this is to use a storage tracker and then plot the last result which was tracked from this. If the tracker is sufficiently regular, this approach gives the solution close to the point at which the simulation fails, but it would be better to be able to extract the results from actual final successful timestep.