Skip to content

Commit

Permalink
Merge pull request #7 from devmotion/fix_dde
Browse files Browse the repository at this point in the history
Extend WorkPrecisionSet to DDE problems
  • Loading branch information
ChrisRackauckas authored Apr 9, 2018
2 parents 31dbb34 + a79e9d7 commit 099d03a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ function WorkPrecision(prob,alg,abstols,reltols,dts=nothing;
return WorkPrecision(prob,abstols,reltols,errors,times,name,N)
end

function WorkPrecisionSet(prob::AbstractODEProblem,abstols,reltols,setups;numruns=20,
function WorkPrecisionSet(prob::Union{AbstractODEProblem,AbstractDDEProblem,
AbstractDAEProblem},
abstols,reltols,setups;numruns=20,
print_names=false,names=nothing,appxsol=nothing,
error_estimate=:final,
test_dt=nothing,kwargs...)
Expand Down
1 change: 1 addition & 0 deletions test/REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DiffEqProblemLibrary
OrdinaryDiffEq 1.0.0
DelayDiffEq
StochasticDiffEq 0.0.5
FiniteElementDiffEq 0.0.5
14 changes: 13 additions & 1 deletion test/benchmark_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq, DiffEqDevTools, DiffEqProblemLibrary, DiffEqBase, Base.Test
using OrdinaryDiffEq, DelayDiffEq, DiffEqDevTools, DiffEqProblemLibrary, DiffEqBase, Base.Test

## Setup Tests

Expand Down Expand Up @@ -96,3 +96,15 @@ setups = [Dict(:alg=>DP5())
Dict(:alg=>Vern6())
]
wp = WorkPrecisionSet(prob,abstols,reltols,setups;appxsol=test_sol,save_everystep=false,numruns=20,maxiters=10000)

# DDE problem
prob = prob_dde_1delay

abstols = 1./10.^(7:10)
reltols = 1./10.^(4:7)
sol = solve(prob, MethodOfSteps(Vern9(), max_fixedpoint_iters=1000); reltol=1e-14, abstol=1e-14)
test_sol = TestSolution(sol)

setups = [Dict(:alg => MethodOfSteps(BS3()))
Dict(:alg => MethodOfSteps(Tsit5()))]
wp = WorkPrecisionSet(prob, abstols, reltols, setups; appxsol = test_sol)

0 comments on commit 099d03a

Please sign in to comment.