[Dev] One source of truth per problem, and the equality of the modelings checked by computation
Maintainer antworten meist innerhalb von 1 Tag
@ocots arbeitet bereits daran.
Seit 06.11.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Written by Claude (Claude Code) at the request of ocots, from a design discussion with ocots.
Goal
Each problem should have one source of truth for what is shared between modelings, and an automatic check for what is written more than once. Today a problem is written once per modeling (OptimalControl @def, its scalarized variant, JuMP), plus its metadata. Nothing checks that the dynamics, costs and constraints of two modelings are the same function. #371 compares NLPs, which happens after discretization and mixes the formulation with the transcription.
What we know
- Declarative data (parameters, bounds, initial guess, reference values, names) can be shared directly: #377 (shared initial guess), #379 (declared fields), #376 (features computed from the model).
ProblemData(ext/JuMPModels/schemes/data.jl, #368, #369) already describes a problem by continuous functions(x, u, v, t), with no discretization in it. These functions are generic Julia code. They can be called with numbers, JuMP variables or symbolic variables, so the same data could feed a ModelingToolkit modeling (#308).- The
@defmodels stay hand-written. They are the showcase of OptimalControl, and two independent writings make a better oracle than one generated from the other. - Exa is the only reason OptimalControl needs
@def. The Exa model is generated from the syntax by CTParser (build_examodel). A model built from functions with the functional API of CTModels has no Exa builder. control-toolbox/CTDirect.jl#673 removes this limit: the components get a traceable form, and one transcription in CTDirect serves every modeler.
Proposal (to be discussed)
- Shared declarative data: one source per problem, read by every modeling (#377, #379).
- Equality of the functions, by computation: for every problem available in both OptimalControl and JuMP, evaluate the dynamics, the Lagrange and Mayer costs, and the path and boundary constraints of the
@defmodel and ofProblemDataat random points, and require equality. This checks the formulation before any discretization, without a hand-written list. Differences that are wanted (scaling withstate_expressions, component names) must be recognised by computation and reported. - ModelingToolkit (optional): build the MTK modeling from
ProblemDatainstead of writing it by hand (#308). - Target, after control-toolbox/CTDirect.jl#673: a
ProblemDatacould become a CTModelsModelwith its traceable form, hence solvable with Exa without@def. Its transcription by CTDirect would then be compared with the hand-written JuMP transcription (schemes/build.jl), which stays an independent oracle.
Related
#257, #284, #308, #371, #376, #377, #379; control-toolbox/CTDirect.jl#673 and control-toolbox/CTDirect.jl#674.
How to work on this theme
This is a theme issue: it describes the work to do and what is known so far, it is not meant to be closed by a single PR.
- Whoever takes it first defines the work precisely and splits it into sub-issues (they can live in any repository of the organization).
- Work proceeds through the sub-issues; tick the checklist below as they are closed.
- Close the theme when everything is done or explicitly dropped.
Sub-issues
- to be created when the theme is taken
- Vorherrschende Sprache
- Julia
- Sterne
- 13
- Forks
- 1
- Ø Merge
- 3 Std. 33 Min.
- Gemergte PRs (30 T.)
- 55
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus control-toolbox/OptimalControlProblems.jl
-
[Cron/Doc] ModelingToolkit convergence cron, trajectories, and documentation (#308)Evtl. vergeben @ocots hat das heute übernommen. Offendocumentation feature
control-toolbox/OptimalControlProblems.jl#439 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Tests] Corleone solve helper and ModelingToolkit test suite (smoke, equivalence, reference solution) (#308)Evtl. vergeben @ocots hat das heute übernommen. Offenfeature
control-toolbox/OptimalControlProblems.jl#438 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Problems] ModelingToolkitBackend, extension ModelingToolkitModels, and continuous bryson_denham (#308)Evtl. vergeben @ocots hat das heute übernommen. Offenfeature
control-toolbox/OptimalControlProblems.jl#437 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
cron-convergence
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 32/100
control-toolbox/OptimalControlProblems.jl#436 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Cron] cron-failureOffencron-failure
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
control-toolbox/OptimalControlProblems.jl#435 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in control-toolbox/OptimalControlProblems.jl
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
Maintainer antworten meist innerhalb von 1 Tag
-
lux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100