@@ -121,11 +121,6 @@ MATLAB solvers do outperform that of Python and R.
121
121
#### Non-Stiff Problem 1: Lotka-Volterra
122
122
123
123
``` julia
124
- using ParameterizedFunctions, MATLABDiffEq, OrdinaryDiffEq, ODEInterface,
125
- ODEInterfaceDiffEq, Plots, Sundials, SciPyDiffEq, deSolveDiffEq
126
- using DiffEqDevTools
127
- using LinearAlgebra
128
-
129
124
f = @ode_def_bare LotkaVolterra begin
130
125
dx = a* x - b* x* y
131
126
dy = - c* y + d* x* y
@@ -145,6 +140,7 @@ setups = [Dict(:alg=>DP5())
145
140
Dict (:alg => MATLABDiffEq. ode113 ())
146
141
Dict (:alg => SciPyDiffEq. RK45 ())
147
142
Dict (:alg => SciPyDiffEq. LSODA ())
143
+ Dict (:alg => SciPyDiffEq. odeint ())
148
144
Dict (:alg => deSolveDiffEq. lsoda ())
149
145
Dict (:alg => deSolveDiffEq. ode45 ())
150
146
Dict (:alg => CVODE_Adams ())
@@ -159,6 +155,7 @@ names = [
159
155
" MATLAB: ode113"
160
156
" SciPy: RK45"
161
157
" SciPy: LSODA"
158
+ " SciPy: odeint"
162
159
" deSolve: lsoda"
163
160
" deSolve: ode45"
164
161
" Sundials: Adams"
@@ -172,10 +169,9 @@ wp = WorkPrecisionSet(prob,abstols,reltols,setups;
172
169
save_everystep= false ,numruns= 100 ,maxiters= 10000000 ,
173
170
timeseries_errors= false ,verbose= false )
174
171
plot (wp,title= " Non-stiff 1: Lotka-Volterra" )
175
- savefig (" benchmark1.png" )
176
172
```
177
173
178
- ![ benchmark1 ] ( https://user-images.githubusercontent.com/1814174/69487806-157cb400-0e2e -11ea-876f-c519aed013c0 .png )
174
+ ![ ] ( https://user-images.githubusercontent.com/1814174/71537082-ef42ac00-28e4 -11ea-9acc-67dfd9990221 .png )
179
175
180
176
#### Non-Stiff Problem 2: Rigid Body
181
177
@@ -197,6 +193,7 @@ setups = [Dict(:alg=>DP5())
197
193
Dict (:alg => MATLABDiffEq. ode113 ())
198
194
Dict (:alg => SciPyDiffEq. RK45 ())
199
195
Dict (:alg => SciPyDiffEq. LSODA ())
196
+ Dict (:alg => SciPyDiffEq. odeint ())
200
197
Dict (:alg => deSolveDiffEq. lsoda ())
201
198
Dict (:alg => deSolveDiffEq. ode45 ())
202
199
Dict (:alg => CVODE_Adams ())
@@ -211,6 +208,7 @@ names = [
211
208
" MATLAB: ode113"
212
209
" SciPy: RK45"
213
210
" SciPy: LSODA"
211
+ " SciPy: odeint"
214
212
" deSolve: lsoda"
215
213
" deSolve: ode45"
216
214
" Sundials: Adams"
@@ -224,20 +222,19 @@ wp = WorkPrecisionSet(prob,abstols,reltols,setups;
224
222
save_everystep= false ,numruns= 100 ,maxiters= 10000000 ,
225
223
timeseries_errors= false ,verbose= false )
226
224
plot (wp,title= " Non-stiff 2: Rigid-Body" )
227
- savefig (" benchmark2.png" )
228
225
```
229
226
230
- ![ benchmark2 ] ( https://user-images.githubusercontent.com/1814174/69487808-17467780-0e2e -11ea-9db2-324d4e319d07 .png )
227
+ ![ ] ( https://user-images.githubusercontent.com/1814174/71537083-ef42ac00-28e4 -11ea-8dc7-a5dca0518baf .png )
231
228
232
- #### Stiff Problem 1: ROBER Shorter and Simpler for SciPy
229
+ #### Stiff Problem 1: ROBER
233
230
234
231
``` julia
235
232
rober = @ode_def begin
236
233
dy₁ = - k₁* y₁+ k₃* y₂* y₃
237
234
dy₂ = k₁* y₁- k₂* y₂^ 2 - k₃* y₂* y₃
238
235
dy₃ = k₂* y₂^ 2
239
236
end k₁ k₂ k₃
240
- prob = ODEProblem (rober,[1.0 ,0.0 ,0.0 ],(0.0 ,1e3 ),[0.04 ,3e7 ,1e4 ])
237
+ prob = ODEProblem (rober,[1.0 ,0.0 ,0.0 ],(0.0 ,1e5 ),[0.04 ,3e7 ,1e4 ])
241
238
sol = solve (prob,CVODE_BDF (),abstol= 1 / 10 ^ 14 ,reltol= 1 / 10 ^ 14 )
242
239
test_sol = TestSolution (sol)
243
240
@@ -253,7 +250,9 @@ setups = [Dict(:alg=>Rosenbrock23())
253
250
Dict (:alg => MATLABDiffEq. ode15s ())
254
251
Dict (:alg => SciPyDiffEq. LSODA ())
255
252
Dict (:alg => SciPyDiffEq. BDF ())
253
+ Dict (:alg => SciPyDiffEq. odeint ())
256
254
Dict (:alg => deSolveDiffEq. lsoda ())
255
+ Dict (:alg => CVODE_BDF ())
257
256
]
258
257
259
258
names = [
@@ -266,68 +265,20 @@ names = [
266
265
" MATLAB: ode15s"
267
266
" SciPy: LSODA"
268
267
" SciPy: BDF"
268
+ " SciPy: odeint"
269
269
" deSolve: lsoda"
270
+ " Sundials: CVODE"
270
271
]
271
272
272
273
wp = WorkPrecisionSet (prob,abstols,reltols,setups;
273
274
names = names,print_names = true ,
274
275
dense= false ,verbose = false ,
275
276
save_everystep= false ,appxsol= test_sol,
276
277
maxiters= Int (1e5 ))
277
- plot (wp,title= " Stiff 1: ROBER Short" )
278
- savefig (" benchmark31.png" )
279
- ```
280
-
281
- ![ benchmark31] ( https://user-images.githubusercontent.com/1814174/69501071-4b25a980-0ecf-11ea-99d1-b7274491498e.png )
282
-
283
- #### Rober Standard length
284
-
285
- ** SciPy Omitted due to failures at higher tolerances and because it's too slow to finish in a day!**
286
- See note below.
287
-
288
- ``` julia
289
- prob = ODEProblem (rober,[1.0 ,0.0 ,0.0 ],(0.0 ,1e5 ),[0.04 ,3e7 ,1e4 ])
290
- sol = solve (prob,CVODE_BDF (),abstol= 1 / 10 ^ 14 ,reltol= 1 / 10 ^ 14 )
291
- test_sol = TestSolution (sol)
292
-
293
- abstols = 1.0 ./ 10.0 .^ (5 : 8 )
294
- reltols = 1.0 ./ 10.0 .^ (1 : 4 );
295
-
296
- setups = [Dict (:alg => Rosenbrock23 ())
297
- Dict (:alg => TRBDF2 ())
298
- Dict (:alg => RadauIIA5 ())
299
- Dict (:alg => rodas ())
300
- Dict (:alg => radau ())
301
- Dict (:alg => MATLABDiffEq. ode23s ())
302
- Dict (:alg => MATLABDiffEq. ode15s ())
303
- # Dict(:alg=>SciPyDiffEq.LSODA())
304
- # Dict(:alg=>SciPyDiffEq.BDF())
305
- Dict (:alg => deSolveDiffEq. lsoda ())
306
- ]
307
-
308
- names = [
309
- " Julia: Rosenbrock23"
310
- " Julia: TRBDF2"
311
- " Julia: radau"
312
- " Hairer: rodas"
313
- " Hairer: radau"
314
- " MATLAB: ode23s"
315
- " MATLAB: ode15s"
316
- # "SciPy: LSODA"
317
- # "SciPy: BDF"
318
- " deSolve: lsoda"
319
- ]
320
-
321
- wp = WorkPrecisionSet (prob,abstols,reltols,setups;
322
- names = names,print_names = true ,
323
- dense= false ,verbose = false ,
324
- save_everystep= false ,appxsol= test_sol,
325
- maxiters= Int (1e5 ))
326
- plot (wp,title= " Stiff 1: ROBER Standard Length" )
327
- savefig (" benchmark32.png" )
278
+ plot (wp,title= " Stiff 1: ROBER" , legend= :topleft )
328
279
```
329
280
330
- ![ benchmark32 ] ( https://user-images.githubusercontent.com/1814174/69501072-4b25a980-0ecf -11ea-82dd-47aa566ecbc2 .png )
281
+ ![ ] ( https://user-images.githubusercontent.com/1814174/71537080-ef42ac00-28e4 -11ea-9abd-37631cd18ad9 .png )
331
282
332
283
#### Stiff Problem 2: HIRES
333
284
@@ -354,6 +305,7 @@ test_sol = TestSolution(sol)
354
305
355
306
abstols = 1.0 ./ 10.0 .^ (5 : 8 )
356
307
reltols = 1.0 ./ 10.0 .^ (1 : 4 );
308
+
357
309
setups = [Dict (:alg => Rosenbrock23 ())
358
310
Dict (:alg => TRBDF2 ())
359
311
Dict (:alg => RadauIIA5 ())
@@ -363,7 +315,9 @@ setups = [Dict(:alg=>Rosenbrock23())
363
315
Dict (:alg => MATLABDiffEq. ode15s ())
364
316
Dict (:alg => SciPyDiffEq. LSODA ())
365
317
Dict (:alg => SciPyDiffEq. BDF ())
318
+ Dict (:alg => SciPyDiffEq. odeint ())
366
319
Dict (:alg => deSolveDiffEq. lsoda ())
320
+ Dict (:alg => CVODE_BDF ())
367
321
]
368
322
369
323
names = [
@@ -376,15 +330,16 @@ names = [
376
330
" MATLAB: ode15s"
377
331
" SciPy: LSODA"
378
332
" SciPy: BDF"
333
+ " SciPy: odeint"
379
334
" deSolve: lsoda"
335
+ " Sundials: CVODE"
380
336
]
381
337
382
338
wp = WorkPrecisionSet (prob,abstols,reltols,setups;
383
339
names = names,print_names = true ,
384
340
save_everystep= false ,appxsol= test_sol,
385
341
maxiters= Int (1e5 ),numruns= 100 )
386
- plot (wp,title= " Stiff 2: Hires" )
387
- savefig (" benchmark4.png" )
342
+ plot (wp,title= " Stiff 2: Hires" ,legend= :topleft )
388
343
```
389
344
390
- ![ benchmark4 ] ( https://user-images.githubusercontent.com/1814174/69501114-bec7b680-0ecf -11ea-9095-7b7f2e98d514 .png )
345
+ ![ ] ( https://user-images.githubusercontent.com/1814174/71537081-ef42ac00-28e4 -11ea-950f-59c762ce9a69 .png )
0 commit comments