Skip to content

Commit 65e67c1

Browse files
Merge pull request #4047 from SciML/as/alias-elim-bad
fix: avoid false positives in consistency check
2 parents b343c1c + ab6e2c3 commit 65e67c1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/systems/systemstructure.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,12 @@ function _mtkcompile!(state::TearingState;
10091009
state = ModelingToolkit.inputs_to_parameters!(state, discrete_inputs)
10101010
ModelingToolkit.markio!(state, Set(), inputs, outputs, disturbance_inputs)
10111011
state = ModelingToolkit.inputs_to_parameters!(state, [inputs; disturbance_inputs])
1012-
trivial_tearing!(state)
1013-
sys, mm = ModelingToolkit.alias_elimination!(state; fully_determined, kwargs...)
10141012
if check_consistency
10151013
fully_determined = ModelingToolkit.check_consistency(
10161014
state, orig_inputs; nothrow = fully_determined === nothing)
10171015
end
1016+
trivial_tearing!(state)
1017+
sys, mm = ModelingToolkit.alias_elimination!(state; fully_determined, kwargs...)
10181018
if fully_determined && dummy_derivative
10191019
sys = ModelingToolkit.dummy_derivative(
10201020
sys, state; mm, check_consistency, kwargs...)

test/stream_connectors.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ function OneFluidSystem(; name)
494494
connect(source_a.H, pipe_a.HA)
495495
connect(pipe_a.HB, volume_a.H)
496496
connect(source_b.H, pipe_b.HA)
497-
connect(pipe_b.HB, volume_b.H)]
497+
connect(pipe_b.HB, volume_b.H)
498+
source_a.H.dm ~ 0]
498499

499500
System(eqs, t, vars, pars; name, systems)
500501
end

0 commit comments

Comments
 (0)