From 8564f6af6e40a285679742f783fdcc837a302e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez?= Date: Tue, 1 Apr 2025 11:29:38 +0200 Subject: [PATCH 1/3] Tighten the callback interval when there's an exact zero crossing --- src/internal_itp.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal_itp.jl b/src/internal_itp.jl index 8e3c36bd5..e26559dde 100644 --- a/src/internal_itp.jl +++ b/src/internal_itp.jl @@ -74,7 +74,7 @@ function SciMLBase.solve(prob::IntervalNonlinearProblem{IP, Tuple{T, T}}, alg::I left, fl = xp, yp else return SciMLBase.build_solution( - prob, alg, xp, yps; retcode = ReturnCode.Success, left, right + prob, alg, xp, yps; retcode = ReturnCode.Success, left=xp, right=xp ) end From a270e372e336ae12d12e225d193d8a1db821977a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez?= Date: Tue, 1 Apr 2025 12:26:39 +0200 Subject: [PATCH 2/3] Fix formatting --- src/internal_itp.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal_itp.jl b/src/internal_itp.jl index e26559dde..f438bdbee 100644 --- a/src/internal_itp.jl +++ b/src/internal_itp.jl @@ -74,7 +74,7 @@ function SciMLBase.solve(prob::IntervalNonlinearProblem{IP, Tuple{T, T}}, alg::I left, fl = xp, yp else return SciMLBase.build_solution( - prob, alg, xp, yps; retcode = ReturnCode.Success, left=xp, right=xp + prob, alg, xp, yps; retcode = ReturnCode.Success, left = xp, right = xp ) end From 8710d9524e6ba4588f968e61bf0a1e95ba329b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez?= Date: Tue, 1 Apr 2025 19:24:48 +0200 Subject: [PATCH 3/3] Integrate #1136 --- src/internal_itp.jl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/internal_itp.jl b/src/internal_itp.jl index f438bdbee..af6ee0b97 100644 --- a/src/internal_itp.jl +++ b/src/internal_itp.jl @@ -41,7 +41,7 @@ function SciMLBase.solve(prob::IntervalNonlinearProblem{IP, Tuple{T, T}}, alg::I retcode = ReturnCode.ExactSolutionRight, left, right) end span = abs(right - left) - k1 = T(alg.scaled_k1)/span + k1 = T(alg.scaled_k1) / span n0 = T(alg.n0) n_h = exponent(span / (2 * ϵ)) ϵ_s = ϵ * exp2(n_h + n0) @@ -61,11 +61,6 @@ function SciMLBase.solve(prob::IntervalNonlinearProblem{IP, Tuple{T, T}}, alg::I xt = ifelse(δ ≤ abs(diff), x_f + copysign(δ, diff), mid) # Truncation Step xp = ifelse(abs(xt - mid) ≤ r, xt, mid - copysign(r, diff)) # Projection Step - if span < 2ϵ - return SciMLBase.build_solution( - prob, alg, xt, f(xt); retcode = ReturnCode.Success, left, right - ) - end yp = f(xp) yps = yp * sign(fr) if yps > T0