Skip to content

Commit

Permalink
Merge pull request #964 from SciML/78
Browse files Browse the repository at this point in the history
version 7.8
  • Loading branch information
ChrisRackauckas committed Jun 8, 2023
2 parents 57e6d78 + 9a362a9 commit 751454f
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 42 deletions.
30 changes: 15 additions & 15 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DifferentialEquations"
uuid = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
version = "7.7.0"
version = "7.8.0"

[deps]
BoundaryValueDiffEq = "764a87c0-6b3e-53db-9096-fe964310641d"
Expand All @@ -23,21 +23,21 @@ StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"

[compat]
BoundaryValueDiffEq = "2.9"
DelayDiffEq = "5.38.0"
DiffEqBase = "6.116.0"
DiffEqCallbacks = "2.24"
DiffEqNoiseProcess = "5.13"
JumpProcesses = "9.2"
LinearSolve = "1"
NonlinearSolve = "1.3.0"
OrdinaryDiffEq = "6.27.2"
RecursiveArrayTools = "2.32"
BoundaryValueDiffEq = "2.11"
DelayDiffEq = "5.42.0"
DiffEqBase = "6.125.0"
DiffEqCallbacks = "2.26"
DiffEqNoiseProcess = "5.17"
JumpProcesses = "9.6"
LinearSolve = "2.1.12"
NonlinearSolve = "1.7.0"
OrdinaryDiffEq = "6.53"
RecursiveArrayTools = "2.38"
Reexport = "1.0"
SciMLBase = "1.59.3"
SteadyStateDiffEq = "1.9"
StochasticDiffEq = "6.54"
Sundials = "4.10"
SciMLBase = "1.92"
SteadyStateDiffEq = "1.15"
StochasticDiffEq = "6.61"
Sundials = "4.19"
julia = "1.6"

[extras]
Expand Down
4 changes: 2 additions & 2 deletions src/dae_default_alg.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function default_algorithm(prob::DiffEqBase.AbstractDAEProblem{uType, duType, tType,
isinplace};
kwargs...) where {uType, duType, tType, isinplace}
isinplace};
kwargs...) where {uType, duType, tType, isinplace}
o = Dict{Symbol, Any}(kwargs)
extra_kwargs = Any[]
alg = IDA() # Standard default
Expand Down
4 changes: 2 additions & 2 deletions src/dde_default_alg.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function default_algorithm(prob::DiffEqBase.AbstractDDEProblem{uType, tType, lType,
isinplace};
kwargs...) where {uType, tType, lType, isinplace}
isinplace};
kwargs...) where {uType, tType, lType, isinplace}
o = Dict{Symbol, Any}(kwargs)
extra_kwargs = Any[]
alg = MethodOfSteps(AutoTsit5(Rosenbrock23(autodiff = false))) # Standard default
Expand Down
8 changes: 4 additions & 4 deletions src/default_solve.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function DiffEqBase.__solve(prob::DiffEqBase.DEProblem,
alg::Union{Nothing, DiffEqBase.DEAlgorithm},
args...; default_set = false, kwargs...)
alg::Union{Nothing, DiffEqBase.DEAlgorithm},
args...; default_set = false, kwargs...)
if default_set == true
error("The chosen algorithm, $alg, does not exist. Please verify that the appropriate solver package has been installed.")
end
Expand All @@ -15,8 +15,8 @@ function DiffEqBase.__solve(prob::DiffEqBase.DEProblem,
end

function DiffEqBase.__init(prob::DiffEqBase.DEProblem,
alg::Union{Nothing, DiffEqBase.DEAlgorithm},
args...; default_set = false, kwargs...)
alg::Union{Nothing, DiffEqBase.DEAlgorithm},
args...; default_set = false, kwargs...)
if default_set == true
error("The chosen algorithm, $alg, does not exist. Please verify that the appropriate solver package has been installed.")
end
Expand Down
6 changes: 3 additions & 3 deletions src/ode_default_alg.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType, tType, inplace};
kwargs...) where {uType, tType, inplace}
kwargs...) where {uType, tType, inplace}
o = Dict{Symbol, Any}(kwargs)
extra_kwargs = Any[]
alg = AutoTsit5(Rosenbrock23(autodiff = false)) # Standard default
Expand Down Expand Up @@ -75,8 +75,8 @@ function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType, tType, inp
elseif tol_level == :low_tol
if length(prob.u0) > 500
alg = AutoVern7(Rodas4(autodiff = false,
linsolve = LinearSolve.KrylovJL_GMRES()),
lazy = !callbacks)
linsolve = LinearSolve.KrylovJL_GMRES()),
lazy = !callbacks)
elseif length(prob.u0) > 50
alg = AutoVern7(TRBDF2(autodiff = false), lazy = !callbacks)
else
Expand Down
2 changes: 1 addition & 1 deletion src/sde_default_alg.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function default_algorithm(prob::DiffEqBase.AbstractSDEProblem{uType, tType, isinplace, ND};
kwargs...) where {uType, tType, isinplace, ND}
kwargs...) where {uType, tType, isinplace, ND}
o = Dict{Symbol, Any}(kwargs)
extra_kwargs = Any[]
alg = SOSRI() # Standard default
Expand Down
16 changes: 9 additions & 7 deletions test/default_ode_alg_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using DifferentialEquations, Test
f_2dlinear = (du, u, p, t) -> (@. du = p * u)
f_2dlinear_analytic = (u0, p, t) -> @. u0 * exp(p * t)
prob_ode_2Dlinear = ODEProblem(ODEFunction(f_2dlinear, analytic = f_2dlinear_analytic),
rand(4, 2), (0.0, 1.0), 1.01)
rand(4, 2), (0.0, 1.0), 1.01)

alg, kwargs = default_algorithm(prob_ode_2Dlinear; dt = 1 // 2^(4))
integ = init(prob_ode_2Dlinear; dt = 1 // 2^(4))
Expand Down Expand Up @@ -36,12 +36,14 @@ sol = solve(prob_ode_2Dlinear; alg_hints = [:stiff], reltol = 1e-1)
@test typeof(sol.alg) <: Rosenbrock23

const linear_bigα = parse(BigFloat, "1.01")
f = (du, u, p, t) -> begin for i in 1:length(u)
du[i] = linear_bigα * u[i]
end end
f = (du, u, p, t) -> begin
for i in 1:length(u)
du[i] = linear_bigα * u[i]
end
end
(::typeof(f))(::Type{Val{:analytic}}, u0, p, t) = u0 * exp(linear_bigα * t)
prob_ode_bigfloat2Dlinear = ODEProblem(f, map(BigFloat, rand(4, 2)) .* ones(4, 2) / 2,
(0.0, 1.0))
(0.0, 1.0))

sol = solve(prob_ode_bigfloat2Dlinear; dt = 1 // 2^(4))
@test typeof(sol.alg.algs[1]) <: Vern9
Expand All @@ -60,12 +62,12 @@ sol = solve(prob_ode_bigfloat2Dlinear, nothing; alg_hints = [:stiff])
struct FooAlg end

@test_throws DiffEqBase.NonSolverError solve(prob_ode_bigfloat2Dlinear, FooAlg();
default_set = true)
default_set = true)

struct FooAlg2 <: DiffEqBase.DEAlgorithm end

@test_throws DiffEqBase.ProblemSolverPairingError solve(prob_ode_bigfloat2Dlinear,
FooAlg2(); default_set = true)
FooAlg2(); default_set = true)

prob = ODEProblem(f, rand(4, 2) .* ones(4, 2) / 2, (0.0, 1.0))

Expand Down
32 changes: 24 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

using DifferentialEquations, Test, SafeTestsets
@time begin
@time @safetestset "Default Discrete Algorithm" begin include("default_discrete_alg_test.jl") end
@time @safetestset "Default ODE Algorithm" begin include("default_ode_alg_test.jl") end
@time @safetestset "Default Steady State Algorithm" begin include("default_steady_state_alg_test.jl") end
@time @safetestset "Default SDE Algorithm" begin include("default_sde_alg_test.jl") end
@time @safetestset "Default RODE Algorithm" begin include("default_rode_alg_test.jl") end
@time @safetestset "Default DDE Algorithm" begin include("default_dde_alg_test.jl") end
@time @safetestset "Default DAE Algorithm" begin include("default_dae_alg_test.jl") end
@time @safetestset "Default BVP Algorithm" begin include("default_bvp_alg_test.jl") end
@time @safetestset "Default Discrete Algorithm" begin
include("default_discrete_alg_test.jl")
end
@time @safetestset "Default ODE Algorithm" begin
include("default_ode_alg_test.jl")
end
@time @safetestset "Default Steady State Algorithm" begin
include("default_steady_state_alg_test.jl")
end
@time @safetestset "Default SDE Algorithm" begin
include("default_sde_alg_test.jl")
end
@time @safetestset "Default RODE Algorithm" begin
include("default_rode_alg_test.jl")
end
@time @safetestset "Default DDE Algorithm" begin
include("default_dde_alg_test.jl")
end
@time @safetestset "Default DAE Algorithm" begin
include("default_dae_alg_test.jl")
end
@time @safetestset "Default BVP Algorithm" begin
include("default_bvp_alg_test.jl")
end
end

0 comments on commit 751454f

Please sign in to comment.