Skip to content

Document observed access and plotting from a live integrator - #5081

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:integrator-observed-plotting
Sep 7, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:integrator-observed-plotting

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed and why

docs/src/examples/interactive_simulation.md (added in
#5055) shows how to keep one integrator
alive and read a state variable from it, but not how to reach the quantities structural
simplification removed from the state vector — which is what a live display usually wants.
That was the follow-up raised in
#5006 (comment): the plot
recipe was not observed-aware, so the plot could not be updated from the integrator.

This adds a section covering integrator[obs], integrator(t; idxs = obs), and
plot(integrator; idxs = ...) with the same specifications plot(sol) takes, plus the one
semantic point that catches people out: plot(integrator) draws the current step, not the
accumulated history — plot integrator.sol for that.

Dependencies

The behavior this documents does not exist in the released packages. It needs:

This should not merge before both are registered.

Verification

The page uses plain ```julia fences, so Documenter does not execute them. I ran every added
line by hand against the two branches above:

integrator[energy] = 0.49999995413823406
integrator(integrator.t; idxs = energy) = 0.49999995413823406
integrator([integrator.tprev, integrator.t]; idxs = [pos, energy]) =
    [0.5938966746905806 0.5403021534151953; 0.4999999541414679 0.49999995413823406]
plot(integrator; idxs = energy) isa Plots.Plot = true
plot(integrator; idxs = [pos, energy]) isa Plots.Plot = true
plot(integrator; idxs = (pos, vel)) isa Plots.Plot = true

energy is the observed equation (pos^2 + vel^2) / 2 on an undamped oscillator with
input = 0, so 0.5 is the conserved value the example should report.

Full docs build (julia --project=docs docs/make.jl) exits 0 with no errors.

Also run: typos on the changed file.

Not verified

Nothing beyond the docs build was run; this PR is documentation only and changes no code.


This PR should be ignored until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam

The interactive-integrator page showed how to advance one integrator and read a
state variable, but not how to reach the quantities structural simplification
removed from the state vector, which is what a live display usually needs. It
also did not say that `plot(integrator)` takes the same `idxs` specifications as
`plot(sol)`, or that it draws the current step rather than the accumulated
history.

Depends on SciMLBase 3.52.0 and OrdinaryDiffEqCore 4.17.0; observed equations do
not resolve through the integrator interpolant or the integrator plot recipe
before those.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 7, 2026 06:50
@ChrisRackauckas
ChrisRackauckas merged commit 9ae5f9d into SciML:master Sep 7, 2026
4 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 7, 2026
- Add analytical parameter jacobian code generation (#5083)
- Document observed access and plotting from a live integrator (#5081)
- [bot] Solve implicit affects at the ODE solver's tolerance (#5080)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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