Skip to content

Commit 85d68c0

Browse files
Merge pull request #127 from LilithHafner/lh/format
Run JuliaFormatter.format()
2 parents eefe055 + 968f314 commit 85d68c0

File tree

3 files changed

+34
-43
lines changed

3 files changed

+34
-43
lines changed

lib/DDEProblemLibrary/src/constant_delays.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,27 @@ function fanalytic_dde_constant_1delay(u₀,
8383
copy(u₀)
8484
else
8585
if z < 2
86-
c = @evalpoly(z, 2,-1)
86+
c = @evalpoly(z, 2, -1)
8787
elseif z < 3
88-
c = @evalpoly(z, 4, -3,1//2)
88+
c = @evalpoly(z, 4, -3, 1//2)
8989
elseif z < 4
90-
c = @evalpoly(z, 17//2, -15//2, 2,-1//6)
90+
c = @evalpoly(z, 17//2, -15//2, 2, -1//6)
9191
elseif z < 5
92-
c = @evalpoly(z, 115//6, -109//6, 6, -5//6,1//24)
92+
c = @evalpoly(z, 115//6, -109//6, 6, -5//6, 1//24)
9393
elseif z < 6
94-
c = @evalpoly(z, 1085//24, -1061//24, 197//12, -35//12, 1//4,-1//120)
94+
c = @evalpoly(z, 1085//24, -1061//24, 197//12, -35//12, 1//4, -1//120)
9595
elseif z < 7
96-
c = @evalpoly(z, 13201//120, -13081//120, 521//12, -107//12, 1, -7//120,1//720)
96+
c = @evalpoly(z, 13201//120, -13081//120, 521//12, -107//12, 1, -7//120, 1//720)
9797
elseif z < 8
9898
c = @evalpoly(z, 39371//144, -39227//144, 27227//240, -3685//144, 487//144,
99-
-21//80, 1//90,-1//5040)
99+
-21//80, 1//90, -1//5040)
100100
elseif z < 9
101101
c = @evalpoly(z, 1158379//1680, -1156699//1680, 212753//720, -51193//720,
102-
1511//144, -701//720, 1//18, -1//560,1//40320)
102+
1511//144, -701//720, 1//18, -1//560, 1//40320)
103103
else
104104
c = @evalpoly(z, 23615939//13440, -23602499//13440, 7761511//10080,
105105
-279533//1440, 89269//2880, -1873//576, 323//1440, -11//1120,
106-
1//4032,-1//362880)
106+
1//4032, -1//362880)
107107
end
108108

109109
c .* u₀
@@ -275,25 +275,25 @@ function fanalytic_dde_constant_2delays(u₀,
275275
copy(u₀)
276276
else
277277
if z < 1 / 3
278-
c = @evalpoly(z, 6//5,-1)
278+
c = @evalpoly(z, 6//5, -1)
279279
elseif z < 2 / 5
280-
c = @evalpoly(z, 23//15,-2)
280+
c = @evalpoly(z, 23//15, -2)
281281
elseif z < 8 / 15
282-
c = @evalpoly(z, 121//75, -12//5,1//2)
282+
c = @evalpoly(z, 121//75, -12//5, 1//2)
283283
elseif z < 3 / 5
284-
c = @evalpoly(z, 427//225, -52//15,3//2)
284+
c = @evalpoly(z, 427//225, -52//15, 3//2)
285285
elseif z < 2 / 3
286-
c = @evalpoly(z, 4351//2250, -547//150, 9//5,-1//6)
286+
c = @evalpoly(z, 4351//2250, -547//150, 9//5, -1//6)
287287
elseif z < 11 / 15
288-
c = @evalpoly(z, 539//250, -647//150, 23//10,-1//6)
288+
c = @evalpoly(z, 539//250, -647//150, 23//10, -1//6)
289289
elseif z < 4 / 5
290-
c = @evalpoly(z, 7942//3375, -128//25, 17//5,-2//3)
290+
c = @evalpoly(z, 7942//3375, -128//25, 17//5, -2//3)
291291
elseif z < 13 / 15
292-
c = @evalpoly(z, 39998//16875, -1952//375, 89//25, -4//5,1//24)
292+
c = @evalpoly(z, 39998//16875, -1952//375, 89//25, -4//5, 1//24)
293293
elseif z < 14 / 15
294-
c = @evalpoly(z, 10109//3750, -1583//250, 243//50, -13//10,1//24)
294+
c = @evalpoly(z, 10109//3750, -1583//250, 243//50, -13//10, 1//24)
295295
else
296-
c = @evalpoly(z, 171449//60750, -139199//20250, 2579//450, -173//90,5//24)
296+
c = @evalpoly(z, 171449//60750, -139199//20250, 2579//450, -173//90, 5//24)
297297
end
298298

299299
c .* u₀

lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ prob_ode_fitzhughnagumo = ODEProblem(fitz, [1.0; 1.0], (0.0, 1.0),
5454

5555
eqs = [D(y) ~ μ * ((1 - x^2) * y - x),
5656
D(x) ~ y]
57-
de = ODESystem(eqs,t; name = :van_der_pol) |> structural_simplify |> complete
57+
de = ODESystem(eqs, t; name = :van_der_pol) |> structural_simplify |> complete
5858
van = ODEFunction(de, [y, x], [μ], jac = true, eval_module = @__MODULE__)
5959

6060
"""
@@ -96,7 +96,7 @@ prob_ode_vanderpol_stiff = ODEProblem(van, [0; sqrt(3)], (0.0, 1.0), 1e6)
9696
eqs = [D(y₁) ~ -k₁ * y₁ + k₃ * y₂ * y₃,
9797
D(y₂) ~ k₁ * y₁ - k₂ * y₂^2 - k₃ * y₂ * y₃,
9898
D(y₃) ~ k₂ * y₂^2]
99-
de = ODESystem(eqs,t; name = :rober) |> structural_simplify |> complete
99+
de = ODESystem(eqs, t; name = :rober) |> structural_simplify |> complete
100100
rober = ODEFunction(de, [y₁, y₂, y₃], [k₁, k₂, k₃], jac = true, eval_module = @__MODULE__)
101101

102102
"""
@@ -177,7 +177,7 @@ prob_ode_threebody = ODEProblem(threebody,
177177
eqs = [D(y₁) ~ I₁ * y₂ * y₃,
178178
D(y₂) ~ I₂ * y₁ * y₃,
179179
D(y₃) ~ I₃ * y₁ * y₂]
180-
de = ODESystem(eqs,t; name = :rigid_body) |> structural_simplify |> complete
180+
de = ODESystem(eqs, t; name = :rigid_body) |> structural_simplify |> complete
181181
rigid = ODEFunction(de, [y₁, y₂, y₃], [I₁, I₂, I₃], jac = true, eval_module = @__MODULE__)
182182

183183
"""
@@ -360,7 +360,7 @@ eqs = [D(y1) ~ -p1 * y1 + p2 * y2 + p3 * y3 + p4,
360360
p2 * y6 + p11 * y7,
361361
D(y7) ~ p10 * y6 * y8 - p12 * y7,
362362
D(y8) ~ -p10 * y6 * y8 + p12 * y7]
363-
de = ODESystem(eqs,t; name = :hires) |> structural_simplify |> complete
363+
de = ODESystem(eqs, t; name = :hires) |> structural_simplify |> complete
364364
hires = ODEFunction(de, [y1, y2, y3, y4, y5, y6, y7, y8],
365365
[p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12],
366366
jac = true)
@@ -402,7 +402,7 @@ prob_ode_hires = ODEProblem(hires, u0, (0.0, 321.8122),
402402
eqs = [D(y1) ~ p1 * (y2 + y1 * (1 - p2 * y1 - y2)),
403403
D(y2) ~ (y3 - (1 + y1) * y2) / p1,
404404
D(y3) ~ p3 * (y1 - y3)]
405-
de = ODESystem(eqs,t; name = :orego) |> structural_simplify |> complete
405+
de = ODESystem(eqs, t; name = :orego) |> structural_simplify |> complete
406406
jac = calculate_jacobian(de)
407407
orego = ODEFunction(de, [y1, y2, y3], [p1, p2, p3], jac = true, eval_module = @__MODULE__)
408408

lib/ODEProblemLibrary/src/strange_attractors.jl

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
# Opted for the equations as reported in papers
44

55
# Thomas
6-
@parameters b=0.208186
6+
@parameters b = 0.208186
77
@variables x(t)=1 y(t)=0 z(t)=0
88

9-
109
eqs = [D(x) ~ sin(y) - b * x,
1110
D(y) ~ sin(z) - b * y,
1211
D(z) ~ sin(x) - b * z]
1312

14-
@mtkbuild thomas = ODESystem(eqs,t)
13+
@mtkbuild thomas = ODESystem(eqs, t)
1514

1615
"""
1716
Thomas' cyclically symmetric attractor equations
@@ -30,12 +29,11 @@ prob_ode_thomas = ODEProblem(thomas, [], (0.0, 1.0))
3029
@parameters σ=10 ρ=28 β=8 / 3
3130
@variables x(t)=1 y(t)=0 z(t)=0
3231

33-
3432
eqs = [D(x) ~ σ * (y - x),
3533
D(y) ~ x *- z) - y,
3634
D(z) ~ x * y - β * z]
3735

38-
@mtkbuild lorenz = ODESystem(eqs,t)
36+
@mtkbuild lorenz = ODESystem(eqs, t)
3937

4038
"""
4139
Lorenz equations
@@ -54,12 +52,11 @@ prob_ode_lorenz = ODEProblem(lorenz, [], (0.0, 1.0))
5452
@parameters a=0.95 b=0.7 c=0.6 d=3.5 e=0.25 f=0.1
5553
@variables x(t)=1 y(t)=0 z(t)=0
5654

57-
5855
eqs = [D(x) ~ (z - b) * x - d * y,
5956
D(y) ~ d * x + (z - b) * y,
6057
D(z) ~ c + a * z - z^3 / 3 - (x^2 + y^2) * (1 + e * z) + f * z * x^3]
6158

62-
@mtkbuild aizawa = ODESystem(eqs,t)
59+
@mtkbuild aizawa = ODESystem(eqs, t)
6360

6461
"""
6562
Aizawa equations
@@ -77,12 +74,11 @@ prob_ode_aizawa = ODEProblem(aizawa, [], (0.0, 1.0))
7774
@parameters a=3 b=2.7 c=1.7 d=2 e=9
7875
@variables x(t)=1 y(t)=0 z(t)=0
7976

80-
8177
eqs = [D(x) ~ y - a * x + b * y * z,
8278
D(y) ~ c * y - x * z + z,
8379
D(z) ~ d * x * y - e * z]
8480

85-
@mtkbuild dadras = ODESystem(eqs,t)
81+
@mtkbuild dadras = ODESystem(eqs, t)
8682

8783
"""
8884
Dadras equations
@@ -100,12 +96,11 @@ prob_ode_dadras = ODEProblem(dadras, [], (0.0, 1.0))
10096
@parameters a=35 b=3 c=28
10197
@variables x(t)=1 y(t)=0 z(t)=0
10298

103-
10499
eqs = [D(x) ~ a * (y - x),
105100
D(y) ~ (c - a) * x - x * z + c * y,
106101
D(z) ~ x * y - b * z]
107102

108-
@mtkbuild chen = ODESystem(eqs,t)
103+
@mtkbuild chen = ODESystem(eqs, t)
109104

110105
"""
111106
chen equations
@@ -123,12 +118,11 @@ prob_ode_chen = ODEProblem(chen, [], (0.0, 1.0))
123118
@parameters a=0.2 b=0.2 c=5.7
124119
@variables x(t)=1 y(t)=0 z(t)=0
125120

126-
127121
eqs = [D(x) ~ -(y + z),
128122
D(y) ~ x + a * y,
129123
D(z) ~ b + z * (x - c)]
130124

131-
@mtkbuild rossler = ODESystem(eqs,t)
125+
@mtkbuild rossler = ODESystem(eqs, t)
132126

133127
"""
134128
rossler equations
@@ -147,12 +141,11 @@ prob_ode_rossler = ODEProblem(rossler, [], (0.0, 1.0))
147141
@parameters a=0.14 b=0.10
148142
@variables x(t)=1 y(t)=0 z(t)=0
149143

150-
151144
eqs = [D(x) ~ y * (z - 1 + x^2) + b * x,
152145
D(y) ~ x * (3 * z + 1 - x^2) + b * y,
153146
D(z) ~ -2 * z * (a + x * y)]
154147

155-
@mtkbuild rabinovich_fabrikant = ODESystem(eqs,t)
148+
@mtkbuild rabinovich_fabrikant = ODESystem(eqs, t)
156149

157150
"""
158151
rabinovich_fabrikant equations
@@ -170,12 +163,11 @@ prob_ode_rabinovich_fabrikant = ODEProblem(rabinovich_fabrikant, [], (0.0, 1.0))
170163
@parameters a=2.07 b=1.79
171164
@variables x(t)=1 y(t)=0 z(t)=0
172165

173-
174166
eqs = [D(x) ~ y + a * x * y + x * z,
175167
D(y) ~ 1 - b * x^2 + y * z,
176168
D(z) ~ x - x^2 - y^2]
177169

178-
@mtkbuild sprott = ODESystem(eqs,t)
170+
@mtkbuild sprott = ODESystem(eqs, t)
179171

180172
"""
181173
sprott equations
@@ -193,12 +185,11 @@ prob_ode_sprott = ODEProblem(sprott, [], (0.0, 1.0))
193185
@parameters a=1 b=3 c=1 d=5 r=1e-2 s=4 xr=-8 / 5 i=5
194186
@variables x(t)=1 y(t)=0 z(t)=0
195187

196-
197188
eqs = [D(x) ~ y - a * x^3 + b * x^2 - z + i,
198189
D(y) ~ c - d * x^2 - y,
199190
D(z) ~ r * (s * (x - xr) - z)]
200191

201-
@mtkbuild hindmarsh_rose = ODESystem(eqs,t)
192+
@mtkbuild hindmarsh_rose = ODESystem(eqs, t)
202193

203194
"""
204195
hindmarsh_rose equations

0 commit comments

Comments
 (0)