diff --git a/lib/ModelingToolkitBase/test/stream_connectors.jl b/lib/ModelingToolkitBase/test/stream_connectors.jl index 4d5020e837..4c6dfcfce1 100644 --- a/lib/ModelingToolkitBase/test/stream_connectors.jl +++ b/lib/ModelingToolkitBase/test/stream_connectors.jl @@ -510,6 +510,7 @@ function TwoFluidSystem(; name) connect(fluid_b, source_b.H) connect(source_b.H, pipe_b.HA) connect(pipe_b.HB, volume_b.H) + source_a.H.dm ~ 0 ] return System(eqs, t, vars, pars; name, systems) diff --git a/src/systems/systemstructure.jl b/src/systems/systemstructure.jl index d67e7d3414..da6edfaba6 100644 --- a/src/systems/systemstructure.jl +++ b/src/systems/systemstructure.jl @@ -233,13 +233,13 @@ function _mtkcompile!( union!(inputs, disturbance_inputs) state = ModelingToolkit.inputs_to_parameters!(state, discrete_inputs, OrderedSet{SymbolicT}()) state = ModelingToolkit.inputs_to_parameters!(state, inputs, outputs) - StateSelection.trivial_tearing!(state) - sys, mm = ModelingToolkit.alias_elimination!(state; fully_determined, kwargs...) if check_consistency fully_determined = StateSelection.check_consistency( state, orig_inputs; nothrow = fully_determined === nothing ) end + StateSelection.trivial_tearing!(state) + sys, mm = ModelingToolkit.alias_elimination!(state; fully_determined, kwargs...) # This phrasing avoids making the `kwcall` dynamic dispatch due to the type of a # keyword (`mm`) being non-concrete if mm isa CLIL.SparseMatrixCLIL{BigInt, Int}