Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small overhead checking benchmarks #36

Open
ChrisRackauckas opened this issue May 13, 2020 · 0 comments
Open

Small overhead checking benchmarks #36

ChrisRackauckas opened this issue May 13, 2020 · 0 comments

Comments

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented May 13, 2020

using OrdinaryDiffEq, StochasticDiffEq, BenchmarkTools, SimpleDiffEq, BridgeDiffEq, StaticArrays

u0=1/2
f(u,p,t) = u
g(u,p,t) = u
dt = 1/2^(4)
tspan = (0.0,1.0)

prob = ODEProblem(f,u0,(0.0,1.0))
@btime sol = solve(prob,BridgeBS3(),dt=dt)
@btime sol = solve(prob,BS3(),dt=dt,adaptive=false,dense=false)

prob = ODEProblem(f,u0,(0.0,100.0))
@btime sol = solve(prob,BridgeBS3(),dt=dt)
@btime sol = solve(prob,BS3(),dt=dt,adaptive=false,dense=false)

prob = SDEProblem(f,g,u0,(0.0,1.0))
@btime sol = solve(prob,EM(),dt=dt)
@btime sol = solve(prob,SimpleEM(),dt=dt)
@btime sol = solve(prob,BridgeEuler(),dt=dt)

prob = SDEProblem(f,g,u0,(0.0,100.0))
@btime sol = solve(prob,EM(),dt=dt)
@btime sol = solve(prob,SimpleEM(),dt=dt)
@btime sol = solve(prob,BridgeEuler(),dt=dt)

u0 = @SVector [2.0,3.0]
prob = ODEProblem(f,u0,(0.0,1.0))
@btime sol = solve(prob,BridgeBS3(),dt=dt)
@btime sol = solve(prob,BS3(),dt=dt,adaptive=false,dense=false)

prob = SDEProblem(f,g,u0,(0.0,1.0))
@btime sol = solve(prob,EM(),dt=dt)
@btime sol = solve(prob,SimpleEM(),dt=dt)
@btime sol = solve(prob,BridgeEuler(),dt=dt)

prob = SDEProblem(f,g,u0,(0.0,100.0))
@btime sol = solve(prob,EM(),dt=dt)
@btime sol = solve(prob,SimpleEM(),dt=dt)
@btime sol = solve(prob,BridgeEuler(),dt=dt)


function lorenzoop(u,p,t)
 SA[10.0(u[2]-u[1]),u[1]*(28.0-u[3]) - u[2],u[1]*u[2] - (8/3)*u[3]]
end
u0 = SA[1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenzoop,u0,tspan)

@btime sol = solve(prob,BridgeBS3(),dt=dt)
@btime sol = solve(prob,BS3(),dt=dt,adaptive=false,dense=false)

@btime sol = solve(prob,Tsit5(),dt=dt,adaptive=false,dense=false)
@btime sol = solve(prob,SimpleTsit5(),dt=dt)


function σ_lorenz(u,p,t)
 SA[3.0,3.0,3.0]
end

prob = SDEProblem(lorenzoop,σ_lorenz,u0,(0.0,100.0))
dt = 1/2^6
@btime sol = solve(prob,EM(),dt=dt)
@btime sol = solve(prob,SimpleEM(),dt=dt)
@btime sol = solve(prob,BridgeEuler(),dt=dt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant