Repository navigation
Take the discretized system's own tspan - #685
Merged
ChrisRackauckas merged 1 commit intoSep 8, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
Raise the PDEBase floor to 0.1.35, which sets `tspan` on the `System` that
`symbolic_discretize` returns, so a caller who keeps only the system can build
a problem from it without repeating the time span:
sys, _ = symbolic_discretize(pdesys, disc)
prob = ODEProblem(mtkcompile(sys), nothing)
`symbolic_discretize` still returns `(sys, tspan)`; the change is additive.
`discretize` and `DAEProblem(::PDESystem, ...)` already pass the span
explicitly and are unaffected. A time-independent `PDESystem` discretizes to
a `NonlinearSystem` and gains no span, which the second test asserts.
ModelingToolkitBase moves to 1.69 for the `System` tspan field, and
ModelingToolkit to 11.42, the first release that floors that version itself.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Agent-Harness: Claude Code 2.1.263
Agent-Model: claude-opus-5
Agent-Session: https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu
Claude-Session: https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu
ChrisRackauckas-Claude
force-pushed
the
tspan-on-discretized-system
branch
from
September 8, 2026 09:36
cbc0953 to
5a6f667
Compare
ChrisRackauckas
marked this pull request as ready for review
September 8, 2026 23:00
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.
What changed and why
The discretized
Systemnow carries its own time span, so a caller who keeps only the system can build a problem from it without repeating the interval:Motivation: SciML/ModelOrderReduction.jl#29, whose other half landed in SciML/ModelOrderReduction.jl#181.
MethodOfLines itself needed no code change. It constructs no
System:PDEBase.generate_systemis the single place the discretized system is built, and that is where thetspankeyword is now passed — SciML/PDEBase.jl#116. Setting the span from here instead would have meant either duplicating that function or mutating a constructedSystemthrough a non-public setter (@set sys.tspan), since ModelingToolkitBase exposestspanonly as a constructor keyword. So this PR is the compat floor, the tests, and one docs paragraph.Depends on PDEBase 0.1.35 being released. The compat floor here names a version that does not exist in the registry yet; CI will be red with
Unsatisfiable requirementsuntil SciML/PDEBase.jl#116 merges and registers. Please merge and register that first.Deliberate decisions
symbolic_discretizekeeps returning(sys, tspan). Dropping the tuple would break every caller that unpacks it, including ModelOrderReduction's test suite and MethodOfLines' owndiscretize,DAEProblem,ODEFunction,ODEFunctionExprand staggered paths. The change is purely additive: the tuple stays, and the system additionally carries the span. The first new test asserts both halves.discretizeis unaffected. It callssymbolic_discretizeand passestspanexplicitly into_dae_problem/_ode_problem, so the value it uses is the same one it always used. Same forDAEProblem(::PDESystem, ::MOLFiniteDifference). Nothing there needed touching, and nothing there changed behaviour. The benefit is confined to thesymbolic_discretizeentry point, where the span was previously only reachable through the tuple.PDESystemwith no time variable discretizes through thet === nothingbranch, which builds aNonlinearSystemwith notspankeyword.get_tspanon it isnothing, not a fabricated interval. The second new test asserts this, so a future change that starts setting the span unconditionally will fail here.ModelingToolkit = "11.42"(was11.39.1),ModelingToolkitBase = "1.69"(was1.67). 1.69.0 is the release that added theSystemtspan field and 11.42.0 is the first ModelingToolkit that floors it; both are registered. Strictly, theModelingToolkitBase = "1.69"floor alone is sufficient, and I verified the tests pass on ModelingToolkit 11.41.0 + ModelingToolkitBase 1.69.0 as well — but 11.42 is what ModelingToolkit itself declares as the supported pairing, so that is what is declared here.Verification
Julia 1.12.7.
ModelingToolkit v11.42.0andModelingToolkitBase v1.69.0from the registry,PDEBase v0.1.35dev'd from the branch in PDEBase#116.The new tests fail without the fix
With the one added line (
tspan = tspan,) removed fromPDEBase.generate_systemand everything else identical, running exactly the two new testsets:That is
MissingTspanErrorfrom ModelingToolkitBase, which is exactly the "no time span anywhere" path.And pass with it
Full test groups
(Both were also run and passed against ModelingToolkit 11.41.0 before the 11.42 compat bump:
Equation discretization 3618/3618 53m08.3s,Problem construction 54/54,QA 21/21.)Format, spelling, docs
Every
@exampleblock evaluated and the doctests ran clean. Withlinkcheck = trueasdocs/make.jlhas it, the build terminates onstatus: 429from api.github.com for a handful of source links — GitHub rate limiting this machine, unrelated to the change, and none of the rate-limited URLs are ones this PR touches. I reran withlinkcheck = falseto confirm the rest of the build is clean; that is the exit-0 above.Not verified
Diffusion,Convection*,Burgers,Brusselator,2D_Diffusion,Higher_Order,Integrals,Mixed_Derivatives,Nonlinear_Diffusion*,Nonlinlap_ADV,Sol_Interface,MOL_Interface1,MOL_Interface2,Components,Complex,Stationary,DAE,Wave_Eq_StaggeredandNeuralNetswere not run locally — theDiscretizationgroup alone takes ~53 minutes on this box. They exercisediscretize, whose behaviour is unchanged, so I do not expect movement, but I have not confirmed it.linkcheck = truedocs build, for the reason above.What a reviewer should push back on
ModelingToolkitfloor should be11.42or left at11.39.1with only theModelingToolkitBase = "1.69"floor doing the work. The latter is looser and I verified it works; I took the stricter one on the argument that 11.41 + MTKBase 1.69 is a pairing ModelingToolkit does not itself declare.1.4.0minor bump is right for behaviour that arrives entirely through a dependency's floor.Ignore this PR until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code
https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu