Skip to content

Commit de902dc

Browse files
test: fix usage of old structural_simplify io syntax
1 parent 0b98fc4 commit de902dc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/downstream/jump_control.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ end
9898
cost = [-x(1.0)] # Maximize the final distance.
9999
@named block = ODESystem(
100100
[D(x(t)) ~ v(t), D(v(t)) ~ u(t)], t; costs = cost, constraints = constr)
101-
block, input_idxs = structural_simplify(block, ([u(t)], []))
101+
block = structural_simplify(block; inputs = [u(t)])
102102

103103
u0map = [x(t) => 0.0, v(t) => 0.0]
104104
tspan = (0.0, 1.0)
@@ -137,7 +137,7 @@ end
137137
costs = [-q(tspan[2])]
138138

139139
@named beesys = ODESystem(eqs, t; costs)
140-
beesys, input_idxs = structural_simplify(beesys, ([α], []))
140+
beesys = structural_simplify(beesys; inputs = [α])
141141
u0map = [w(t) => 40, q(t) => 2]
142142
pmap = [b => 1, c => 1, μ => 1, s => 1, ν => 1, α => 1]
143143

@@ -180,7 +180,7 @@ end
180180
costs = [-h(te)]
181181
cons = [T(te) ~ 0, m(te) ~ m_c]
182182
@named rocket = ODESystem(eqs, t; costs, constraints = cons)
183-
rocket, input_idxs = structural_simplify(rocket, ([T(t)], []))
183+
rocket = structural_simplify(rocket; inputs = [T(t)])
184184

185185
u0map = [h(t) => h₀, m(t) => m₀, v(t) => 0]
186186
pmap = [
@@ -223,7 +223,7 @@ end
223223
costs = [-Symbolics.Integral(t in (0, tf))(x(t) - u(t)), -x(tf)]
224224
consolidate(u) = u[1] + u[2]
225225
@named rocket = ODESystem(eqs, t; costs, consolidate)
226-
rocket, input_idxs = structural_simplify(rocket, ([u(t)], []))
226+
rocket = structural_simplify(rocket; inputs = [u(t)])
227227

228228
u0map = [x(t) => 17.5]
229229
pmap = [u(t) => 0.0, tf => 8]
@@ -243,7 +243,7 @@ end
243243

244244
@named block = ODESystem(
245245
[D(x(t)) ~ v(t), D(v(t)) ~ u(t)], t; costs = cost, constraints = constr)
246-
block, input_idxs = structural_simplify(block, ([u(t)], []))
246+
block = structural_simplify(block, inputs = [u(t)])
247247

248248
u0map = [x(t) => 1.0, v(t) => 0.0]
249249
tspan = (0.0, tf)
@@ -282,7 +282,7 @@ end
282282
tspan = (0, tf)
283283

284284
@named cartpole = ODESystem(eqs, t; costs, constraints = cons)
285-
cartpole, input_idxs = structural_simplify(cartpole, ([u], []))
285+
cartpole, input_idxs = structural_simplify(cartpole; inputs = [u])
286286

287287
u0map = [D(x(t)) => 0.0, D(θ(t)) => 0.0, θ(t) => 0.0, x(t) => 0.0]
288288
pmap = [mₖ => 1.0, mₚ => 0.2, l => 0.5, g => 9.81, u => 0]

test/odesystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ let
466466

467467
eqs = [D(x) ~ ẋ, D(ẋ) ~ f - k * x - d * ẋ]
468468
@named sys = ODESystem(eqs, t, [x, ẋ], [d, k])
469-
sys, _ = structural_simplify(sys, ([f], []))
469+
sys = structural_simplify(sys; inputs = [f])
470470

471471
@test isequal(calculate_control_jacobian(sys),
472472
reshape(Num[0, 1], 2, 1))

0 commit comments

Comments
 (0)