|
98 | 98 | cost = [-x(1.0)] # Maximize the final distance. |
99 | 99 | @named block = ODESystem( |
100 | 100 | [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)]) |
102 | 102 |
|
103 | 103 | u0map = [x(t) => 0.0, v(t) => 0.0] |
104 | 104 | tspan = (0.0, 1.0) |
|
137 | 137 | costs = [-q(tspan[2])] |
138 | 138 |
|
139 | 139 | @named beesys = ODESystem(eqs, t; costs) |
140 | | - beesys, input_idxs = structural_simplify(beesys, ([α], [])) |
| 140 | + beesys = structural_simplify(beesys; inputs = [α]) |
141 | 141 | u0map = [w(t) => 40, q(t) => 2] |
142 | 142 | pmap = [b => 1, c => 1, μ => 1, s => 1, ν => 1, α => 1] |
143 | 143 |
|
|
180 | 180 | costs = [-h(te)] |
181 | 181 | cons = [T(te) ~ 0, m(te) ~ m_c] |
182 | 182 | @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)]) |
184 | 184 |
|
185 | 185 | u0map = [h(t) => h₀, m(t) => m₀, v(t) => 0] |
186 | 186 | pmap = [ |
|
223 | 223 | costs = [-Symbolics.Integral(t in (0, tf))(x(t) - u(t)), -x(tf)] |
224 | 224 | consolidate(u) = u[1] + u[2] |
225 | 225 | @named rocket = ODESystem(eqs, t; costs, consolidate) |
226 | | - rocket, input_idxs = structural_simplify(rocket, ([u(t)], [])) |
| 226 | + rocket = structural_simplify(rocket; inputs = [u(t)]) |
227 | 227 |
|
228 | 228 | u0map = [x(t) => 17.5] |
229 | 229 | pmap = [u(t) => 0.0, tf => 8] |
|
243 | 243 |
|
244 | 244 | @named block = ODESystem( |
245 | 245 | [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)]) |
247 | 247 |
|
248 | 248 | u0map = [x(t) => 1.0, v(t) => 0.0] |
249 | 249 | tspan = (0.0, tf) |
|
282 | 282 | tspan = (0, tf) |
283 | 283 |
|
284 | 284 | @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]) |
286 | 286 |
|
287 | 287 | u0map = [D(x(t)) => 0.0, D(θ(t)) => 0.0, θ(t) => 0.0, x(t) => 0.0] |
288 | 288 | pmap = [mₖ => 1.0, mₚ => 0.2, l => 0.5, g => 9.81, u => 0] |
|
0 commit comments