My simulations are suddenly 5-10 times faster. Why?

I am running a simulation with about 70 states that uses the DFBDF implicit solver. See: KiteModels.jl/examples/bench_4p.jl at main · OpenSourceAWE/KiteModels.jl · GitHub

Recently, I noticed a 5-10x increase in performance. I can now run my simulations at about 200x real time. I can run a simulation of 1000s duration in 5s.

Old:

# Ryzen 7950X, Solver: DFBDF
# Total simulation time: 0.043 s
# Simulation speed: 116.99 times real-time.

New:

# Ryzen 7950X, Solver: DFBDF, Julia 1.11, 04-03-2026
# Total simulation time: 0.006 s
# Simulation speed: 772.5 times real-time.

What could be the reason? Was the solver’s code improved? It now requires far fewer residual function evaluations to achieve the same accuracy (8 instead of 126). While this is a toy example, the full simulation also shows this speed advantage, even though it is only 200 times real-time under more complex environmental conditions.

What could be the reason?

I also updated many packages, fixed JETLS warnings, and improved the initial conditions. The initial conditions might matter in the toy example, but they cannot in the full example.

@ChrisRackauckas has recently added a substantial number of optimizations to DFBDF (mostly better order control and jacobian reuse). I’m a bit surprised that we’re getting 10x improvement, but especially for DAEs we improved a lot of things.

1 Like

DFBDF, not surprised. Biggest change is the Jacobian split, less factorizations

1 Like

Such a nice solver! :heart_eyes:
Let’s see how MTK compares.

But I had to set the dtmax parameter to avoid stability issues:

dtmax:   0.025         # max internal step size of the DAE solver [s]; Inf means no limit