Skip to content

Commit bea9fad

Browse files
committed
Added test
1 parent 4f89795 commit bea9fad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/initializationsystem.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,3 +447,11 @@ prob = ODEProblem(pend, [x => 1], (0.0, 1.5), [g => 1],
447447
unsimp = generate_initializesystem(pend; u0map = [x => 1], initialization_eqs = [y ~ 1])
448448
sys = structural_simplify(unsimp; fully_determined = false)
449449
@test length(equations(sys)) == 3
450+
451+
# Extend two systems with initialization equations
452+
# https://github.com/SciML/ModelingToolkit.jl/issues/2845
453+
@variables x(t) y(t)
454+
@named sysx = ODESystem([D(x) ~ 0], t; initialization_eqs = [x ~ 1])
455+
@named sysy = ODESystem([D(y) ~ 0], t; initialization_eqs = [y ~ 2])
456+
sys = extend(sysx, sysy)
457+
@test length(equations(generate_initializesystem(sys))) == 2

0 commit comments

Comments
 (0)