@@ -4,66 +4,66 @@ srand(100)
4
4
5
5
# Linear ODE
6
6
linear = (t,u) -> (1.01 * u)
7
- analytic_linear = (t,u₀ ) -> u₀ * exp (1.01 * t)
7
+ analytic_linear = (t,u0 ) -> u0 * exp (1.01 * t)
8
8
"""
9
9
Linear ODE
10
10
11
11
```math
12
12
\\ frac{du}{dt} = αu
13
13
```
14
14
15
- with initial condition ``u₀ =1/2``, ``α=1.01``, and solution
15
+ with initial condition ``u0 =1/2``, ``α=1.01``, and solution
16
16
17
17
```math
18
- u(t) = u₀e ^{αt}
18
+ u(t) = u0e ^{αt}
19
19
```
20
20
21
21
with Float64s
22
22
"""
23
- prob_ode_linear = ODEProblem (linear,1 / 2 ,analytic = analytic_linear)
23
+ prob_ode_linear = ODETestProblem (linear,1 / 2 ,analytic_linear)
24
24
25
25
const linear_bigα = parse (BigFloat," 1.01" )
26
26
f_linearbig = (t,u) -> (linear_bigα* u)
27
- analytic_linearbig = (t,u₀ ) -> u₀ * exp (linear_bigα* t)
27
+ analytic_linearbig = (t,u0 ) -> u0 * exp (linear_bigα* t)
28
28
"""
29
29
Linear ODE
30
30
31
31
```math
32
32
\\ frac{du}{dt} = αu
33
33
```
34
34
35
- with initial condition ``u₀ =1/2``, ``α=1.01``, and solution
35
+ with initial condition ``u0 =1/2``, ``α=1.01``, and solution
36
36
37
37
```math
38
- u(t) = u₀e ^{αt}
38
+ u(t) = u0e ^{αt}
39
39
```
40
40
41
41
with BigFloats
42
42
"""
43
- prob_ode_bigfloatlinear = ODEProblem (f_linearbig,parse (BigFloat," 0.5" ),analytic = analytic_linearbig)
43
+ prob_ode_bigfloatlinear = ODETestProblem (f_linearbig,parse (BigFloat," 0.5" ),analytic_linearbig)
44
44
45
45
f_2dlinear = (t,u,du) -> begin
46
46
for i in 1 : length (u)
47
47
du[i] = 1.01 * u[i]
48
48
end
49
49
end
50
- analytic_2dlinear = (t,u₀ ) -> u₀ * exp .(1.01 * t)
50
+ analytic_2dlinear = (t,u0 ) -> u0 * exp .(1.01 * t)
51
51
"""
52
52
4x2 version of the Linear ODE
53
53
54
54
```math
55
55
\\ frac{du}{dt} = αu
56
56
```
57
57
58
- with initial condition ``u₀ =1/2``, ``α=1.01``, and solution
58
+ with initial condition ``u0 =1/2``, ``α=1.01``, and solution
59
59
60
60
```math
61
- u(t) = u₀e ^{αt}
61
+ u(t) = u0e ^{αt}
62
62
```
63
63
64
64
with Float64s
65
65
"""
66
- prob_ode_2Dlinear = ODEProblem (f_2dlinear,rand (4 ,2 ),analytic = analytic_2dlinear)
66
+ prob_ode_2Dlinear = ODETestProblem (f_2dlinear,rand (4 ,2 ),analytic_2dlinear)
67
67
68
68
"""
69
69
100x100 version of the Linear ODE
@@ -72,15 +72,15 @@ prob_ode_2Dlinear = ODEProblem(f_2dlinear,rand(4,2),analytic=analytic_2dlinear)
72
72
\\ frac{du}{dt} = αu
73
73
```
74
74
75
- with initial condition ``u₀ =1/2``, ``α=1.01``, and solution
75
+ with initial condition ``u0 =1/2``, ``α=1.01``, and solution
76
76
77
77
```math
78
- u(t) = u₀e ^{αt}
78
+ u(t) = u0e ^{αt}
79
79
```
80
80
81
81
with Float64s
82
82
"""
83
- prob_ode_large2Dlinear = ODEProblem (f_2dlinear,rand (100 ,100 ),analytic = analytic_2dlinear)
83
+ prob_ode_large2Dlinear = ODETestProblem (f_2dlinear,rand (100 ,100 ),analytic_2dlinear)
84
84
85
85
f_2dlinearbig = (t,u,du) -> begin
86
86
for i in 1 : length (u)
94
94
\\ frac{du}{dt} = αu
95
95
```
96
96
97
- with initial condition ``u₀ =1/2``, ``α=1.01``, and solution
97
+ with initial condition ``u0 =1/2``, ``α=1.01``, and solution
98
98
99
99
```math
100
- u(t) = u₀e ^{αt}
100
+ u(t) = u0e ^{αt}
101
101
```
102
102
103
103
with BigFloats
104
104
"""
105
- prob_ode_bigfloat2Dlinear = ODEProblem (f_2dlinearbig,map (BigFloat,rand (4 ,2 )).* ones (4 ,2 )/ 2 ,analytic = analytic_2dlinear)
105
+ prob_ode_bigfloat2Dlinear = ODETestProblem (f_2dlinearbig,map (BigFloat,rand (4 ,2 )).* ones (4 ,2 )/ 2 ,analytic_2dlinear)
106
106
f_2dlinear_notinplace = (t,u) -> 1.01 * u
107
107
"""
108
108
4x2 version of the Linear ODE
@@ -111,15 +111,15 @@ f_2dlinear_notinplace = (t,u) -> 1.01*u
111
111
\\ frac{du}{dt} = αu
112
112
```
113
113
114
- with initial condition ``u₀ =1/2``, ``α=1.01``, and solution
114
+ with initial condition ``u0 =1/2``, ``α=1.01``, and solution
115
115
116
116
```math
117
- u(t) = u₀e ^{αt}
117
+ u(t) = u0e ^{αt}
118
118
```
119
119
120
120
on Float64. Purposefully not in-place as a test.
121
121
"""
122
- prob_ode_2Dlinear_notinplace = ODEProblem (f_2dlinear_notinplace,rand (4 ,2 ),analytic = analytic_2dlinear)
122
+ prob_ode_2Dlinear_notinplace = ODETestProblem (f_2dlinear_notinplace,rand (4 ,2 ),analytic_2dlinear)
123
123
124
124
# # Lotka-Volterra
125
125
@@ -139,7 +139,7 @@ Lotka-Voltera Equations
139
139
140
140
with initial condition ``x=y=1``
141
141
"""
142
- prb_ode_lotkavoltera = ODEProblem (lotka,[1 ;1 ])
142
+ prb_ode_lotkavoltera = ODEProblem (lotka,[1 ;1 ],( 0.0 , 1.0 ) )
143
143
144
144
# # Fitzhugh-Nagumo
145
145
@@ -157,7 +157,7 @@ Fitzhugh-Nagumo
157
157
158
158
with initial condition ``v=w=1``
159
159
"""
160
- prob_ode_fitzhughnagumo = ODEProblem (fitz,[1 ;1 ])
160
+ prob_ode_fitzhughnagumo = ODEProblem (fitz,[1 ;1 ],( 0.0 , 1.0 ) )
161
161
162
162
# Van der Pol Equations
163
163
van = @ode_def_noinvhes VanDerPol begin
@@ -175,11 +175,11 @@ Van der Pol Equations
175
175
\\ end{align}
176
176
```
177
177
178
- with ``μ=1.0`` and ``u₀ =[0,\\ sqrt{3}]``
178
+ with ``μ=1.0`` and ``u0 =[0,\\ sqrt{3}]``
179
179
180
180
Non-stiff parameters.
181
181
"""
182
- prob_ode_vanderpol = ODEProblem (van,[0 ;sqrt (3 )])
182
+ prob_ode_vanderpol = ODEProblem (van,[0 ;sqrt (3 )],( 0.0 , 1.0 ) )
183
183
184
184
van_stiff = VanDerPol (μ= 1e6 )
185
185
""" Van der Pol Equations
@@ -191,11 +191,11 @@ van_stiff = VanDerPol(μ=1e6)
191
191
\\ end{align}
192
192
```
193
193
194
- with ``μ=10^6`` and ``u₀ =[0,\\ sqrt{3}]``
194
+ with ``μ=10^6`` and ``u0 =[0,\\ sqrt{3}]``
195
195
196
196
Stiff parameters.
197
197
"""
198
- prob_ode_vanderpol_stiff = ODEProblem (van_stiff,[0 ;sqrt (3 )])
198
+ prob_ode_vanderpol_stiff = ODEProblem (van_stiff,[0 ;sqrt (3 )],( 0.0 , 1.0 ) )
199
199
200
200
# ROBER
201
201
@@ -222,7 +222,7 @@ Hairer Norsett Wanner Solving Ordinary Differential Euations I - Nonstiff Proble
222
222
223
223
Usually solved on `[0,1e11]`
224
224
"""
225
- prob_ode_rober = ODEProblem (rober,[1.0 ;0.0 ;0.0 ])
225
+ prob_ode_rober = ODEProblem (rober,[1.0 ;0.0 ;0.0 ],( 0.0 , 1e11 ) )
226
226
227
227
# Three Body
228
228
const threebody_μ = parse (BigFloat," 0.012277471" ); const threebody_μ′ = 1 - threebody_μ
@@ -258,7 +258,7 @@ From Hairer Norsett Wanner Solving Ordinary Differential Euations I - Nonstiff P
258
258
Usually solved on `t₀ = 0.0`; `T = parse(BigFloat,"17.0652165601579625588917206249")`
259
259
Periodic with that setup.
260
260
"""
261
- prob_ode_threebody = ODEProblem (threebody,[0.994 , 0.0 , 0.0 , parse (BigFloat," -2.00158510637908252240537862224" )])
261
+ prob_ode_threebody = ODEProblem (threebody,[0.994 , 0.0 , 0.0 , parse (BigFloat," -2.00158510637908252240537862224" )],( parse (BigFloat, " 0.0 " ), parse (BigFloat, " 17.0652165601579625588917206249 " )) )
262
262
263
263
# Rigid Body Equations
264
264
@@ -289,7 +289,7 @@ or Hairer Norsett Wanner Solving Ordinary Differential Euations I - Nonstiff Pro
289
289
290
290
Usually solved from 0 to 20.
291
291
"""
292
- prob_ode_rigidbody = ODEProblem (rigid,[1.0 ,0.0 ,0.9 ])
292
+ prob_ode_rigidbody = ODEProblem (rigid,[1.0 ,0.0 ,0.9 ],( 0.0 , 20.0 ) )
293
293
294
294
# Pleiades Problem
295
295
@@ -363,4 +363,4 @@ From Hairer Norsett Wanner Solving Ordinary Differential Euations I - Nonstiff P
363
363
364
364
Usually solved from 0 to 3.
365
365
"""
366
- prob_ode_pleides = ODEProblem (pleides,[3.0 ,3.0 ,- 1.0 ,- 3.0 ,2.0 ,- 2.0 ,2.0 ,3.0 ,- 3.0 ,2.0 ,0 ,0 ,- 4.0 ,4.0 ,0 ,0 ,0 ,0 ,0 ,1.75 ,- 1.5 ,0 ,0 ,0 ,- 1.25 ,1 ,0 ,0 ])
366
+ prob_ode_pleides = ODEProblem (pleides,[3.0 ,3.0 ,- 1.0 ,- 3.0 ,2.0 ,- 2.0 ,2.0 ,3.0 ,- 3.0 ,2.0 ,0 ,0 ,- 4.0 ,4.0 ,0 ,0 ,0 ,0 ,0 ,1.75 ,- 1.5 ,0 ,0 ,0 ,- 1.25 ,1 ,0 ,0 ],( 0.0 , 3.0 ) )
0 commit comments