@@ -787,6 +787,9 @@ function mtkcompile!(state::TearingState; simplify = false,
787
787
inputs = Any[], outputs = Any[],
788
788
disturbance_inputs = Any[],
789
789
kwargs... )
790
+ # split_system returns one or two systems and the inputs for each
791
+ # mod clock inference to be binary
792
+ # if it's continous keep going, if not then error unless given trait impl in additional passes
790
793
ci = ModelingToolkit. ClockInference (state)
791
794
ci = ModelingToolkit. infer_clocks! (ci)
792
795
time_domains = merge (Dict (state. fullvars .=> ci. var_domain),
@@ -800,7 +803,7 @@ function mtkcompile!(state::TearingState; simplify = false,
800
803
discrete_pass_idx = findfirst (discrete_compile_pass, additional_passes)
801
804
discrete_compile = additional_passes[discrete_pass_idx]
802
805
deleteat! (additional_passes, discrete_pass_idx)
803
- return discrete_compile (tss, clocked_inputs)
806
+ return discrete_compile (tss, clocked_inputs, ci )
804
807
end
805
808
throw (HybridSystemNotSupportedException ("""
806
809
Discrete systems with multiple clocks are not supported with the standard \
@@ -821,7 +824,7 @@ function mtkcompile!(state::TearingState; simplify = false,
821
824
deleteat! (additional_passes, discrete_pass_idx)
822
825
# in the case of a hybrid system, the discrete_compile pass should take the currents of sys.discrete_subsystems
823
826
# and modifies discrete_subsystems to bea tuple of the io and anything else, while adding or manipulating the rest of sys as needed
824
- return discrete_compile (sys, tss[2 : end ], inputs )
827
+ return discrete_compile (sys, tss[[i for i in eachindex (tss) if i != continuous_id]], clocked_inputs, ci )
825
828
end
826
829
throw (HybridSystemNotSupportedException ("""
827
830
Hybrid continuous-discrete systems are currently not supported with \
0 commit comments