<p>Let's say I have an objective function <span class="math-container">$F$</span> with state variables <span class="math-container">$A,B,C$</span> and relative equations of motion, I can create the current time Hamiltonian with <span class="math-container">$H_C = F\{A,B,C\}+\alpha * \dot A+\beta * \dot B + \gamma \dot C$</span>, where <span class="math-container">$\alpha, \beta, \gamma$</span> are the 3 co-state variables (I'm omitting here the control variables).</p>
<p>But what if I also have a constraint that in each moment in time I must have something like <span class="math-container">$aA + bB + cC = k$</span> (where <span class="math-container">$a,b,c,k$</span> are fixed parameters) ? How do I set this constraint in the hamiltonian ?</p>
<p>Of course I could simply use only the <span class="math-container">$A,B$</span> variables, but then I still have an equation of motion for <span class="math-container">$C$</span> (in my application <span class="math-container">$A$</span>, <span class="math-container">$B$</span> and <span class="math-container">$C$</span> are different land use areas).</p>

CC BY-SA 4.0
2023-11-26T02:07:45.540Z
I think Dorfman might do a similar thing in this paper but I'm not absolutely certain because it's been a long time since I read it.  Check it out and see if it helps. https://www.andrew.cmu.edu/course/88-737/optimal_control/papers/dorfman.pdf
mark leeds
CC BY-SA 4.0
2023-11-28T21:23:16.937Z
In the meantime II have found [this](https://edisciplinas.usp.br/pluginfile.php/5458441/mod_resource/content/1/Aula%2013.pdf) where the constraint is simply added to the Hamilton to maximise with an ancillary variable, a bit like with the Lagrangian.
Antonello
<optimal-control><hamiltonian>
How to add a linear contraint between state variables to a current time Hamiltonian?
Antonello
# How to add a linear contraint between state variables to a current time Hamiltonian?

(Asked by: username_0 on 2023-11-24)

Let's say I have an objective function $F$ with state variables $A,B,C$ and relative equations of motion, I can create the current time Hamiltonian with $H\_C = F\{A,B,C\}+\alpha \* \dot A+\beta \* \dot B + \gamma \dot C$, where $\alpha, \beta, \gamma$ are the 3 co-state variables (I'm omitting here the control variables).

But what if I also have a constraint that in each moment in time I must have something like $aA + bB + cC = k$ (where $a,b,c,k$ are fixed parameters) ? How do I set this constraint in the hamiltonian ?

Of course I could simply use only the $A,B$ variables, but then I still have an equation of motion for $C$ (in my application $A$, $B$ and $C$ are different land use areas).

**Tags:** optimal-control, hamiltonian
> **Comments:**
> **username_1**: I think Dorfman might do a similar thing in this paper but I'm not absolutely certain because it's been a long time since I read it.  Check it out and see if it helps. https://www.andrew.cmu.edu/course/88-737/optimal_control/papers/dorfman.pdf  
> **username_0**: In the meantime II have found [this](https://edisciplinas.usp.br/pluginfile.php/5458441/mod_resource/content/1/Aula%2013.pdf) where the constraint is simply added to the Hamilton to maximise with an ancillary variable, a bit like with the Lagrangian.  

---

## 0 answers

