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