<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mintoc.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AlexanderBuchner</id>
	<title>mintOC - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://mintoc.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AlexanderBuchner"/>
	<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Special:Contributions/AlexanderBuchner"/>
	<updated>2026-06-09T07:58:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://mintoc.de/index.php?title=User:AlexanderBuchner&amp;diff=411</id>
		<title>User:AlexanderBuchner</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=User:AlexanderBuchner&amp;diff=411"/>
		<updated>2009-04-11T07:31:43Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Just created this page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Prevent creation of a table of content --&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- User image&lt;br /&gt;
  You have to upload it first. &lt;br /&gt;
  If you do not want an image comment out the following line. &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
== Personal ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Name&#039;&#039;&#039;: || Alexander Buchner&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Affiliation&#039;&#039;&#039;: || [http://www.iwr.uni-heidelberg.de Interdisciplinary Center for Scientific Computing], [http://www.uni-heidelberg.de University of Heidelberg]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Background&#039;&#039;&#039;: || Mathematics&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
== Contact ==&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Address&#039;&#039;&#039;: || Im Neuenheimer Feld 368, 69120 Heidelberg, Germany&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Web&#039;&#039;&#039;:     || [http://mathopt.uni-hd.de http://mathopt.uni-hd.de]&lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Email&#039;&#039;&#039;:   || alexander.buchner -- iwr.uni-heidelberg.de&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;PGP-key&#039;&#039;&#039;: || [http://www.rzuser.uni-heidelberg.de/~abuchner/pgp.asc]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Categories&lt;br /&gt;
  Here you can list the categories you are interested in.&lt;br /&gt;
  You can find a list of all categories at [[Special:Categories]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:Community]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=378</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=378"/>
		<updated>2008-11-29T19:14:36Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Parameters */ Put the parameters into a table, added descriptions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened. This valve controls the flow of refrigerant into the evaporator, where it absorbs heat from the surrounding air. The refrigerated air then creates the well-known air-curtain at the front of the display case.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- bgcolor=#c7c7c7&lt;br /&gt;
! Symbol !! Value !! Unit !! Description&lt;br /&gt;
|- &lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\dot{Q}_{airload}&amp;lt;/math&amp;gt; || align=right | 3000.00 || &amp;lt;math&amp;gt;\frac{J}{s}&amp;lt;/math&amp;gt; || Disturbance, heat transfer from outside the display case&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\dot{m}_{ref,const}&amp;lt;/math&amp;gt; || align=right | 0.20 || &amp;lt;math&amp;gt;\frac{kg}{s}&amp;lt;/math&amp;gt; || Disturbance, constant mass flow of refrigerant&lt;br /&gt;
from unmodeled entities &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;M_{goods}&amp;lt;/math&amp;gt; || align=right | 200.00 || &amp;lt;math&amp;gt;kg&amp;lt;/math&amp;gt; || Mass of goods &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_{p,goods}&amp;lt;/math&amp;gt; || align=right | 1000.00 || &amp;lt;math&amp;gt;\frac{J}{kg \cdot K}&amp;lt;/math&amp;gt; || Heat capacity of goods&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;&lt;br /&gt;
UA_{goods-air} &amp;lt;/math&amp;gt; || align=right | 300.00 || &amp;lt;math&amp;gt;\frac{J}{s \cdot K}&amp;lt;/math&amp;gt; || Heat transfer coefficient between goods&lt;br /&gt;
and air &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;M_{wall} &amp;lt;/math&amp;gt; || align=right | 260.00 || &amp;lt;math&amp;gt;kg&amp;lt;/math&amp;gt; || Mass of evaporator wall &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_{p,wall} &amp;lt;/math&amp;gt; || align=right | 385.00 || &amp;lt;math&amp;gt;\frac{J}{kg \cdot K}&amp;lt;/math&amp;gt; || Heat capacity of evaporator wall&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;UA_{air-wall}&amp;lt;/math&amp;gt; || align=right | 500.00 || &amp;lt;math&amp;gt;\frac{J}{s \cdot K}&amp;lt;/math&amp;gt; || Heat transfer coefficient between air and&lt;br /&gt;
wall&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;M_{air}&amp;lt;/math&amp;gt; || align=right | 50.00 || &amp;lt;math&amp;gt;kg&amp;lt;/math&amp;gt; || Mass of air in display case &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_{p,air}&amp;lt;/math&amp;gt; || align=right | 1000.00 || &amp;lt;math&amp;gt;\frac{J}{kg \cdot K}&amp;lt;/math&amp;gt; || Heat capacity of air&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;UA_{wall-ref,max}&amp;lt;/math&amp;gt; || align=right | 4000.00 || &amp;lt;math&amp;gt;\frac{J}{s \cdot K}&amp;lt;/math&amp;gt; || Maximum heat transfer coefficient between&lt;br /&gt;
refrigerant and evaporator wall&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\tau_{fill}&amp;lt;/math&amp;gt; || align=right | 40.00 || &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; || Parameter describing the filling time of the&lt;br /&gt;
evaporator under opened valve &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;T_{SH}&amp;lt;/math&amp;gt; || align=right | 10.00 || &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; || Superheat in the suction manifold&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;M_{ref,max}&amp;lt;/math&amp;gt; || align=right | 1.00 || &amp;lt;math&amp;gt;kg&amp;lt;/math&amp;gt; || Maximum mass of refrigerant in evaporator&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;V_{suc}&amp;lt;/math&amp;gt; || align=right | 5.00 || &amp;lt;math&amp;gt;m^3&amp;lt;/math&amp;gt; || Total volume of suction manifold&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;V_{sl}&amp;lt;/math&amp;gt; || align=right | 0.08 || &amp;lt;math&amp;gt;\frac{m^3}{s}&amp;lt;/math&amp;gt; || Total displacement volume&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\eta_{vol}&amp;lt;/math&amp;gt; || align=right | 0.81 || &amp;lt;math&amp;gt;-&amp;lt;/math&amp;gt; || Volumetric efficiency&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;350px&amp;quot; heights=&amp;quot;300px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:FridgeControlsRelaxed.png| Optimal relaxed control.&lt;br /&gt;
 Image:FridgeControls.png| Optimal integer control.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* The differential equation for the mass of the refrigerant had another switch, if the valve (e.g. &amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt;) is closed. It was formulated this way:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dot{x_4} =  \begin{cases}&lt;br /&gt;
&lt;br /&gt;
\dfrac{M_{ref,max} - x_4}{\tau_{fill}} &amp;amp; \qquad \text{if} \quad u_0 = 1 \\ \\&lt;br /&gt;
- \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} x_4 \big( x_2 - T_e(x_0) \big) &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and}\quad  x_4 &amp;gt; 0 \\ \\ &lt;br /&gt;
0 &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and} \quad x_4 = 0&lt;br /&gt;
&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This additional switch is redundant because the mass itself is a factor on the right hand side and so the complete right hand side is 0 if &amp;lt;math&amp;gt;x_4 = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Periodic]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Car_testdrive_(lane_change_manoeuvre)&amp;diff=356</id>
		<title>Car testdrive (lane change manoeuvre)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Car_testdrive_(lane_change_manoeuvre)&amp;diff=356"/>
		<updated>2008-11-26T13:25:13Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 7&lt;br /&gt;
|nu        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nri       = 7&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The testdrive control problem is a time optimal double lane change maneouvre with gear shift. It has been introduced as a benchmark problem for mixed-integer optimal control by &amp;lt;bibref&amp;gt;Gerdts2005&amp;lt;/bibref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. &lt;br /&gt;
&lt;br /&gt;
The vehicle dynamics are based on a single-track model, derived under the simplifying assumption that rolling and pitching of the car body can be neglected. Consequentially, only a single front and rear wheel is modeled, located in the virtual center of the original two wheels. Motion of the car body is considered on the horizontal plane only.&lt;br /&gt;
&lt;br /&gt;
Four controls represent the driver&#039;s choice on steering and velocity. We denote with &amp;lt;math&amp;gt;w_\delta&amp;lt;/math&amp;gt; the steering wheel&#039;s angular velocity. The force &amp;lt;math&amp;gt;F_\text{B}&amp;lt;/math&amp;gt; controls the total braking force, while the accelerator pedal position &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is translated into an accelerating force. Finally, the selected gear &amp;lt;math&amp;gt;\mu&amp;lt;/math&amp;gt; influences the effective engine torque&#039;s transmission.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resulting MIOCP ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x(\cdot), u(\cdot), \mu(\cdot)} &amp;amp; t_\text{f}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x}(t) &amp;amp; = &amp;amp; f(t, x(t), u(t), \mu(t)), \\&lt;br /&gt;
 &amp;amp; x(t_0) &amp;amp;=&amp;amp; x_0, \\&lt;br /&gt;
 &amp;amp; r(t,x(t),u(t)) &amp;amp;\geq&amp;amp; 0, \\&lt;br /&gt;
 &amp;amp; \mu(t) &amp;amp;\in&amp;amp;  \{1, 2, 3, 4, 5\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- bgcolor=#c7c7c7&lt;br /&gt;
! Symbol !! Value !! Unit !! Description&lt;br /&gt;
|- &lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; || align=right | 1.239e+3 || kg || Mass of the car&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;g&amp;lt;/math&amp;gt; || align=right | 9.81 || m/s^2 || Gravity constant&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;l_\text{f}&amp;lt;/math&amp;gt; || align=right | 1.19016 || m || Front wheel distance to center of gravity&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;l_\text{r}&amp;lt;/math&amp;gt; || align=right | 1.37484 || m || Rear wheel distance to center of gravity&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;e_\text{SP}&amp;lt;/math&amp;gt; || align=right | 0.5 || m || Drag mount point distance to center of gravity&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; || align=right | 0.302 || m || Wheel radius&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;I_\text{zz}&amp;lt;/math&amp;gt; || align=right | 1.752e+3 || kg m^2 || Moment of inertia&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;c_\text{w}&amp;lt;/math&amp;gt; || align=right | 0.3 || - || Air drag coefficient&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\varrho&amp;lt;/math&amp;gt; || align=right | 1.249512 || kg/m^3 || Air density&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; || align=right | 1.4378946874 || m^2 || Effective flow surface&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;i_\text{g}&amp;lt;/math&amp;gt; || align=right | 3.09, 2.002, 1.33, 1.0, 0.805 || - || Transmission ratios for the five gears&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;i_\text{t}&amp;lt;/math&amp;gt; || align=right | 3.91 || - || Engine transmission ratio&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;B_\text{f}&amp;lt;/math&amp;gt; || align=right | 1.096e+1 || - || Pacejka coefficients (stiffness)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;B_\text{r}&amp;lt;/math&amp;gt; || align=right | 1.267e+1 || - || &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_\text{f}&amp;lt;/math&amp;gt; || align=right | 1.3 || - || Pacejka coefficients (shape)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_\text{r}&amp;lt;/math&amp;gt; || align=right | 1.3 || - || &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;D_\text{f}&amp;lt;/math&amp;gt; || align=right | 4.5604e+3 || - || Pacejka coefficients (peak)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;D_\text{r}&amp;lt;/math&amp;gt; || align=right | 3.94781e+3 || - || &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;E_\text{f}&amp;lt;/math&amp;gt; || align=right | -0.5 || - || Pacejka coefficients (curvature)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;E_\text{r}&amp;lt;/math&amp;gt; || align=right | -0.5 || - || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test course ==&lt;br /&gt;
&lt;br /&gt;
The double-lane change manoeuvre presented in &amp;lt;bibref&amp;gt;Gerdts2005&amp;lt;/bibref&amp;gt; is realized by constraining the car&#039;s position onto a prescribed track at any time &amp;lt;math&amp;gt;t\in[t_0,t_\text{f}]&amp;lt;/math&amp;gt;. Starting in the left position with an initial prescribed velocity, the driver is asked to manage a change of lanes modeled by an offset of 3.5 meters in the track. Afterwards he is asked to return to the starting lane. This manoeuvre can be regarded as an overtaking move or as an evasive action taken to avoid hitting an obstacle suddenly appearing on the starting lane.&lt;br /&gt;
&lt;br /&gt;
From a mathematical point of view, the test track is described by setting up piecewise cubic spline functions &amp;lt;math&amp;gt;P_\text{l}(x)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_\text{r}(x)&amp;lt;/math&amp;gt; modeling the top and bottom track boundary, given a horizontal position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P_\text{l}(x) &amp;amp;:=&amp;amp; \left\{ &lt;br /&gt;
	\begin{array}{llrcl}&lt;br /&gt;
		0                        &amp;amp; \text{if } &amp;amp;        &amp;amp; x &amp;amp; \leq 44, \\&lt;br /&gt;
		4\; h_2\; (x-44)^3       &amp;amp; \text{if } &amp;amp; 44 &amp;lt;   &amp;amp; x &amp;amp; \leq 44.5, \\&lt;br /&gt;
		4\; h_2\; (x-45)^3 + h_2 &amp;amp; \text{if } &amp;amp; 44.5 &amp;lt; &amp;amp; x &amp;amp; \leq 45, \\&lt;br /&gt;
		h_2                      &amp;amp; \text{if } &amp;amp; 45 &amp;lt;   &amp;amp; x &amp;amp; \leq 70, \\&lt;br /&gt;
		4\; h_2\; (70-x)^3 + h_2 &amp;amp; \text{if } &amp;amp; 70 &amp;lt;   &amp;amp; x &amp;amp; \leq 70.5, \\&lt;br /&gt;
		4\; h_2\; (71-x)^3       &amp;amp; \text{if } &amp;amp; 70.5 &amp;lt; &amp;amp; x &amp;amp; \leq 71, \\&lt;br /&gt;
		0                        &amp;amp; \text{if } &amp;amp; 71 &amp;lt;   &amp;amp; x. &amp;amp;  \\&lt;br /&gt;
	\end{array} \right.  \\&lt;br /&gt;
P_\text{u}(x) &amp;amp;:=&amp;amp; \left\{ &lt;br /&gt;
	\begin{array}{llrcl}&lt;br /&gt;
		h_1                            &amp;amp; \text{if } &amp;amp;        &amp;amp; x &amp;amp; \leq 15, \\&lt;br /&gt;
		4\; (h_3-h_1)\; (x-15)^3 + h_1 &amp;amp; \text{if } &amp;amp; 15 &amp;lt;   &amp;amp; x &amp;amp; \leq 15.5, \\&lt;br /&gt;
		4\; (h_3-h_1)\; (x-16)^3 + h_3 &amp;amp; \text{if } &amp;amp; 15.5 &amp;lt; &amp;amp; x &amp;amp; \leq 16, \\&lt;br /&gt;
		h_3                            &amp;amp; \text{if } &amp;amp; 16 &amp;lt;   &amp;amp; x &amp;amp; \leq 94, \\&lt;br /&gt;
		4\; (h_3-h_4)\; (94-x)^3 + h_3 &amp;amp; \text{if } &amp;amp; 94 &amp;lt;   &amp;amp; x &amp;amp; \leq 94.5, \\&lt;br /&gt;
		4\; (h_3-h_4)\; (95-x)^3 + h_4 &amp;amp; \text{if } &amp;amp; 94.5 &amp;lt; &amp;amp; x &amp;amp; \leq 95, \\&lt;br /&gt;
		h_4                            &amp;amp; \text{if } &amp;amp; 95 &amp;lt;   &amp;amp; x. &amp;amp;  \\&lt;br /&gt;
	\end{array} \right.  &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;B=1.5\;\text{m}&amp;lt;/math&amp;gt; is the car&#039;s width and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
	h_1 := 1.1\; B + 0.25, \quad&lt;br /&gt;
	h_2 := 3.5, \quad&lt;br /&gt;
	h_3 := 1.2\; B + 3.75,\quad&lt;br /&gt;
	h_4 := 1.3\; B + 0.25.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:test-course.png|Test course for the double lane change manoeuvre]]&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
Reference solutions for the case of a fixed time-grid are given in &amp;lt;bibref&amp;gt;Gerdts2005&amp;lt;/bibref&amp;gt;. Solutions for a non-fixed time grid are given in &amp;lt;bibref&amp;gt;Gerdts2006&amp;lt;/bibref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Controls&lt;br /&gt;
double C_steer = u[0];&lt;br /&gt;
double C_brake = u[1];&lt;br /&gt;
double C_acc   = u[2];&lt;br /&gt;
&lt;br /&gt;
// Differential states&lt;br /&gt;
double X_v     = xd[2];&lt;br /&gt;
double X_beta  = xd[3];&lt;br /&gt;
double X_psi   = xd[4];&lt;br /&gt;
double X_wz    = xd[5];&lt;br /&gt;
double X_delta = xd[6];&lt;br /&gt;
&lt;br /&gt;
// Intermediate values&lt;br /&gt;
double alpha_f, alpha_r, v_km_h, v_km_h2;&lt;br /&gt;
double F_Ax, F_Ay, F_Bf, F_Br, F_Rf, F_Rr, F_sf, F_sr, F_lr, F_lf;&lt;br /&gt;
double f_R, f_1, w_mot, f_2, f_3, M_mot, M_wheel;&lt;br /&gt;
double X_v_cos_X_beta, X_v_sin_X_beta;&lt;br /&gt;
&lt;br /&gt;
X_v_cos_X_beta = X_v * cos ( X_beta );&lt;br /&gt;
X_v_sin_X_beta = X_v * sin ( X_beta );&lt;br /&gt;
alpha_f        = X_delta - atan( ( P_l_f * X_wz - X_v_sin_X_beta ) / X_v_cos_X_beta );&lt;br /&gt;
alpha_r        =           atan( ( P_l_r * X_wz + X_v_sin_X_beta ) / X_v_cos_X_beta );&lt;br /&gt;
&lt;br /&gt;
F_sf    = P_D_f * sin( P_C_f * atan( P_B_f*alpha_f - P_E_f*(P_B_f*alpha_f - atan(P_B_f*alpha_f)) ) );&lt;br /&gt;
F_sr    = P_D_r * sin( P_C_r * atan( P_B_r*alpha_r - P_E_r*(P_B_r*alpha_r - atan(P_B_r*alpha_r)) ) );&lt;br /&gt;
&lt;br /&gt;
F_Ax    = 0.5 * P_c_w * P_rho * P_A * X_v*X_v;&lt;br /&gt;
F_Ay    = 0.0;&lt;br /&gt;
F_Bf    = 2.0/3.0 * C_brake;&lt;br /&gt;
F_Br    = 1.0/3.0 * C_brake;&lt;br /&gt;
&lt;br /&gt;
v_km_h  = X_v / 100.0 * 3.6;&lt;br /&gt;
v_km_h2 = v_km_h * v_km_h;&lt;br /&gt;
f_R     = P_f_R0 + P_f_R1 * v_km_h + P_f_R4 * v_km_h2 * v_km_h2;&lt;br /&gt;
F_Rf    = f_R * P_F_zf;&lt;br /&gt;
F_Rr    = f_R * P_F_zr;&lt;br /&gt;
&lt;br /&gt;
f_1     = 1.0 - exp( -3.0 * C_acc );&lt;br /&gt;
w_mot   = X_v * P_ig * P_i_t / P_R;&lt;br /&gt;
f_2     = -37.8 + (1.54 - 0.0019 * w_mot_i) * w_mot;&lt;br /&gt;
f_3     = -34.9 - 0.04775 * w_mot;&lt;br /&gt;
M_mot   = f_1 * f_2_i + ( 1.0 - f_1 ) * f_3_i;&lt;br /&gt;
M_wheel = P_ig * P_i_t * M_mot_i;&lt;br /&gt;
	&lt;br /&gt;
F_lr    = M_wheel / P_R - F_Br - F_Rr;&lt;br /&gt;
F_lf    = - F_Bf - F_Rf;&lt;br /&gt;
&lt;br /&gt;
// 0 Horizontal position x&lt;br /&gt;
rhs[0] = X_v * cos( X_psi - X_beta );&lt;br /&gt;
// 1 Vertical position y&lt;br /&gt;
rhs[1] = X_v * sin( X_psi - X_beta );&lt;br /&gt;
// 2 Velocity v&lt;br /&gt;
rhs[2] = 1.0 / P_m * (&lt;br /&gt;
	  (F_lr - F_Ax) * cos(X_beta) + F_lf * cos(X_delta + X_beta)&lt;br /&gt;
	- (F_sr - F_Ay) * sin(X_beta) - F_sf * sin(X_delta + X_beta) );&lt;br /&gt;
// 3 Side slip angle beta&lt;br /&gt;
rhs[3] = X_wz - 1.0 / (P_m * X_v) * (&lt;br /&gt;
	  (F_lr - F_Ax) * sin(X_beta) + F_lf * sin(X_delta + X_beta)&lt;br /&gt;
	+ (F_sr - F_Ay) * cos(X_beta) + F_sf * cos(X_delta + X_beta) );&lt;br /&gt;
// 4 Yaw angle psi&lt;br /&gt;
rhs[4] = X_wz;&lt;br /&gt;
// 5 Velocity of yaw angle w_z&lt;br /&gt;
rhs[5] = 1.0 / P_I_zz * (&lt;br /&gt;
	  F_sf * P_l_f * cos(X_delta) - F_sr * P_l_r&lt;br /&gt;
	+ F_lf * P_l_f * sin(X_delta) - F_Ay * P_e_SP );&lt;br /&gt;
// 6 Steering angle delta&lt;br /&gt;
rhs[6] = C_steer;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
See testdrive [[Car testdrive | overview page]].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Minimum time]]&lt;br /&gt;
[[Category:Bang bang]]&lt;br /&gt;
[[Category:Transport]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=355</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=355"/>
		<updated>2008-11-26T13:24:28Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Undo revision 354 by AlexanderBuchner (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened. This valve controls the flow of refrigerant into the evaporator, where it absorbs heat from the surrounding air. The refrigerated air then creates the well-known air-curtain at the front of the display case.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;350px&amp;quot; heights=&amp;quot;300px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:FridgeControlsRelaxed.png| Optimal relaxed control.&lt;br /&gt;
 Image:FridgeControls.png| Optimal integer control.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* The differential equation for the mass of the refrigerant had another switch, if the valve (e.g. &amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt;) is closed. It was formulated this way:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dot{x_4} =  \begin{cases}&lt;br /&gt;
&lt;br /&gt;
\dfrac{M_{ref,max} - x_4}{\tau_{fill}} &amp;amp; \qquad \text{if} \quad u_0 = 1 \\ \\&lt;br /&gt;
- \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} x_4 \big( x_2 - T_e(x_0) \big) &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and}\quad  x_4 &amp;gt; 0 \\ \\ &lt;br /&gt;
0 &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and} \quad x_4 = 0&lt;br /&gt;
&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This additional switch is redundant because the mass itself is a factor on the right hand side and so the complete right hand side is 0 if &amp;lt;math&amp;gt;x_4 = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Periodic]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=354</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=354"/>
		<updated>2008-11-26T13:23:47Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened. This valve controls the flow of refrigerant into the evaporator, where it absorbs heat from the surrounding air. The refrigerated air then creates the well-known air-curtain at the front of the display case.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|- bgcolor=#c7c7c7&lt;br /&gt;
! Symbol !! Value !! Unit !! Description&lt;br /&gt;
|- &lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\dot{Q}_{airload}&amp;lt;/math&amp;gt; || align=right | 1.239e+3 || kg || Mass of the car&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;g&amp;lt;/math&amp;gt; || align=right | 9.81 || m/s^2 || Gravity constant&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;l_\text{f}&amp;lt;/math&amp;gt; || align=right | 1.19016 || m || Front wheel distance to center of gravity&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;l_\text{r}&amp;lt;/math&amp;gt; || align=right | 1.37484 || m || Rear wheel distance to center of gravity&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;e_\text{SP}&amp;lt;/math&amp;gt; || align=right | 0.5 || m || Drag mount point distance to center of gravity&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; || align=right | 0.302 || m || Wheel radius&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;I_\text{zz}&amp;lt;/math&amp;gt; || align=right | 1.752e+3 || kg m^2 || Moment of inertia&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;c_\text{w}&amp;lt;/math&amp;gt; || align=right | 0.3 ||  || Air drag coefficient&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;\varrho&amp;lt;/math&amp;gt; || align=right | 1.249512 || kg/m^3 || Air density&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; || align=right | 1.4378946874 || m^2 || Effective flow surface&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;i_\text{g}&amp;lt;/math&amp;gt; || align=right | 3.09, 2.002, 1.33, 1.0, 0.805 || - || Transmission ratios for the five gears&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;i_\text{t}&amp;lt;/math&amp;gt; || align=right | 3.91 || - || Engine transmission ratio&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;B_\text{f}&amp;lt;/math&amp;gt; || align=right | 1.096e+1 || - || Pacejka coefficients (stiffness)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;B_\text{r}&amp;lt;/math&amp;gt; || align=right | 1.267e+1 || - || &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_\text{f}&amp;lt;/math&amp;gt; || align=right | 1.3 || - || Pacejka coefficients (shape)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;C_\text{r}&amp;lt;/math&amp;gt; || align=right | 1.3 || - || &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;D_\text{f}&amp;lt;/math&amp;gt; || align=right | 4.5604e+3 || - || Pacejka coefficients (peak)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;D_\text{r}&amp;lt;/math&amp;gt; || align=right | 3.94781e+3 || - || &lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;E_\text{f}&amp;lt;/math&amp;gt; || align=right | -0.5 || - || Pacejka coefficients (curvature)&lt;br /&gt;
|-&lt;br /&gt;
| align=center | &amp;lt;math&amp;gt;E_\text{r}&amp;lt;/math&amp;gt; || align=right | -0.5 || - || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;350px&amp;quot; heights=&amp;quot;300px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:FridgeControlsRelaxed.png| Optimal relaxed control.&lt;br /&gt;
 Image:FridgeControls.png| Optimal integer control.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* The differential equation for the mass of the refrigerant had another switch, if the valve (e.g. &amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt;) is closed. It was formulated this way:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dot{x_4} =  \begin{cases}&lt;br /&gt;
&lt;br /&gt;
\dfrac{M_{ref,max} - x_4}{\tau_{fill}} &amp;amp; \qquad \text{if} \quad u_0 = 1 \\ \\&lt;br /&gt;
- \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} x_4 \big( x_2 - T_e(x_0) \big) &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and}\quad  x_4 &amp;gt; 0 \\ \\ &lt;br /&gt;
0 &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and} \quad x_4 = 0&lt;br /&gt;
&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This additional switch is redundant because the mass itself is a factor on the right hand side and so the complete right hand side is 0 if &amp;lt;math&amp;gt;x_4 = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Periodic]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=351</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=351"/>
		<updated>2008-11-25T14:53:29Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Addad this problem to category &amp;quot;Periodic&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened. This valve controls the flow of refrigerant into the evaporator, where it absorbs heat from the surrounding air. The refrigerated air then creates the well-known air-curtain at the front of the display case.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;350px&amp;quot; heights=&amp;quot;300px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:FridgeControlsRelaxed.png| Optimal relaxed control.&lt;br /&gt;
 Image:FridgeControls.png| Optimal integer control.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* The differential equation for the mass of the refrigerant had another switch, if the valve (e.g. &amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt;) is closed. It was formulated this way:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dot{x_4} =  \begin{cases}&lt;br /&gt;
&lt;br /&gt;
\dfrac{M_{ref,max} - x_4}{\tau_{fill}} &amp;amp; \qquad \text{if} \quad u_0 = 1 \\ \\&lt;br /&gt;
- \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} x_4 \big( x_2 - T_e(x_0) \big) &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and}\quad  x_4 &amp;gt; 0 \\ \\ &lt;br /&gt;
0 &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and} \quad x_4 = 0&lt;br /&gt;
&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This additional switch is redundant because the mass itself is a factor on the right hand side and so the complete right hand side is 0 if &amp;lt;math&amp;gt;x_4 = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Periodic]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Car_testdrive&amp;diff=326</id>
		<title>Car testdrive</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Car_testdrive&amp;diff=326"/>
		<updated>2008-11-24T11:40:35Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: corrected misspelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The car testdrive MIOCPs are about controlling a car to achieve a specific task in minimum time or with minimum energy with a constrained end time. The mathematical model includes gears and can be found in the [[Car testdrive (lane change manoeuvre) | lane change]] problem description. Altogether there are the following benchmark problem descriptions available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; A [[Car testdrive (lane change manoeuvre) | lane change]] manoeuvre to avoid an obstacle.&lt;br /&gt;
 &amp;lt;li&amp;gt; An [[Car testdrive (elliptic track) | elliptic track]] testdrive.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Bang bang]]&lt;br /&gt;
[[Category:Transport]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=319</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=319"/>
		<updated>2008-11-19T11:43:15Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Reference Solutions */ Added plots of optimal solutions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened. This valve controls the flow of refrigerant into the evaporator, where it absorbs heat from the surrounding air. The refrigerated air then creates the well-known air-curtain at the front of the display case.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;350px&amp;quot; heights=&amp;quot;300px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:FridgeControlsRelaxed.png| Optimal relaxed control.&lt;br /&gt;
 Image:FridgeControls.png| Optimal integer control.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* The differential equation for the mass of the refrigerant had another switch, if the valve (e.g. &amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt;) is closed. It was formulated this way:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dot{x_4} =  \begin{cases}&lt;br /&gt;
&lt;br /&gt;
\dfrac{M_{ref,max} - x_4}{\tau_{fill}} &amp;amp; \qquad \text{if} \quad u_0 = 1 \\ \\&lt;br /&gt;
- \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} x_4 \big( x_2 - T_e(x_0) \big) &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and}\quad  x_4 &amp;gt; 0 \\ \\ &lt;br /&gt;
0 &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and} \quad x_4 = 0&lt;br /&gt;
&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This additional switch is redundant because the mass itself is a factor on the right hand side and so the complete right hand side is 0 if &amp;lt;math&amp;gt;x_4 = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:FridgeControlsRelaxed.png&amp;diff=318</id>
		<title>File:FridgeControlsRelaxed.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:FridgeControlsRelaxed.png&amp;diff=318"/>
		<updated>2008-11-19T11:34:14Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Optimal relaxed solution.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Optimal relaxed solution.&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:FridgeControls.png&amp;diff=317</id>
		<title>File:FridgeControls.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:FridgeControls.png&amp;diff=317"/>
		<updated>2008-11-19T11:30:11Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Output of optimal integer solution.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Output of optimal integer solution.&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=316</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=316"/>
		<updated>2008-11-18T14:31:28Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Added another variant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened. This valve controls the flow of refrigerant into the evaporator, where it absorbs heat from the surrounding air. The refrigerated air then creates the well-known air-curtain at the front of the display case.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* The differential equation for the mass of the refrigerant had another switch, if the valve (e.g. &amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt;) is closed. It was formulated this way:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\dot{x_4} =  \begin{cases}&lt;br /&gt;
&lt;br /&gt;
\dfrac{M_{ref,max} - x_4}{\tau_{fill}} &amp;amp; \qquad \text{if} \quad u_0 = 1 \\ \\&lt;br /&gt;
- \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} x_4 \big( x_2 - T_e(x_0) \big) &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and}\quad  x_4 &amp;gt; 0 \\ \\ &lt;br /&gt;
0 &amp;amp; \qquad \text{if} \quad u_0 = 0 \quad \text{and} \quad x_4 = 0&lt;br /&gt;
&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This additional switch is redundant because the mass itself is a factor on the right hand side and so the complete right hand side is 0 if &amp;lt;math&amp;gt;x_4 = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=308</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=308"/>
		<updated>2008-11-14T15:25:27Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots, 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots, 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=307</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=307"/>
		<updated>2008-11-14T15:03:13Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; &lt;br /&gt;
\dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ &lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ [2.5ex]&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ [4ex]&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. &lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=306</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=306"/>
		<updated>2008-11-14T14:17:23Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=305</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=305"/>
		<updated>2008-11-14T14:05:58Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* C */  fixed indentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
    Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
    Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
    UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
    Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
    m[i] = Q_e[i]/delta_h;&lt;br /&gt;
    m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
double V_comp = 0.0;&lt;br /&gt;
double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
// suction pressure&lt;br /&gt;
rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
// for each display/valve&lt;br /&gt;
for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
&lt;br /&gt;
    // temperatures:&lt;br /&gt;
&lt;br /&gt;
    // goods&lt;br /&gt;
    rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
&lt;br /&gt;
    // wall&lt;br /&gt;
    rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
&lt;br /&gt;
    // air&lt;br /&gt;
    rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i]) /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
    // mass of liquefied refrigerant:&lt;br /&gt;
    rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i] - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=304</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=304"/>
		<updated>2008-11-14T14:01:53Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */  Added a new line so that the objective is always shown above the ODE system independent from the browser window&amp;#039;s width.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=303</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=303"/>
		<updated>2008-11-14T13:44:38Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE model|ODE model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_3(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\geq&amp;amp; 2.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_7(t) &amp;amp;\leq&amp;amp; 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE model]]&lt;br /&gt;
[[Category:Chattering]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=297</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=297"/>
		<updated>2008-11-14T13:13:44Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors (called a compressor rack) which only can be controlled stepwise (each single compressor can be turned on or off) and 2 open refrigerated display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=296</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=296"/>
		<updated>2008-11-14T12:25:02Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description originating from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 {x_0}^3 + 0.2161 {x_0}^2 - 0.4742 x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=295</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=295"/>
		<updated>2008-11-13T15:22:16Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left( (u_2 + u_3)\cdot 0.5 \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=294</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=294"/>
		<updated>2008-11-13T15:07:30Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.5 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Template:Dimensions&amp;diff=293</id>
		<title>Template:Dimensions</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Template:Dimensions&amp;diff=293"/>
		<updated>2008-11-13T14:32:55Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: fixed description of &amp;quot;nd&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{| class=&amp;quot;infobox&amp;quot;&lt;br /&gt;
|- style=&amp;quot;text-align:center; width:{{{box_width|55em}}}; text-align:left; font-size:85%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; font-size=&amp;quot;125%&amp;quot;|{{PAGENAME}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{nd|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;State dimension:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nd}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nx|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Differential states:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nx}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nz|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Algebraic states:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nz}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nu|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Continuous control functions:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nu}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nw|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Discrete control functions:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nw}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{np|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Continuous control values:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{np}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nrho|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Discrete control values:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nrho}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nc|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Path constraints:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nc}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nri|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Interior point inequalities:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nri}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
{{#if:{{{nre|}}}|&lt;br /&gt;
{{!}}align=&amp;quot;left&amp;quot;{{!}}&#039;&#039;Interior point equalities:&#039;&#039;&lt;br /&gt;
{{!}}align=&amp;quot;right&amp;quot;{{!}}&#039;&#039;&#039;{{{nre}}}&#039;&#039;&#039;&lt;br /&gt;
{{!}}-&lt;br /&gt;
|}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Dimensions&lt;br /&gt;
|nd        = enter the dimension of the differential states&lt;br /&gt;
|nx        = enter the number of differential states&lt;br /&gt;
|nz        = enter the number of algebraic states&lt;br /&gt;
|nu        = enter the number of continuous control functions&lt;br /&gt;
|nw        = enter the number of discrete-valued control functions&lt;br /&gt;
|np        = enter the number of time-independent, continuous control values&lt;br /&gt;
|nrho      = enter the number of time-independent, discrete control values&lt;br /&gt;
|nc        = enter the number of path- and control constraints&lt;br /&gt;
|nri       = enter the number of interior point inequalities&lt;br /&gt;
|nre       = enter the number of interior point equalities&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=292</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=292"/>
		<updated>2008-11-13T14:16:40Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00 &amp;amp; \frac{J}{s}, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00 &amp;amp; \frac{kg}{s},  \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally the constraint on the suction pressure &amp;lt;math&amp;gt;x_0(t)&amp;lt;/math&amp;gt; is softened to &amp;lt;math&amp;gt;x_0(t) \leq 1.9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=291</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=291"/>
		<updated>2008-11-13T14:08:21Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Parameters */ Added units of constant parameters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcrr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00, &amp;amp; s\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, &amp;amp; \frac{J}{s} \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, &amp;amp; \frac{kg}{s} \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, &amp;amp; kg\\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, &amp;amp; \frac{J}{kg \cdot K} \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, &amp;amp; \frac{J}{s \cdot K} \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, &amp;amp; s\\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, &amp;amp; K\\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, &amp;amp; kg\\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, &amp;amp; m^3\\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, &amp;amp; \frac{m^3}{s} \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, &amp;amp; -\\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=290</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=290"/>
		<updated>2008-11-13T13:54:16Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants|Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00 ,\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, \\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, \\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, \\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, \\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, \\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, \\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, \\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=289</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=289"/>
		<updated>2008-11-13T13:53:29Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario. A night scenario is also available, see [[#Variants]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00 ,\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, \\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, \\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, \\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, \\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, \\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, \\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, \\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=288</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=288"/>
		<updated>2008-11-13T13:41:08Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00 ,\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, \\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, \\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, \\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, \\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, \\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, \\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, \\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=287</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=287"/>
		<updated>2008-11-13T13:40:11Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */ fixed indices&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{0,\dots 8\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{0,\dots 3\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00 ,\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, \\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, \\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, \\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, \\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, \\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, \\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, \\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=286</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=286"/>
		<updated>2008-11-13T13:39:00Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x_i(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00 ,\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, \\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, \\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, \\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, \\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, \\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, \\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, \\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=285</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=285"/>
		<updated>2008-11-13T13:31:39Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model for the day scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
t_0                 &amp;amp;=&amp;amp;    0.00 ,\\&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 3000.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.20, \\&lt;br /&gt;
M_{goods}           &amp;amp;=&amp;amp;  200.00, \\&lt;br /&gt;
C_{p,goods}         &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{goods-air}      &amp;amp;=&amp;amp;  300.00, \\&lt;br /&gt;
M_{wall}            &amp;amp;=&amp;amp;  260.00, \\&lt;br /&gt;
C_{p,wall}          &amp;amp;=&amp;amp;  385.00, \\&lt;br /&gt;
UA_{air-wall}       &amp;amp;=&amp;amp;  500.00, \\&lt;br /&gt;
M_{air}             &amp;amp;=&amp;amp;   50.00, \\&lt;br /&gt;
C_{p,air}           &amp;amp;=&amp;amp; 1000.00, \\&lt;br /&gt;
UA_{wall-ref,max}   &amp;amp;=&amp;amp; 4000.00, \\&lt;br /&gt;
\tau_{fill}         &amp;amp;=&amp;amp;   40.00, \\&lt;br /&gt;
T_{SH}              &amp;amp;=&amp;amp;   10.00, \\&lt;br /&gt;
M_{ref,max}         &amp;amp;=&amp;amp;    1.00, \\&lt;br /&gt;
V_{suc}             &amp;amp;=&amp;amp;    5.00, \\&lt;br /&gt;
V_{sl}              &amp;amp;=&amp;amp;    0.08, \\&lt;br /&gt;
\eta_{vol}          &amp;amp;=&amp;amp;    0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=284</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=284"/>
		<updated>2008-11-13T13:26:37Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{lcr}&lt;br /&gt;
\dot{Q}_{airload}   &amp;amp;=&amp;amp; 1800.00, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp;    0.00, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=283</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=283"/>
		<updated>2008-11-13T13:22:12Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
\dot{Q}_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
\dot{m}_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=282</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=282"/>
		<updated>2008-11-13T13:21:08Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Variants */ Added the reformulation of the compressors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
Since the compressors are parallel connected one can introduce a single control &amp;lt;math&amp;gt; u_2 \in \{0,1,2\}&amp;lt;/math&amp;gt; instead of two equivalent controls. The same holds for scenarions with &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; parallel connected compressors.&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
Q_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
M_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=281</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=281"/>
		<updated>2008-11-13T13:16:20Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */ fixed objective&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\frac{\sum_{i=2}^3 u_i}{2} \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
Q_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
M_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=280</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=280"/>
		<updated>2008-11-13T13:09:31Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f} \left(\sum_i u_i \cdot \eta_{vol} \cdot V_{sl} \cdot f \right) dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const}   - \eta_{vol} \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_4}{\tau_{fill}} \right) u_0&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) \right) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \left(\dfrac{M_{ref,max} - x_8}{\tau_{fill}} \right) u_1&lt;br /&gt;
                    - \left( \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) \right) (1-u_1)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
Q_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
M_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=279</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=279"/>
		<updated>2008-11-13T11:47:28Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: /* Mathematical formulation */ tidy up&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\min_{x,u} \frac {1}{t_f - t_0}\int_{t_0}^{t_f}\dot{V}_{comp} \cdot f dt &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle &lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const} \\&lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  - \eta_{vol}&lt;br /&gt;
                    \cdot V_{sl} \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_1-x_3 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \dfrac{M_{ref,max} - x_4}{\tau_{fill}} u_0&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{goods} \cdot C_{p,goods} &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{air-wall} \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max}}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{wall} \cdot C_{p,wall}&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA_{goods-air} \left( x_5-x_7 \right) + \dot{Q}_{airload}&lt;br /&gt;
                     - UA_{air-wall} \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M_{air} \cdot C_{p,air}&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \dfrac{M_{ref,max} - x_8}{\tau_{fill}} u_0&lt;br /&gt;
                    - \dfrac{UA_{wall-ref,max}}{M_{ref,max} \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
Q_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
M_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=278</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=278"/>
		<updated>2008-11-13T11:29:39Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: Added interpolation polynomials&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x,u} &amp;amp; \frac {1}{t_f - t_0}\int_{t_0}^{t_f}\dot{V}_{comp} \cdot f dt \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V_{suc} \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M_{ref, max} \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M_{ref,const} \\&lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  - ETA\_VOL&lt;br /&gt;
                    \cdot V\_SL \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_GOODS \cdot C\_P\_GOODS &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_AIR\_WALL \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_WALL \cdot C\_P\_WALL&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_1-x_3 \right) + Q\_AIRLOAD&lt;br /&gt;
                     - UA\_AIR\_WALL \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_AIR \cdot C\_P\_AIR&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \dfrac{M\_REF\_MAX - x_4}{TAU\_FILL} u_0&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_GOODS \cdot C\_P\_GOODS &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_AIR\_WALL \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_WALL \cdot C\_P\_WALL&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_5-x_7 \right) + Q\_AIRLOAD&lt;br /&gt;
                     - UA\_AIR\_WALL \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_AIR \cdot C\_P\_AIR&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \dfrac{M\_REF\_MAX - x_4}{TAU\_FILL} u_0&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following polynomial functions are used in the model description and originate from interpolations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
&lt;br /&gt;
T_e(x_0)                             &amp;amp;=&amp;amp; -4.3544 x_0^2 + 29.224 x_0 - 51.2005,\\&lt;br /&gt;
\Delta h_{lg}(x_0)                   &amp;amp;=&amp;amp; (0.0217 x_0^2 - 0.1704 x_0 + 2.2988)\cdot 10^5, \\&lt;br /&gt;
\rho_{suc}(x_0)                      &amp;amp;=&amp;amp; 4.6073 x_0 + 0.3798, \\&lt;br /&gt;
\frac{d\rho_{suc}}{dP_{suc}}(x_0)    &amp;amp;=&amp;amp; -0.0329 \cdot {x_0}^3 + 0.2161 \cdot {x_0}^2 - 0.4742 \cdot x_0 + 5.4817,\\&lt;br /&gt;
f(x_0)                               &amp;amp;=&amp;amp; (0.0265 x_0^3 - 0.4346 x_0^2 + 2.4923 x_0 + 1.2189) \cdot 10^5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
Q_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
M_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
* The number of compressors and display cases is not fixed. Larsen also proposed the problem with 3 compressors and 3 display cases. This leads to a change in the compressor rack&#039;s preformance to &amp;lt;math&amp;gt;V_{sl} = 0.095 \frac{m^3}{s}&amp;lt;/math&amp;gt;. Unfortunately this constant is only given for these two cases although Larsen proposed scenarios with more compressors and display cases.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=277</id>
		<title>Supermarket refrigeration system</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Supermarket_refrigeration_system&amp;diff=277"/>
		<updated>2008-11-13T10:56:16Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: first ugly version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 9&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nri       = 5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;supermarket refrigeration system problem&#039;&#039;&#039; is based on a model describing a refrigeration system with 2 parallel connected compressors which only can be controlled stepwise (each single compressor can be turned on or off) and 2 display cases containing goods needed to be refrigerated. Each display case is connected to the refrigeration circuit through an expansion valve which also can only be closed or opened.&lt;br /&gt;
&lt;br /&gt;
The air temperatures surrounding the goods in each display case are modeled by one differential state each. These states have to be bounded, so that the goods are properly refrigerated.&lt;br /&gt;
&lt;br /&gt;
The model was published by Larsen et. al. in 2007 &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt;. The main goal is to control the refirgeration system energy-optimal. The problem was set up as a benchmark problem for MIOCPs. &lt;br /&gt;
&lt;br /&gt;
The mathematical equations form an [[:Category:ODE Model|ODE Model]]. The initial values of the differential states are not fixed but periodicity of the whole process is required.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the supermarket refrigeration system problem a candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;t \in [t_0, t_f]&amp;lt;/math&amp;gt; almost everywhere the mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x,u} &amp;amp; \frac {1}{t_f - t_0}\int_{t_0}^{t_f}\dot{V}_{comp} \cdot f dt \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp; \dot{x_0}(t) &amp;amp;=&amp;amp;  \dfrac{1}{V\_SUC \cdot \frac{d\rho_{suc}}{dP_{suc}}(x_0)} \cdot \bigg[ &lt;br /&gt;
                    \left(\dfrac{UA_{wall-ref, max}}{M\_REF\_MAX \cdot&lt;br /&gt;
                    \Delta h_{lg}(x_0)}\right) \Big( x_4 \big( x_2 - T_e(x_0) \big)\\ &lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  + \, x_8 \big( x_6 - T_e(x_0) \big) \Big) + \, M\_REF\_CONST \\&lt;br /&gt;
&amp;amp;           &amp;amp;&amp;amp;  - ETA\_VOL&lt;br /&gt;
                    \cdot V\_SL \cdot 0.01 \, \left(u_2+u_3\right) \rho_{suc}(x_0) &lt;br /&gt;
                \bigg] \\&lt;br /&gt;
 &amp;amp;\dot{x_1}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_1 - x_3 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_GOODS \cdot C\_P\_GOODS &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_2}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_AIR\_WALL \left( x_3-x_2 \right)&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX}&lt;br /&gt;
                    \, x_4 \big( x_2 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_WALL \cdot C\_P\_WALL&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_3}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_1-x_3 \right) + Q\_AIRLOAD&lt;br /&gt;
                     - UA\_AIR\_WALL \, (x_3-x_2)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_AIR \cdot C\_P\_AIR&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_4}(t) &amp;amp;=&amp;amp;   \dfrac{M\_REF\_MAX - x_4}{TAU\_FILL} u_0&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_4 \big( x_2 - T_e(x_0) \big) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
&amp;amp;\dot{x_5}(t) &amp;amp;=&amp;amp;  - \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_5 - x_7 \right)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_GOODS \cdot C\_P\_GOODS &lt;br /&gt;
} \\ \\&lt;br /&gt;
 &amp;amp;\dot{x_6}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_AIR\_WALL \left( x_7-x_6 \right)&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX}&lt;br /&gt;
                    \, x_8 \big( x_6 - T_e(x_0) \big)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_WALL \cdot C\_P\_WALL&lt;br /&gt;
} \\ \\  \\[1.5ex]&lt;br /&gt;
&amp;amp;\dot{x_7}(t) &amp;amp;=&amp;amp;  \dfrac{&lt;br /&gt;
                    UA\_GOODS\_AIR \left( x_5-x_7 \right) + Q\_AIRLOAD&lt;br /&gt;
                     - UA\_AIR\_WALL \, (x_7-x_6)&lt;br /&gt;
}{&lt;br /&gt;
                    M\_AIR \cdot C\_P\_AIR&lt;br /&gt;
} \\ \\&lt;br /&gt;
&amp;amp;\dot{x_8}(t) &amp;amp;=&amp;amp;   \dfrac{M\_REF\_MAX - x_4}{TAU\_FILL} u_0&lt;br /&gt;
                    - \dfrac{UA\_WALL\_REF\_MAX}{M\_REF\_MAX \cdot \Delta h_{lg}(x_0)} \,&lt;br /&gt;
                    x_8 \big( x_6 - T_e(x_0) \big) (1-u_0)&lt;br /&gt;
                 \\ \\&lt;br /&gt;
 &amp;amp; 2.0 &amp;amp;\leq&amp;amp; x_3(t), x_7(t) \leq 5.0 \quad \forall t \in [t_0, t_f],\\&lt;br /&gt;
 &amp;amp; x_0(t) &amp;amp;\leq&amp;amp; 1.7 \quad \forall t \in [t_0, t_f], \\&lt;br /&gt;
 &amp;amp; x_i(t_0) &amp;amp;=&amp;amp; free \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; x_i(t_f) &amp;amp;=&amp;amp; x(t_0) \quad \forall i \in \{1,\dots 9\}, \\&lt;br /&gt;
 &amp;amp; u_i(t)   &amp;amp;\in&amp;amp;  \{0, 1\} \quad \forall i \in \{1,\dots 4\}, \\&lt;br /&gt;
 &amp;amp; t_f    &amp;amp;\in&amp;amp; [ 650, 750 ]. \\&lt;br /&gt;
&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Here the differential state &amp;lt;math&amp;gt;x_0&amp;lt;/math&amp;gt; describes the suction pressure in the suction manifold (in bar). The next three states model temperatures in the first display case (in °C). &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; is the goods&#039; temperature, &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt; the one of the evaporator wall and &amp;lt;math&amp;gt;x_3&amp;lt;/math&amp;gt; the air temperature surrounding the goods. &amp;lt;math&amp;gt;x_4&amp;lt;/math&amp;gt; then models the mass of the liquefied refrigerant in the evaporator (in kg).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(x_5, x_6, x_7, x_8)&amp;lt;/math&amp;gt; describe the corresponding states in the second display case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;u_0&amp;lt;/math&amp;gt; describes the inlet valve of the first display case, &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; respectively the valve of the second display case.&lt;br /&gt;
&amp;lt;math&amp;gt;u_2, u_3&amp;lt;/math&amp;gt; denote the activity of a single compressor.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
These fixed values are used within the model. TODO: night scenario&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
t_0 &amp;amp;=&amp;amp; 0,\\&lt;br /&gt;
Q\_AIRLOAD &amp;amp;=&amp;amp; 3000, \\&lt;br /&gt;
M\_REF\_CONST &amp;amp;=&amp;amp; 0.2, \\&lt;br /&gt;
MGOODS &amp;amp;=&amp;amp; 200, \\&lt;br /&gt;
C\_P\_GOODS &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_GOODS\_AIR &amp;amp;=&amp;amp; 300, \\&lt;br /&gt;
M\_WALL &amp;amp;=&amp;amp; 260, \\&lt;br /&gt;
C\_P\_WALL &amp;amp;=&amp;amp; 385, \\&lt;br /&gt;
UA\_AIR\_WALL &amp;amp;=&amp;amp; 500, \\&lt;br /&gt;
M\_AIR &amp;amp;=&amp;amp; 50, \\&lt;br /&gt;
C\_P\_AIR &amp;amp;=&amp;amp; 1000, \\&lt;br /&gt;
UA\_WALL\_REF\_MAX &amp;amp;=&amp;amp; 4000, \\&lt;br /&gt;
TAU\_FILL &amp;amp;=&amp;amp; 40, \\&lt;br /&gt;
T\_SH &amp;amp;=&amp;amp; 10, \\&lt;br /&gt;
M\_REF\_MAX &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
V\_SUC &amp;amp;=&amp;amp; 5, \\&lt;br /&gt;
V\_SL &amp;amp;=&amp;amp; 0.08, \\&lt;br /&gt;
ETA\_VOL &amp;amp;=&amp;amp; 0.81, \\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
For the relaxed problem (we only demand &amp;lt;math&amp;gt;u_i(t) \in  [0,1]&amp;lt;/math&amp;gt; instead of &amp;lt;math&amp;gt;u_i(t) \in  \{0,1\}&amp;lt;/math&amp;gt; the optimal solution is 12072.45.&lt;br /&gt;
If we restrict ourselves to a solution with only integer controls we obtain the optimum objective value 12252.81.&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
The differential equations in C code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// number of compressors&lt;br /&gt;
#define NVALVES 2&lt;br /&gt;
&lt;br /&gt;
// constants&lt;br /&gt;
#define M_GOODS 200.0&lt;br /&gt;
#define C_P_GOODS 1000.0&lt;br /&gt;
#define UA_GOODS_AIR 300.0&lt;br /&gt;
#define M_WALL 260.0&lt;br /&gt;
#define C_P_WALL 385.0&lt;br /&gt;
#define UA_AIR_WALL 500.0&lt;br /&gt;
#define M_AIR 50.0&lt;br /&gt;
#define C_P_AIR 1000.0&lt;br /&gt;
#define UA_WALL_REF_MAX 4000.0&lt;br /&gt;
#define M_REF_MAX 1.0&lt;br /&gt;
#define TAU_FILL 40.0&lt;br /&gt;
#define T_SH 10.0&lt;br /&gt;
#define V_SUC 5.0&lt;br /&gt;
#define V_SL 0.08 // 2 display cases - 2 compressors&lt;br /&gt;
// #define V_SL 0.095 // 3 display cases - 3 compressors&lt;br /&gt;
#define ETA_VOL 0.81&lt;br /&gt;
&lt;br /&gt;
// disturbances - day scenario&lt;br /&gt;
#define Q_AIRLOAD 3000.0&lt;br /&gt;
#define M_REF_CONST 0.2&lt;br /&gt;
&lt;br /&gt;
// disturbances - night scenario&lt;br /&gt;
// #define Q_AIRLOAD 1800.0&lt;br /&gt;
// #define M_REF_CONST 0.0&lt;br /&gt;
&lt;br /&gt;
double delta_h = (0.0217*xd[0]*xd[0] - 0.1704*xd[0] + 2.2988)*1e5;&lt;br /&gt;
double T_e = -4.3544*xd[0]*xd[0] + 29.224*xd[0] - 51.2005;&lt;br /&gt;
double rho_suc = 4.6073*xd[0] + 0.3798;&lt;br /&gt;
double rho_suc__P_suc = -0.0329*xd[0]*xd[0]*xd[0] + 0.2161*xd[0]*xd[0] - 0.4742*xd[0] + 5.4817;&lt;br /&gt;
double f = (0.0265*xd[0]*xd[0]*xd[0] -0.4346*xd[0]*xd[0] + 2.4923*xd[0] + 1.2189)*1e5;&lt;br /&gt;
&lt;br /&gt;
double Q_goods_air[NVALVES];&lt;br /&gt;
double Q_air_wall[NVALVES];&lt;br /&gt;
double UA_wall_ref[NVALVES];&lt;br /&gt;
double Q_e[NVALVES];&lt;br /&gt;
double m[NVALVES];&lt;br /&gt;
&lt;br /&gt;
double m_in_suc = 0.0;&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        Q_goods_air[i] = UA_GOODS_AIR*(xd[1 + i*4] - xd[3 + i*4]);&lt;br /&gt;
        Q_air_wall[i] = UA_AIR_WALL*(xd[3 + i*4] - xd[2 + i*4]);&lt;br /&gt;
        UA_wall_ref[i] = UA_WALL_REF_MAX * xd[4 + 4*i]/M_REF_MAX;&lt;br /&gt;
        Q_e[i] = UA_wall_ref[i]*(xd[2 + 4*i] - T_e);&lt;br /&gt;
&lt;br /&gt;
        m[i] = Q_e[i]/delta_h;&lt;br /&gt;
        m_in_suc += m[i];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
    double V_comp = 0.0;&lt;br /&gt;
    double comp_scale = (double) 1.0/NCOMPS;&lt;br /&gt;
    V_comp = comp_scale*u[NVALVES]*ETA_VOL*V_SL;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
    // suction pressure&lt;br /&gt;
	rhs[0] = (m_in_suc + M_REF_CONST - V_comp*rho_suc) / (V_SUC*rho_suc__P_suc);&lt;br /&gt;
&lt;br /&gt;
    // for each display/valve&lt;br /&gt;
    for (i=0; i&amp;lt;NVALVES; i++){&lt;br /&gt;
        // temperatures:&lt;br /&gt;
        // goods&lt;br /&gt;
        rhs[1 + i*4] = - Q_goods_air[i]/(M_GOODS*C_P_GOODS);&lt;br /&gt;
        // wall&lt;br /&gt;
        rhs[2 + i*4] = (Q_air_wall[i] - Q_e[i])/(M_WALL*C_P_WALL);&lt;br /&gt;
        // air&lt;br /&gt;
        rhs[3 + i*4] = ((Q_goods_air[i] + Q_AIRLOAD - Q_air_wall[i])&lt;br /&gt;
		        /(M_AIR*C_P_AIR));&lt;br /&gt;
&lt;br /&gt;
        // mass of liquefied refrigerant:&lt;br /&gt;
        rhs[4 + i*4] = ((M_REF_MAX - xd[4 + 4*i])/TAU_FILL * u[i]&lt;br /&gt;
		        - m[i] * (1 - u[i]));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
There are several alternative formulations and variants of the above problem, in particular&lt;br /&gt;
&lt;br /&gt;
In the paper &amp;lt;bibref&amp;gt;Larsen2007&amp;lt;/bibref&amp;gt; mentioned above, the problem was stated slightly different:&lt;br /&gt;
&lt;br /&gt;
* The temperature constraints weren&#039;t hard bounds but there was a penalization term added to the objective function to minimize the violation of these constraints.&lt;br /&gt;
* A night scenario with two different parameters was given. At night the following parameters change their value:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
Q_{airload} &amp;amp;=&amp;amp; 1800, \\&lt;br /&gt;
M_{ref,const} &amp;amp;=&amp;amp; 0.0, \\&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* No periodicity was required but the solution on a fixed time horizon 4 hours - 2 in day scenario and 2 in night scenario - with &amp;lt;math&amp;gt;t_f = 14400&amp;lt;/math&amp;gt; was asked.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;bibreferences/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--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 --&amp;gt;&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:MIOCP]]&lt;br /&gt;
[[Category:ODE Model]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Main_Page&amp;diff=236</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Main_Page&amp;diff=236"/>
		<updated>2008-11-10T10:58:02Z</updated>

		<summary type="html">&lt;p&gt;AlexanderBuchner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This wiki contains a &#039;&#039;&#039;benchmark library&#039;&#039;&#039; of &#039;&#039;&#039;mixed-integer optimal control problems&#039;&#039;&#039;. The main intention is to provide algorithm developers with a set of challenging problems to evaluate their numerical optimization methods. An important focus is given on &#039;&#039;&#039;reproducibility&#039;&#039;&#039; of optimal solutions.&lt;br /&gt;
As, in contrast to say linear programming, there are no standard formats for the formulation of such problems, and they often show completely different characteristics, these pages dedicate some space for a thorough description of problem and solutions. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TOP TABLE WITH NEWS  --&amp;gt;&lt;br /&gt;
&amp;lt;table bgcolor=&amp;quot;#EEEEFF&amp;quot; width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;80%&amp;quot; bgcolor=&amp;quot;#EEEEFF&amp;quot;&amp;gt;&lt;br /&gt;
==[[:Category:News|News]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Current News|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&amp;lt;!-- The actual news are being included from the page Current News with the following line. --&amp;gt;&lt;br /&gt;
{{:Current News}}&lt;br /&gt;
&amp;lt;!-- Do not edit between this comment and the next &#039;&amp;lt;td&amp;gt;&#039; tag! --&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table width=&amp;quot;100%&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- CATEGORY FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot;&amp;gt;&lt;br /&gt;
==[[:Category:Problem characterization|Problem characterization]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Help:Adding a problem characterization|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
via &#039;&#039;[[:Category:Model characterization|mathematical model]]&#039;&#039; - via &#039;&#039;[[:Category:Solution characterization|optimal solution]]&#039;&#039; - via &#039;&#039;[[:Category:Application|application area]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[:Category:ODE model|ODE model]]&#039;&#039; - &#039;&#039;[[:Category:Bang bang|Bang bang]]&#039;&#039; - &#039;&#039;[[:Category:Chattering|Chattering]]&#039;&#039; - &#039;&#039;[[:Category:AMPL|AMPL model available]]&#039;&#039;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- PROBLEM FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:MIOCP|Problems]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Help:Adding a Problem|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[Lotka Volterra fishing problem]]&#039;&#039; - [[F-8 aircraft | F-8]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- HELP FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:Help|Help]]==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[[Help:How to contribute|How to contribute]]&#039;&#039; - &#039;&#039;[[Help:How to cite|How to cite]]&#039;&#039; - &#039;&#039;[[Help:Using LaTeX|LaTeX]]&#039;&#039; - &#039;&#039;[[Help:Description guidelines | Guidelines]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- COMMUNITY FIELD--&amp;gt;&lt;br /&gt;
&amp;lt;td width=&amp;quot;50%&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==[[:Category:Community|Community]] &amp;lt;span style=&amp;quot;font-variant:small-caps&amp;quot; style=&amp;quot;font-size:10px&amp;quot;&amp;gt;[[Help:Adding a User|(add)]]&amp;lt;/span&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Have a look at the contributors to this benchmark library. Feel encouraged to participate!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Main]]&lt;/div&gt;</summary>
		<author><name>AlexanderBuchner</name></author>
	</entry>
</feed>