@@ -897,6 +897,9 @@ function mtkcompile!(state::TearingState; simplify = false,
897
897
inputs = Any[], outputs = Any[],
898
898
disturbance_inputs = Any[],
899
899
kwargs... )
900
+ # split_system returns one or two systems and the inputs for each
901
+ # mod clock inference to be binary
902
+ # if it's continous keep going, if not then error unless given trait impl in additional passes
900
903
ci = ModelingToolkit. ClockInference (state)
901
904
ci = ModelingToolkit. infer_clocks! (ci)
902
905
time_domains = merge (Dict (state. fullvars .=> ci. var_domain),
@@ -910,7 +913,7 @@ function mtkcompile!(state::TearingState; simplify = false,
910
913
discrete_pass_idx = findfirst (discrete_compile_pass, additional_passes)
911
914
discrete_compile = additional_passes[discrete_pass_idx]
912
915
deleteat! (additional_passes, discrete_pass_idx)
913
- return discrete_compile (tss, clocked_inputs)
916
+ return discrete_compile (tss, clocked_inputs, ci )
914
917
end
915
918
throw (HybridSystemNotSupportedException ("""
916
919
Discrete systems with multiple clocks are not supported with the standard \
@@ -931,7 +934,7 @@ function mtkcompile!(state::TearingState; simplify = false,
931
934
deleteat! (additional_passes, discrete_pass_idx)
932
935
# in the case of a hybrid system, the discrete_compile pass should take the currents of sys.discrete_subsystems
933
936
# and modifies discrete_subsystems to bea tuple of the io and anything else, while adding or manipulating the rest of sys as needed
934
- return discrete_compile (sys, tss[2 : end ], inputs )
937
+ return discrete_compile (sys, tss[[i for i in eachindex (tss) if i != continuous_id]], clocked_inputs, ci )
935
938
end
936
939
throw (HybridSystemNotSupportedException ("""
937
940
Hybrid continuous-discrete systems are currently not supported with \
0 commit comments