diff --git a/Project.toml b/Project.toml index c8d9114..f4d18b5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,18 +1,19 @@ name = "DelayDiffEq" uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" authors = ["Chris Rackauckas "] -version = "5.53.0" +version = "6.0.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" +FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" -OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" OrdinaryDiffEqDefault = "50262376-6c5a-4cf5-baba-aaf4f84d72d7" OrdinaryDiffEqDifferentiation = "4302a76b-040a-498a-8c04-15b101fed76b" +OrdinaryDiffEqFunctionMap = "d3585ca7-f5d3-4ba6-8057-292ed1abd90f" OrdinaryDiffEqNonlinearSolve = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8" OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" @@ -25,12 +26,14 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5" [compat] ArrayInterface = "7" +DDEProblemLibrary = "0.1.2" DataStructures = "0.18" DiffEqBase = "6.122" -OrdinaryDiffEq = "6.69" +FastBroadcast = "0.3.5" OrdinaryDiffEqCore = "1.9.0" OrdinaryDiffEqDefault = "1.1.0" OrdinaryDiffEqDifferentiation = "1.6.0" +OrdinaryDiffEqFunctionMap = "1.1.1" OrdinaryDiffEqNonlinearSolve = "1.6.0" OrdinaryDiffEqRosenbrock = "1.2.0" RecursiveArrayTools = "2, 3" @@ -40,3 +43,23 @@ SimpleNonlinearSolve = "0.1, 1, 2" SimpleUnPack = "1" SymbolicIndexingInterface = "0.3.36" julia = "1.10" + +[extras] +DDEProblemLibrary = "f42792ee-6ffc-4e2a-ae83-8ee2f22de800" +DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" +DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" +DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" +FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" +ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" + +[targets] +test = ["DDEProblemLibrary", "DiffEqBase", "DiffEqCallbacks", "DiffEqDevTools", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEq", "OrdinaryDiffEqTsit5", "Random", "RecursiveArrayTools", "SafeTestsets", "Test", "Unitful"] diff --git a/src/DelayDiffEq.jl b/src/DelayDiffEq.jl index 9ecc323..3c8980a 100644 --- a/src/DelayDiffEq.jl +++ b/src/DelayDiffEq.jl @@ -1,9 +1,5 @@ module DelayDiffEq -using Reexport -import OrdinaryDiffEqCore, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqDifferentiation, OrdinaryDiffEqRosenbrock -@reexport using OrdinaryDiffEq - using DataStructures using LinearAlgebra using Logging @@ -15,17 +11,24 @@ import ArrayInterface import SimpleNonlinearSolve import SymbolicIndexingInterface as SII -using DiffEqBase: AbstractDDEAlgorithm, AbstractDDEIntegrator, AbstractODEIntegrator, +using DiffEqBase: DiffEqBase, AbstractDDEAlgorithm, AbstractDDEIntegrator, AbstractODEIntegrator, DEIntegrator, AbstractDDEProblem -using DiffEqBase: @.. +using FastBroadcast +using Reexport +@reexport using DiffEqBase +import OrdinaryDiffEqCore, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqDifferentiation, OrdinaryDiffEqRosenbrock +using OrdinaryDiffEqCore: CompositeAlgorithm, AutoSwitch +using OrdinaryDiffEqFunctionMap: FunctionMap +using OrdinaryDiffEqRosenbrock: RosenbrockMutableCache using OrdinaryDiffEqNonlinearSolve: NLNewton, NLAnderson, NLFunctional, AbstractNLSolverCache, FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence -using OrdinaryDiffEqRosenbrock: RosenbrockMutableCache import SciMLBase +export DDEProblem + export Discontinuity, MethodOfSteps include("discontinuity_type.jl") diff --git a/src/integrators/type.jl b/src/integrators/type.jl index bda3a8c..a51c01a 100644 --- a/src/integrators/type.jl +++ b/src/integrators/type.jl @@ -99,12 +99,12 @@ mutable struct DDEIntegrator{algType, IIP, uType, tType, P, eigenType, tTypeNoUn end function (integrator::DDEIntegrator)(t, deriv::Type = Val{0}; idxs = nothing) - OrdinaryDiffEq.current_interpolant(t, integrator, idxs, deriv) + OrdinaryDiffEqCore.current_interpolant(t, integrator, idxs, deriv) end function (integrator::DDEIntegrator)(val::AbstractArray, t::Union{Number, AbstractArray}, deriv::Type = Val{0}; idxs = nothing) - OrdinaryDiffEq.current_interpolant!(val, t, integrator, idxs, deriv) + OrdinaryDiffEqCore.current_interpolant!(val, t, integrator, idxs, deriv) end function SII.get_history_function(integrator::DDEIntegrator) diff --git a/test/Project.toml b/test/Project.toml deleted file mode 100644 index 1ad758f..0000000 --- a/test/Project.toml +++ /dev/null @@ -1,17 +0,0 @@ -[deps] -DDEProblemLibrary = "f42792ee-6ffc-4e2a-ae83-8ee2f22de800" -DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" -DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" -DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" -FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" -ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" -SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" - -[compat] -DDEProblemLibrary = "0.1.2" \ No newline at end of file diff --git a/test/integrators/cache.jl b/test/integrators/cache.jl index bdd5359..8f2df70 100644 --- a/test/integrators/cache.jl +++ b/test/integrators/cache.jl @@ -1,4 +1,5 @@ using DelayDiffEq, Test +using OrdinaryDiffEq using Random Random.seed!(213) diff --git a/test/integrators/events.jl b/test/integrators/events.jl index 8a16229..ad4a00f 100644 --- a/test/integrators/events.jl +++ b/test/integrators/events.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary, DiffEqDevTools, DiffEqCallbacks -using Test +using Test, OrdinaryDiffEqTsit5 const prob = prob_dde_constant_1delay_scalar const alg = MethodOfSteps(Tsit5(); constrained = false) diff --git a/test/integrators/initialization.jl b/test/integrators/initialization.jl index d1fd1df..d6352d0 100644 --- a/test/integrators/initialization.jl +++ b/test/integrators/initialization.jl @@ -1,6 +1,6 @@ using DelayDiffEq using LinearAlgebra -using Test +using Test, OrdinaryDiffEq @testset "CheckInit" begin u0_good = [0.99, 0.01, 0.0] diff --git a/test/integrators/iterator.jl b/test/integrators/iterator.jl index 1dbe6b8..988682a 100644 --- a/test/integrators/iterator.jl +++ b/test/integrators/iterator.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEq const prob = prob_dde_constant_1delay_scalar diff --git a/test/integrators/reinit.jl b/test/integrators/reinit.jl index 8be7f04..aab5b8b 100644 --- a/test/integrators/reinit.jl +++ b/test/integrators/reinit.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary, RecursiveArrayTools -using Test +using Test, OrdinaryDiffEq const prob_ip = prob_dde_constant_1delay_ip const prob_scalar = prob_dde_constant_1delay_scalar diff --git a/test/integrators/residual_control.jl b/test/integrators/residual_control.jl index 3d6a61a..aa6fb33 100644 --- a/test/integrators/residual_control.jl +++ b/test/integrators/residual_control.jl @@ -1,7 +1,7 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEq -const alg = MethodOfSteps(RK4(); constrained = false) +const alg = MethodOfSteps(Tsit5(); constrained = false) const prob = prob_dde_constant_1delay_scalar # reference solution with delays specified diff --git a/test/integrators/retcode.jl b/test/integrators/retcode.jl index 204d141..c94b163 100644 --- a/test/integrators/retcode.jl +++ b/test/integrators/retcode.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEq const prob = prob_dde_constant_1delay_ip diff --git a/test/integrators/rosenbrock.jl b/test/integrators/rosenbrock.jl index 5fe5a41..8c8d30b 100644 --- a/test/integrators/rosenbrock.jl +++ b/test/integrators/rosenbrock.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEq const prob_ip = prob_dde_constant_1delay_ip const prob_scalar = prob_dde_constant_1delay_scalar diff --git a/test/integrators/sdirk.jl b/test/integrators/sdirk.jl index d5b7674..33cbd00 100644 --- a/test/integrators/sdirk.jl +++ b/test/integrators/sdirk.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEq const prob_ip = prob_dde_constant_1delay_ip const prob_scalar = prob_dde_constant_1delay_scalar diff --git a/test/integrators/unique_times.jl b/test/integrators/unique_times.jl index b28ea1f..d179125 100644 --- a/test/integrators/unique_times.jl +++ b/test/integrators/unique_times.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEqTsit5 const prob = prob_dde_constant_1delay_long_ip diff --git a/test/integrators/verner.jl b/test/integrators/verner.jl index b5413d8..72cae04 100644 --- a/test/integrators/verner.jl +++ b/test/integrators/verner.jl @@ -1,5 +1,5 @@ using DelayDiffEq, DDEProblemLibrary -using Test +using Test, OrdinaryDiffEq # simple problems @testset "simple problems" begin diff --git a/test/interface/ad.jl b/test/interface/ad.jl index 435465b..3d9a543 100644 --- a/test/interface/ad.jl +++ b/test/interface/ad.jl @@ -1,5 +1,5 @@ using DelayDiffEq - +using OrdinaryDiffEqTsit5 import FiniteDiff import ForwardDiff diff --git a/test/interface/backwards.jl b/test/interface/backwards.jl index 3232a6d..3fe574a 100644 --- a/test/interface/backwards.jl +++ b/test/interface/backwards.jl @@ -1,4 +1,5 @@ using DelayDiffEq +using OrdinaryDiffEqTsit5 using Test h(p, t) = 1.0 @@ -12,7 +13,7 @@ f_analytic(u₀, ::typeof(h), p, t) = t < 1 ? (t^2 - 1) / 2 : t - 1 const dde_f = DDEFunction(f, analytic = f_analytic) @testset "Without lags" begin - sol = solve(DDEProblem(dde_f, h, tspan), MethodOfSteps(RK4())) + sol = solve(DDEProblem(dde_f, h, tspan), MethodOfSteps(Tsit5())) @test sol.errors[:l∞] < 1.2e-12 # 1.2e-16 end @@ -53,12 +54,12 @@ end @testset "dt and dtmax" begin prob = DDEProblem(dde_f, h, tspan) - dde_int = init(prob, MethodOfSteps(RK4()); dt = 0.1, dtmax = 0.5) + dde_int = init(prob, MethodOfSteps(Tsit5()); dt = 0.1, dtmax = 0.5) @test dde_int.dt == -0.1 @test dde_int.opts.dtmax == -0.5 sol1 = solve!(dde_int) - sol2 = solve(prob, MethodOfSteps(RK4()); dt = -0.1, dtmax = -0.5) + sol2 = solve(prob, MethodOfSteps(Tsit5()); dt = -0.1, dtmax = -0.5) @test sol1.t == sol2.t @test sol1.u == sol2.u end diff --git a/test/interface/composite_solution.jl b/test/interface/composite_solution.jl index 19f344e..4f4b8c2 100644 --- a/test/interface/composite_solution.jl +++ b/test/interface/composite_solution.jl @@ -1,4 +1,6 @@ using DelayDiffEq, DDEProblemLibrary +using OrdinaryDiffEqCore, OrdinaryDiffEqTsit5, OrdinaryDiffEqRosenbrock +using OrdinaryDiffEqCore: CompositeAlgorithm using Test @testset "integrator" begin @@ -22,7 +24,7 @@ end @testset "issue #148" begin alg = MethodOfSteps(Tsit5()) - compositealg = MethodOfSteps(CompositeAlgorithm((Tsit5(), RK4()), integrator -> 1)) + compositealg = MethodOfSteps(CompositeAlgorithm((Tsit5(), Tsit5()), integrator -> 1)) prob = DDEProblem((du, u, h, p, t) -> (du[1] = -h(p, t - 1)[1]; nothing), [1.0], (p, t) -> [1.0], (0.0, 5.0)) diff --git a/test/interface/constrained.jl b/test/interface/constrained.jl index 307cb6b..e9e5cc2 100644 --- a/test/interface/constrained.jl +++ b/test/interface/constrained.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary +using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq using Test # Check that numerical solutions approximate analytical solutions, diff --git a/test/interface/dependent_delays.jl b/test/interface/dependent_delays.jl index 2edff46..2a22f3d 100644 --- a/test/interface/dependent_delays.jl +++ b/test/interface/dependent_delays.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary +using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq using Test const alg = MethodOfSteps(BS3()) diff --git a/test/interface/discontinuities.jl b/test/interface/discontinuities.jl index 0b382e0..d652131 100644 --- a/test/interface/discontinuities.jl +++ b/test/interface/discontinuities.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary +using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq using Test const prob = prob_dde_constant_2delays_ip diff --git a/test/interface/fpsolve.jl b/test/interface/fpsolve.jl index a88d24a..b93c7ac 100644 --- a/test/interface/fpsolve.jl +++ b/test/interface/fpsolve.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary, DiffEqDevTools +using DelayDiffEq, DDEProblemLibrary, DiffEqDevTools, OrdinaryDiffEq using LinearAlgebra using Test diff --git a/test/interface/history_function.jl b/test/interface/history_function.jl index e0bdab0..cf6edad 100644 --- a/test/interface/history_function.jl +++ b/test/interface/history_function.jl @@ -1,4 +1,4 @@ -using DelayDiffEq +using DelayDiffEq, OrdinaryDiffEq using Test # check constant extrapolation with problem with vanishing delays at t = 0 diff --git a/test/interface/jacobian.jl b/test/interface/jacobian.jl index 50fe4d7..5772aa7 100644 --- a/test/interface/jacobian.jl +++ b/test/interface/jacobian.jl @@ -1,4 +1,4 @@ -using DelayDiffEq +using DelayDiffEq, OrdinaryDiffEq using Test @testset "in-place" begin diff --git a/test/interface/mass_matrix.jl b/test/interface/mass_matrix.jl index 853b27d..3c6d125 100644 --- a/test/interface/mass_matrix.jl +++ b/test/interface/mass_matrix.jl @@ -1,5 +1,6 @@ using DelayDiffEq using DiffEqDevTools +using OrdinaryDiffEq using LinearAlgebra using Test diff --git a/test/interface/parameters.jl b/test/interface/parameters.jl index e23b7e6..642a08f 100644 --- a/test/interface/parameters.jl +++ b/test/interface/parameters.jl @@ -1,4 +1,4 @@ -using DelayDiffEq +using DelayDiffEq, OrdinaryDiffEqTsit5 using Test # Test parameterized delayed logistic equation diff --git a/test/interface/save_idxs.jl b/test/interface/save_idxs.jl index fbc46a3..062c305 100644 --- a/test/interface/save_idxs.jl +++ b/test/interface/save_idxs.jl @@ -1,4 +1,5 @@ using DelayDiffEq +using OrdinaryDiffEq using Test # out-of-place problem diff --git a/test/interface/saveat.jl b/test/interface/saveat.jl index 44559b1..a725286 100644 --- a/test/interface/saveat.jl +++ b/test/interface/saveat.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary +using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEqTsit5 using Test const prob = prob_dde_constant_1delay_long_ip diff --git a/test/interface/unconstrained.jl b/test/interface/unconstrained.jl index 0e3dca3..22eaa06 100644 --- a/test/interface/unconstrained.jl +++ b/test/interface/unconstrained.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary +using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq using Test # Check that numerical solutions approximate analytical solutions, diff --git a/test/interface/units.jl b/test/interface/units.jl index cc20a48..35303e2 100644 --- a/test/interface/units.jl +++ b/test/interface/units.jl @@ -1,4 +1,4 @@ -using DelayDiffEq, DDEProblemLibrary, Unitful +using DelayDiffEq, DDEProblemLibrary, Unitful, OrdinaryDiffEq using Test using DDEProblemLibrary: remake_dde_constant_u0_tType