Skip to content

Commit 4a7b12d

Browse files
feat: allow full_equations on a singular system
1 parent 8ce87ea commit 4a7b12d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ These equations matches generated numerical code.
104104
105105
See also [`equations`](@ref) and [`ModelingToolkit.get_eqs`](@ref).
106106
"""
107-
function full_equations(sys::AbstractSystem; simplify = false)
107+
function full_equations(sys::AbstractSystem; simplify = false, allow_singular = false)
108108
empty_substitutions(sys) && return equations(sys)
109109
substitutions = get_substitutions(sys)
110110
substitutions.subed_eqs === nothing || return substitutions.subed_eqs
@@ -119,7 +119,7 @@ function full_equations(sys::AbstractSystem; simplify = false)
119119
eq = 0 ~ eq.rhs - eq.lhs
120120
end
121121
rhs = tearing_sub(eq.rhs, solved, simplify)
122-
if rhs isa Symbolic
122+
if rhs isa Symbolic || allow_singular
123123
return 0 ~ rhs
124124
else # a number
125125
error("tearing failed because the system is singular")

0 commit comments

Comments
 (0)