Skip to content

Commit ade94d9

Browse files
committed
format: format
1 parent 15f3e8a commit ade94d9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ext/MTKJuMPDynamicOptExt.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ function init_model(sys, tspan, steps, u0map, pmap, u0; is_free_t = false)
103103

104104
if is_free_t
105105
(ts_sym, te_sym) = tspan
106-
MTK.symbolic_type(ts_sym) !== MTK.NotSymbolic() && error("Free initial time problems are not currently supported.")
106+
MTK.symbolic_type(ts_sym) !== MTK.NotSymbolic() &&
107+
error("Free initial time problems are not currently supported.")
107108
@variable(model, tf, start=pmap[te_sym])
108109
set_lower_bound(tf, ts_sym)
109110
hasbounds(te_sym) && begin
@@ -236,7 +237,8 @@ function substitute_jump_vars(model, sys, pmap, exprs; auxmap = Dict(), is_free_
236237
exprs = map(c -> Symbolics.fixpoint_sub(c, Dict(pmap)), exprs)
237238
if is_free_t
238239
tf = model[:tf]
239-
free_t_map = Dict([[x(tf) => U[i](1) for (i, x) in enumerate(x_ops)]; [c(tf) => V[i](1) for (i, c) in enumerate(c_ops)]])
240+
free_t_map = Dict([[x(tf) => U[i](1) for (i, x) in enumerate(x_ops)];
241+
[c(tf) => V[i](1) for (i, c) in enumerate(c_ops)]])
240242
exprs = map(c -> Symbolics.fixpoint_sub(c, free_t_map), exprs)
241243
end
242244

test/downstream/jump_control.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ end
193193
iprob = InfiniteOptDynamicOptProblem(
194194
rocket, u0map, (ts, te), pmap; dt = 0.001, cse = false)
195195
isol = solve(iprob, Ipopt.Optimizer,
196-
derivative_method = InfiniteOpt.OrthogonalCollocation(3), silent = true)
196+
derivative_method = InfiniteOpt.OrthogonalCollocation(3), silent = true)
197197
@test isol.sol.u[end][1] > 1.012
198198

199199
# Test solution
@@ -245,7 +245,7 @@ end
245245
@named block = ODESystem(
246246
[D(x(t)) ~ v(t), D(v(t)) ~ u(t)], t; costs = cost, constraints = constr)
247247
block, input_idxs = structural_simplify(block, ([u(t)], []))
248-
248+
249249
u0map = [x(t) => 1.0, v(t) => 0.0]
250250
tspan = (0.0, tf)
251251
parammap = [u(t) => 0.0, tf => 1.0]

0 commit comments

Comments
 (0)