[Dev] Align the costate and dual signs of the JuMP models with OptimalControl

Ouverte
#326 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@ocots y travaille déjà.

Depuis le 4/11/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

Context

On the same problem and the same scheme (trapezoidal rule), the costate returned by the JuMP accessor costate(model) is the opposite of the costate of the OptimalControl solution. Example on beam, N = 100, trapezoid, Ipopt: objectives agree (8.89860 in both), but

OptimalControl  costate(sol)(0.5)   = [ 4.2e-6,  0.00795]
JuMP            costate(model)(0.5) = [-2.3e-5, -0.00800]

The documentation works around it by plotting -p(t) for JuMP (docs/src/tutorial-solve.md, docs/problems.jl), and the comparison tests do not compare costates.

What to do (later)

  • Apply the sign conventions of ct-conventions rules/signs.md (SGN1–SGN6, v0.10.0) to the JuMP side: costate and, when they are exposed, the duals of the constraints, so that the same constraint has the same dual in both modelings (SGN5).
  • Follow the ecosystem work on multipliers and duals: https://github.com/orgs/control-toolbox/discussions/68#discussioncomment-19323512 (not done yet); this issue waits for it.
  • Then remove the -p(t) workaround from the docs and add costate comparisons to the comparison tests.

Related: #283 (port to OptimalControl v2, JuMP → Solution), #284 (JuMP schemes), #170.

Langage dominant
Julia
Étoiles
13
Forks
1
Merge moyen
3 h 24 min
PR mergées (30 j)
34

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de control-toolbox/OptimalControlProblems.jl

Toutes les issues de control-toolbox/OptimalControlProblems.jl

Issues similaires

Plus d'issues Julia

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.