Skip to content

Commit 1de2713

Browse files
Merge pull request #851 from SciML/YingboMa-patch-1
Fix the error checking of `calculate_massmatrix`
2 parents 1c6fd41 + 9867e18 commit 1de2713

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function calculate_massmatrix(sys::AbstractODESystem; simplify=false)
8787
j = findfirst(x->isequal(tosymbol(x),tosymbol(var_from_nested_derivative(eq.lhs)[1])),dvs)
8888
M[i,j] = 1
8989
else
90-
eq.lhs == 0 || error("Only semi-explicit constant mass matrices are currently supported. Faulty equation: $eq.")
90+
_iszero(eq.lhs) || error("Only semi-explicit constant mass matrices are currently supported. Faulty equation: $eq.")
9191
end
9292
end
9393
M = simplify ? ModelingToolkit.simplify.(M) : M

0 commit comments

Comments
 (0)