Skip to content

Commit 27dbd53

Browse files
Merge pull request #152 from ChrisRackauckas/fix-formatting
Apply JuliaFormatter to fix code formatting
2 parents 96ae0ad + b00f438 commit 27dbd53

File tree

6 files changed

+47
-27
lines changed

6 files changed

+47
-27
lines changed

lib/DDEProblemLibrary/src/qs.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Cultures of Pseudomonas Putida IsoF By Use of ELISA and UHPLC/qTOF-MS-derived Me
1111
and Mathematical Models, Analytical and Bioanalytical Chemistry.
1212
"""
1313
const prob_dde_qs = let S₀ = 1, τ = 2, D = 0.1, γₛ = 1.3e-12, Kₘ = 0.38, nₛ = 1.3, a = 0.66,
14-
αₐ = 2.3e-19,
15-
βₐ = 2.3e-18, C₁ = 70e-9, n₁ = 2.3, γₐ = 0.05, αC = 4e4, R = 5e-7, γ₃ = 0.08,
16-
Kₑ = 1.5e-4, αₗ = 1.1e-8, C₂ = 70e-9, n₂ = 2.5, γₗ = 0.005
14+
αₐ = 2.3e-19, βₐ = 2.3e-18, C₁ = 70e-9, n₁ = 2.3, γₐ = 0.05, αC = 4e4, R = 5e-7,
15+
γ₃ = 0.08, Kₑ = 1.5e-4, αₗ = 1.1e-8, C₂ = 70e-9, n₂ = 2.5, γₗ = 0.005
1716

1817
function hill_growth(x, K, n)
1918
if x > K

lib/JumpProblemLibrary/src/JumpProblemLibrary.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ rs = @reaction_network begin
141141
kAdp, S8 --> S5
142142
kAdp, S9 --> S3
143143
end
144-
rates = [:kon, :kAon, :koff, :kAoff, :kAp, :kAdp] .=>
145-
params[[rsi[:kon], rsi[:kAon], rsi[:koff], rsi[:kAoff], rsi[:kAp], rsi[:kAdp]]]
144+
rates = [:kon,
145+
:kAon,
146+
:koff,
147+
:kAoff,
148+
:kAp,
149+
:kAdp] .=> params[[
150+
rsi[:kon], rsi[:kAon], rsi[:koff], rsi[:kAoff], rsi[:kAp], rsi[:kAdp]]]
146151
u0 = [:S1 => params[1], :S2 => params[2], :S3 => params[3], :S4 => 0, :S5 => 0,
147152
:S6 => 0, :S7 => 0, :S8 => 0, :S9 => 0]
148153
tf = 100.0

lib/NonlinearProblemLibrary/src/NonlinearProblemLibrary.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ p12_dict = Dict("n" => n, "start" => x_start, "sol" => x_sol,
264264

265265
@inbounds function p13_f!(out, x, p = nothing)
266266
n = length(x)
267-
out[1] = broyden_tridiag_kernel(x[1]) -2.0 * x[2]
267+
out[1] = broyden_tridiag_kernel(x[1]) - 2.0 * x[2]
268268
for k in 2:(n - 1)
269269
out[k] = broyden_tridiag_kernel(x[k]) - x[k - 1] - 2.0 * x[k + 1]
270270
end

lib/ODEProblemLibrary/src/ODEProblemLibrary.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export prob_ode_linear, prob_ode_bigfloatlinear, prob_ode_2Dlinear,
3737
end
3838
end
3939

40-
4140
include("ode_linear_prob.jl")
4241
include("ode_simple_nonlinear_prob.jl")
4342
include("brusselator_prob.jl")

lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ with ``μ=1.0`` and ``u_0=[x => \\sqrt{3}, y => 0]``
7070
7171
Non-stiff parameters.
7272
"""
73-
prob_ode_vanderpol = ODEProblem(van, [y => 0, x => sqrt(3), μ => 1.0], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
73+
prob_ode_vanderpol = ODEProblem(van, [y => 0, x => sqrt(3), μ => 1.0], (0.0, 1.0),
74+
jac = true, eval_module = @__MODULE__)
7475

7576
"""
7677
Van der Pol Equations
@@ -86,7 +87,8 @@ with ``μ=10^6`` and ``u_0=[x => \\sqrt{3}, y => 0]``
8687
8788
Stiff parameters.
8889
"""
89-
prob_ode_vanderpol_stiff = ODEProblem(van, [y => 0, x => sqrt(3), μ => 1e6], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
90+
prob_ode_vanderpol_stiff = ODEProblem(van, [y => 0, x => sqrt(3), μ => 1e6], (0.0, 1.0),
91+
jac = true, eval_module = @__MODULE__)
9092

9193
# ROBER
9294
@parameters k₁ k₂ k₃
@@ -116,13 +118,18 @@ Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Probl
116118
117119
Usually solved on ``[0,1e11]``
118120
"""
119-
prob_ode_rober = ODEProblem(rober, [[y₁, y₂, y₃] .=> [1.0; 0.0; 0.0]; [k₁, k₂, k₃] .=> (0.04, 3e7, 1e4)], (0.0, 1e11), jac = true, eval_module = @__MODULE__)
121+
prob_ode_rober = ODEProblem(
122+
rober, [[y₁, y₂, y₃] .=> [1.0; 0.0; 0.0]; [k₁, k₂, k₃] .=> (0.04, 3e7, 1e4)],
123+
(0.0, 1e11), jac = true, eval_module = @__MODULE__)
120124

121125
# Three Body
122126
const threebody_μ = big(0.012277471);
123127
const threebody_μ′ = 1 - threebody_μ;
124128

125-
threebody = (du, u, p, t) -> begin
129+
threebody = (du,
130+
u,
131+
p,
132+
t) -> begin
126133
# 1 = y₁
127134
# 2 = y₂
128135
# 3 = y₁'
@@ -200,8 +207,10 @@ or Hairer Norsett Wanner Solving Ordinary Differential Equations I - Nonstiff Pr
200207
201208
Usually solved from 0 to 20.
202209
"""
203-
prob_ode_rigidbody = ODEProblem(rigid, [[y₁, y₂, y₃] .=> [1.0, 0.0, 0.9]; [I₁, I₂, I₃] .=> (-2.0, 1.25, -0.5)], (0.0, 20.0),
204-
jac = true, eval_module = @__MODULE__)
210+
prob_ode_rigidbody = ODEProblem(
211+
rigid, [[y₁, y₂, y₃] .=> [1.0, 0.0, 0.9]; [I₁, I₂, I₃] .=> (-2.0, 1.25, -0.5)],
212+
(0.0, 20.0),
213+
jac = true, eval_module = @__MODULE__)
205214

206215
# Pleiades Problem
207216

@@ -216,6 +225,7 @@ pleiades = (du, u, p, t) -> begin
216225
du[i] = zero(eltype(u))
217226
end
218227
for i in 1:7, j in 1:7
228+
219229
if i != j
220230
r = ((x[i] - x[j])^2 + (y[i] - y[j])^2)^(3 / 2)
221231
du[14 + i] += j * (x[j] - x[i]) / r
@@ -365,7 +375,8 @@ u0[1] = 1
365375
u0[8] = 0.0057
366376

367377
u0 = [y1, y2, y3, y4, y5, y6, y7, y8] .=> u0
368-
p = [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12] .=> (1.71, 0.43, 8.32, 0.0007, 8.75,
378+
p = [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
379+
p12] .=> (1.71, 0.43, 8.32, 0.0007, 8.75,
369380
10.03, 0.035, 1.12, 1.745, 280.0, 0.69, 1.81)
370381

371382
"""
@@ -390,7 +401,8 @@ where ``f`` is defined by
390401
Reference: [demohires.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoHires/demohires.pdf)
391402
Notebook: [Hires.ipynb](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Hires.ipynb)
392403
"""
393-
prob_ode_hires = ODEProblem(hires, [u0; p], (0.0, 321.8122), jac = true, eval_module = @__MODULE__)
404+
prob_ode_hires = ODEProblem(
405+
hires, [u0; p], (0.0, 321.8122), jac = true, eval_module = @__MODULE__)
394406

395407
@parameters p1 p2 p3
396408
@variables y1(t) y2(t) y3(t)
@@ -418,4 +430,6 @@ where ``s=77.27``, ``w=0.161`` and ``q=8.375⋅10^{-6}``.
418430
Reference: [demoorego.pdf](http://www.radford.edu/~thompson/vodef90web/problems/demosnodislin/Demos_Pitagora/DemoOrego/demoorego.pdf)
419431
Notebook: [Orego.ipynb](http://nbviewer.jupyter.org/github/JuliaDiffEq/DiffEqBenchmarks.jl/blob/master/StiffODE/Orego.ipynb)
420432
"""
421-
prob_ode_orego = ODEProblem(orego, [[y1, y2, y3] .=> [1.0, 2.0, 3.0]; [p1, p2, p3] .=> [77.27, 8.375e-6, 0.161]], (0.0, 30.0), jac = true, eval_module = @__MODULE__)
433+
prob_ode_orego = ODEProblem(
434+
orego, [[y1, y2, y3] .=> [1.0, 2.0, 3.0]; [p1, p2, p3] .=> [77.27, 8.375e-6, 0.161]],
435+
(0.0, 30.0), jac = true, eval_module = @__MODULE__)

lib/ODEProblemLibrary/src/strange_attractors.jl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ $(latexify(thomas; mult_symbol=""))
2323
2424
[Wikipedia](https://en.wikipedia.org/wiki/Thomas%27_cyclically_symmetric_attractor)
2525
"""
26-
prob_ode_thomas = ODEProblem(thomas, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
26+
prob_ode_thomas = ODEProblem(thomas, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
2727

2828
# Lorenz
29-
@parameters σ=10 ρ=28 β=8 / 3
29+
@parameters σ=10 ρ=28 β=8/3
3030
@variables x(t)=1 y(t)=0 z(t)=0
3131

3232
eqs = [D(x) ~ σ * (y - x),
@@ -46,7 +46,7 @@ $(latexify(lorenz; mult_symbol=""))
4646
4747
[Wikipedia](https://en.wikipedia.org/wiki/Lorenz_system)
4848
"""
49-
prob_ode_lorenz = ODEProblem(lorenz, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
49+
prob_ode_lorenz = ODEProblem(lorenz, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
5050

5151
# Aizawa
5252
@parameters a=0.95 b=0.7 c=0.6 d=3.5 e=0.25 f=0.1
@@ -68,7 +68,7 @@ $(latexify(aizawa; mult_symbol=""))
6868
[Reference](https://journals.ametsoc.org/view/journals/atsc/20/2/1520-0469_1963_020_0130_dnf_2_0_co_2.xml)
6969
7070
"""
71-
prob_ode_aizawa = ODEProblem(aizawa, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
71+
prob_ode_aizawa = ODEProblem(aizawa, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
7272

7373
# Dadras
7474
@parameters a=3 b=2.7 c=1.7 d=2 e=9
@@ -90,7 +90,7 @@ $(latexify(dadras; mult_symbol=""))
9090
[Reference](https://www.sciencedirect.com/science/article/abs/pii/S0375960109009591)
9191
9292
"""
93-
prob_ode_dadras = ODEProblem(dadras, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
93+
prob_ode_dadras = ODEProblem(dadras, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
9494

9595
# chen
9696
@parameters a=35 b=3 c=28
@@ -112,7 +112,7 @@ $(latexify(chen; mult_symbol=""))
112112
[Reference](https://www.worldscientific.com/doi/abs/10.1142/S0218127499001024)
113113
114114
"""
115-
prob_ode_chen = ODEProblem(chen, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
115+
prob_ode_chen = ODEProblem(chen, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
116116

117117
# rossler
118118
@parameters a=0.2 b=0.2 c=5.7
@@ -135,7 +135,8 @@ $(latexify(rossler; mult_symbol=""))
135135
[Wikipedia](https://en.wikipedia.org/wiki/R%C3%B6ssler_attractor)
136136
137137
"""
138-
prob_ode_rossler = ODEProblem(rossler, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
138+
prob_ode_rossler = ODEProblem(
139+
rossler, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
139140

140141
# rabinovich_fabrikant
141142
@parameters a=0.14 b=0.10
@@ -157,7 +158,8 @@ $(latexify(rabinovich_fabrikant; mult_symbol=""))
157158
[Reference](https://en.wikipedia.org/wiki/Rabinovich%E2%80%93Fabrikant_equations)
158159
159160
"""
160-
prob_ode_rabinovich_fabrikant = ODEProblem(rabinovich_fabrikant, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
161+
prob_ode_rabinovich_fabrikant = ODEProblem(
162+
rabinovich_fabrikant, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
161163

162164
# sprott
163165
@parameters a=2.07 b=1.79
@@ -179,10 +181,10 @@ $(latexify(sprott; mult_symbol=""))
179181
[Reference](https://sprott.physics.wisc.edu/pubs/paper423.pdf)
180182
181183
"""
182-
prob_ode_sprott = ODEProblem(sprott, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
184+
prob_ode_sprott = ODEProblem(sprott, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)
183185

184186
# hindmarsh_rose
185-
@parameters a=1 b=3 c=1 d=5 r=1e-2 s=4 xr=-8 / 5 i=5
187+
@parameters a=1 b=3 c=1 d=5 r=1e-2 s=4 xr=-8/5 i=5
186188
@variables x(t)=1 y(t)=0 z(t)=0
187189

188190
eqs = [D(x) ~ y - a * x^3 + b * x^2 - z + i,
@@ -201,4 +203,5 @@ $(latexify(hindmarsh_rose; mult_symbol=""))
201203
[Reference](https://en.wikipedia.org/wiki/Hindmarsh%E2%80%93Rose_model)
202204
203205
"""
204-
prob_ode_hindmarsh_rose = ODEProblem(hindmarsh_rose, [], (0.0, 1.0), jac=true, eval_module = @__MODULE__)
206+
prob_ode_hindmarsh_rose = ODEProblem(
207+
hindmarsh_rose, [], (0.0, 1.0), jac = true, eval_module = @__MODULE__)

0 commit comments

Comments
 (0)