Jump to content

Double Tank: Difference between revisions

From mintOC
No edit summary
No edit summary
Line 72: Line 72:
== Reference Solution ==
== Reference Solution ==
By introducing the lifts <math>l_i=\sqrt{x_i}</math>, algebraically constrained as <math>l_i^2=x_i, \; l_i\geq 0,</math> the problem is recast with polynomial data. In this way way switch in connection with GloptiPoly3(Verlinkung),(Erklärung) can be applied.
By introducing the lifts <math>l_i=\sqrt{x_i}</math>, algebraically constrained as <math>l_i^2=x_i, \; l_i\geq 0,</math> the problem is recast with polynomial data. In this way way switch in connection with GloptiPoly3(Verlinkung),(Erklärung) can be applied.
The resulting NLP was implemented using CasADi 2.4.2 using CVodes as an integrator and IPOPT as a solver. The exact code used to solve the problem can be found under [[Gravity Turn Maneuver (Casadi)]].


== Source Code ==


== Source Code ==
Model descriptions are available in


With the parameters above, the optimal control problem was tested using the following code.
* [[:Category: switch | switch code]] at [[Double Tank Problem (switch)]]


== References ==
== References ==
CLAEYS, Mathieu; DAAFOUZ Jamal; HENRION Didier Modal occupation measures and LMI relaxations for nonlinear switched systems control. arXiv preprint arXiv:1404.4699 (2014)
VASUDEVAN, Ramanarayan, et al. Consistent Approximations for the Optimal Control of Constrained Switched Systems---Part 2: An Implementable Algorithm. SIAM Journal on Control and Optimization, 2013, 51. Jg., Nr. 6, S. 4484-4503.
<!--List of all categories this page is part of. List characterization of solution behavior, model properties, ore presence of implementation details (e.g., AMPL for AMPL model) here -->
[[Category:MIOCP]]
[[Category:ODE model]]

Revision as of 17:05, 10 December 2015

Double Tank
State dimension: 1
Differential states: 2
Continuous control functions: 0
Discrete control functions: 1
Interior point equalities: 2


The double tank problem is a basic example for a switching system. It contains the dynamics of an upper and a lower tank, connected to each other with a pipe. The goal is to minimize the deviation of a certain fluid level k2 in the lower tank. The problem was introduced and discussed in a variety of publications for the optimal control of constrained switched systems, e.g. Henrion et al. and Vasudevan et al.

Mathematical formulation

minσ0Tk1(x2k2)2dts.t.x˙1(t)=cσ(t)x1(t)for t[0,T],x˙2(t)=x2(t)x2(t)for t[0,T],xi(0)=xi0for i=1,2,σ(t){1,2}for t[0,T],


The two states of the system correspond to the fluid levels of an upper and a lower tank. The output of the upper tank flows into the lower tank, the output of the lower tank exits the system, and the flow into the upper tank is restricted to either c1 [lt/s] or c2 [lt/s]. The dynamics in each mode are then derived using Torricelli’s law, as shown in constraints 1 and 2. The objective of the optimization is to have the fluid level in the lower tank equal to k2 [m], as reflected in the cost function.

Parameters

In an exemplary test, the parameters were chosen to be:

State variables
Symbol Initial value (xi0)
x1(t) 2
x2(t) 2


Parameters
Symbol Value
k1 2
k2 3
c1 1
c2 2
T 10


Reference Solution

By introducing the lifts li=xi, algebraically constrained as li2=xi,li0, the problem is recast with polynomial data. In this way way switch in connection with GloptiPoly3(Verlinkung),(Erklärung) can be applied. The resulting NLP was implemented using CasADi 2.4.2 using CVodes as an integrator and IPOPT as a solver. The exact code used to solve the problem can be found under Gravity Turn Maneuver (Casadi).

Source Code

Model descriptions are available in

References

CLAEYS, Mathieu; DAAFOUZ Jamal; HENRION Didier Modal occupation measures and LMI relaxations for nonlinear switched systems control. arXiv preprint arXiv:1404.4699 (2014)
VASUDEVAN, Ramanarayan, et al. Consistent Approximations for the Optimal Control of Constrained Switched Systems---Part 2: An Implementable Algorithm. SIAM Journal on Control and Optimization, 2013, 51. Jg., Nr. 6, S. 4484-4503.