[Metadata] Computed features, reference objective, shared initial guess
I maintainer di solito rispondono entro 1 giorno
@ocots ci sta già lavorando.
Dal 4/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Agents: read the guide for agents in #310 first (order, difficulty, how to claim an issue, working method). The specification is in this description and in the comments below.
Goal
Separate what is computed about a problem from what is declared in its metadata, add the declared fields the tests, the crons and the benchmarks need, and make the metadata the single source of the initial guess shared by every modeling (#151).
Part of #310, step 5. Depends on #283 (continuous problems, Problem) and #303 (statuses). Used by #304 (comparison rule), #305 (crons), #307 (documentation pages).
Current state
metadata(:p)holds:grid_sizeand:parameters(ext/MetaData/<p>.jl, anOrderedDict); types checked at load time (METADATA_INFOS,METADATA_TYPESinsrc/OptimalControlProblems.jl).- The documentation browser already computes dimensions, cost kind (Mayer / Lagrange / Bolza), fixed or free final time and constraint counts from the
ocp(docs/browser.jl:742-767,collect_problem_data). - Initial guesses are written in each model file: in
ext/OptimalControlModels/mostly constants (xinit = [0.1, 0.1]), one function of time, and one defined on the grid (xinit = [[…] for i in 0:N]), which cannot exist for a continuous problem; JuMP models use constantstart=values.
Computed, never written by hand
A function (e.g. features(:beam)) computes, when an extension is loaded: dimensions, cost kind, fixed or free initial and final times, kinds and counts of constraints (box on state / control / variable, nonlinear path, boundary). From the ocp (OptimalControl modelings), or from the keys stored in the JuMP model for problems available in JuMP only. Move the computation out of docs/browser.jl into it; the documentation (browser, status page) and CTBenchmarks read it.
Declared fields
| Field | Content |
|---|---|
:grid_size, :parameters |
unchanged |
:status, :notes |
see #303 |
:known_failures |
see #305 |
:reference_objective |
see below |
:init |
see below |
:tags |
controlled vocabulary defined in src and checked by the tests (e.g. :hard from CTDirect#580, :analytic, :large_state) |
:references |
bibliographic sources of the problem (literature values of the objective, when known, go here as information) |
:corleone |
name of the matching problem in Corleone's OptimalControlBenchmarks, and whether the formulation is the same (#308) |
:reference_solution |
optional: analytic x(t), u(t), for convergence orders |
Every field is type-checked at load time and by the consistency tests of #304.
:reference_objective
Entries (value, source, grid_size, scheme, …), with a priority order:
- Analytic value, when it exists:
source = :analytic,grid_size = nothing, with the reference where it is derived. - Otherwise, computed by us on a fine grid:
source = :computed, with the configuration used (grid size, scheme, modeler, solver, tolerances) and the package versions. A script (e.g.scripts/reference_objective.jl) computes and writes these entries, so they are never typed by hand; it is rerun when a problem or its parameters change.
The source is always stated, in the metadata and in the documentation. For a problem available in one modeling only, a :computed reference is a regression check (it detects changes), not an independent validation: the status page (#307) shows it as such.
Tolerance: to decide later, from the first cron results (#305). Until then the crons report the relative gap to the reference without failing on it.
:init
The initial guess of every modeling comes from the metadata, no longer from each model file:
- format
(state=…, control=…, variable=…); each component a constant, a vector, or a function oft, never data on a grid; - OptimalControl and OptimalControlScalarized: passed as is (
Problem.init, #283); - JuMP: evaluated at the nodes, with the number of controls of the scheme (
N+1for trapezoid,Nfor Euler and midpoint, see #284); - overridable:
beam(JuMPBackend(); init=…), andinit=insolveon the OptimalControl side; - rewrite the grid-defined guess as a function of
t, and check the problem still converges; - the tests check that the OptimalControl guess and the JuMP start values coincide at the nodes (today
test_init).
Not now
:expected_structure (smooth, bang-bang, singular, state constraints) is dropped: it depends on the parameters, and doing it properly means a list of arcs and switching times. To revisit with indirect methods.
Done when
-
features(:p)computed from the model;docs/browser.jluses it. - Declared fields above with type checks; consistency tests cover them.
-
:reference_objectivefor every problem: analytic where it exists, otherwise computed by the script, source stated. - Initial guesses read from the metadata by every modeling; no initial guess left in the model files; the grid-defined one rewritten.
- Initial guess documented (#151), with how to override it.
- Lingua principale
- Julia
- Stelle
- 13
- Fork
- 1
- Merge medio
- 3h 20m
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di control-toolbox/OptimalControlProblems.jl
-
[Metadata] Declared fields: tags, references, Corleone, reference solutionForse già presa @ocots l’ha presa oggi. Aperta
control-toolbox/OptimalControlProblems.jl#379 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Cron] Robustness of the initial guess and known local objectivesForse già presa @ocots l’ha presa oggi. Aperta
control-toolbox/OptimalControlProblems.jl#378 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Metadata] Shared initial guess in the metadata, read by every modelingForse già presa @ocots l’ha presa oggi. Aperta
control-toolbox/OptimalControlProblems.jl#377 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Metadata] Compute the features of a problem from its modelForse già presa @ocots l’ha presa oggi. Aperta
control-toolbox/OptimalControlProblems.jl#376 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Metadata] Reference objectives per scheme, computed by a scriptForse già presa @ocots l’ha presa oggi. Aperta
control-toolbox/OptimalControlProblems.jl#375 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di control-toolbox/OptimalControlProblems.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
backport 1.14 GC
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
`binary_focal_loss` throws a `DomainError` when a negative sample has `ŷ = 1`Forse già presa @parth-patel010 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FluxML/Flux.jl#2818 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaDiff/TaylorSeries.jl#445 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
control-toolbox/CTActions#139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno