Skip to content

Commit 7505a50

Browse files
committed
Formatting
1 parent 5384bb4 commit 7505a50

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

src/systems/optimization/optimizationsystem.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ function OptimizationProblemExpr{iip}(sys::OptimizationSystem, u0,
392392
rep_pars_vals!(obj_expr, pairs_arr)
393393
@show sys.constraints
394394
if length(sys.constraints) > 0
395-
396395
@named cons_sys = NonlinearSystem(sys.constraints, dvs, ps)
397396
cons = generate_function(cons_sys, checkbounds = checkbounds,
398397
linenumbers = linenumbers,

src/utils.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,10 @@ function collect_constants(eqs::Vector{Matrix{Num}}) # For nonlinear hessian
531531
return constants
532532
end
533533

534-
535534
collect_constants(x::Num) = collect_constants(unwrap(x))
536535
function collect_constants(expr::Symbolic{T}) where {T} # For jump system affect / rate
537536
constants = Symbolic[]
538-
collect_constants!(constants,expr)
537+
collect_constants!(constants, expr)
539538
return constants
540539
end
541540

test/jumpsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ MT = ModelingToolkit
33

44
# basic MT SIR model with tweaks
55
@parameters β γ t
6-
@constants h=1
6+
@constants h = 1
77
@variables S(t) I(t) R(t)
88
rate₁ = β * S * I * h
99
affect₁ = [S ~ S - 1 * h, I ~ I + 1]

test/nonlinearsystem.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonequal(a, b) = isequal(simplify(a), simplify(b))
88

99
# Define some variables
1010
@parameters t σ ρ β
11-
@constants h=1
11+
@constants h = 1
1212
@variables x y z
1313

1414
function test_nlsys_inference(name, sys, vs, ps)
@@ -88,7 +88,7 @@ sol = solve(prob, NewtonRaphson())
8888

8989
@variables u F s a
9090
eqs1 = [
91-
0 ~ σ * (y - x) * h + F,
91+
0 ~ σ * (y - x) * h + F,
9292
0 ~ x *- z) - u,
9393
0 ~ x * y - β * z,
9494
0 ~ x + y - z - u,
@@ -171,7 +171,8 @@ end
171171
# observed variable handling
172172
@variables t x(t) RHS(t)
173173
@parameters τ
174-
@named fol = NonlinearSystem([0 ~ (1 - x * h) / τ], [x], [τ]; observed = [RHS ~ (1 - x) / τ])
174+
@named fol = NonlinearSystem([0 ~ (1 - x * h) / τ], [x], [τ];
175+
observed = [RHS ~ (1 - x) / τ])
175176
@test isequal(RHS, @nonamespace fol.RHS)
176177
RHS2 = RHS
177178
@unpack RHS = fol

test/optimizationsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using ModelingToolkit, SparseArrays, Test, Optimization, OptimizationOptimJL,
22
OptimizationMOI, Ipopt, AmplNLWriter, Ipopt_jll
33

44
@variables x y
5-
@constants h=1
5+
@constants h = 1
66
@parameters a b
77
loss = (a - x)^2 + b * (y * h - x^2)^2
88
sys1 = OptimizationSystem(loss, [x, y], [a, b], name = :sys1)

test/pde.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using ModelingToolkit, DiffEqBase, LinearAlgebra
22

33
# Define some variables
44
@parameters t x
5-
@constants h=1
5+
@constants h = 1
66
@variables u(..)
77
Dt = Differential(t)
88
Dxx = Differential(x)^2

0 commit comments

Comments
 (0)