SciML / ExponentialUtilities.jl

Fast and differentiable implementations of matrix exponentials, Krylov exponential matrix-vector multiplications ("expmv"), KIOPS, ExpoKit functions, and more. All your exponential needs in SciML form.
https://docs.sciml.ai/ExponentialUtilities/stable/
Other
93 stars 29 forks source link

Finish timestepping after happy breakdown #147

Closed ArneBouillon closed 9 months ago

ArneBouillon commented 10 months ago

Fixes #143

I looked into that issue a bit more. Expokit.jl uses the same initial time step as ExponentialUtilities.jl, but does not face the dimension-1 issue since it stops timestepping upon a happy breakdown. When using the matrix dimension as the Krylov subspace dimension, happy breakdown will occur and there is no need for taking (potentially very small) time steps.

ChrisRackauckas commented 10 months ago

This seems reasonable. I don't know who looked at this code last, @YingboMa ?

ArneBouillon commented 9 months ago

@ChrisRackauckas As far as I'm concerned, this one is ready for review. I added some documentation on this shortcut.

I'm unsure as to why some integration tests are failing. It seems unrelated to my changes.

ChrisRackauckas commented 9 months ago

See the note on re-solve. Also, does expv_timestep! need to be handled similarly?

ArneBouillon commented 9 months ago

Good point, I didn't realise the caches were reused! expv_timestep! calls phiv_timestep! under the hood, so that doesn't need extra care.

ChrisRackauckas commented 9 months ago

Thanks!