@@ -963,7 +963,9 @@ function structural_simplify(sys::AbstractSystem, io = nothing; simplify = false
963
963
has_io && markio! (state, io... )
964
964
state, input_idxs = inputs_to_parameters! (state, ! has_io)
965
965
sys = alias_elimination! (state)
966
+ # TODO : avoid construct `TearingState` again.
966
967
state = TearingState (sys)
968
+ has_io && markio! (state, io... , check= false )
967
969
check_consistency (state)
968
970
find_solvables! (state; kwargs... )
969
971
sys = dummy_derivative (sys, state; simplify)
@@ -1053,7 +1055,7 @@ function linearization_function(sys::AbstractSystem, inputs,
1053
1055
return lin_fun, sys
1054
1056
end
1055
1057
1056
- function markio! (state, inputs, outputs)
1058
+ function markio! (state, inputs, outputs; check = true )
1057
1059
fullvars = state. fullvars
1058
1060
inputset = Dict (inputs .=> false )
1059
1061
outputset = Dict (outputs .=> false )
@@ -1074,12 +1076,12 @@ function markio!(state, inputs, outputs)
1074
1076
fullvars[i] = v
1075
1077
end
1076
1078
end
1077
- all (values (inputset)) ||
1079
+ check && ( all (values (inputset)) ||
1078
1080
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)) ||
1081
1083
error (" Some specified outputs were not found in system. The following Dict indicates the found variables " ,
1082
- outputset)
1084
+ outputset))
1083
1085
state
1084
1086
end
1085
1087
0 commit comments