Skip to content

Upgrade to OrdinaryDiffEq v7 / DifferentialEquations v8 - #222

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:odeq-v7-upgrade
Jun 29, 2026
Merged

Upgrade to OrdinaryDiffEq v7 / DifferentialEquations v8#222
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:odeq-v7-upgrade

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Warning

Draft — please ignore until reviewed by @ChrisRackauckas.

What this does

Upgrades the book to OrdinaryDiffEq v7 / DifferentialEquations v8 (which pulls SciMLBase v3, DiffEqBase v7, RecursiveArrayTools v4) and applies the lecture-code changes those breaking releases require. This supersedes the dependabot bump in #221.

Why #221 alone is insufficient

Dependabot #221 only widens OrdinaryDiffEq compat "6""6, 7.1". That is effectively a no-op: DiffEqBase is still pinned to "6", which forces SciMLBase 2, and OrdinaryDiffEq 7 requires SciMLBase 3. I resolved the full Project.toml with only #221 applied and it stays on OrdinaryDiffEq 6.111.0 (silently — no error). The actual gate is DiffEqBase. This PR bumps DiffEqBase "6""7" as well, which is what lets the whole stack move to the SciMLBase-3 line.

Project.toml

  • OrdinaryDiffEq compat "6""7"
  • DiffEqBase compat "6""7"
  • add OrdinaryDiffEqLowOrderRK dep + compat "2" (hosts Euler, which the trimmed v7 using OrdinaryDiffEq default set no longer re-exports)
  • Manifest.toml regenerated with Pkg.update() → OrdinaryDiffEq 7.1.1, DiffEqBase 7.6.0, SciMLBase 3.30.0, DifferentialEquations 8.0.2, RecursiveArrayTools 4.3.2

Lecture fixes (each reproduced and verified on the real v7 stack)

File Change Reason
lecture03/sciml.jmd iterate sol(trange).u instead of sol(trange) (4 comprehensions) RAT v4 makes DiffEqArray <: AbstractArray, so iterating now yields scalarsBoundsError: access Float64 at index [2]
lecture07/discretizing_odes.jmd Rodas5()Rodas5P() Rodas5 is not in the trimmed v7 using OrdinaryDiffEq default set (it now lives in OrdinaryDiffEqRosenbrock); Rodas5P is in the default set and is the recommended method
lecture16/probabilistic_programming.jmd ensemble prob_func(prob,i,repeat)prob_func(prob,ctx) SciMLBase 3 changed the ensemble prob_func signature to 2-arg; the 3-arg form now MethodErrors
lecture19/uncertainty_programming.jmd add OrdinaryDiffEqLowOrderRK to the using line so Euler() resolves

Everything else in the book's DiffEq usage was checked and is unaffected: using DifferentialEquations v8 still re-exports the full ODE API (only SDE/DDE/BVP/Jump/SteadyState/Sundials were dropped from the umbrella, none of which the lectures use); default solve, Tsit5/Vern8/Rosenbrock23, SecondOrderODEProblem, @ode_def, EnsembleSummary, using DiffEqBase.EnsembleAnalysis, Measurements, DiffEqCallbacks, Sundials, and save_everystep/abstol/reltol/saveat/dt all still work. No autodiff/alias/verbose Bool keywords are used (those hard-error in v7).

Verification

Each of the 4 changed code paths was executed in an isolated env on OrdinaryDiffEq 7.1.1 / DifferentialEquations 8.0.2 / SciMLBase 3.30.0 / RecursiveArrayTools 4.3.2 — the broken form was confirmed to fail and the fixed form to run (e.g. the ensemble: 3-arg prob_func MethodErrord, 2-arg ran 20/20 successful trajectories).

Not validated locally: the full book weave (the GPU/MPI/Lux/Enzyme lectures) was not run — that environment can't be provisioned here. CI should validate the complete build. The Manifest.toml was regenerated with a full Pkg.update(), so packages beyond the ODE stack also moved to their latest compatible versions; happy to produce a more surgical Manifest if preferred.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DgQWCeDiwiAXWXmgnYHFeV

Bumps the solver stack to OrdinaryDiffEq v7 (SciMLBase v3, DiffEqBase v7,
RecursiveArrayTools v4, DifferentialEquations v8) and applies the lecture
code changes required by the v7/v8 breaking changes. Each affected code path
was run on a real OrdinaryDiffEq 7.1.1 / DifferentialEquations 8.0.2 /
SciMLBase 3.30.0 / RecursiveArrayTools 4.3.2 environment and verified.

Project.toml:
- OrdinaryDiffEq compat "6" -> "7"; DiffEqBase compat "6" -> "7" (the
  DiffEqBase cap is what actually gates SciMLBase 2 -> 3; bumping
  OrdinaryDiffEq alone leaves the resolver on v6).
- Add OrdinaryDiffEqLowOrderRK (hosts Euler, no longer re-exported by the
  trimmed `using OrdinaryDiffEq` default set).
- Manifest.toml regenerated via Pkg.update(): OrdinaryDiffEq 7.1.1,
  DiffEqBase 7.6.0, SciMLBase 3.30.0, DifferentialEquations 8.0.2,
  RecursiveArrayTools 4.3.2.

Lecture fixes:
- lecture03: iterate `sol(trange).u` instead of `sol(trange)` — RAT v4 makes
  a DiffEqArray subtype AbstractArray, so iterating now yields scalars.
- lecture07: Rodas5() -> Rodas5P() — Rodas5 is no longer in the default
  `using OrdinaryDiffEq` set; Rodas5P is, and is the recommended method.
- lecture16: ensemble prob_func(prob,i,repeat) -> prob_func(prob,ctx) —
  SciMLBase 3 changed the ensemble prob_func signature.
- lecture19: import OrdinaryDiffEqLowOrderRK so Euler() resolves.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DgQWCeDiwiAXWXmgnYHFeV
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review June 29, 2026 11:53
@ChrisRackauckas
ChrisRackauckas merged commit d27487e into SciML:master Jun 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants