Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/systems/systemstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ function mtkcompile!(state::TearingState; simplify = false,
time_domains = merge(Dict(state.fullvars .=> ci.var_domain),
Dict(default_toterm.(state.fullvars) .=> ci.var_domain))
tss, clocked_inputs, continuous_id, id_to_clock = ModelingToolkit.split_system(ci)
if continuous_id == 0
if !isempty(tss) && continuous_id == 0
# do a trait check here - handle fully discrete system
additional_passes = get(kwargs, :additional_passes, nothing)
if !isnothing(additional_passes) && any(discrete_compile_pass, additional_passes)
Expand Down
6 changes: 6 additions & 0 deletions test/odesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1628,3 +1628,9 @@ import Test: @test
@mtkbuild sys = System(D(x) ~ t, t)
@test sys isa System
end

@testset "Empty system can be simplified" begin
@named sys = System(Equation[], t)
ss = mtkcompile(sys)
@test length(equations(ss)) == length(unknowns(ss)) == 0
end
Loading