diff --git a/src/systems/systems.jl b/src/systems/systems.jl index 862718968d..97d22cf4cf 100644 --- a/src/systems/systems.jl +++ b/src/systems/systems.jl @@ -72,6 +72,10 @@ function __structural_simplify(sys::JumpSystem, args...; kwargs...) return sys end +function __structural_simplify(sys::SDESystem, args...; kwargs...) + return __structural_simplify(ODESystem(sys), args...; kwargs...) +end + function __structural_simplify(sys::AbstractSystem, io = nothing; simplify = false, kwargs...) sys = expand_connections(sys) diff --git a/test/sdesystem.jl b/test/sdesystem.jl index 036c94b868..8069581dcc 100644 --- a/test/sdesystem.jl +++ b/test/sdesystem.jl @@ -858,3 +858,13 @@ end end end end + +@testset "`structural_simplify(::SDESystem)`" begin + @variables x(t) y(t) + @mtkbuild sys = SDESystem( + [D(x) ~ x, y ~ 2x], [x, 0], t, [x, y], []; is_scalar_noise = true) + @test sys isa SDESystem + @test length(equations(sys)) == 1 + @test length(ModelingToolkit.get_noiseeqs(sys)) == 1 + @test length(observed(sys)) == 1 +end