BoundsError: attempt to access Float64 using ModelingToolkit.jl and AutoOptimize.jl to optimize a DifferentialEquations.jl model

Thanks for the well-written report. It looks like we introduced a bug here in our ModelingToolkit v4 release. I fixed it in https://github.com/SciML/ModelingToolkit.jl/pull/677 and will merge and tag the patch tomorrow morning. Also, I made this model into a regression test to catch this in the future.

P.S. The speedup you get from this is before:

0.000285 seconds (4.43 k allocations: 197.484 KiB)

after:

0.000060 seconds (73 allocations: 13.453 KiB)

mostly due to the allocation of the Λ.

3 Likes