Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header told to run `julia --project=. docs/make.jl`, which activates the root environment first: shared dependencies then resolve from the root Manifest, against the note below it (docs/Manifest.toml must win) and against CTActions' documentation workflow, which runs with --project=docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Critical review before the page-by-page passA review of the hand-written pages as they stand on this branch, compared with what the sub-packages (CTBase, CTModels, CTParser, CTDirect, CTSolvers, CTFlows, CTLie) show in their own documentation and code, and with the presentation of OptimalControlProblems.jl. Every item has an identifier and a checkbox, so you can tick what you take. Overall. The pages are in good shape: executed examples, hidden
Method. Conventions: ct-conventions v0.14.0, ct-agents v0.5.0. Checks were run in the docs environment (
A. Fix first (facts)
B. What the sub-packages show and this site does not
C. Structure
D. Presentation
E. Suggested order
🤖 Generated with Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Issues opened for the code decisions of the review (section E, step 3):
🤖 Generated with Claude Code |
With CUDA and CUDSS loaded but not MadNLPGPU, the ExtensionError now names MadNLPGPU directly. The probe checks the new behaviour. Fixed upstream: control-toolbox/CTSolvers.jl#234 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The error raised by Lift on a HamiltonianVectorField now names Lift. The @repl block shows it. Fixed upstream: control-toolbox/CTLie.jl#41 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ditionError CTFlows#437 is fixed: the error is no longer a MethodError and says that variable_costate=true only works on the point call. Fixed upstream: control-toolbox/CTFlows.jl#437 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… explicit CTFlows#438 is fixed: - the gradients of the Hamiltonian and the pseudo-Hamiltonian take the short form (x, p) and (x, p, u), as well as the full form; the page shows both and checks them with hidden asserts; - an accessor on a state flow raises an IncorrectArgument that points to vector_field; the page shows it next to the Hamiltonian-flow case. Fixed upstream: control-toolbox/CTFlows.jl#438 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is built CTBase#570 was closed as not planned: a Julia function has no fixed arity, and a check at construction would reject valid laws. The MethodError at the call is the intended behaviour, so the page drops the link to the issue and adds a note that says why, and how to read the error. Decision: control-toolbox/CTBase.jl#570 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning title said that OpenLoop checks the arity of the law, which it does not. Retitle it, and drop the link to CTBase#570, closed as not planned: the MethodError at the call is the intended behaviour. Decision: control-toolbox/CTBase.jl#570 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment CTModels#435 is fixed: the error no longer is an obscure dimension mismatch, it lists what differs between the file and the model. Measured with JLD2 and JSON. Fixed upstream: control-toolbox/CTModels.jl#435 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tream - CTFlows#434 and #441: saveat no longer needs dense=false, and the point call of a flow built with saveat returns the value at the requested time. - CTFlows#436: a GPU flow called with host arrays raises a PreconditionError that says so (measured); without Mooncake, CTBase's check_backend raises an ExtensionError naming it (read in the code, no GPU to measure it here). Fixed upstream: control-toolbox/CTFlows.jl#434, control-toolbox/CTFlows.jl#436, control-toolbox/CTFlows.jl#441 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The box and path multipliers now have the same sign, and with :exa, dual on a boundary constraint throws a PreconditionError instead of returning zeros. The page already describes both; the probe still expected the old behaviour. CTDirect#639 (scaling) and CTParser#414 (:exa) stay open and are still checked. Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Before CTLie 0.3, the expansion … failed" describes a bug fixed upstream (CTLie#40). A user page states the current behaviour only (C2.1). Fixed upstream: control-toolbox/CTLie.jl#40 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ases "since CTParser 0.9.6" is history: the aliases are accepted by :exa in the version the docs use (CTParser#355, fixed). The open CTDirect#638 caveat stays. Fixed upstream: control-toolbox/CTParser.jl#355 Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SolverFailure is the exception a flow throws when an integration fails, and the only one of the seven typed exceptions OptimalControl did not import. It is now reachable as OptimalControl.SolverFailure (level 2, like the others), listed in the qualified API reference, and covered by the reexport test. Closes #1078 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
switching_times, phase_labels, has_switching, left_limit and right_limit read the structure a multi-phase flow keeps in its Solution. They are exported with the other Solution accessors (dual, iterations, ...), after a check that none clashes with OrdinaryDiffEqTsit5, Plots, NonlinearSolve or NLPModelsIpopt. switching_model stays in CTModels. Tests: the reexport test covers the five names, and a new test reads the structure of a two-phase time-minimal extremal through OptimalControl only (times, labels, the jump of the control, the continuity of the state and the costate), and checks a one-phase solution has none. The guide pages come with #992. Closes #1079 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ocp_solution only accepts the BuiltModel that build_model returns, and
neither was reachable from OptimalControl, so the exported nlp_model and
ocp_solution could not be chained. Both are now imported at level 2
(qualified), which closes the loop:
built = OptimalControl.build_model(docp, init, modeler)
stats = ipopt(built.nlp)
sol = ocp_solution(built, stats, modeler)
Tests: the reexport test covers the two names; a new test runs the whole
chain through OptimalControl for ADNLP and Exa, and checks it against solve
on the same discretized problem.
Closes #1077
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…veGrid A trajectory call takes a `grid` keyword: an integer, UniformGrid(n) or AdaptiveGrid(n), and by default an adaptive grid of 250 times. The two types were not reachable from OptimalControl. They are imported at level 2, like the other configuration objects; AbstractGrid and AutomaticGrid stay in CTFlows. `grid=n` stays the common spelling. Tests: the reexport test covers the two names and calls a flow with each, and checks the default 250-time grid. Review item A1 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Solution: the five switching accessors, with their guide pending in #992. - Qualified: build_model and BuiltModel (explicit mode, the stages of solve), UniformGrid and AdaptiveGrid (plotting a flow), SolverFailure. - Open holes: SolverFailure is implemented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
style.css defined .responsive-columns-40-60 twice. The first block, a copy of the left-priority layout, hid the last column under 700px (opacity 0, zero max-width and max-height); the second block stacks the columns but did not reset these properties, so on a phone the functional-API column of modelling/functional-api.md was invisible. The first block is removed: the two columns now stack, as the comment of the second block says. Review item A3 of #1063. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ymmetry statement - one commented using block at the top (OptimalControl, NLPModelsIpopt, CairoMakie, Colors) - the problem in two tabs (@def / Mathematics), link to the direct method, 400 time steps stated - the insertion values named and displayed with a hidden @show; the asserts reuse them - the symmetry statement made exact (rotated departure point), costate origin and direct-only note - Makie code without spaces around keyword equals; logo figure at half size Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The results shown at the end of a block were anonymous tuples. They are now displayed with their name, one per line, with `@show`: - the comparisons of the costs and of the final times (direct vs indirect) - the unknowns of the shooting (p0, junction times, jumps, variables) - "Your first problem": cost, iterations, status, state and control values The @show of the named unknowns is hidden, the displayed expressions of the comparisons are visible. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The shared stylesheet of control-toolbox.org resets the padding and the margin of every MathJax container, inline (#90) and display (#92). Its selectors outrank the bare mjx-container, so the template's padding and margin set here never applied. The comment said the padding gave display math its space, which is no longer true. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Status: the Examples section is doneAll eight examples have been read page by page in gallery order and committed, one commit per page, plus two commits that apply a choice to every example at once. The pages were built and read in a browser, not only in the diff. What changed across the examples
What it taught us about the direct methodThe dual of the direct method does not mean the same thing for the two orders of state constraint, and the page now says so:
Dividing every box multiplier by the step, as CTDirect.jl#639 asks, would fix the first case and break the second. The issue now carries both examples with measured values, the link between the KKT multipliers and the maximum principle (Cots, Gergaud and Goubinat, OCAM), the sign conventions, and a list of questions to settle (what Outside this repository
Not in this PR
|
…r min and max The pseudo-Hamiltonian is always maximised: p0 <= 0 for a minimisation, p0 >= 0 for a maximisation, with costate and duals unchanged (ct-conventions SGN1-SGN5). Explain the normalisation of state constraints and link the formulation, abstract syntax and dual variables pages. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…namics arguments Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…e, callbacks first Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… set - wrap the examples in ::::tabs with short labels, plus a legend before the tabs mapping each label to its gallery example - move the per-example using statements into hidden @setup blocks; a plain julia block announces the two packages before the tabs - drop the plot from the energy example and the Plots dependency - temporary draft mode kept for single-page preview Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Raw HTML headings render with the same .vp-doc h3 style but are not picked up by the outline extractor, keeping the right-side menu clean. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Headings inside the tabs leak into the page outline (the active panel's heading is scanned into the right-side menu); raw HTML is escaped by the VitePress pipeline, so plain bold keeps the titles out of the outline. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Remove the single-page draft setup and refresh the reproducibility snapshot (docs/src/assets Manifest/Project). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… hook Read back the executed model in the preview build instead of duplicating it: a `<!-- model: id -->` comment tags an executed `@example` problem and `@inspect-model <id> "fragment"…` blocks are rewritten at VitePress render time into that problem's code with warning highlights on matching lines (docs/src/.vitepress/inspect-model.ts, hooked in config.mts). The page itself: per-section lead-ins, the executed problem as the single source of truth for the highlighted display blocks, TimesModel and ConstraintsModel details with CTModels cross-references, a state box added to the richer example, :path (not :mixed) as the type of a mixed constraint, equality-on-variable constraints documented as boxes with an automatic label, `index` on a FreeTimeModel, distinct problem names in Time dependence, and the is_* aliases listed in a table. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Point the teach-prompt URLs (and the prefill links of the assistant buttons) at /stable/ rather than /dev/, fix the button colours to the actual brand colours (ChatGPT black, Claude terracotta, Copilot indigo, Gemini blue, Mistral orange, Perplexity teal), and invert the ChatGPT chip in dark mode the way OpenAI itself does. Also "In our tests" and a 600px cap on the rocket image. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…, and solving them yourself New page modelling/discretisation.md, after "Inspect a problem": - the direct method, moved from the Solve overview (anchor modelling-discretisation-direct-method; the ten links to the old anchor follow); - the four steps of `solve` (discretize, nlp_model, an NLP solver, ocp_solution); - the discretised problem: built once, solved with several modelers/solvers, warm-started from a solution; - the NLP models (ADNLPModel, ExaModel), evaluated through the NLPModels API; - solving the NLP with ipopt / madnlp called directly, and turning the stats back into a Solution with OptimalControl.build_model + ocp_solution, versus `solve`. The Solve overview keeps a short summary of the direct method; the "stages behind solve" section of Explicit mode keeps only solve(docp, init, modeler, solver) and points to the new page, which now carries the discretize/OrdinaryDiffEqTsit5 warning. Anchor added on "Discretisation schemes" (Choosing a method). The notebook link of the guided tour now targets the @id anchor (the old slug did not exist). NLPModels added to the docs environment (already in the manifest, v0.21.12) for obj/grad/cons/jac. Checked locally: draft build with the three executed pages opted out, CI=true, no warning, every hidden @Assert passing (ct-conventions v0.14.0, ct-agents v0.5.0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pages `import Pkg` (321575f) tripped the MOD3 guard test/suite/meta/test_no_import.jl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file itself was deleted in 89df4fb (staged by mistake with that docs commit); this commit removes its commented-out `include`. The file was added with its `include` already commented out (8aff195) and was never loaded. Its content is redundant or unwanted: `variable`, `constraint`, `objective` and `discretize` are already re-exported from CTModels and CTSolvers.DOCP, and the one addition, a `discretize(ocp)` with a default discretizer, is not wanted: discretising by hand is an advanced use, where the discretizer is chosen explicitly. Checked: test/suite/reexport, test/suite/meta, test/suite/solve/test_staged_pipeline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-level solve Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…-method - overview: @show for the success/status/violation checks. - Set up the single-page review: draft = true globally, Draft = false on choosing-a-method. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Emphasize the first-match rule of methods() with a tip and first(methods()) (also in explicit-mode). - Incompatible tokens: the rule is "no method contains every token", with a cross-family example (:adnlp + :gpu). - Schemes table: an explicit order column; the LQ convergence check moves into a details block with the output explained. - time_grid example commented; the :exa limitations (custom grid, Gauss-Legendre) are warnings. The time_grid + :exa failure is a DimensionMismatch, tracked as CTDirect#638. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Introduce the two action options up front, in a table; the routing story and its escape hatches (route_to, bypass) are signposted to their sections. - route_to section reordered: what it does first, then a note that no ambiguity exists today and that strategies declare a curated subset of options. - NotProvided vs OptimalControl defaults explained in a note, with verified examples (max_iter, mu_strategy, hessian_approximation). - Printed tables get headers; inspection blocks become @repl/@show. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Point to describe and the inspection sections right where options first appear; both sections get @id anchors. - Component types are not exported: a warning explains the clash with the solver modules (NLPModelsIpopt brings its own Ipopt). - Partial components: a warning that completed components only get default options — build them or use descriptive mode instead. - mode=:permissive documented as the constructor-level alternative to bypass for several undeclared options. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Intro says what the initial guess is (the starting point of the NLP iterations) and maps the page; a sentence introduces the usings. - Examples as @repl with one-line outputs; data lines silenced; the figure code of the obstacle example folded in a details block, with hidden asserts (the default guess reaches the better solution). - The two running problems in tabs. - Facts checked and added: linear interpolation on a time grid, held constant outside it; @init validates the guess itself; named tuples take component labels and (T, data) pairs; a grid spec referenced from a temporal one gives an UndefVarError. - Real error sessions for a wrong dimension and for init together with initial_guess; the indexed syntax x[1](t) becomes a warning (control-toolbox/CTParser.jl#434). - Warm start: grids may differ, links to grid and discrete continuation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Intro says what runs on the device (ExaModels with a CUDA backend, MadNLP with cuDSS) and maps the page; a sentence introduces the usings. - display=false silences MadNLP too: the print_level=MadNLP.ERROR advice and the `using MadNLP` of the timing block are dropped. - describe(:gpu) also lists :di and :sciml: they are the flows' ones. - Option defaults, describe and the CUDA.functional() guard as @repl; the guard now runs a real solve on either parameter; the problem's display hidden; the construction warning hidden without a device. - Combination errors are raised at construction or completion, not at compile time; the hard-coded "no functional device" message is gone. - make.jl back to draft = false: every page executes again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Status: Getting started, Modelling and Solve are doneEverything from the home page to the end of the Solve section (direct method) has now been read page by page, in sidebar order, and committed, one commit per page. Each page was built on its own (the other pages drafted) and read in the rendered output, with its examples executed. The branch is back to Still to read: Results, Flows, Geometry, Migration and About. Getting started
Modelling
Solve (direct)
Across these pages: Issues opened or followed during the pass
Conventions applied: ct-conventions v0.14.0, ct-agents v0.5.0. 🤖 Generated with Claude Code |
To do once CTSolvers is released:
|
Page-by-page proof-read of the hand-written documentation pages, in sidebar order. One commit per reviewed page.
Mechanics
draft = trueindocs/make.jl: the build skips every@example/@replblock. It is set back tofalseat the end of each section.@meta Draft = falseblock, so it is the only page that executes. The marker is removed before the page is committed.draftflip, no leftover@metablocks.Pages
Progress is reported in the commits (one per page) and in the status comments below; the latest one covers Getting started, Modelling and Solve (direct). Done: the Examples, Getting started, Modelling and Solve sections. Still to read: Results, Flows, Geometry, Migration, About. Generated
api/*.mdpages are out of scope;guided-tour.mdis edited throughdocs/src-literate/guided-tour.jl.🤖 Generated with Claude Code