Skip to content

Commit 4b7e89f

Browse files
committed
Make sure fullvars are marked
1 parent 6dd1014 commit 4b7e89f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/systems/abstractsystem.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,9 @@ function structural_simplify(sys::AbstractSystem, io = nothing; simplify = false
963963
has_io && markio!(state, io...)
964964
state, input_idxs = inputs_to_parameters!(state, !has_io)
965965
sys = alias_elimination!(state)
966+
# TODO: avoid construct `TearingState` again.
966967
state = TearingState(sys)
968+
has_io && markio!(state, io..., check=false)
967969
check_consistency(state)
968970
find_solvables!(state; kwargs...)
969971
sys = dummy_derivative(sys, state; simplify)
@@ -1053,7 +1055,7 @@ function linearization_function(sys::AbstractSystem, inputs,
10531055
return lin_fun, sys
10541056
end
10551057

1056-
function markio!(state, inputs, outputs)
1058+
function markio!(state, inputs, outputs; check = true)
10571059
fullvars = state.fullvars
10581060
inputset = Dict(inputs .=> false)
10591061
outputset = Dict(outputs .=> false)
@@ -1074,12 +1076,12 @@ function markio!(state, inputs, outputs)
10741076
fullvars[i] = v
10751077
end
10761078
end
1077-
all(values(inputset)) ||
1079+
check && (all(values(inputset)) ||
10781080
error("Some specified inputs were not found in system. The following Dict indicates the found variables ",
1079-
inputset)
1080-
all(values(outputset)) ||
1081+
inputset))
1082+
check && (all(values(outputset)) ||
10811083
error("Some specified outputs were not found in system. The following Dict indicates the found variables ",
1082-
outputset)
1084+
outputset))
10831085
state
10841086
end
10851087

0 commit comments

Comments
 (0)