@@ -787,6 +787,9 @@ function mtkcompile!(state::TearingState; simplify = false,
787787 inputs = Any[], outputs = Any[],
788788 disturbance_inputs = Any[],
789789 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
790793 ci = ModelingToolkit. ClockInference (state)
791794 ci = ModelingToolkit. infer_clocks! (ci)
792795 time_domains = merge (Dict (state. fullvars .=> ci. var_domain),
@@ -800,7 +803,7 @@ function mtkcompile!(state::TearingState; simplify = false,
800803 discrete_pass_idx = findfirst (discrete_compile_pass, additional_passes)
801804 discrete_compile = additional_passes[discrete_pass_idx]
802805 deleteat! (additional_passes, discrete_pass_idx)
803- return discrete_compile (tss, clocked_inputs)
806+ return discrete_compile (tss, clocked_inputs, ci )
804807 end
805808 throw (HybridSystemNotSupportedException ("""
806809 Discrete systems with multiple clocks are not supported with the standard \
@@ -821,7 +824,7 @@ function mtkcompile!(state::TearingState; simplify = false,
821824 deleteat! (additional_passes, discrete_pass_idx)
822825 # in the case of a hybrid system, the discrete_compile pass should take the currents of sys.discrete_subsystems
823826 # 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 )
825828 end
826829 throw (HybridSystemNotSupportedException ("""
827830 Hybrid continuous-discrete systems are currently not supported with \
0 commit comments