[Cron/Doc] ModelingToolkit convergence cron, trajectories, and documentation (#308)
Mantenedores costumam responder em até 1 dia
@ocots já está trabalhando nisso.
Desde 8/11/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Agents: read the guide for agents in #310 first (order, difficulty, how to claim an issue, working method). Read
AGENTS.mdand clone.ct-conventions(v0.11.0) and.ct-agents(v0.4.0). Specification: this description and #308.
Sub-issue of #308, part 3 of 3. Depends on #438 (SolveModelingToolkit and test/suite/ModelingToolkit/).
Goal
Add the weekly ModelingToolkit convergence cron (test/cron/ModelingToolkit/test_convergence.jl) recording results and trajectories for the documentation results pipeline (#314), enable the Saturday cron schedule in .github/workflows/CronModelingToolkit.yml, and complete the documentation adapter and developer READMEs (docs/modelings.jl, docs/make.jl, docs/api_reference.jl, ext/README.md, test/README.md).
At the end of this issue, cron/ModelingToolkit runs end-to-end and generates its report and trajectory files, the documentation builds cleanly with the ModelingToolkit tab on bryson_denham's page, and all requirements of #308 are complete.
Technical Findings (from #308 preliminary checks)
- Convergence report (
test/cron/ModelingToolkit/test_convergence.jl):- Convergence is reported, never tested as a binary failure (#360).
- For a shooting method with piecewise-constant controls (
scheme = :shooting_singleor:shooting_multiple),reference_objective(problem; grid_size, scheme)has no trapezoidal entry inext/MetaData/references/<problem>.toml, soTestStatus.result!naturally recordsref_objective = nothingunless passed or matched, while the convergence script can also print both:- the gap to the analytic objective
OptimalControlProblems.analytic_reference(problem).value($J^* = 4.0$ forbryson_denham), and - the gap to the OptimalControl trapezoidal reference
OptimalControlProblems.reference_objective(problem; grid_size, scheme=:trapezoid).
- the gap to the analytic objective
- Trajectories &
ProblemPlot.vue(#314):docs/src/components/ProblemPlot.vuechecksif (data[group][name])forgroup in ['state', 'control', 'costate']. SinceCorleoneis a direct shooting solver without explicit costates, passingcostate = Dict{String, Vector{Float64}}()in thetrajectoryreturned bySolveModelingToolkit.trajectorycausesProblemPlot.vueto cleanly omit the Costate section and plot State and Control trajectories.docs/make.jldoes not runCorleoneat build time (it only reads source files and precomputed JSONs fromresults), sodocs/Project.tomlonly needsModelingToolkit(to loadModelingToolkitModelsfordocs/api_reference.jl), notCorleone.
- Documentation problem page adapter (
docs/modelings.jl):- Verify and polish the
:ModelingToolkit => ModelingAdapter(...)entry indocs/modelings.jlso theModelingToolkittab onproblems/bryson_denham.mdshows:- how to retrieve the continuous
ModelingToolkit.System(pb = bryson_denham(ModelingToolkitBackend()); sys = model(pb)), - how to discretize the path constraint on a constraint grid, build a
CorleoneDynamicOptProblemwith our sharedinitial_guess(pb), and solve it withIpopt, - the note required by #308: "With direct shooting in Corleone, the state path constraint is enforced at the points of a constraint grid, and controls are piecewise constant on a control grid."
- how to retrieve the continuous
- Verify and polish the
Mandatory Rules & Conventions (ct-conventions v0.11.0, #310)
- Worktree per issue (
#310rule 3a): Never edit or switch branches in the main checkout. Use a dedicated worktree (git worktree add ../OptimalControlProblems-<issue> -b feat/<issue>-mtk-cron-docs main). - Qualified imports only (
MOD3,MOD4): Always useusing Pkg: Pkg, sym. Never use bareusing Pkgorimport. - No hand-written problem lists (
test_no_handwritten_listintest/suite/core/test_consistency.jl): Intest/cron/ModelingToolkit/test_convergence.jl, loop over problems usingMain.TestStatus.for_each_problem(..., OptimalControlProblems.ModelingToolkitBackend()); never hardcode:bryson_denham. - Docstrings (
DOC1–DOC8) & Site rules (SITE1–SITE18): Verify the documentation builds without warnings or errors.
Detailed Implementation Plan
Files to Create or Modify
| File | Action | Details |
|---|---|---|
test/cron/ModelingToolkit/test_convergence.jl |
Create | Run every problem in ModelingToolkitBackend() across CONFIGS.ModelingToolkit on its default grid (max_iter=1000, tol=1e-6). Record Main.TestStatus.result! with trajectory = SolveModelingToolkit.trajectory(...) and log comparisons against analytic_reference(problem) and reference_objective(problem; grid_size, scheme=:trapezoid). |
.github/workflows/CronModelingToolkit.yml |
Modify | Uncomment the Saturday schedule (cron: "0 4 * * 6"). |
tools/cron/report.py |
Modify | Update _CADENCE_NOTE so ModelingToolkit is listed among active weekly crons (Saturday 04:00 UTC). |
docs/modelings.jl |
Modify | Polish the :ModelingToolkit ModelingAdapter snippet and explanatory note on shooting with Corleone (piecewise-constant controls on control grid, path constraints sampled on constraint grid). |
docs/Project.toml & docs/make.jl & docs/api_reference.jl |
Modify | Add ModelingToolkit to docs/Project.toml, load using ModelingToolkit: ModelingToolkit in docs/make.jl, and include :ModelingToolkitModels in docs/api_reference.jl. |
ext/README.md & test/README.md |
Modify | Document ext/ModelingToolkitModels.jl, ext/ModelingToolkitModels/, test/suite/ModelingToolkit/, and test/cron/ModelingToolkit/. |
Verification Commands
julia --project=. -e 'using Pkg; Pkg.test(test_args=["cron/ModelingToolkit"])'
julia --project=. -e 'using Pkg; Pkg.test(test_args=["suite/core"])'
julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=".")); Pkg.instantiate(); include("docs/make.jl")'
Done when
-
test/cron/ModelingToolkit/test_convergence.jlruns cleanly, writestest/reports/ModelingToolkit-cron.{md,json}and trajectory files, and prints gaps to both the analytic objective and the OptimalControl reference objective. -
.github/workflows/CronModelingToolkit.ymlhas its Saturday cron enabled andtools/cron/report.pyreflects it. -
docs/make.jlbuilds cleanly; thebryson_denhampage shows theModelingToolkittab (retrieve continuousSystem, then solve withCorleone) without problem-specific code in the page generator. -
ext/README.mdandtest/README.mdare updated.
Refs #308, #305, #307, #310, #314
- Linguagem predominante
- Julia
- Estrelas
- 13
- Forks
- 1
- Merge médio
- 3h 33min
- PRs com merge (30d)
- 55
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de control-toolbox/OptimalControlProblems.jl
-
[Tests] Corleone solve helper and ModelingToolkit test suite (smoke, equivalence, reference solution) (#308)Talvez já em andamento @ocots assumiu hoje. Abertafeature
control-toolbox/OptimalControlProblems.jl#438 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
[Problems] ModelingToolkitBackend, extension ModelingToolkitModels, and continuous bryson_denham (#308)Talvez já em andamento @ocots assumiu hoje. Abertafeature
control-toolbox/OptimalControlProblems.jl#437 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
cron-convergence
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 32/100
control-toolbox/OptimalControlProblems.jl#436 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Cron] cron-failureAbertacron-failure
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
control-toolbox/OptimalControlProblems.jl#435 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
[Dev] Expose the duals of the JuMP path, boundary and box constraints, aligned with signs.mdTalvez já em andamento @ocots assumiu hoje. Aberta
control-toolbox/OptimalControlProblems.jl#430 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de control-toolbox/OptimalControlProblems.jl
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
Mantenedores costumam responder em até 1 dia
-
lux
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100