Often in computation with an NDSolve-type solver, one hopes to know about its progress.
To this end, I am using StepMonitor
as follows,
NDSolve[eqn, y, {x, 0, L}, {t, 0, tm}, StepMonitor :> (Print["t=", t]; s++), Method -> method]
where the DE is about y[x,t]
, and s
is a counter for time step for reference.
This is ok for short calculations, but for long ones with a big terminal time tm
,
especially with a stiff problem, the output from StepMonitor
is going to be extremely long due to small time steps. This makes the notebook very long and hard to scroll up and down.
Sometimes, the notebook even breaks down!! Also, I believe the long output consumes a certain amount of memory.
So, I really need an appropriate method to get feedback about the solver's progress. For example, if tm=1000
is it
possible to get a time step printed out on the notebook every $\Delta t=50$ approximately. Consider the time steps cannot be an exact integer,
so just to print out a time step when it runs up to t>~50, t>~100, t>~150, .... Thank you very much!