Skip to content

Commit 58a25c2

Browse files
Update README.md
1 parent 1a52e79 commit 58a25c2

File tree

1 file changed

+21
-66
lines changed

1 file changed

+21
-66
lines changed

README.md

Lines changed: 21 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ MATLAB solvers do outperform that of Python and R.
121121
#### Non-Stiff Problem 1: Lotka-Volterra
122122

123123
```julia
124-
using ParameterizedFunctions, MATLABDiffEq, OrdinaryDiffEq, ODEInterface,
125-
ODEInterfaceDiffEq, Plots, Sundials, SciPyDiffEq, deSolveDiffEq
126-
using DiffEqDevTools
127-
using LinearAlgebra
128-
129124
f = @ode_def_bare LotkaVolterra begin
130125
dx = a*x - b*x*y
131126
dy = -c*y + d*x*y
@@ -145,6 +140,7 @@ setups = [Dict(:alg=>DP5())
145140
Dict(:alg=>MATLABDiffEq.ode113())
146141
Dict(:alg=>SciPyDiffEq.RK45())
147142
Dict(:alg=>SciPyDiffEq.LSODA())
143+
Dict(:alg=>SciPyDiffEq.odeint())
148144
Dict(:alg=>deSolveDiffEq.lsoda())
149145
Dict(:alg=>deSolveDiffEq.ode45())
150146
Dict(:alg=>CVODE_Adams())
@@ -159,6 +155,7 @@ names = [
159155
"MATLAB: ode113"
160156
"SciPy: RK45"
161157
"SciPy: LSODA"
158+
"SciPy: odeint"
162159
"deSolve: lsoda"
163160
"deSolve: ode45"
164161
"Sundials: Adams"
@@ -172,10 +169,9 @@ wp = WorkPrecisionSet(prob,abstols,reltols,setups;
172169
save_everystep=false,numruns=100,maxiters=10000000,
173170
timeseries_errors=false,verbose=false)
174171
plot(wp,title="Non-stiff 1: Lotka-Volterra")
175-
savefig("benchmark1.png")
176172
```
177173

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)
179175

180176
#### Non-Stiff Problem 2: Rigid Body
181177

@@ -197,6 +193,7 @@ setups = [Dict(:alg=>DP5())
197193
Dict(:alg=>MATLABDiffEq.ode113())
198194
Dict(:alg=>SciPyDiffEq.RK45())
199195
Dict(:alg=>SciPyDiffEq.LSODA())
196+
Dict(:alg=>SciPyDiffEq.odeint())
200197
Dict(:alg=>deSolveDiffEq.lsoda())
201198
Dict(:alg=>deSolveDiffEq.ode45())
202199
Dict(:alg=>CVODE_Adams())
@@ -211,6 +208,7 @@ names = [
211208
"MATLAB: ode113"
212209
"SciPy: RK45"
213210
"SciPy: LSODA"
211+
"SciPy: odeint"
214212
"deSolve: lsoda"
215213
"deSolve: ode45"
216214
"Sundials: Adams"
@@ -224,20 +222,19 @@ wp = WorkPrecisionSet(prob,abstols,reltols,setups;
224222
save_everystep=false,numruns=100,maxiters=10000000,
225223
timeseries_errors=false,verbose=false)
226224
plot(wp,title="Non-stiff 2: Rigid-Body")
227-
savefig("benchmark2.png")
228225
```
229226

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)
231228

232-
#### Stiff Problem 1: ROBER Shorter and Simpler for SciPy
229+
#### Stiff Problem 1: ROBER
233230

234231
```julia
235232
rober = @ode_def begin
236233
dy₁ = -k₁*y₁+k₃*y₂*y₃
237234
dy₂ = k₁*y₁-k₂*y₂^2-k₃*y₂*y₃
238235
dy₃ = k₂*y₂^2
239236
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])
241238
sol = solve(prob,CVODE_BDF(),abstol=1/10^14,reltol=1/10^14)
242239
test_sol = TestSolution(sol)
243240

@@ -253,7 +250,9 @@ setups = [Dict(:alg=>Rosenbrock23())
253250
Dict(:alg=>MATLABDiffEq.ode15s())
254251
Dict(:alg=>SciPyDiffEq.LSODA())
255252
Dict(:alg=>SciPyDiffEq.BDF())
253+
Dict(:alg=>SciPyDiffEq.odeint())
256254
Dict(:alg=>deSolveDiffEq.lsoda())
255+
Dict(:alg=>CVODE_BDF())
257256
]
258257

259258
names = [
@@ -266,68 +265,20 @@ names = [
266265
"MATLAB: ode15s"
267266
"SciPy: LSODA"
268267
"SciPy: BDF"
268+
"SciPy: odeint"
269269
"deSolve: lsoda"
270+
"Sundials: CVODE"
270271
]
271272

272273
wp = WorkPrecisionSet(prob,abstols,reltols,setups;
273274
names = names,print_names = true,
274275
dense=false,verbose = false,
275276
save_everystep=false,appxsol=test_sol,
276277
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)
328279
```
329280

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)
331282

332283
#### Stiff Problem 2: HIRES
333284

@@ -354,6 +305,7 @@ test_sol = TestSolution(sol)
354305

355306
abstols = 1.0 ./ 10.0 .^ (5:8)
356307
reltols = 1.0 ./ 10.0 .^ (1:4);
308+
357309
setups = [Dict(:alg=>Rosenbrock23())
358310
Dict(:alg=>TRBDF2())
359311
Dict(:alg=>RadauIIA5())
@@ -363,7 +315,9 @@ setups = [Dict(:alg=>Rosenbrock23())
363315
Dict(:alg=>MATLABDiffEq.ode15s())
364316
Dict(:alg=>SciPyDiffEq.LSODA())
365317
Dict(:alg=>SciPyDiffEq.BDF())
318+
Dict(:alg=>SciPyDiffEq.odeint())
366319
Dict(:alg=>deSolveDiffEq.lsoda())
320+
Dict(:alg=>CVODE_BDF())
367321
]
368322

369323
names = [
@@ -376,15 +330,16 @@ names = [
376330
"MATLAB: ode15s"
377331
"SciPy: LSODA"
378332
"SciPy: BDF"
333+
"SciPy: odeint"
379334
"deSolve: lsoda"
335+
"Sundials: CVODE"
380336
]
381337

382338
wp = WorkPrecisionSet(prob,abstols,reltols,setups;
383339
names = names,print_names = true,
384340
save_everystep=false,appxsol=test_sol,
385341
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)
388343
```
389344

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

Comments
 (0)