diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl index 233f45f5bd..ad507a091b 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl @@ -17,7 +17,8 @@ struct StaticWOperator{isinv, T, F} <: AbstractSciMLOperator{T} # when constructing W for the first time for the type # inv(W) can be singular _W = if isinv && callinv - inv(W) + # W may be sparse, needs to be dense to inv + inv(Matrix(W)) else W end