henry2004y / TestParticle.jl

Test particle tracing in electromagnetic field
https://henry2004y.github.io/TestParticle.jl/dev/
MIT License
14 stars 3 forks source link

Adaptive timestepping control #131

Open henry2004y opened 5 months ago

henry2004y commented 5 months ago

When I tried to reproduce a previous Ganymede tracing results with Vern9() using recent versions of OrdinaryDiffEq.jl, I noticed that the performance deceased a lot. After investigating the issue, I noticed that the adaptive timestepping control must have changed between versions, because most of the time is spent in advancing with extremely small dt near the planet boundary where the magnetic field becomes stronger and isoutofdomain may take place.

According to the common solver options, one possible fix to recover the previous speed performance is to set a dtmin. This needs further testing.

P.S. I don't really understand how the adaptive timestepping schemes work.

henry2004y commented 3 months ago

For the Boris pusher, we can try the adaptive timestepping scheme implemented in FLEKS. Instead of using characteristic wave speeds, we can use local gyroperiod to limit the timesteps.