Skip to content

Commit fa550f5

Browse files
Change allow_symbolic to default to true
From the longer conversation. The reason for not defaulting to it before was a scare that the eliminated expression may be zero. This was found before, leading to NaNs in the resulting system evaluations. However, such zeros would also be problematic to the solver as well, since leaving the uneliminated term in leads to the structural jacobian not matching the true jacobian, which can make the structural DAE index different from the true index. Because of this phenomena, it is no less safe to eliminate the extra variables. But it can lead to some numerical improvements. For example, `p * y ~ p * z` is trivial at `p = 0`, but `y ~ z` is not, and therefore eliminating the `p` is more numerically robust.
1 parent f690295 commit fa550f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/systems.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ topological sort of the observed equations in `sys`.
2222
2323
### Optional Keyword Arguments:
2424
+ When `simplify=true`, the `simplify` function will be applied during the tearing process.
25-
+ `allow_symbolic=false`, `allow_parameter=true`, and `conservative=false` limit the coefficient types during tearing. In particular, `conservative=true` limits tearing to only solve for trivial linear systems where the coefficient has the absolute value of ``1``.
25+
+ `allow_symbolic=true`, `allow_parameter=true`, and `conservative=false` limit the coefficient types during tearing. In particular, `conservative=true` limits tearing to only solve for trivial linear systems where the coefficient has the absolute value of ``1``.
2626
+ `fully_determined=true` controls whether or not an error will be thrown if the number of equations don't match the number of inputs, outputs, and equations.
2727
"""
2828
function structural_simplify(
2929
sys::AbstractSystem, io = nothing; additional_passes = [], simplify = false, split = true,
30-
allow_symbolic = false, allow_parameter = true, conservative = false, fully_determined = true,
30+
allow_symbolic = true, allow_parameter = true, conservative = false, fully_determined = true,
3131
kwargs...)
3232
isscheduled(sys) && throw(RepeatedStructuralSimplificationError())
3333
newsys′ = __structural_simplify(sys, io; simplify,

0 commit comments

Comments
 (0)