Skip to content

support ForwardDiff 1.0 #2643

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqBDF/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OrdinaryDiffEqBDF"
uuid = "6ad6398a-0878-4a85-9266-38940aa047c8"
authors = ["ParamThakkar123 <[email protected]>"]
version = "1.5.0"
version = "1.5.1"

[sources]
OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"}
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqDifferentiation/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OrdinaryDiffEqDifferentiation"
uuid = "4302a76b-040a-498a-8c04-15b101fed76b"
authors = ["Chris Rackauckas <[email protected]>", "Yingbo Ma <[email protected]>"]
version = "1.9.0"
version = "1.9.1"

[sources]
OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"}
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqNonlinearSolve/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OrdinaryDiffEqNonlinearSolve"
uuid = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8"
authors = ["Chris Rackauckas <[email protected]>", "Yingbo Ma <[email protected]>"]
version = "1.9.0"
version = "1.9.1"

[sources]
OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"}
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqPDIRK/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OrdinaryDiffEqPDIRK"
uuid = "5dd0a6cf-3d4b-4314-aa06-06d4e299bc89"
authors = ["ParamThakkar123 <[email protected]>"]
version = "1.3.0"
version = "1.3.1"

[sources]
OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"}
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqRosenbrock/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OrdinaryDiffEqRosenbrock"
uuid = "43230ef6-c299-4910-a778-202eb28ce4ce"
authors = ["ParamThakkar123 <[email protected]>"]
version = "1.10.0"
version = "1.10.1"

[sources]
OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"}
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions test/regression/hard_dae.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
10 changes: 7 additions & 3 deletions test/regression/ode_dense_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Loading