zwicker-group / py-pde

Python package for solving partial differential equations using finite differences.

Home Page:https://py-pde.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract result from last successful timestep when simulation fails to converge

OliverPaulin opened this issue · 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.