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