Skip to content

Commit 352e86e

Browse files
Merge pull request #2765 from SciML/no_clocks
error for hybrid continuous/discrete systems
2 parents a285fc2 + 234d20c commit 352e86e

File tree

4 files changed

+431
-413
lines changed

4 files changed

+431
-413
lines changed

src/systems/abstractsystem.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,6 +2320,13 @@ function Base.showerror(io::IO, e::ExtraEquationsSystemException)
23202320
print(io, "ExtraEquationsSystemException: ", e.msg)
23212321
end
23222322

2323+
struct HybridSystemNotSupportedExcpetion <: Exception
2324+
msg::String
2325+
end
2326+
function Base.showerror(io::IO, e::HybridSystemNotSupportedExcpetion)
2327+
print(io, "HybridSystemNotSupportedExcpetion: ", e.msg)
2328+
end
2329+
23232330
function AbstractTrees.children(sys::ModelingToolkit.AbstractSystem)
23242331
ModelingToolkit.get_systems(sys)
23252332
end

src/systems/systemstructure.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@ function structural_simplify!(state::TearingState, io = nothing; simplify = fals
635635
check_consistency, fully_determined,
636636
kwargs...)
637637
if length(tss) > 1
638+
if continuous_id > 0
639+
throw(HybridSystemNotSupportedExcpetion("Hybrid continuous-discrete systems are currently not supported with the standard MTK compiler. This system requires JuliaSimCompiler.jl, see https://help.juliahub.com/juliasimcompiler/stable/"))
640+
end
638641
# TODO: rename it to something else
639642
discrete_subsystems = Vector{ODESystem}(undef, length(tss))
640643
# Note that the appended_parameters must agree with

0 commit comments

Comments
 (0)