Skip to content

Commit 5b976cb

Browse files
update matlab_bench.
1 parent 684c678 commit 5b976cb

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,25 @@ julia> @time MATLABDiffEq.eval_string("[t,u] = $(algstr)(f,tspan,u0,options);")
117117

118118
MATLABDiffEq.jl will be included into [DiffEqBenchmarks.jl](https://github.com/JuliaDiffEq/DiffEqBenchmarks.jl). However, the benchmarks are not encouraging to MATLAB at all. Instead, they show that the cost of evaluating functions in MATLAB are too large (note that the functions are re-defined in MATLAB, meaning that they are true MATLAB functions and not interop functions).
119119

120-
Running bechmarks at various tolerance using the same problem as before, we get the following:
120+
Running benchmarks at various tolerance using the same Lotka-Volterra problem from before, we get the following:
121121

122122
```julia
123123
using OrdinaryDiffEq, ODEInterfaceDiffEq, Plots, ODE
124+
using DiffEqDevTools
124125
abstols = 1./10.^(6:13)
125126
reltols = 1./10.^(3:10)
126127
sol = solve(prob,Vern7(),abstol=1/10^14,reltol=1/10^14)
127128
test_sol = TestSolution(sol)
128129
plotly()
129130
setups = [Dict(:alg=>DP5())
130-
#Dict(:alg=>ode45())
131131
Dict(:alg=>dopri5())
132132
Dict(:alg=>BS5())
133133
Dict(:alg=>Tsit5())
134134
Dict(:alg=>Vern6())
135+
Dict(:alg=>Vern7())
135136
Dict(:alg=>MATLABDiffEq.ode45())
136-
]
137-
wp = ode_workprecision_set(prob,abstols,reltols,setups;appxsol=test_sol,dense=false,save_timeseries=false,numruns=100,maxiters=10000000)
137+
]
138+
wp = ode_workprecision_set(prob,abstols,reltols,setups;appxsol=test_sol,dense=false,save_everystep=false,numruns=1000,maxiters=10000000,ttimeseries_errors=false,verbose=false)
138139
plot(wp)
139140
```
140141

assets/matlab_bench.png

52.7 KB
Loading

src/MATLABDiffEq.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ immutable ode23tb <: MATLABAlgorithm end
1515
immutable ode15s <: MATLABAlgorithm end
1616
immutable ode15i <: MATLABAlgorithm end
1717

18-
function solve{uType,tType,isinplace,AlgType<:MATLABAlgorithm,F}(
19-
prob::AbstractODEProblem{uType,tType,isinplace,F},
18+
function solve{uType,tType,isinplace,AlgType<:MATLABAlgorithm}(
19+
prob::AbstractODEProblem{uType,tType,isinplace},
2020
alg::AlgType,timeseries=[],ts=[],ks=[];
2121
saveat=tType[],timeseries_errors=true,reltol = 1e-3, abstol = 1e-6,
2222
kwargs...)
@@ -28,7 +28,7 @@ function solve{uType,tType,isinplace,AlgType<:MATLABAlgorithm,F}(
2828
if prob.tspan[end]-prob.tspan[1]<tType(0)
2929
error("final time must be greater than starting time. Aborting.")
3030
end
31-
31+
3232
f = prob.f
3333
u0 = prob.u0
3434

0 commit comments

Comments
 (0)