Skip to content

Commit d69dae7

Browse files
committed
format
1 parent bf91816 commit d69dae7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ struct ODESystem <: AbstractODESystem
209209
parent::Any
210210

211211
function ODESystem(
212-
tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, constraints, costs, coalesce, tgrad,
212+
tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls,
213+
observed, constraints, costs, coalesce, tgrad,
213214
jac, ctrl_jac, Wfact, Wfact_t, name, description, systems, defaults, guesses,
214215
torn_matching, initializesystem, initialization_eqs, schedule,
215216
connector_type, preface, cevents,
@@ -332,15 +333,16 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
332333
@set! constraintsystem.systems = conssystems
333334
end
334335
costs = wrap.(costs)
335-
336+
336337
if length(costs) > 1 && isnothing(coalesce)
337338
error("Must specify a coalesce function for the costs vector.")
338339
end
339340

340341
assertions = Dict{BasicSymbolic, Any}(unwrap(k) => v for (k, v) in assertions)
341342

342343
ODESystem(Threads.atomic_add!(SYSTEM_COUNT, UInt(1)),
343-
deqs, iv′, dvs′, ps′, tspan, var_to_name, ctrl′, observed, constraintsystem, costs, coalesce, tgrad, jac,
344+
deqs, iv′, dvs′, ps′, tspan, var_to_name, ctrl′, observed,
345+
constraintsystem, costs, coalesce, tgrad, jac,
344346
ctrl_jac, Wfact, Wfact_t, name, description, systems,
345347
defaults, guesses, nothing, initializesystem,
346348
initialization_eqs, schedule, connector_type, preface, cont_callbacks,
@@ -403,7 +405,7 @@ function ODESystem(eqs, iv; constraints = Equation[], costs = Num[], kwargs...)
403405
costs = wrap.(costs)
404406

405407
return ODESystem(eqs, iv, collect(Iterators.flatten((diffvars, algevars, consvars))),
406-
collect(new_ps); constraintsystem, costs, kwargs...)
408+
collect(new_ps); constraintsystem, costs, kwargs...)
407409
end
408410

409411
# NOTE: equality does not check cached Jacobian
@@ -800,7 +802,7 @@ parameter of the system.
800802
function validate_vars_and_find_ps!(auxvars, auxps, sysvars, iv)
801803
sts = sysvars
802804

803-
for var in auxvars
805+
for var in auxvars
804806
if !iscall(var)
805807
occursin(iv, var) && (var sts ||
806808
throw(ArgumentError("Time-dependent variable $var is not an unknown of the system.")))

test/optimal_control.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ end
293293
prob = ODEProblem(lksys, u0map, tspan, parammap)
294294
sol = solve(prob, Tsit5())
295295
costfn = ModelingToolkit.generate_cost_function(lksys)
296-
p = prob.p
296+
p = prob.p
297297
t = tspan[2]
298298
@test costfn(sol, p, t) (sol(0.6)[1] + 3)^2 + sol(0.3)[1]^2
299299
end

0 commit comments

Comments
 (0)