Update for OrdinaryDiffEq v7 / DifferentialEquations v8 - #3
Merged
tobydriscoll merged 2 commits intoMay 4, 2026
Merged
tobydriscoll merged 2 commits into
tobydriscoll merged 2 commits into
Conversation
Bumps the DifferentialEquations compat to allow v8. The umbrella package was scoped down in v8 to only re-export OrdinaryDiffEq, but all uses in this repo are ODE-only (Tsit5, ODEProblem, solve), so the existing call sites continue to work after the bump. Fixes one indexing breakage in chapter10's `shoot`: under RecursiveArrayTools v4 (shipped with OrdinaryDiffEq v7), an ODESolution now subtypes AbstractArray, so `sol[end]` returns the last *scalar* element in column-major order rather than the last timestep vector. The downstream `g₂(y[end]...)` then tries to splat a Float64 and errors. Switching to `y.u[end]...` is the forward-compatible form and works under both RAT v3 and v4. The companion `y[1,:], y[2,:]` lines from commit e15d935 still work unchanged, because AbstractArray row-slicing on the (ncomponents, ntimesteps) column-major storage returns the same per-component trajectories as the v3 override did. Updates the README's "alternative packages" table to point BVP users at BoundaryValueDiffEq directly, since DifferentialEquations v8 no longer re-exports the BVP solver family. All test sets pass on Julia 1.11 with DifferentialEquations v8.0.0 and OrdinaryDiffEq v7.0.0. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The DiffEq docs site (diffeq.sciml.ai) is a unified portal that covers all topic-specific solvers including BVPs, even after the v8 umbrella stopped re-exporting them from `using DifferentialEquations`. Linking to the consolidated docs matches the IVP entry's existing convention and is a more useful landing page for a newcomer than the BoundaryValueDiffEq subpackage docs. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| Arpack = "0.5" | ||
| Dierckx = "0.5" | ||
| DifferentialEquations = "7.15" | ||
| DifferentialEquations = "7.15, 8" |
Contributor
There was a problem hiding this comment.
Both versions are still supported.
| | Spline | [Dierckx](https://github.com/kbarbary/Dierckx.jl) | | ||
| | [Initial-value problem](https://diffeq.sciml.ai/latest/tutorials/ode_example/#ode_example) | [DifferentialEquations](https://diffeq.sciml.ai/latest/) | | ||
| | [Boundary-value problem](https://diffeq.sciml.ai/latest/tutorials/bvp_example/#Boundary-Value-Problems) | [DifferentialEquations](https://diffeq.sciml.ai/latest/) | | ||
| | [Boundary-value problem](https://diffeq.sciml.ai/latest/tutorials/bvp_example/#Boundary-Value-Problems) | [BoundaryValueDiffEq](https://diffeq.sciml.ai/latest/) | |
Contributor
There was a problem hiding this comment.
The other BVP docs are sub-docs here, so the full thing is better. Therefore this is good.
| sol = solve(IVP,Tsit5(),abstol=tol/10,reltol=tol/10) | ||
| x = sol.t; y = sol; | ||
| return [g₁(s...),g₂(y[end]...)] | ||
| return [g₁(s...),g₂(y.u[end]...)] |
Contributor
There was a problem hiding this comment.
You probably shouldn't splat for performance, but this at least matches before.
Contributor
|
This is a reasonably backwards compatible change. |
ChrisRackauckas
approved these changes
May 4, 2026
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.
Summary
Updates the package for the OrdinaryDiffEq v7 / DifferentialEquations v8 breaking release. Three small changes are sufficient — FNC only uses ODE features, so most of the v7 surface (controllers, ADTypes, ODEAliasSpecifier, ODEVerbosity, callback signatures, ensemble RNG, …) doesn't apply here.
Changes
Project.toml— bumpedDifferentialEquationscompat from"7.15"to"7.15, 8". The umbrella package was scoped down in v8 to only re-exportOrdinaryDiffEq, but every call site in this repo is ODE-only (Tsit5,ODEProblem,solve), so existing usage continues to work after the bump.src/chapter10.jl— fixed one indexing breakage inshoot. Under RecursiveArrayTools v4 (shipped with OrdinaryDiffEq v7),ODESolutionnow subtypesAbstractArray, sosol[end]returns the last scalar element in column-major order rather than the last timestep vector. The downstreamg₂(y[end]...)then tries to splat aFloat64and errors. Switched toy.u[end]..., which is the forward-compatible form (works under both RAT v3 and v4).The companion
y[1,:], y[2,:]lines from commit e15d935 still work unchanged:AbstractArrayrow-slicing on the(ncomponents, ntimesteps)column-major storage returns the same per-component trajectories as the v3 override did. I verified this empirically against OrdinaryDiffEq v7.0.0 before deciding to leave them.README.md— updated the "alternative numerical packages" table to point BVP users atBoundaryValueDiffEqdirectly.DifferentialEquationsv8 no longer re-exports the BVP solver family from the umbrella, so the old recommendation would no longer give the user a working BVP setup.Why this is the whole diff
I read the OrdinaryDiffEq v7 / DiffEq v8 NEWS.md end-to-end and audited the repo for every category of breaking change:
sol[i]→sol.u[i]chapter10.jlsol[1,:]/sol[2,:]row slicingfor u in sol,length(sol),eachindex(sol)sol.retcode == :Symbolretcodenot inspectedsol.destats→sol.statsu_modified!→derivative_discontinuity!autodiff::Bool→ADTypesverbose::Bool→ODEVerbosityalias::Bool/alias_u0→ODEAliasSpecifiergamma/beta1/beta2/q*controller kwargs →controller=chunk_size/diff_type/standardtag/precsalgorithm kwargslazy::Bool→Val{true/false}williamson_condition=truedefault →falseVectorContinuousCallbackaffect!signatureCheckInitdefault DAE initconstruct*renameStatic.True/False→Serial/Threaded{CS,AD,FDT,ST,CJ}type-param removalprob_func/output_funcsignatureKenCarp4/Rodas4/etc. now require explicit sublibTsit5used)The only call site touched in
src/is theshootfunction. Everything else in the repo (euler,ie2,rk4,rk23,ab4,am2in chapter06,parabolicin chapter11) operates on user-written RHS functions or usessolve(ivp)with default-solver behavior, both of which are unchanged.Test plan
Resolve and precompile FNC against
DifferentialEquationsv8.0.0 /OrdinaryDiffEqv7.0.0 on Julia 1.11Pkg.test()— all 11 test sets pass (74 total tests):Empirically verified RAT v4 indexing semantics (
sol[1,:]andsol[2,:]return per-component trajectories;sol[end]returns a scalar;sol.u[end]returns the last timestep vector) before deciding which lines actually needed migration.