Skip to content

Commit c5e4974

Browse files
committed
Fix more tests
1 parent 3133a15 commit c5e4974

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

test/structural_transformation/index_reduction.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ idx1_pendulum = [D(x) ~ w,
8282
# 2x*D(D(x)) + 2*D(x)*D(x) + 2y*D(D(y)) + 2*D(y)*D(y) and
8383
# substitute the rhs
8484
0 ~ 2x*(T*x) + 2*xˍt*xˍt + 2y*(T*y - g) + 2*yˍt*yˍt]
85-
idx1_pendulum = ODESystem(idx1_pendulum, t, [x, y, w, z, xˍt, yˍt, T], [L, g])
85+
@named idx1_pendulum = ODESystem(idx1_pendulum, t, [x, y, w, z, xˍt, yˍt, T], [L, g])
8686
first_order_idx1_pendulum = ode_order_lowering(idx1_pendulum)
8787

8888
using OrdinaryDiffEq

test/structural_transformation/tearing.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ eqs = [
1818
0 ~ u4 - hypot(u2, u3),
1919
0 ~ u5 - hypot(u4, u1),
2020
]
21-
sys = NonlinearSystem(eqs, [u1, u2, u3, u4, u5], [])
21+
@named sys = NonlinearSystem(eqs, [u1, u2, u3, u4, u5], [])
2222
sys = initialize_system_structure(sys)
2323
StructuralTransformations.find_solvables!(sys)
2424
sss = structure(sys)
@@ -125,7 +125,7 @@ eqs = [
125125
0 ~ z + y,
126126
0 ~ x + z,
127127
]
128-
nlsys = NonlinearSystem(eqs, [x, y, z], [])
128+
@named nlsys = NonlinearSystem(eqs, [x, y, z], [])
129129
newsys = tearing(nlsys)
130130
@test equations(newsys) == [0 ~ z]
131131
@test isequal(states(newsys), [z])
@@ -142,7 +142,7 @@ eqs = [
142142
0 ~ x - y
143143
0 ~ sin(z) + y - p*t
144144
]
145-
daesys = ODESystem(eqs, t)
145+
@named daesys = ODESystem(eqs, t)
146146
newdaesys = tearing(daesys)
147147
@test equations(newdaesys) == [D(x) ~ z; 0 ~ x + sin(z) - p*t]
148148
@test isequal(states(newdaesys), [x, z])
@@ -152,7 +152,8 @@ du = [0.0]; u = [1.0]; pr = 0.2; tt = 0.1
152152
@test du [-asin(u[1] - pr * tt)] atol=1e-5
153153

154154
# test the initial guess is respected
155-
infprob = ODAEProblem(tearing(ODESystem(eqs, t, defaults=Dict(z=>Inf))), [x=>1.0], (0, 1.0), [p=>0.2])
155+
@named sys = ODESystem(eqs, t, defaults=Dict(z=>Inf))
156+
infprob = ODAEProblem(tearing(sys), [x=>1.0], (0, 1.0), [p=>0.2])
156157
@test_throws DomainError infprob.f(du, u, pr, tt)
157158

158159
sol1 = solve(prob, Tsit5())

0 commit comments

Comments
 (0)