pythonscipyjuliadifferentialequations.jl

Method for measuring the percentual of time span in a Differential Equation solver


I use Differential Equations from julia (previously solve_ivp from scipy) and it would be very convenient for me to have a notion of the amount of time steps that have occured. For example, if my simulation has a timespan = (0.0, 10e4), the method should print each increase of 1% of the total timespan. I thought about using a for loop inside the dydt function to print time at every interval but I'm afraid the amount of text printed will pollute too much my notebook output.


Solution

  • The easiest thing to do here is to use a callback https://diffeq.sciml.ai/stable/features/callback_functions/ to print when appropriate. Note that since timestep size is dynamic, this spacing evenly over timesteps will not space evenly over time.