1

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.

Prometeu
  • 55
  • 5

1 Answers1

3

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.

Oscar Smith
  • 5,766
  • 1
  • 20
  • 34