Upgrade to OrdinaryDiffEq v7 / DifferentialEquations v8 - #222
Merged
ChrisRackauckas merged 1 commit intoJun 29, 2026
Conversation
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
marked this pull request as ready for review
June 29, 2026 11:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
OrdinaryDiffEqcompat"6"→"6, 7.1". That is effectively a no-op:DiffEqBaseis still pinned to"6", which forcesSciMLBase2, and OrdinaryDiffEq 7 requires SciMLBase 3. I resolved the fullProject.tomlwith only #221 applied and it stays on OrdinaryDiffEq 6.111.0 (silently — no error). The actual gate isDiffEqBase. This PR bumpsDiffEqBase"6"→"7"as well, which is what lets the whole stack move to the SciMLBase-3 line.Project.toml
OrdinaryDiffEqcompat"6"→"7"DiffEqBasecompat"6"→"7"OrdinaryDiffEqLowOrderRKdep + compat"2"(hostsEuler, which the trimmed v7using OrdinaryDiffEqdefault set no longer re-exports)Manifest.tomlregenerated withPkg.update()→ OrdinaryDiffEq 7.1.1, DiffEqBase 7.6.0, SciMLBase 3.30.0, DifferentialEquations 8.0.2, RecursiveArrayTools 4.3.2Lecture fixes (each reproduced and verified on the real v7 stack)
lecture03/sciml.jmdsol(trange).uinstead ofsol(trange)(4 comprehensions)DiffEqArray <: AbstractArray, so iterating now yields scalars →BoundsError: access Float64 at index [2]lecture07/discretizing_odes.jmdRodas5()→Rodas5P()Rodas5is not in the trimmed v7using OrdinaryDiffEqdefault set (it now lives inOrdinaryDiffEqRosenbrock);Rodas5Pis in the default set and is the recommended methodlecture16/probabilistic_programming.jmdprob_func(prob,i,repeat)→prob_func(prob,ctx)prob_funcsignature to 2-arg; the 3-arg form nowMethodErrorslecture19/uncertainty_programming.jmdOrdinaryDiffEqLowOrderRKto theusinglineEuler()resolvesEverything else in the book's DiffEq usage was checked and is unaffected:
using DifferentialEquationsv8 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); defaultsolve,Tsit5/Vern8/Rosenbrock23,SecondOrderODEProblem,@ode_def,EnsembleSummary,using DiffEqBase.EnsembleAnalysis,Measurements,DiffEqCallbacks,Sundials, andsave_everystep/abstol/reltol/saveat/dtall still work. Noautodiff/alias/verboseBool 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_funcMethodErrord, 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.tomlwas regenerated with a fullPkg.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