From 1249ef024968e10d8667af073b5b3416c2472c04 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 15 Jun 2026 09:54:33 -0400 Subject: [PATCH 1/3] Fix docs build for OrdinaryDiffEq v7: load solver subpackages explicitly OrdinaryDiffEq v7 dropped its blanket @reexport, so `OrdinaryDiffEq.OrdinaryDiffEqXXX` no longer resolves and `make.jl` died with `UndefVarError` at the makedocs `modules` list. Load each OrdinaryDiffEq *and* StochasticDiffEq solver subpackage by bare name and list them directly (mirroring OrdinaryDiffEq.jl's own docs build), rather than relying on the meta-packages to reexport them; add them as deps + compat. Also in this commit: - Bump AlgebraicMultigrid compat to allow v2 (PR #868). v2's SPQR coarse solver fixes the non-SPD preconditioner crash that v1's Pinv/SVD coarse solver hits. - Add LinearSolve as a docs dependency (used by advanced_ode_example.md, previously only available transitively). - Bring the OrdinaryDiffEqCore controller API symbols into Main so the unqualified @ref links in the copied controllers.md resolve. - Drop OrdinaryDiffEq's contributor-internal devtools pages from the user docs: their @eval blocks read paths relative to OrdinaryDiffEq's own build layout and cannot build when embedded in DiffEqDocs. - Guard the StochasticDiffEq API nav section, which is empty now that StochasticDiffEq ships no docs/ directory in the v7 monorepo. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/Project.toml | 80 ++++++++++++++++++++++++++++++++++++++++- docs/make.jl | 91 +++++++++++++++++++++++++++++++++-------------- docs/pages.jl | 9 +++++ 3 files changed, 153 insertions(+), 27 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 1cca0ef04..e082e146d 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -15,15 +15,18 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DelayDiffEq = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" +DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" DiffEqDocs = "d91efeb5-c178-44a6-a2ee-51685df7c78e" DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" +ImplicitDiscreteSolve = "3263718b-31ed-49cf-8a0f-35a466e8af96" IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895" JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" LSODA = "7f56f5a3-f504-529b-bc02-0b1fe5e64312" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" ODEInterfaceDiffEq = "09606e27-ecf5-54fc-bb29-004bd9f985bf" @@ -31,8 +34,34 @@ ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5" Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +OrdinaryDiffEqAMF = "08082164-f6a1-4363-b3df-3aa6fcf571ad" +OrdinaryDiffEqAdamsBashforthMoulton = "89bda076-bce5-4f1c-845f-551c83cdda9a" OrdinaryDiffEqBDF = "6ad6398a-0878-4a85-9266-38940aa047c8" OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" +OrdinaryDiffEqDefault = "50262376-6c5a-4cf5-baba-aaf4f84d72d7" +OrdinaryDiffEqExplicitRK = "9286f039-9fbf-40e8-bf65-aa933bdc4db0" +OrdinaryDiffEqExponentialRK = "e0540318-69ee-4070-8777-9e2de6de23de" +OrdinaryDiffEqExtrapolation = "becaefa8-8ca2-5cf9-886d-c06f3d2bd2c4" +OrdinaryDiffEqFIRK = "5960d6e9-dd7a-4743-88e7-cf307b64f125" +OrdinaryDiffEqFeagin = "101fe9f7-ebb6-4678-b671-3a81e7194747" +OrdinaryDiffEqHighOrderRK = "d28bc4f8-55e1-4f49-af69-84c1a99f0f58" +OrdinaryDiffEqIMEXMultistep = "9f002381-b378-40b7-97a6-27a27c83f129" +OrdinaryDiffEqLinear = "521117fe-8c41-49f8-b3b6-30780b3f0fb5" +OrdinaryDiffEqLowOrderRK = "1344f307-1e59-4825-a18e-ace9aa3fa4c6" +OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d" +OrdinaryDiffEqNordsieck = "c9986a66-5c92-4813-8696-a7ec84c806c8" +OrdinaryDiffEqPDIRK = "5dd0a6cf-3d4b-4314-aa06-06d4e299bc89" +OrdinaryDiffEqPRK = "5b33eab2-c0f1-4480-b2c3-94bc1e80bda1" +OrdinaryDiffEqQPRK = "04162be5-8125-4266-98ed-640baecc6514" +OrdinaryDiffEqRKN = "af6ede74-add8-4cfd-b1df-9a4dbb109d7a" +OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce" +OrdinaryDiffEqSDIRK = "2d112036-d095-4a1e-ab9a-08536f3ecdbf" +OrdinaryDiffEqSSPRK = "669c94d9-1f4b-4b64-b377-1aa079aa2388" +OrdinaryDiffEqStabilizedIRK = "e3e12d00-db14-5390-b879-ac3dd2ef6296" +OrdinaryDiffEqStabilizedRK = "358294b1-0aab-51c3-aafe-ad5ab194a2ad" +OrdinaryDiffEqSymplecticRK = "fa646aed-7ef9-47eb-84c4-9443fc8cbfa8" +OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a" +OrdinaryDiffEqVerner = "79d7bb75-1356-48c1-b8c0-6832512096c2" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" SDEProblemLibrary = "c72e72a9-a271-4b2b-8966-303ed956772e" @@ -43,6 +72,16 @@ SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" +StochasticDiffEqCore = "19c5a474-6cd1-4a5f-be79-46dc34e54d7f" +StochasticDiffEqHighOrder = "0520c28c-50fd-4d16-9c96-902fc80b3bab" +StochasticDiffEqIIF = "ebf54054-c36b-4494-9aba-657e36df524f" +StochasticDiffEqImplicit = "5080b986-4c76-4669-b5dc-373a41579d5b" +StochasticDiffEqLeaping = "aefaaa88-39f2-4e89-b162-d61b7e8cc81b" +StochasticDiffEqLowOrder = "d15fe365-ce7f-450a-828a-7985bd5b681b" +StochasticDiffEqMilstein = "8c95a807-c8e7-4581-8419-890d001af53e" +StochasticDiffEqROCK = "db241ea8-0e6b-4abc-8f2d-1adff2294fd9" +StochasticDiffEqRODE = "49714585-0aa1-4f53-b1e6-a9b8c0d5e03f" +StochasticDiffEqWeak = "af2a2fcd-1c36-4cbe-a6d0-5afda784a085" Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" @@ -51,7 +90,7 @@ DiffEqDocs = {path = ".."} [compat] ADTypes = "1.7" -AlgebraicMultigrid = "0.5, 0.6, 1" +AlgebraicMultigrid = "0.5, 0.6, 1, 2" BSON = "0.3" BVProblemLibrary = "0.1.2" BenchmarkTools = "1" @@ -66,14 +105,17 @@ DataFrames = "1.4" DelayDiffEq = "5.52, 6.0" DiffEqBase = "7" DiffEqCallbacks = "4" +DiffEqDevTools = "3, 4.0" DifferentialEquations = "7.14, 8.0" Distributions = "0.25" Documenter = "1" FiniteDiff = "2" ForwardDiff = "0.10, 1" +ImplicitDiscreteSolve = "2" IncompleteLU = "0.2" JLD2 = "0.4, 0.5.1, 0.6" LSODA = "0.7, 1.0" +LinearSolve = "2, 3" ModelingToolkit = "9, 10, 11.0" NonlinearSolve = "3.15, 4" ODEInterfaceDiffEq = "3, 4.0, 5.0" @@ -81,8 +123,34 @@ ODEProblemLibrary = "0.1, 1" Optimization = "3, 4, 5" OptimizationNLopt = "0.2, 0.3" OrdinaryDiffEq = "7" +OrdinaryDiffEqAMF = "2" +OrdinaryDiffEqAdamsBashforthMoulton = "2" OrdinaryDiffEqBDF = "2" OrdinaryDiffEqCore = "4, 5.0" +OrdinaryDiffEqDefault = "2" +OrdinaryDiffEqExplicitRK = "2" +OrdinaryDiffEqExponentialRK = "2" +OrdinaryDiffEqExtrapolation = "2" +OrdinaryDiffEqFIRK = "2" +OrdinaryDiffEqFeagin = "2" +OrdinaryDiffEqHighOrderRK = "2" +OrdinaryDiffEqIMEXMultistep = "2" +OrdinaryDiffEqLinear = "2" +OrdinaryDiffEqLowOrderRK = "2" +OrdinaryDiffEqLowStorageRK = "3" +OrdinaryDiffEqNordsieck = "2" +OrdinaryDiffEqPDIRK = "2" +OrdinaryDiffEqPRK = "2" +OrdinaryDiffEqQPRK = "2" +OrdinaryDiffEqRKN = "2" +OrdinaryDiffEqRosenbrock = "2" +OrdinaryDiffEqSDIRK = "2" +OrdinaryDiffEqSSPRK = "2" +OrdinaryDiffEqStabilizedIRK = "2" +OrdinaryDiffEqStabilizedRK = "2" +OrdinaryDiffEqSymplecticRK = "2" +OrdinaryDiffEqTsit5 = "2" +OrdinaryDiffEqVerner = "2" Plots = "1" RecursiveArrayTools = "4" SDEProblemLibrary = "0.1, 1" @@ -93,5 +161,15 @@ SparseConnectivityTracer = "0.6, 1" StaticArrays = "1" SteadyStateDiffEq = "2.4" StochasticDiffEq = "7" +StochasticDiffEqCore = "2" +StochasticDiffEqHighOrder = "2" +StochasticDiffEqIIF = "2" +StochasticDiffEqImplicit = "2" +StochasticDiffEqLeaping = "2" +StochasticDiffEqLowOrder = "2" +StochasticDiffEqMilstein = "2" +StochasticDiffEqROCK = "2" +StochasticDiffEqRODE = "2" +StochasticDiffEqWeak = "2" Sundials = "4.11.3, 5, 6.0" Unitful = "1" diff --git a/docs/make.jl b/docs/make.jl index 07da36521..4fc6d1711 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,6 +1,26 @@ using Documenter, DiffEqBase, SciMLBase, OrdinaryDiffEq, OrdinaryDiffEqBDF, OrdinaryDiffEqCore, StochasticDiffEq, DelayDiffEq, SteadyStateDiffEq, DiffEqCallbacks, BoundaryValueDiffEq +# Load the OrdinaryDiffEq/StochasticDiffEq solver subpackages directly instead of relying +# on the meta-packages to reexport them: OrdinaryDiffEq v7 already dropped its reexports, +# so listing each subpackage explicitly is what keeps the API docs complete and robust. +using OrdinaryDiffEqAdamsBashforthMoulton, OrdinaryDiffEqDefault, OrdinaryDiffEqExplicitRK, + OrdinaryDiffEqExponentialRK, OrdinaryDiffEqExtrapolation, OrdinaryDiffEqFeagin, + OrdinaryDiffEqFIRK, OrdinaryDiffEqHighOrderRK, OrdinaryDiffEqIMEXMultistep, + OrdinaryDiffEqLinear, OrdinaryDiffEqLowOrderRK, OrdinaryDiffEqLowStorageRK, + OrdinaryDiffEqNordsieck, OrdinaryDiffEqPDIRK, OrdinaryDiffEqPRK, OrdinaryDiffEqQPRK, + OrdinaryDiffEqRKN, OrdinaryDiffEqRosenbrock, OrdinaryDiffEqSDIRK, OrdinaryDiffEqSSPRK, + OrdinaryDiffEqStabilizedIRK, OrdinaryDiffEqStabilizedRK, OrdinaryDiffEqSymplecticRK, + OrdinaryDiffEqTsit5, OrdinaryDiffEqVerner, OrdinaryDiffEqAMF, ImplicitDiscreteSolve, + DiffEqDevTools +using StochasticDiffEqCore, StochasticDiffEqHighOrder, StochasticDiffEqIIF, + StochasticDiffEqImplicit, StochasticDiffEqLeaping, StochasticDiffEqLowOrder, + StochasticDiffEqMilstein, StochasticDiffEqROCK, StochasticDiffEqRODE, + StochasticDiffEqWeak +# Bring the OrdinaryDiffEqCore controller API symbols into Main so the unqualified +# @ref links in the copied controllers.md resolve (mirrors OrdinaryDiffEq.jl's docs). +using OrdinaryDiffEqCore: default_controller, resolve_basic, get_EEst, set_EEst!, + CompositeController import ODEProblemLibrary, SDEProblemLibrary, DDEProblemLibrary, DAEProblemLibrary, BVProblemLibrary using Sundials, DASKR, LSODA, DASSL, SimpleDiffEq, ODEInterfaceDiffEq @@ -24,6 +44,11 @@ if isdir(ordinartdiffeq_docs_path) # Copy all the docs from OrdinaryDiffEq.jl cp(ordinartdiffeq_docs_path, ordinary_diffeq_dest, force = true) + # OrdinaryDiffEq's developer docs are contributor-internal and their @eval blocks + # read paths relative to OrdinaryDiffEq's own build layout, so they cannot build + # inside DiffEqDocs; drop them from the user-facing site. + rm(joinpath(ordinary_diffeq_dest, "devtools"), recursive = true, force = true) + # Copy the pages.jl file from OrdinaryDiffEq.jl ordinary_diffeq_pages_dest = joinpath(@__DIR__, "ordinarydiffeq_pages.jl") ordinary_diffeq_pages_file = joinpath(ordinartdiffeq_docs_root, "pages.jl") @@ -69,33 +94,47 @@ makedocs( DAEProblemLibrary, BVProblemLibrary, OrdinaryDiffEq, - OrdinaryDiffEq.OrdinaryDiffEqAdamsBashforthMoulton, - OrdinaryDiffEq.OrdinaryDiffEqBDF, - OrdinaryDiffEq.OrdinaryDiffEqDefault, - OrdinaryDiffEq.OrdinaryDiffEqExplicitRK, - OrdinaryDiffEq.OrdinaryDiffEqExponentialRK, - OrdinaryDiffEq.OrdinaryDiffEqExtrapolation, - OrdinaryDiffEq.OrdinaryDiffEqFeagin, - OrdinaryDiffEq.OrdinaryDiffEqFIRK, - OrdinaryDiffEq.OrdinaryDiffEqHighOrderRK, - OrdinaryDiffEq.OrdinaryDiffEqIMEXMultistep, - OrdinaryDiffEq.OrdinaryDiffEqLinear, - OrdinaryDiffEq.OrdinaryDiffEqLowOrderRK, - OrdinaryDiffEq.OrdinaryDiffEqLowStorageRK, - OrdinaryDiffEq.OrdinaryDiffEqNordsieck, - OrdinaryDiffEq.OrdinaryDiffEqPDIRK, - OrdinaryDiffEq.OrdinaryDiffEqPRK, - OrdinaryDiffEq.OrdinaryDiffEqQPRK, - OrdinaryDiffEq.OrdinaryDiffEqRKN, - OrdinaryDiffEq.OrdinaryDiffEqRosenbrock, - OrdinaryDiffEq.OrdinaryDiffEqSDIRK, - OrdinaryDiffEq.OrdinaryDiffEqSSPRK, - OrdinaryDiffEq.OrdinaryDiffEqStabilizedIRK, - OrdinaryDiffEq.OrdinaryDiffEqStabilizedRK, - OrdinaryDiffEq.OrdinaryDiffEqSymplecticRK, - OrdinaryDiffEq.OrdinaryDiffEqTsit5, - OrdinaryDiffEq.OrdinaryDiffEqVerner, + OrdinaryDiffEqCore, + OrdinaryDiffEqAdamsBashforthMoulton, + OrdinaryDiffEqBDF, + OrdinaryDiffEqDefault, + OrdinaryDiffEqExplicitRK, + OrdinaryDiffEqExponentialRK, + OrdinaryDiffEqExtrapolation, + OrdinaryDiffEqFeagin, + OrdinaryDiffEqFIRK, + OrdinaryDiffEqHighOrderRK, + OrdinaryDiffEqIMEXMultistep, + OrdinaryDiffEqLinear, + OrdinaryDiffEqLowOrderRK, + OrdinaryDiffEqLowStorageRK, + OrdinaryDiffEqNordsieck, + OrdinaryDiffEqPDIRK, + OrdinaryDiffEqPRK, + OrdinaryDiffEqQPRK, + OrdinaryDiffEqRKN, + OrdinaryDiffEqRosenbrock, + OrdinaryDiffEqSDIRK, + OrdinaryDiffEqSSPRK, + OrdinaryDiffEqStabilizedIRK, + OrdinaryDiffEqStabilizedRK, + OrdinaryDiffEqSymplecticRK, + OrdinaryDiffEqTsit5, + OrdinaryDiffEqVerner, + OrdinaryDiffEqAMF, + ImplicitDiscreteSolve, + DiffEqDevTools, StochasticDiffEq, + StochasticDiffEqCore, + StochasticDiffEqHighOrder, + StochasticDiffEqIIF, + StochasticDiffEqImplicit, + StochasticDiffEqLeaping, + StochasticDiffEqLowOrder, + StochasticDiffEqMilstein, + StochasticDiffEqROCK, + StochasticDiffEqRODE, + StochasticDiffEqWeak, DelayDiffEq, SteadyStateDiffEq, DiffEqCallbacks, diff --git a/docs/pages.jl b/docs/pages.jl index b26ba3b47..8f1473d72 100644 --- a/docs/pages.jl +++ b/docs/pages.jl @@ -25,6 +25,9 @@ function transform_ordinarydiffeq_pages(pages_array) end ordinary_diffeq_pages = transform_ordinarydiffeq_pages(pages) +# The Developer Documentation section maps to OrdinaryDiffEq's contributor-internal +# devtools pages, which are excluded from the DiffEqDocs build (see docs/make.jl). +filter!(p -> !(p isa Pair && first(p) == "Developer Documentation"), ordinary_diffeq_pages) # Load StochasticDiffEq pages - if available stochastic_diffeq_pages_file = joinpath(@__DIR__, "stochasticdiffeq_pages.jl") @@ -159,3 +162,9 @@ pages = Any[ "migration/ordinarydiffeq_v7.md", ], ] + +# StochasticDiffEq ships no docs in the OrdinaryDiffEq v7 monorepo, so drop the API +# section entirely rather than leaving an empty navigation entry. +if isempty(stochastic_diffeq_pages) + filter!(p -> !(p isa Pair && first(p) == "StochasticDiffEq.jl API"), pages) +end From f3a815c75209cb770146d3ce98dea1ee4b4bf946 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 15 Jun 2026 09:54:46 -0400 Subject: [PATCH 2/3] Update executed doc examples for DifferentialEquations v8 + RecursiveArrayTools v4 With OrdinaryDiffEq v7 pinned, the resolver takes DifferentialEquations v8, which now only `@reexport`s SciMLBase + OrdinaryDiffEq (documented in index.md/getting_started.md). Executed @example blocks that reached for symbols no longer reexported through `DE.` therefore errored. Source each from the package it now lives in: - ensemble.md: `DE.SRIW1` -> `SDE.SRIW1` (StochasticDiffEq) - dde_example.md: `DE.RK4` -> `ODELow.RK4` (OrdinaryDiffEqLowOrderRK) - callback_functions.md, spiking_neural_systems.md: `DE.PresetTimeCallback` -> `CB.PresetTimeCallback` (DiffEqCallbacks) - callback_functions.md: `DE.resize!` -> `resize!` (Base, extended for integrators) Also: - advanced_ode_example.md: preconditioner `precs` functions returned `(Pl, nothing)`, but Krylov.jl now calls `ldiv!` on the right preconditioner; return `(Pl, I)` so the identity right-preconditioner has an `ldiv!` method. (LinearSolve `import` was already used here; LinearSolve is added as a docs dep in the previous commit.) - faq.md: `solve(...)[end]` returned a scalar under RecursiveArrayTools v4 (AbstractArray indexing), breaking the downstream ForwardDiff/FiniteDiff jacobian blocks; use `.u[end]` to get the final state vector. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/src/basics/faq.md | 2 +- docs/src/examples/spiking_neural_systems.md | 15 +++++++++------ docs/src/features/callback_functions.md | 5 +++-- docs/src/features/ensemble.md | 3 ++- docs/src/tutorials/advanced_ode_example.md | 10 +++++----- docs/src/tutorials/dde_example.md | 7 ++++--- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/src/basics/faq.md b/docs/src/basics/faq.md index 6f39ea7c1..33add8092 100644 --- a/docs/src/basics/faq.md +++ b/docs/src/basics/faq.md @@ -480,7 +480,7 @@ end function f(p) prob = DE.ODEProblem(func, eltype(p).([1.0, 1.0]), (0.0, 10.0), p) # Lower tolerances to show the methods converge to the same value - DE.solve(prob, DE.Tsit5(), save_everystep = false, abstol = 1e-12, reltol = 1e-12)[end] + DE.solve(prob, DE.Tsit5(), save_everystep = false, abstol = 1e-12, reltol = 1e-12).u[end] end ``` diff --git a/docs/src/examples/spiking_neural_systems.md b/docs/src/examples/spiking_neural_systems.md index ba04bca8b..9de8a5d23 100644 --- a/docs/src/examples/spiking_neural_systems.md +++ b/docs/src/examples/spiking_neural_systems.md @@ -20,6 +20,7 @@ The LIF model has five parameters, `gL, EL, C, Vth, I` and we define it in the ` ```@example spikingneural import DifferentialEquations as DE +import DiffEqCallbacks as CB # PresetTimeCallback is no longer reexported by DifferentialEquations v8 import ComponentArrays import Plots Plots.gr() @@ -65,7 +66,7 @@ function reset!(integrator) end threshold = DE.ContinuousCallback(thr, reset!, nothing) -current_step = DE.PresetTimeCallback([2, 15], integrator -> integrator.p.I += 150.0) +current_step = CB.PresetTimeCallback([2, 15], integrator -> integrator.p.I += 150.0) cb = DE.CallbackSet(current_step, threshold) ``` @@ -100,6 +101,7 @@ We see that the model is resting at `-75` while there is no input. At `t=2` the ```@example spikingneural #Izhikevichch Model import DifferentialEquations as DE +import DiffEqCallbacks as CB import Plots function izh!(du, u, p, t) @@ -123,7 +125,7 @@ function reset!(integrator) end threshold = DE.DiscreteCallback(thr, reset!) -current_step = DE.PresetTimeCallback(50, integrator -> integrator.p[5] += 10) +current_step = CB.PresetTimeCallback(50, integrator -> integrator.p[5] += 10) cb = DE.CallbackSet(current_step, threshold) ``` @@ -168,6 +170,7 @@ The Hodgkin-Huxley (HH) model is our first biophysically realistic model. This m ```@example spikingneural import DifferentialEquations as DE +import DiffEqCallbacks as CB import Plots # Potassium ion-channel rate functions @@ -198,7 +201,7 @@ We have three different types of ionic conductances. Potassium, sodium and the l The sodium current is not very different, but it has two gating variables, `m, h` instead of one. The leak conductance gL has no gating variables because it is not voltage gated. Let's move on to the parameters. If you want all the details on the HH model, you can find a great description [here](https://neuronaldynamics.epfl.ch/online/Ch2.S2.html). ```@example spikingneural -current_step = DE.PresetTimeCallback(100, integrator -> integrator.p[8] += 1) +current_step = CB.PresetTimeCallback(100, integrator -> integrator.p[8] += 1) # n, m & h steady-states n_inf(v) = alpha_n(v) / (alpha_n(v) + beta_n(v)) @@ -308,7 +311,7 @@ function epsp!(integrator) integrator.u[6] -= integrator.u[5] * integrator.u[6] end -epsp_ts = DE.PresetTimeCallback(100:100:500, epsp!) +epsp_ts = CB.PresetTimeCallback(100:100:500, epsp!) p = [35.0, 40.0, 0.3, -77.0, 55.0, -65.0, 1, 0, 30, 1000, 50, 0.5, 0.005, 0] u0 = [-60, n_inf(-60), m_inf(-60), h_inf(-60), 0.0, 1.0, 0.0] @@ -331,7 +334,7 @@ Plots.plot(sol, vars = [5, 6]) Because of the time courses at play here, this facilitation is frequency-dependent. If we increase the period between these events, facilitation does not occur. ```@example spikingneural -epsp_ts = DE.PresetTimeCallback(100:1000:5100, epsp!) +epsp_ts = CB.PresetTimeCallback(100:1000:5100, epsp!) p = [35.0, 40.0, 0.3, -77.0, 55.0, -65.0, 1, 0, 30, 500, 50, 0.5, 0.005, 0] u0 = [-60, n_inf(-60), m_inf(-60), h_inf(-60), 0.0, 1.0, 0.0] @@ -348,7 +351,7 @@ Plots.plot(sol, vars = [5, 6]) We can also change these time constants such that the dynamics show short-term depression instead of facilitation. ```@example spikingneural -epsp_ts = DE.PresetTimeCallback(100:100:500, epsp!) +epsp_ts = CB.PresetTimeCallback(100:100:500, epsp!) p = [35.0, 40.0, 0.3, -77.0, 55.0, -65.0, 1, 0, 30, 100, 1000, 0.5, 0.005, 0] u0 = [-60, n_inf(-60), m_inf(-60), h_inf(-60), 0.0, 1.0, 0.0] diff --git a/docs/src/features/callback_functions.md b/docs/src/features/callback_functions.md index 63fb4c052..ce035cb3c 100644 --- a/docs/src/features/callback_functions.md +++ b/docs/src/features/callback_functions.md @@ -78,6 +78,7 @@ a negative coefficient: ```@example callback1 import DifferentialEquations as DE +import DiffEqCallbacks as CB # PresetTimeCallback is no longer reexported by DifferentialEquations v8 function f(du, u, p, t) du[1] = -u[1] end @@ -154,7 +155,7 @@ could do the following: ```@example callback1 dosetimes = [4.0, 8.0] affect!(integrator) = integrator.u[1] += 10 -cb = DE.PresetTimeCallback(dosetimes, affect!) +cb = CB.PresetTimeCallback(dosetimes, affect!) sol = DE.solve(prob, DE.Tsit5(), callback = cb) Plots.plot(sol) ``` @@ -689,7 +690,7 @@ the values of these two cells at the time of the event: function affect!(integrator) u = integrator.u maxidx = findmax(u)[2] - DE.resize!(integrator, length(u) + 1) + resize!(integrator, length(u) + 1) Θ = rand() u[maxidx] = Θ u[end] = 1 - Θ diff --git a/docs/src/features/ensemble.md b/docs/src/features/ensemble.md index 7d9e9c40f..46e4e7474 100644 --- a/docs/src/features/ensemble.md +++ b/docs/src/features/ensemble.md @@ -538,8 +538,9 @@ to make sure the steps all hit the same times. We thus set `adaptive=false` and explicitly give a `dt`. ```@example ensemble4 +import StochasticDiffEq as SDE # SRIW1 is no longer reexported by DifferentialEquations v8 prob2 = DE.EnsembleProblem(prob) -sim = DE.solve(prob2, DE.SRIW1(), dt = 1 // 2^(3), trajectories = 10, adaptive = false); +sim = SDE.solve(prob2, SDE.SRIW1(), dt = 1 // 2^(3), trajectories = 10, adaptive = false); @info "Ensemble solution computed with $(length(sim)) trajectories" # hide nothing # hide ``` diff --git a/docs/src/tutorials/advanced_ode_example.md b/docs/src/tutorials/advanced_ode_example.md index 4385f8876..7d8ec0447 100644 --- a/docs/src/tutorials/advanced_ode_example.md +++ b/docs/src/tutorials/advanced_ode_example.md @@ -232,7 +232,7 @@ LinearSolve.jl linear solver object (e.g. `KrylovJL_GMRES(precs = ...)`) rather than on the ODE algorithm, and the `precs` callback signature is `Pl, Pr = precs(A, p)` — where `A` is the current `W = I - γJ` operator and `p` is the ODE parameter object. Preconditioners can be either left, right, -or both; return `nothing` (or `IdentityOperator`) for sides you don't want to +or both; return `I` (or `IdentityOperator`) for sides you don't want to precondition. An example using [IncompleteLU.jl](https://github.com/haampie/IncompleteLU.jl) @@ -242,7 +242,7 @@ is: import IncompleteLU function incompletelu(W, p) Pl = IncompleteLU.ilu(convert(AbstractMatrix, W), τ = 50.0) - Pl, nothing + Pl, LinearAlgebra.I end # Required due to a bug in Krylov.jl: https://github.com/JuliaSmoothOptimizers/Krylov.jl/pull/477 @@ -260,7 +260,7 @@ generate the Jacobian (otherwise, a Jacobian-free algorithm is used with GMRES by default). We use `convert(AbstractMatrix,W)` to get the concrete `W` matrix (matching `jac_prototype`, thus `SparseMatrixCSC`) which we can use in the preconditioner's definition. Then we use `IncompleteLU.ilu` on that sparse -matrix to generate the preconditioner. We return `Pl,nothing` to say that our +matrix to generate the preconditioner. We return `Pl, I` to say that our preconditioner is a left preconditioner, and that there is no right preconditioning. @@ -274,7 +274,7 @@ which is more automatic. The setup is very similar to before: import AlgebraicMultigrid function algebraicmultigrid(W, p) Pl = AlgebraicMultigrid.aspreconditioner(AlgebraicMultigrid.ruge_stuben(convert(AbstractMatrix, W))) - Pl, nothing + Pl, LinearAlgebra.I end BT.@btime DE.solve(prob_ode_brusselator_2d_sparse, @@ -291,7 +291,7 @@ function algebraicmultigrid2(W, p) Pl = AlgebraicMultigrid.aspreconditioner(AlgebraicMultigrid.ruge_stuben(A, presmoother = AlgebraicMultigrid.Jacobi(rand(size(A, 1))), postsmoother = AlgebraicMultigrid.Jacobi(rand(size(A, 1))))) - Pl, nothing + Pl, LinearAlgebra.I end BT.@btime DE.solve(prob_ode_brusselator_2d_sparse, diff --git a/docs/src/tutorials/dde_example.md b/docs/src/tutorials/dde_example.md index 49d79bc2f..bd0ec592b 100644 --- a/docs/src/tutorials/dde_example.md +++ b/docs/src/tutorials/dde_example.md @@ -37,6 +37,7 @@ Thus, the function for this model is given by: ```@example dde import DelayDiffEq as DDE, DifferentialEquations as DE +import OrdinaryDiffEqLowOrderRK as ODELow # RK4 is no longer reexported by DifferentialEquations v8 function bc_model(du, u, h, p, t) p0, q0, v0, d0, p1, q1, v1, d1, d2, beta0, beta1, tau = p hist3 = h(p, t - tau)[3] @@ -191,19 +192,19 @@ You might have noticed DifferentialEquations.jl allows you to solve problems with undeclared delays, since you can interpolate `h` at any value. This is a feature, but use it with caution. Undeclared delays can increase the error in the solution. It's recommended that you use a method with a residual control, -such as `MethodOfSteps(DDE.RK4())` whenever there are undeclared delays. With this, +such as `MethodOfSteps(RK4())` whenever there are undeclared delays. With this, you can use interpolated derivatives, solve functional differential equations by using quadrature on the interpolant, etc. However, note that residual control solves with a low level of accuracy, so the tolerances should be made very small, and the solution should not be trusted for more than 2-3 decimal places. -Note: `MethodOfSteps(DDE.RK4())` with undeclared delays is similar to MATLAB's +Note: `MethodOfSteps(RK4())` with undeclared delays is similar to MATLAB's `ddesd`. Thus, for example, the following is similar to solving the example from above with residual control: ```@example dde prob = DDE.DDEProblem(bc_model, u0, h, tspan) -alg = DDE.MethodOfSteps(DE.RK4()) +alg = DDE.MethodOfSteps(ODELow.RK4()) sol = DDE.solve(prob, alg); nothing # hide ``` From 383977876c5c6da5bfc98b37ce6876fab0e3cb85 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 15 Jun 2026 10:01:37 -0400 Subject: [PATCH 3/3] Fix pre-existing spell-check failures blocking docs CI The Spell Check (typos) job has been failing on master and every PR. Fix the two real typos and allowlist the proper noun so the check passes: - classical_physics.md: ContiunousCallback -> ContinuousCallback - bvp_solve.md: prblem -> problem - .typos.toml: allowlist `Lamba` (the surname in the Lamba & Rackauckas methods LambaEM / LambaEulerHeun; typos mis-flags it as "Lambda") Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- .typos.toml | 1 + docs/src/examples/classical_physics.md | 2 +- docs/src/solvers/bvp_solve.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.typos.toml b/.typos.toml index 8b7c2c30d..825ef3dfd 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,5 +1,6 @@ [default.extend-words] quations = "quations" +Lamba = "Lamba" IIF = "IIF" padd = "padd" thr = "thr" diff --git a/docs/src/examples/classical_physics.md b/docs/src/examples/classical_physics.md index c7f0558ea..77aa41ebb 100644 --- a/docs/src/examples/classical_physics.md +++ b/docs/src/examples/classical_physics.md @@ -265,7 +265,7 @@ function double_pendulum_hamiltonian(udot, u, p, t) 2sin(2β) * ((lα^2 - 2(1 + cos(β))lα * lβ + (3 + 2cos(β))lβ^2) / (3 - cos(2β))^2)] end -# Construct a ContiunousCallback +# Construct a ContinuousCallback condition(u, t, integrator) = u[1] affect!(integrator) = nothing cb = ODE.ContinuousCallback(condition, affect!, nothing, diff --git a/docs/src/solvers/bvp_solve.md b/docs/src/solvers/bvp_solve.md index 670553193..fad0efa79 100644 --- a/docs/src/solvers/bvp_solve.md +++ b/docs/src/solvers/bvp_solve.md @@ -99,7 +99,7 @@ Similar to `MIRK` methods, fully implicit Runge-Kutta methods construct nonlinea #### Gauss Legendre collocation methods -The `Ascher` collocation methods are similar with `MIRK` and `FIRK` methods but have extension for BVDAE prblem solving, the error control is based on instead of defect control adaptivity. +The `Ascher` collocation methods are similar with `MIRK` and `FIRK` methods but have extension for BVDAE problem solving, the error control is based on instead of defect control adaptivity. - `BoundaryValueDiffEqAscher.Ascher1` - A 1st stage Gauss Legendre collocation method with Ascher's error control adaptivity. - `BoundaryValueDiffEqAscher.Ascher2` - A 2nd stage Gauss Legendre collocation method with Ascher's error control adaptivity.