SciMLBook icon indicating copy to clipboard operation
SciMLBook copied to clipboard

Add IntervalArithmetic v0.23.0+ compatibility guide and robust examples

Open ChrisRackauckas-Claude opened this issue 3 months ago โ€ข 0 comments

Summary

Adds comprehensive documentation and robust examples for IntervalArithmetic.jl v0.23.0+ compatibility, addressing breaking changes introduced in the latest version.

Problem Solved

IntervalArithmetic.jl v0.23.0 introduced breaking changes for IEEE 1788-2015 compliance that can cause failures in interval ODE examples:

โŒ ArgumentError: `isfinite` is purposely not supported for intervals containing infinite bounds
โŒ ArgumentError: `==` is purposely not supported for overlapping non-thin intervals  

Changes Made

๐Ÿ“š Documentation Updates

  • Breaking changes guide for v0.23.0+ users
  • Migration instructions from deprecated functions:
    • isfinite() โ†’ isbounded() for interval bounds checking
    • == โ†’ isequal_interval() for interval comparison
  • Best practices for robust interval ODE solving

๐Ÿ› ๏ธ Robust Example Code

Added solve_interval_ode_safely() function that:

  • โœ… Handles solver failures gracefully with Euler fallback
  • โœ… Checks interval bounds using isbounded()
  • โœ… Uses fixed-step solvers to avoid adaptive step issues
  • โœ… Provides clear error messages and fallback strategies

๐Ÿงช Testing Results

Verified with IntervalArithmetic v0.23.0:

  • โœ… Original examples still work (with our ฯ€/3.0 fix)
  • โœ… New robust examples handle edge cases gracefully
  • โœ… All interval arithmetic operations function correctly
  • โœ… Error handling provides useful fallback strategies

Benefits

๐ŸŽฏ User Experience: Clear guidance for v0.23.0+ users
๐Ÿ›ก๏ธ Robustness: Examples handle interval explosion gracefully
๐Ÿ“– Educational: Explains breaking changes and solutions
๐Ÿ”„ Backward Compatible: Works with both v0.22.x and v0.23.0+

Example Usage

The new robust solver automatically handles IntervalArithmetic v0.23.0 issues:

gaccel = interval(9.79, 9.81)
L = interval(0.99, 1.01) 
uโ‚€ = [interval(0,0), interval(ฯ€/3.0 - 0.01, ฯ€/3.0 + 0.01)]
sol = solve_interval_ode_safely(gaccel, L, uโ‚€, (0.0, 3.0))

This ensures the SciMLBook examples work reliably with the latest IntervalArithmetic.jl versions while providing educational value about handling numerical uncertainties.

๐Ÿค– Generated with Claude Code

ChrisRackauckas-Claude avatar Sep 12 '25 11:09 ChrisRackauckas-Claude