Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Backport ITP bugfixes from DiffEqBase in high precision contexts #74

Merged
merged 5 commits into from
Jul 24, 2023
Merged

Conversation

DaniGlez
Copy link
Contributor

@DaniGlez DaniGlez commented Jul 23, 2023

Fix a couple of issues on ITP that we found on SciML/DiffEqBase.jl#917
Specifically:

  • Prevent iterations with zero progress (and thus getting stuck in a value until max iters) due to loss of relative precision near the solution
  • Allow for reversed tspans

I also extended the bracketing tests to cover cases of IntervalNonlinearProblem with a reversed tspan (ie tspan[2] < tspan[1]). I am not sure if this is intended behavior; I assume it is since it works for the previous methods and the corresponding problem can be created. If this is not intended, we can remove those tests but I think it should error at IntervalNonlinearProblem creation time, then.

Another point: return behaviour is slightly different from the DiffEqBase implementation, where the solution has to fulfill iszero(f(nextfloat(t_sol))) || f(t_sol) * f(nextfloat(tsol)) < 0.0. Here, if f(t) = 0.0 then t is returned as the solution, which I guess makes more sense for other purposes.

@codecov
Copy link

codecov bot commented Jul 23, 2023

Codecov Report

Merging #74 (73a977b) into main (26b5799) will increase coverage by 0.61%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   92.48%   93.09%   +0.61%     
==========================================
  Files          21       21              
  Lines        1011     1014       +3     
==========================================
+ Hits          935      944       +9     
+ Misses         76       70       -6     
Impacted Files Coverage Δ
src/itp.jl 91.93% <100.00%> (-1.29%) ⬇️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChrisRackauckas ChrisRackauckas merged commit 2711d48 into SciML:main Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants