Skip to content

Give the POD reduced system its own time span - #205

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix/pod-carries-tspan
Sep 9, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix/pod-carries-tspan

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Ignore this PR until reviewed by @ChrisRackauckas.

Finishes the ModelOrderReduction side of #29, in 1.0.0 before it is released. No version bump: General still has 0.1.11, so 1.0.0 has never shipped and this lands as part of it.

#181 gave deim an inherited time span, but pod arrived in parallel through #202 and did not get one. So the POD Galerkin example in the README still read:

rom_prob = DAEProblem(rom, nothing, full_prob.tspan; build_initializeprob = false)

which is exactly the out-of-band time-span threading issue 29 is about. pod now inherits one on the same terms as deim:

rom = pod(full_prob, sol, 4)
rom_prob = DAEProblem(rom, nothing; build_initializeprob = false)

What changed

  • _pod takes a tspan and forwards it into the shared _assemble_reduced_system, on both the array and the compiled-fallback paths. That function already accepted the keyword, so this is a thread-through rather than new machinery.
  • The problem method uses prob.tspan, the interval the reduction was trained on. The system method uses get_tspan(sys). A source without a span still yields a reduced system without one, rather than a fabricated interval, and passing one explicitly still overrides.
  • The README POD example, the pod docstring example, and the FitzHugh-Nagumo DEIM test drop the now-redundant argument. That test now asserts deim_prob.tspan == full_prob.tspan, so the inherited span is checked end to end through MethodOfLines rather than merely being unused.
  • AGENTS.md records the convention. Its note from Give the reduced system its own time span #181 never actually reached main: the squash merge of that PR did not carry the file, which I confirmed with git log -S. This restores it covering both entry points, and corrects a now-stale line claiming a time span must be passed to build a problem.

Two full_problem.tspan uses remain in test/pod.jl. They are deliberate: they exercise the explicit-override path, which still has to work.

Verification

Julia 1.12.7, against ModelingToolkit 11.42.0 and ModelingToolkitBase 1.69.0 from the registry.

=== pod exit 0 (1111s)
POD graph size is grid-independent for array equations |    1      1   2.3s
scalarized POD Galerkin fallback                       |    5      5   7.8s
parameterized array POD                                |    5      5   5.2s
the POD reduced system carries a tspan                 |    5      5   2.2s

=== deim exit 0 (260s)
training parameters and nonautonomous nonlinearities   |    4      4   3.2s
ODEProblem sources and scalar code generation          |    9      9  18.4s
nonautonomous linear terms                             |    5      5   3.2s
the reduced system carries a tspan                     |    8      8   2.7s

The new pod testset covers all four cases: inherited from the problem, inherited from the system, absent when the source has none, and the problem building without an explicit span.

Runic --check ., typos, and git diff --check all exit 0.

Not verified

  • GROUP=QA and the docs build were not re-run; this adds no public name and changes no import. The README edit is not executed by the docs build.
  • Julia LTS and prerelease, and the downgrade configuration, were not run locally.

The rest of the chain, for context

ModelingToolkitBase 1.69.0 added the System field, ModelingToolkit 11.42.0 raised the floor that guarantees it, and PDEBase 0.1.35 sets the span on the system symbolic_discretize returns, so a MethodOfLines discretization carries the PDE's own t domain. All three are registered. SciML/MethodOfLines.jl#685 raises its floors to match and is still open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu

deim already inherited a time span; pod did not, so the POD Galerkin
examples still had to repeat the full problem's. Thread tspan through
_pod into the shared assembler, from prob.tspan for the problem method
and get_tspan(sys) for the system method, and drop the now-redundant
argument from the README, the docstring and the FitzHugh-Nagumo test.

Completes the ModelOrderReduction side of SciML#29, in 1.0.0 before release.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
ChrisRackauckas marked this pull request as ready for review September 9, 2026 10:20
@ChrisRackauckas
ChrisRackauckas merged commit a3f866e into SciML:main Sep 9, 2026
11 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