Skip to content

Commit 8f2c780

Browse files
Fix some odd test choices
1 parent 96bfc35 commit 8f2c780

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function generate_initializesystem(sys::ODESystem;
3333
if u0map === nothing || isempty(u0map)
3434
filtered_u0 = u0map
3535
else
36-
filtered_u0 = []
36+
filtered_u0 = Pair[]
3737
for x in u0map
3838
y = get(schedule.dummy_sub, x[1], x[1])
3939
y = get(diffmap, y, y)
@@ -51,10 +51,9 @@ function generate_initializesystem(sys::ODESystem;
5151
elseif y set_full_states
5252
push!(filtered_u0, y => x[2])
5353
else
54-
error("Unreachable. Open an issue")
54+
error("Initialization expression $y is currently not supported. If its a higher order derivative expression, then only the dummy derivative expressions are supported.")
5555
end
5656
end
57-
filtered_u0 = reduce(vcat, filtered_u0)
5857
filtered_u0 = filtered_u0 isa Pair ? todict([filtered_u0]) : todict(filtered_u0)
5958
end
6059
else

test/odesystem.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ let
671671
@test isapprox(sol[x[1]][end], 2, atol = 1e-3)
672672

673673
# no initial conditions for D(x[1]) and D(x[2]) provided
674-
@test_throws ArgumentError prob=DAEProblem(sys, Pair[], Pair[], (0, 50))
674+
@test_throws ModelingToolkit.MissingVariablesError prob=DAEProblem(
675+
sys, Pair[], Pair[], (0, 50))
675676

676677
prob = ODEProblem(sys, Pair[x[1] => 0], (0, 50))
677678
sol = solve(prob, Rosenbrock23())

test/structural_transformation/index_reduction.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ let sys = structural_simplify(pendulum2)
138138
@test length(unknowns(sys)) == 5
139139

140140
u0 = [
141-
D(x) => 0.0,
142-
D(D(x)) => 0.0,
143-
D(y) => 0.0,
144-
D(D(y)) => 0.0,
145141
x => sqrt(2) / 2,
146142
y => sqrt(2) / 2
147143
]

0 commit comments

Comments
 (0)