Open natlampen opened 2 weeks ago
I see... you should be writing this as fun = ODEFunction(f!; mass_matrix = LinearAlgebra.I)
because allocating that mass matrix is not useful for performance, and if you use I
then that's the same as the default. Right now we're checking for compatibility with === I
, but we probably should be checking if the matrix is equal to the identity matrix in general.
However, is there a reason to not use I
here?
Yes. That is a good point. This was the most basic example I could make trigger the error. This was an edge case of a spring-mass-damper system where mass is 1. So essentially the mass matrix would be LinearAlgebra.Diagonal([1,m])
.
we should be able to support arbitrary nonzero diagonal matrices here.
Interpolation using the solution struct errors when the mass matrix is the identity matrix.
A bit of context. For my use case I was passing some mass information to a function which would be passed to the mass matrix.
Minimal Reproducible Example 👇
Error & Stacktrace ⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
versioninfo()