diff --git a/Project.toml b/Project.toml index bdb25702ae..29c89803d8 100644 --- a/Project.toml +++ b/Project.toml @@ -118,7 +118,7 @@ FastBroadcast = "0.2, 0.3" FastClosures = "0.3" FillArrays = "1.9" FiniteDiff = "2" -ForwardDiff = "0.10" +ForwardDiff = "0.10, 1" FunctionWrappersWrappers = "0.1" InteractiveUtils = "1.9" LineSearches = "7" diff --git a/lib/OrdinaryDiffEqBDF/Project.toml b/lib/OrdinaryDiffEqBDF/Project.toml index 7d11d3e6e0..44f9575dd7 100644 --- a/lib/OrdinaryDiffEqBDF/Project.toml +++ b/lib/OrdinaryDiffEqBDF/Project.toml @@ -1,7 +1,7 @@ name = "OrdinaryDiffEqBDF" uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" authors = ["ParamThakkar123 "] -version = "1.5.0" +version = "1.5.1" [sources] OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"} @@ -35,7 +35,7 @@ DiffEqBase = "6.152.2" DiffEqDevTools = "2.44.4" Enzyme = "0.13" FastBroadcast = "0.3.5" -ForwardDiff = "0.10.36" +ForwardDiff = "0.10.36, 1" LinearAlgebra = "<0.0.1, 1" LinearSolve = "2.32, 3" MacroTools = "0.5.13" diff --git a/lib/OrdinaryDiffEqDifferentiation/Project.toml b/lib/OrdinaryDiffEqDifferentiation/Project.toml index 2c44042dcc..5a5c65a704 100644 --- a/lib/OrdinaryDiffEqDifferentiation/Project.toml +++ b/lib/OrdinaryDiffEqDifferentiation/Project.toml @@ -1,7 +1,7 @@ name = "OrdinaryDiffEqDifferentiation" uuid = "4302a76b-040a-498a-8c04-15b101fed76b" authors = ["Chris Rackauckas ", "Yingbo Ma "] -version = "1.9.0" +version = "1.9.1" [sources] OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"} @@ -37,7 +37,7 @@ DiffEqDevTools = "2.44.4" DifferentiationInterface = "0.6.48" FastBroadcast = "0.3" FiniteDiff = "2" -ForwardDiff = "0.10" +ForwardDiff = "0.10, 1" FunctionWrappersWrappers = "0.1" LinearAlgebra = "1.10" LinearSolve = "2, 3" diff --git a/lib/OrdinaryDiffEqNonlinearSolve/Project.toml b/lib/OrdinaryDiffEqNonlinearSolve/Project.toml index d06a8bb4bd..349346c158 100644 --- a/lib/OrdinaryDiffEqNonlinearSolve/Project.toml +++ b/lib/OrdinaryDiffEqNonlinearSolve/Project.toml @@ -1,7 +1,7 @@ name = "OrdinaryDiffEqNonlinearSolve" uuid = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8" authors = ["Chris Rackauckas ", "Yingbo Ma "] -version = "1.9.0" +version = "1.9.1" [sources] OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"} @@ -35,7 +35,7 @@ DiffEqBase = "6.152.2" DiffEqDevTools = "2.44.4" FastBroadcast = "0.3.5" FastClosures = "0.3.2" -ForwardDiff = "0.10.36" +ForwardDiff = "0.10.36, 1" LinearAlgebra = "<0.0.1, 1" LinearSolve = "2.32.0, 3" LineSearches = "7" diff --git a/lib/OrdinaryDiffEqPDIRK/Project.toml b/lib/OrdinaryDiffEqPDIRK/Project.toml index 2c44a504db..ffe9cbbc4d 100644 --- a/lib/OrdinaryDiffEqPDIRK/Project.toml +++ b/lib/OrdinaryDiffEqPDIRK/Project.toml @@ -1,7 +1,7 @@ name = "OrdinaryDiffEqPDIRK" uuid = "5dd0a6cf-3d4b-4314-aa06-06d4e299bc89" authors = ["ParamThakkar123 "] -version = "1.3.0" +version = "1.3.1" [sources] OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"} @@ -24,7 +24,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" ADTypes = "1.11" DiffEqBase = "6.152.2" DiffEqDevTools = "2.44.4" -FastBroadcast = "0.3.5" +FastBroadcast = "0.3.5, 1" MuladdMacro = "0.2.4" OrdinaryDiffEqCore = "1.19" OrdinaryDiffEqDifferentiation = "<0.0.1, 1.2" diff --git a/lib/OrdinaryDiffEqRosenbrock/Project.toml b/lib/OrdinaryDiffEqRosenbrock/Project.toml index efd7761e57..113926909e 100644 --- a/lib/OrdinaryDiffEqRosenbrock/Project.toml +++ b/lib/OrdinaryDiffEqRosenbrock/Project.toml @@ -1,7 +1,7 @@ name = "OrdinaryDiffEqRosenbrock" uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" authors = ["ParamThakkar123 "] -version = "1.10.0" +version = "1.10.1" [sources] OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"} @@ -35,7 +35,7 @@ DifferentiationInterface = "0.6.48" Enzyme = "0.13" FastBroadcast = "0.3.5" FiniteDiff = "2.24.0" -ForwardDiff = "0.10.36" +ForwardDiff = "0.10.36, 1" LinearAlgebra = "<0.0.1, 1" LinearSolve = "2.32.0, 3" MacroTools = "0.5.13" diff --git a/test/regression/hard_dae.jl b/test/regression/hard_dae.jl index 302de87d2a..db4ff23eaa 100644 --- a/test/regression/hard_dae.jl +++ b/test/regression/hard_dae.jl @@ -233,7 +233,7 @@ function hardstop!(du, u, p, t) pm, pg = p y, f_wall, dy = u du[1] = dy - du[2] = ifelse(y <= 0, y, f_wall) + du[2] = ifelse(y < 0, y, f_wall) du[3] = (-ifelse(t < 2, -pg * pm, pg * pm) - f_wall) / (-pm) end @@ -270,6 +270,6 @@ for prob in [prob1, prob2], alg in [simple_implicit_euler, alg_switch] sol = solve(prob, alg, callback = cb, dt = 1 / 2^10, adaptive = false) @test sol.retcode == ReturnCode.Success @test sol(0, idxs = 1) == 5 - @test sol(2, idxs = 1) == 0 + @test sol(2-2^-10, idxs = 1) == 0 @test sol(4, idxs = 1) > 10 end diff --git a/test/regression/ode_dense_tests.jl b/test/regression/ode_dense_tests.jl index 753177957b..a2c979c016 100644 --- a/test/regression/ode_dense_tests.jl +++ b/test/regression/ode_dense_tests.jl @@ -36,6 +36,10 @@ end const deriv_test_points = range(0, stop = 1, length = 5) +# left continuous derivative \lim{ϵ->0⁺}\frac{f(x)-f(x-ϵ)}{ϵ} +function LeftDeriv(f, x) + ForwardDiff.derivative(t -> -f(-t), -x) +end # perform the regression tests # NOTE: If you want to add new tests (for new algorithms), you have to run the # commands below to get numerical values for `tol_ode_linear` and @@ -63,7 +67,7 @@ function regression_test(alg, tol_ode_linear, tol_ode_2Dlinear; test_diff1 = fal @test interpolation_results_1d[1] ≈ der for t in deriv_test_points deriv = sol(t, Val{N}) - @test deriv≈ForwardDiff.derivative(t -> sol(t, Val{N - 1}), t) rtol=dertol + @test deriv≈LeftDeriv(t -> sol(t, Val{N - 1}), t) rtol=dertol end end end @@ -84,7 +88,7 @@ function regression_test(alg, tol_ode_linear, tol_ode_2Dlinear; test_diff1 = fal @test interpolation_results_1d_inplace[1] ≈ der for t in deriv_test_points deriv = sol(t, Val{N}, idxs = 1) - @test deriv≈ForwardDiff.derivative(t -> sol(t, Val{N - 1}; idxs = 1), t) rtol=dertol + @test deriv≈LeftDeriv(t -> sol(t, Val{N - 1}; idxs = 1), t) rtol=dertol end end end @@ -122,7 +126,7 @@ end interpd_idxs = sol(0:(1 // 2^(4)):1, idxs = 1:2:5) -@test minimum([interpd_idxs[i] == interpd[i][1:2:5] for i in 1:length(interpd)]) +@test minimum([isapprox(interpd_idxs[i], interpd[i][1:2:5], rtol=1e-14) for i in 1:length(interpd)]) interpd_single = sol(0:(1 // 2^(4)):1, idxs = 1)