<?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=ClemensZeile</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=ClemensZeile"/>
	<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Special:Contributions/ClemensZeile"/>
	<updated>2026-06-09T09:04:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem_(Julia_Neural_Network_solve)&amp;diff=2341</id>
		<title>Lotka Volterra fishing problem (Julia Neural Network solve)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem_(Julia_Neural_Network_solve)&amp;diff=2341"/>
		<updated>2021-09-20T15:20:00Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an implementation of the [[Lotka Volterra fishing problem]] using Julia and a neural network by Julius Martensen, see https://github.com/AlCap23/IMPRS2021&lt;br /&gt;
&lt;br /&gt;
The control function was relaxed, i.e. &amp;lt;math&amp;gt; u(t)  \in [0,1] &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
using LinearAlgebra&lt;br /&gt;
using Plots&lt;br /&gt;
&lt;br /&gt;
using OrdinaryDiffEq&lt;br /&gt;
using Flux&lt;br /&gt;
using DiffEqFlux&lt;br /&gt;
&lt;br /&gt;
# Example for optimal control&lt;br /&gt;
&lt;br /&gt;
controller = Chain(Dense(1, 10, relu), Dense(10,10, relu), Dense(10,10, relu), Dense(10, 1, σ))&lt;br /&gt;
&lt;br /&gt;
pnn, f = Flux.destructure(controller)&lt;br /&gt;
&lt;br /&gt;
function lotka!(du, u, p, t)&lt;br /&gt;
    c = f(p)([t])[1]&lt;br /&gt;
    du[1] = (1-0.4*c)*u[1] - u[1]*u[2]&lt;br /&gt;
    du[2] = u[1]*u[2] - (1+0.2*c)*u[2]&lt;br /&gt;
    du[3] = (u[1] - 1)^2 + (u[2] -1)^2&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
u0 = Float32[0.5; 0.7; 0.0]&lt;br /&gt;
tspan = (0.0f0, 12.0f0)&lt;br /&gt;
Δt = 12.0f0/100&lt;br /&gt;
&lt;br /&gt;
prob = ODEProblem(lotka!, u0, tspan, pnn)&lt;br /&gt;
solution = solve(prob, Tsit5(), saveat = Δt)&lt;br /&gt;
length(solution)&lt;br /&gt;
&lt;br /&gt;
function loss(p)&lt;br /&gt;
    s_ = solve(prob, Tsit5(), p = p)&lt;br /&gt;
    l = sum(abs, s_[end,end])&lt;br /&gt;
    return l, s_&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
loss(pnn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ps = typeof(solution)[]&lt;br /&gt;
ls = eltype(p_init)[]&lt;br /&gt;
&lt;br /&gt;
callback = function (p, l, pred)&lt;br /&gt;
    display(l)&lt;br /&gt;
    push!(ps, pred)&lt;br /&gt;
    push!(ls, l)&lt;br /&gt;
    l &amp;lt;= 1.35 &amp;amp;&amp;amp; return true&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
# Steer away from initial position and try to avoid local minima&lt;br /&gt;
res_1 = DiffEqFlux.sciml_train(loss, pnn, cb = callback, maxiters = 100)&lt;br /&gt;
&lt;br /&gt;
anm = @animate for i in 1:1:length(ps)&lt;br /&gt;
    pl_ = plot(ps[i], ylim = (0, 4), title = &amp;quot;Iteration $i : $(ls[i])&amp;quot;)&lt;br /&gt;
    plot!(ps[i].t, 1.34408f0*ones(length(ps[i].t)), color = :black, style = :dash, label = &amp;quot;Optimum&amp;quot;)&lt;br /&gt;
    pl_&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
gif(anm, joinpath(pwd(), &amp;quot;figures&amp;quot;, &amp;quot;lotka_volterra_optimal_control.gif&amp;quot;), fps = 10)&lt;br /&gt;
&lt;br /&gt;
# Plot the control value&lt;br /&gt;
s_ = solve(prob, Tsit5(), p = res_1.u, saveat = Δt)&lt;br /&gt;
us = f(res_1.u)(permutedims(s_.t))&lt;br /&gt;
&lt;br /&gt;
p1 = plot(s_, legend = :bottomright, ylabel = &amp;quot;u(t)&amp;quot;)&lt;br /&gt;
plot!(s_.t, 1.34408f0*ones(length(s_.t)), color = :black, style = :dash, label = &amp;quot;Optimum&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plot(&lt;br /&gt;
    p1,&lt;br /&gt;
    plot(s_.t, us&#039;, xlabel = &amp;quot;t&amp;quot;, ylabel = &amp;quot;w(t)&amp;quot;, label = nothing, xticks = 0:2:12),&lt;br /&gt;
    layout = (2,1), link = :x&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
savefig(joinpath(pwd(), &amp;quot;figures&amp;quot;, &amp;quot;lotka_volterra_optimal_control_input.png&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
plot(ls, title = &amp;quot;Objective&amp;quot;, xlabel = &amp;quot;Iterations&amp;quot;, label = nothing)&lt;br /&gt;
savefig(joinpath(pwd(), &amp;quot;figures&amp;quot;, &amp;quot;lotka_volterra_optimal_control_objective.png&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plot&amp;quot; widths=&amp;quot;280px&amp;quot; heights=&amp;quot;240px&amp;quot; perrow=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
Image:Lotka volterra optimal control julia NN.gif| Animated solution process&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Julia/JuMP]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Lotka_volterra_optimal_control_julia_NN.gif&amp;diff=2340</id>
		<title>File:Lotka volterra optimal control julia NN.gif</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Lotka_volterra_optimal_control_julia_NN.gif&amp;diff=2340"/>
		<updated>2021-09-20T15:17:37Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Solution of the relaxed Lotka-Volterra-OCP with Julia and NN by
https://github.com/AlCap23/IMPRS2021/blob/master/figures/lotka_volterra_optimal_control.gif&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution of the relaxed Lotka-Volterra-OCP with Julia and NN by&lt;br /&gt;
https://github.com/AlCap23/IMPRS2021/blob/master/figures/lotka_volterra_optimal_control.gif&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2339</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2339"/>
		<updated>2021-09-20T15:16:03Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Source Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; looks for an optimal fishing strategy to be performed on a fixed time horizon to bring the biomasses of both predator as prey fish to a prescribed steady state. The problem was set up as a small-scale benchmark problem. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra Lotka Volterra equations] for a predator-prey system have been augmented by an additional linear term, relating to fishing by man. The control can be regarded both in a relaxed, as in a discrete manner, corresponding to a part of the fleet, or the full fishing fleet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory &amp;lt;bib id=&amp;quot;Sager2011d&amp;quot; /&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:ACADO | ACADO code]] at [[Lotka Volterra fishing problem (ACADO)]]&lt;br /&gt;
* [[:Category:AMPL | AMPL code]] at [[Lotka Volterra fishing problem (AMPL)]]&lt;br /&gt;
* [[:Category:APMonitor | APMonitor code]] at [[Lotka Volterra fishing problem (APMonitor)]]&lt;br /&gt;
* [[:Category:Bocop | Bocop code]] at [[Lotka Volterra fishing problem (Bocop)]]&lt;br /&gt;
* [[:Category:Casadi | Casadi code]] at [[Lotka Volterra fishing problem (Casadi)]]&lt;br /&gt;
* [[:Category:Gekko | GEKKO Python code]] at [[Lotka Volterra fishing problem (GEKKO)]]&lt;br /&gt;
* [[:Category:JModelica | JModelica code]] at [[Lotka Volterra fishing problem (JModelica)]]&lt;br /&gt;
* [[:Category:Julia/JuMP | JuMP code]] at [[Lotka Volterra fishing problem (JuMP)]]&lt;br /&gt;
* [[:Category:Muscod | Muscod code]] at [[Lotka Volterra fishing problem (Muscod)]]&lt;br /&gt;
* [[:Category:switch | switch code]] at [[Lotka Volterra fishing problem (switch)]]&lt;br /&gt;
* [[:Category:TomDyn/PROPT | PROPT code]] at [[Lotka Volterra fishing problem (TomDyn/PROPT)]]&lt;br /&gt;
* [[:Category:Julia/JuMP | Julia code]] at [[Lotka Volterra fishing problem (Julia Neural Network solve)]]&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;
* a prescribed time grid for the control function &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt;, see also [[Lotka Volterra fishing problem (AMPL)]],&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;, see [[Lotka Volterra multi-arcs problem]]&lt;br /&gt;
* different fishing control functions for the two species, see [[Lotka Volterra Multimode fishing problem]]&lt;br /&gt;
* different fishing control functions that fish an absolute value from the two species, see [[Lotka Volterra absolute fishing problem]]&lt;br /&gt;
* a terminal constrained formulation, where a violation is penalized via slack variables, see [[Lotka Volterra (terminal constraint violation)]]&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt; and revisited in his PhD thesis &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;biblist /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem_(Julia_Neural_Network_solve)&amp;diff=2338</id>
		<title>Lotka Volterra fishing problem (Julia Neural Network solve)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem_(Julia_Neural_Network_solve)&amp;diff=2338"/>
		<updated>2021-09-20T15:12:45Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;This is an implementation of the Lotka Volterra fishing problem using Julia and a neural network by Julius Martensen, see https://github.com/AlCap23/IMPRS2021  The control...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an implementation of the [[Lotka Volterra fishing problem]] using Julia and a neural network by Julius Martensen, see https://github.com/AlCap23/IMPRS2021&lt;br /&gt;
&lt;br /&gt;
The control function was relaxed, i.e. &amp;lt;math&amp;gt; u(t)  \in [0,1] &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;AMPL&amp;quot;&amp;gt;&lt;br /&gt;
using LinearAlgebra&lt;br /&gt;
using Plots&lt;br /&gt;
&lt;br /&gt;
using OrdinaryDiffEq&lt;br /&gt;
using Flux&lt;br /&gt;
using DiffEqFlux&lt;br /&gt;
&lt;br /&gt;
# Example for optimal control&lt;br /&gt;
&lt;br /&gt;
controller = Chain(Dense(1, 10, relu), Dense(10,10, relu), Dense(10,10, relu), Dense(10, 1, σ))&lt;br /&gt;
&lt;br /&gt;
pnn, f = Flux.destructure(controller)&lt;br /&gt;
&lt;br /&gt;
function lotka!(du, u, p, t)&lt;br /&gt;
    c = f(p)([t])[1]&lt;br /&gt;
    du[1] = (1-0.4*c)*u[1] - u[1]*u[2]&lt;br /&gt;
    du[2] = u[1]*u[2] - (1+0.2*c)*u[2]&lt;br /&gt;
    du[3] = (u[1] - 1)^2 + (u[2] -1)^2&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
u0 = Float32[0.5; 0.7; 0.0]&lt;br /&gt;
tspan = (0.0f0, 12.0f0)&lt;br /&gt;
Δt = 12.0f0/100&lt;br /&gt;
&lt;br /&gt;
prob = ODEProblem(lotka!, u0, tspan, pnn)&lt;br /&gt;
solution = solve(prob, Tsit5(), saveat = Δt)&lt;br /&gt;
length(solution)&lt;br /&gt;
&lt;br /&gt;
function loss(p)&lt;br /&gt;
    s_ = solve(prob, Tsit5(), p = p)&lt;br /&gt;
    l = sum(abs, s_[end,end])&lt;br /&gt;
    return l, s_&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
loss(pnn)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ps = typeof(solution)[]&lt;br /&gt;
ls = eltype(p_init)[]&lt;br /&gt;
&lt;br /&gt;
callback = function (p, l, pred)&lt;br /&gt;
    display(l)&lt;br /&gt;
    push!(ps, pred)&lt;br /&gt;
    push!(ls, l)&lt;br /&gt;
    l &amp;lt;= 1.35 &amp;amp;&amp;amp; return true&lt;br /&gt;
    return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
# Steer away from initial position and try to avoid local minima&lt;br /&gt;
res_1 = DiffEqFlux.sciml_train(loss, pnn, cb = callback, maxiters = 100)&lt;br /&gt;
&lt;br /&gt;
anm = @animate for i in 1:1:length(ps)&lt;br /&gt;
    pl_ = plot(ps[i], ylim = (0, 4), title = &amp;quot;Iteration $i : $(ls[i])&amp;quot;)&lt;br /&gt;
    plot!(ps[i].t, 1.34408f0*ones(length(ps[i].t)), color = :black, style = :dash, label = &amp;quot;Optimum&amp;quot;)&lt;br /&gt;
    pl_&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
gif(anm, joinpath(pwd(), &amp;quot;figures&amp;quot;, &amp;quot;lotka_volterra_optimal_control.gif&amp;quot;), fps = 10)&lt;br /&gt;
&lt;br /&gt;
# Plot the control value&lt;br /&gt;
s_ = solve(prob, Tsit5(), p = res_1.u, saveat = Δt)&lt;br /&gt;
us = f(res_1.u)(permutedims(s_.t))&lt;br /&gt;
&lt;br /&gt;
p1 = plot(s_, legend = :bottomright, ylabel = &amp;quot;u(t)&amp;quot;)&lt;br /&gt;
plot!(s_.t, 1.34408f0*ones(length(s_.t)), color = :black, style = :dash, label = &amp;quot;Optimum&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plot(&lt;br /&gt;
    p1,&lt;br /&gt;
    plot(s_.t, us&#039;, xlabel = &amp;quot;t&amp;quot;, ylabel = &amp;quot;w(t)&amp;quot;, label = nothing, xticks = 0:2:12),&lt;br /&gt;
    layout = (2,1), link = :x&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
savefig(joinpath(pwd(), &amp;quot;figures&amp;quot;, &amp;quot;lotka_volterra_optimal_control_input.png&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
plot(ls, title = &amp;quot;Objective&amp;quot;, xlabel = &amp;quot;Iterations&amp;quot;, label = nothing)&lt;br /&gt;
savefig(joinpath(pwd(), &amp;quot;figures&amp;quot;, &amp;quot;lotka_volterra_optimal_control_objective.png&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Julia/JuMP]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2336</id>
		<title>Three Tank multimode problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2336"/>
		<updated>2020-03-14T09:18:16Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Double tank problem variant with three binary controls instead of only one control and three tanks, i.e., three differential states representing different compartments. &lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
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}{llll}&lt;br /&gt;
 \displaystyle \min_{x,w} &amp;amp;  \displaystyle \int_{0}^{T} &amp;amp; k_1(x_2-k_2)^2 + k_3(x_3-k_4)^2  \; \text{d}t\\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp;  \dot{x}_1 &amp;amp; = -\sqrt{x_1}+c_1 w_1 + c_2 w_2 - w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_2 &amp;amp; = \sqrt{x_1}-\sqrt{x_2}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_3 &amp;amp; = \sqrt{x_2}-\sqrt{x_3}+w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  x(0) &amp;amp; = (2,2,2)^T, \\[1.5ex]&lt;br /&gt;
&amp;amp; 1 &amp;amp; = \sum\limits_{i=1}^{3}w_i(t), \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in  \{0, 1\}, \quad i=1\ldots 3.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt; T=12, c_1=1, c_2=2, c_3=0.8, k_1=2, k_2=3, k_3 = 1, k_4 = 3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of direct optimal control and the CIA decomposition. We denote the relaxed control values with &amp;lt;math&amp;gt;a(t)\in[0, 1]&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=100, \, n_u=100  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;8.775979&amp;lt;/math&amp;gt;. The objective value of the binary controls obtained by Combinatorial Integral Approimation (CIA) is &amp;lt;math&amp;gt;8.789487&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:three_tank_relaxed_solution.png| Optimal relaxed controls and states determined by an direct approach with python 3.6 and CasADi, applied Multiple Shooting, 4th order Runge Kutta scheme and 100 discretization intervals.&lt;br /&gt;
 Image:three_tank_binary_solution.png| According optimal binary controls and states determined by the direct approach. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
 Image:three_tank_rounding_solution.png| Binary and relaxed control values as part of the Combinatorial Integral Approximation problem&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model description is available in (using pycombina for solving the (CIA) rounding problem step):&lt;br /&gt;
* [[:Category:Casadi | Casadi code]] at [[Three Tank multimode problem (python/casadi)]]&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Three_Tank_multimode_problem_(python/casadi)&amp;diff=2335</id>
		<title>Three Tank multimode problem (python/casadi)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Three_Tank_multimode_problem_(python/casadi)&amp;diff=2335"/>
		<updated>2020-03-14T09:17:46Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;=== Casadi ===  The model in Python code for a fixed control discretization grid using direct multiple shooting. We use pycombina for solving the (CIA) problem. &amp;lt;source lang=&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Casadi ===&lt;br /&gt;
&lt;br /&gt;
The model in Python code for a fixed control discretization grid using direct multiple shooting. We use pycombina for solving the (CIA) problem.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Three tank optimal control&lt;br /&gt;
# ----------------------&lt;br /&gt;
# An optimal control problem (OCP),&lt;br /&gt;
# solved with direct multiple-shooting.&lt;br /&gt;
#&lt;br /&gt;
# For more information on CasADi see: http://labs.casadi.org/OCP&lt;br /&gt;
from casadi import *&lt;br /&gt;
import pylab as pl&lt;br /&gt;
from pycombina import BinApprox, CombinaBnB&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
############# Input variables ############# &lt;br /&gt;
T = 12&lt;br /&gt;
N = 100 # number of control intervals&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
############# End of Input variables ############# &lt;br /&gt;
&lt;br /&gt;
opti = Opti() # Optimization problem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#------- parameter values --------------&lt;br /&gt;
# Model parameters&lt;br /&gt;
k_1 = 2&lt;br /&gt;
k_2 = 3&lt;br /&gt;
k_3 = 1&lt;br /&gt;
k_4 = 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
c_1 = 1&lt;br /&gt;
c_2 = 2&lt;br /&gt;
c_3 = 0.8&lt;br /&gt;
T = 12&lt;br /&gt;
&lt;br /&gt;
# ---- decision variables ---------&lt;br /&gt;
X = opti.variable(4,N+1) # state trajectory&lt;br /&gt;
x1   = X[0,:]&lt;br /&gt;
x2 = X[1,:]&lt;br /&gt;
x3 = X[2,:]&lt;br /&gt;
x4 = X[3,:]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
U = opti.variable(3,N)   # control trajectory (throttle)&lt;br /&gt;
u1   = U[0,:]&lt;br /&gt;
u2 = U[1,:]&lt;br /&gt;
u3 = U[2,:]&lt;br /&gt;
&lt;br /&gt;
# ---- objective          ---------&lt;br /&gt;
opti.minimize(x4[N]) # Objective as Mayer term&lt;br /&gt;
&lt;br /&gt;
# ---- dynamic constraints -------&lt;br /&gt;
f = lambda x,u: vertcat(c_1*u[0]+c_2*u[1]-(x[0])**0.5-  u[2]* (c_3*x[0])**0.5 , (x[0])**0.5- (x[1])**0.5, (x[1])**0.5- (x[2])**0.5 +u[2]* (c_3*x[0])**0.5 , u[1]*0.0+ k_1*(x[1]-k_2)**2 + k_3*(x[2]-k_4)**2 ) # dx/dt = f(x,u)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dt = T/N # length of a control interval&lt;br /&gt;
for k in range(N): # loop over control intervals&lt;br /&gt;
   # Runge-Kutta 4 integration&lt;br /&gt;
   k1 = f(X[:,k],         U[:,k])&lt;br /&gt;
   k2 = f(X[:,k]+dt/2*k1, U[:,k])&lt;br /&gt;
   k3 = f(X[:,k]+dt/2*k2, U[:,k])&lt;br /&gt;
   k4 = f(X[:,k]+dt*k3,   U[:,k])&lt;br /&gt;
   x_next = X[:,k] + dt/6*(k1+2*k2+2*k3+k4) &lt;br /&gt;
   opti.subject_to(X[:,k+1]==x_next) # close the gaps&lt;br /&gt;
&lt;br /&gt;
# ---- path constraints -----------&lt;br /&gt;
&lt;br /&gt;
opti.subject_to(opti.bounded(0,U,1)) # control is limited&lt;br /&gt;
opti.subject_to(u1+u2+u3 == 1) # SOS1 constraint&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# ---- boundary conditions --------&lt;br /&gt;
opti.subject_to(x1[0]==2)   # intitial values&lt;br /&gt;
opti.subject_to(x2[0]==2) # ... &lt;br /&gt;
opti.subject_to(x3[0]==2) # ... &lt;br /&gt;
opti.subject_to(x4[0]==0) # ... mayer term auxiliary state&lt;br /&gt;
&lt;br /&gt;
#opti.subject_to(pos[-1]==1)  # finish line at position 1&lt;br /&gt;
&lt;br /&gt;
# ---- misc. constraints  ----------&lt;br /&gt;
#opti.subject_to(T&amp;gt;=0) # Time must be positive&lt;br /&gt;
&lt;br /&gt;
# ---- initial values for solver ---&lt;br /&gt;
opti.set_initial(x1, 2)&lt;br /&gt;
opti.set_initial(x2, 2)&lt;br /&gt;
opti.set_initial(x3, 2)&lt;br /&gt;
opti.set_initial(x4, 0)&lt;br /&gt;
opti.set_initial(u1, 1)&lt;br /&gt;
opti.set_initial(u2, 0)&lt;br /&gt;
opti.set_initial(u3, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# ---- solve NLP              ------&lt;br /&gt;
opti.solver(&amp;quot;ipopt&amp;quot;) # set numerical backend&lt;br /&gt;
sol = opti.solve()   # actual solve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# ---- post-processing        ------&lt;br /&gt;
from pylab import plot, step, figure, legend, show, spy&lt;br /&gt;
&lt;br /&gt;
plt.plot(pl.linspace(0, 12, num=N+1),sol.value(x1),label=&amp;quot;x1&amp;quot;)&lt;br /&gt;
plt.plot(pl.linspace(0, 12, num=N+1),sol.value(x2),label=&amp;quot;x2&amp;quot;)&lt;br /&gt;
plt.plot(pl.linspace(0, 12, num=N+1),sol.value(x3),label=&amp;quot;x3&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#plot(limit(sol.value(pos)),&#039;r--&#039;,label=&amp;quot;speed limit&amp;quot;)&lt;br /&gt;
plt.step(pl.linspace(0, 12, num=N),sol.value(U[0,:]),&#039;k&#039;,label=&amp;quot;a1&amp;quot;)&lt;br /&gt;
plt.step(pl.linspace(0, 12, num=N),sol.value(U[1,:]),label=&amp;quot;a2&amp;quot;)&lt;br /&gt;
plt.step(pl.linspace(0, 12, num=N),sol.value(U[2,:]),label=&amp;quot;a3&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plt.xlabel(&#039;t&#039;)&lt;br /&gt;
plt.ylabel(&#039;state and control values&#039;)&lt;br /&gt;
plt.title(&#039;Differential state trajectories for relaxed controls&#039;)&lt;br /&gt;
&lt;br /&gt;
#xlabel=(&amp;quot;t&amp;quot;)&lt;br /&gt;
plt.legend(loc=&amp;quot;upper left&amp;quot;)&lt;br /&gt;
#title=&amp;quot;&lt;br /&gt;
plt.savefig(&#039;three_tank_relaxed_solution.png&#039;)&lt;br /&gt;
  &lt;br /&gt;
#################################################&lt;br /&gt;
&lt;br /&gt;
### Setting up CIA problem&lt;br /&gt;
&lt;br /&gt;
 ################################################&lt;br /&gt;
&lt;br /&gt;
t = np.linspace(0,T,N+1)&lt;br /&gt;
b_rel = np.array([[min(1,max(0,x)) for x in sol.value(U[0,:])], [min(1,max(0,x)) for x in sol.value(U[1,:])], [min(1,max(0,x)) for x in sol.value(U[2,:])]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
binapprox = BinApprox(t = t, b_rel = b_rel, binary_threshold = 1e-3, \&lt;br /&gt;
    off_state_included = False)&lt;br /&gt;
&lt;br /&gt;
#binapprox.set_n_max_switches(n_max_switches = max_switches)&lt;br /&gt;
#binapprox.set_min_up_times(min_up_times = [min_up_time])&lt;br /&gt;
#binapprox.set_min_down_times(min_down_times = [min_down_time])&lt;br /&gt;
&lt;br /&gt;
combina = CombinaBnB(binapprox)&lt;br /&gt;
combina.solve(use_warm_start=False, bnb_search_strategy=&#039;dfs&#039;, bnb_opts={&#039;max_iter&#039;: 1000000})&lt;br /&gt;
&lt;br /&gt;
b_bin_orig = pl.asarray(binapprox.b_bin)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#################################################&lt;br /&gt;
&lt;br /&gt;
### Re-run Optimization Problem with fixed binary controls&lt;br /&gt;
### &#039;Dirty hack&#039;: just copy previous problem set up due to reuse issues of constraints&lt;br /&gt;
&lt;br /&gt;
sol1_x1 = sol.value(x1)&lt;br /&gt;
sol1_x2 = sol.value(x2)&lt;br /&gt;
sol1_x3 = sol.value(x3)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
opti2 = Opti() # Optimization problem&lt;br /&gt;
&lt;br /&gt;
# ---- decision variables ---------&lt;br /&gt;
X = opti2.variable(4,N+1) # state trajectory&lt;br /&gt;
x1   = X[0,:]&lt;br /&gt;
x2 = X[1,:]&lt;br /&gt;
x3 = X[2,:]&lt;br /&gt;
x4 = X[3,:]&lt;br /&gt;
&lt;br /&gt;
U = opti2.variable(3,N)   # control trajectory (throttle)&lt;br /&gt;
u1   = U[0,:]&lt;br /&gt;
u2 = U[1,:]&lt;br /&gt;
u3 = U[2,:]&lt;br /&gt;
&lt;br /&gt;
# ---- objective          ---------&lt;br /&gt;
opti2.minimize(x4[N]) # Objective as Mayer term&lt;br /&gt;
&lt;br /&gt;
# ---- dynamic constraints --------&lt;br /&gt;
f = lambda x,u: vertcat(c_1*u[0]+c_2*u[1]-(x[0])**0.5-  u[2]* (c_3*x[0])**0.5 , (x[0])**0.5- (x[1])**0.5, (x[1])**0.5- (x[2])**0.5 +u[2]* (c_3*x[0])**0.5 , u[1]*0.0+ k_1*(x[1]-k_2)**2 + k_3*(x[2]-k_4)**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dt = T/N # length of a control interval&lt;br /&gt;
for k in range(N): # loop over control intervals&lt;br /&gt;
   # Runge-Kutta 4 integration&lt;br /&gt;
   k1 = f(X[:,k],         U[:,k])&lt;br /&gt;
   k2 = f(X[:,k]+dt/2*k1, U[:,k])&lt;br /&gt;
   k3 = f(X[:,k]+dt/2*k2, U[:,k])&lt;br /&gt;
   k4 = f(X[:,k]+dt*k3,   U[:,k])&lt;br /&gt;
   x_next = X[:,k] + dt/6*(k1+2*k2+2*k3+k4) &lt;br /&gt;
   opti2.subject_to(X[:,k+1]==x_next) # close the gaps&lt;br /&gt;
&lt;br /&gt;
# ---- path constraints -----------&lt;br /&gt;
opti2.subject_to(U==b_bin_orig) # control is fixed&lt;br /&gt;
&lt;br /&gt;
# ---- boundary conditions --------&lt;br /&gt;
opti2.subject_to(x1[0]==2)   # intitial values&lt;br /&gt;
opti2.subject_to(x2[0]==2) # ... &lt;br /&gt;
opti2.subject_to(x3[0]==2) # ... &lt;br /&gt;
opti2.subject_to(x4[0]==0) # ... mayer term auxiliary state&lt;br /&gt;
&lt;br /&gt;
#opti.subject_to(pos[-1]==1)  # finish line at position 1&lt;br /&gt;
&lt;br /&gt;
# ---- misc. constraints  ----------&lt;br /&gt;
#opti.subject_to(T&amp;gt;=0) # Time must be positive&lt;br /&gt;
&lt;br /&gt;
# ---- initial values for solver ---&lt;br /&gt;
opti2.set_initial(sol.value_variables())&lt;br /&gt;
# ---- initial values for solver ---&lt;br /&gt;
opti2.set_initial(x1, sol1_x1)&lt;br /&gt;
opti2.set_initial(x2, sol1_x2)&lt;br /&gt;
opti2.set_initial(x3, sol1_x3)&lt;br /&gt;
opti2.set_initial(x4, 0)&lt;br /&gt;
#opti.set_initial(u1, 0)&lt;br /&gt;
#opti.set_initial(u2, 0)&lt;br /&gt;
#opti.set_initial(u3, 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# ---- solve NLP              ------&lt;br /&gt;
opti2.solver(&amp;quot;ipopt&amp;quot;) # set numerical backend&lt;br /&gt;
sol2 = opti2.solve()   # actual solve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
######################&lt;br /&gt;
#### Plot the binary feasible trajectory solution&lt;br /&gt;
#####################&lt;br /&gt;
&lt;br /&gt;
figure()&lt;br /&gt;
&lt;br /&gt;
plt.plot(pl.linspace(0, 12, num=N+1),sol2.value(x1),label=&amp;quot;x1&amp;quot;)&lt;br /&gt;
plt.plot(pl.linspace(0, 12, num=N+1),sol2.value(x2),label=&amp;quot;x2&amp;quot;)&lt;br /&gt;
plt.plot(pl.linspace(0, 12, num=N+1),sol2.value(x3),label=&amp;quot;x3&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#plot(limit(sol.value(pos)),&#039;r--&#039;,label=&amp;quot;speed limit&amp;quot;)&lt;br /&gt;
plt.step(pl.linspace(0, 12, num=N),sol2.value(U[0,:]),&#039;k&#039;,label=&amp;quot;w1&amp;quot;)&lt;br /&gt;
plt.step(pl.linspace(0, 12, num=N),sol2.value(U[1,:]),label=&amp;quot;w2&amp;quot;)&lt;br /&gt;
plt.step(pl.linspace(0, 12, num=N),sol2.value(U[2,:]),label=&amp;quot;w3&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plt.xlabel(&#039;t&#039;)&lt;br /&gt;
plt.ylabel(&#039;state and control values&#039;)&lt;br /&gt;
plt.title(&#039;Differential state trajectories for binary controls&#039;)&lt;br /&gt;
&lt;br /&gt;
#xlabel=(&amp;quot;t&amp;quot;)&lt;br /&gt;
plt.legend(loc=&amp;quot;upper left&amp;quot;)&lt;br /&gt;
#title=&amp;quot;&lt;br /&gt;
show()&lt;br /&gt;
plt.savefig(&#039;three_tank_binary_solution.png&#039;)&lt;br /&gt;
&lt;br /&gt;
######################&lt;br /&gt;
#### Plot also the (CIA) rounding trajectories&lt;br /&gt;
#####################&lt;br /&gt;
&lt;br /&gt;
f, (ax1, ax2, ax3) = pl.subplots(3, sharex = True)&lt;br /&gt;
&lt;br /&gt;
ax1.step(t[:-1], b_bin_orig[0,:], label = &amp;quot;w&amp;quot;, color = &amp;quot;C0&amp;quot;, where = &amp;quot;post&amp;quot;)&lt;br /&gt;
# ax1.step(t[:-1], b_bin_red[0,:], label = &amp;quot;b_bin_red&amp;quot;, color = &amp;quot;C0&amp;quot;, linestyle = &amp;quot;dashed&amp;quot;, where = &amp;quot;post&amp;quot;)&lt;br /&gt;
ax1.scatter(t[:-1], b_rel[0,:], label = &amp;quot;a&amp;quot;, color = &amp;quot;C0&amp;quot;, marker = &amp;quot;x&amp;quot;)&lt;br /&gt;
ax1.legend(loc = &amp;quot;upper left&amp;quot;)&lt;br /&gt;
ax1.set_ylabel(&amp;quot;w_1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
ax2.step(t[:-1], b_bin_orig[1,:], label = &amp;quot;w&amp;quot;, color = &amp;quot;C1&amp;quot;, where = &amp;quot;post&amp;quot;)&lt;br /&gt;
# ax2.step(t[:-1], b_bin_red[1,:], label = &amp;quot;b_bin_red&amp;quot;, color = &amp;quot;C1&amp;quot;, linestyle = &amp;quot;dashed&amp;quot;, where = &amp;quot;post&amp;quot;)&lt;br /&gt;
ax2.scatter(t[:-1], b_rel[1,:], label = &amp;quot;a&amp;quot;, color = &amp;quot;C1&amp;quot;, marker = &amp;quot;x&amp;quot;)&lt;br /&gt;
ax2.legend(loc = &amp;quot;upper left&amp;quot;)&lt;br /&gt;
ax2.set_ylabel(&amp;quot;w_2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
ax3.step(t[:-1], b_bin_orig[2,:], label = &amp;quot;w&amp;quot;, color = &amp;quot;C2&amp;quot;, where = &amp;quot;post&amp;quot;)&lt;br /&gt;
# ax3.step(t[:-1], b_bin_red[2,:], label = &amp;quot;b_bin_red&amp;quot;, color = &amp;quot;C2&amp;quot;, linestyle = &amp;quot;dashed&amp;quot;, where = &amp;quot;post&amp;quot;)&lt;br /&gt;
ax3.scatter(t[:-1], b_rel[2,:], label = &amp;quot;a&amp;quot;, color = &amp;quot;C2&amp;quot;, marker = &amp;quot;x&amp;quot;)&lt;br /&gt;
ax3.legend(loc = &amp;quot;upper left&amp;quot;)&lt;br /&gt;
ax3.set_ylabel(&amp;quot;w_3&amp;quot;)&lt;br /&gt;
ax3.set_xlabel(&amp;quot;t&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
show()&lt;br /&gt;
plt.savefig(&#039;three_tank_rounding_solution.png&#039;)&lt;br /&gt;
 ################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2334</id>
		<title>Three Tank multimode problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2334"/>
		<updated>2020-03-14T09:13:31Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Reference Solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Double tank problem variant with three binary controls instead of only one control and three tanks, i.e., three differential states representing different compartments. &lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
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}{llll}&lt;br /&gt;
 \displaystyle \min_{x,w} &amp;amp;  \displaystyle \int_{0}^{T} &amp;amp; k_1(x_2-k_2)^2 + k_3(x_3-k_4)^2  \; \text{d}t\\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp;  \dot{x}_1 &amp;amp; = -\sqrt{x_1}+c_1 w_1 + c_2 w_2 - w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_2 &amp;amp; = \sqrt{x_1}-\sqrt{x_2}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_3 &amp;amp; = \sqrt{x_2}-\sqrt{x_3}+w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  x(0) &amp;amp; = (2,2,2)^T, \\[1.5ex]&lt;br /&gt;
&amp;amp; 1 &amp;amp; = \sum\limits_{i=1}^{3}w_i(t), \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in  \{0, 1\}, \quad i=1\ldots 3.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt; T=12, c_1=1, c_2=2, c_3=0.8, k_1=2, k_2=3, k_3 = 1, k_4 = 3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of direct optimal control and the CIA decomposition. We denote the relaxed control values with &amp;lt;math&amp;gt;a(t)\in[0, 1]&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=100, \, n_u=100  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;8.775979&amp;lt;/math&amp;gt;. The objective value of the binary controls obtained by Combinatorial Integral Approimation (CIA) is &amp;lt;math&amp;gt;8.789487&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:three_tank_relaxed_solution.png| Optimal relaxed controls and states determined by an direct approach with python 3.6 and CasADi, applied Multiple Shooting, 4th order Runge Kutta scheme and 100 discretization intervals.&lt;br /&gt;
 Image:three_tank_binary_solution.png| According optimal binary controls and states determined by the direct approach. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
 Image:three_tank_rounding_solution.png| Binary and relaxed control values as part of the Combinatorial Integral Approximation problem&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2333</id>
		<title>Three Tank multimode problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2333"/>
		<updated>2020-03-14T09:12:39Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Reference Solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Double tank problem variant with three binary controls instead of only one control and three tanks, i.e., three differential states representing different compartments. &lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
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}{llll}&lt;br /&gt;
 \displaystyle \min_{x,w} &amp;amp;  \displaystyle \int_{0}^{T} &amp;amp; k_1(x_2-k_2)^2 + k_3(x_3-k_4)^2  \; \text{d}t\\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp;  \dot{x}_1 &amp;amp; = -\sqrt{x_1}+c_1 w_1 + c_2 w_2 - w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_2 &amp;amp; = \sqrt{x_1}-\sqrt{x_2}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_3 &amp;amp; = \sqrt{x_2}-\sqrt{x_3}+w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  x(0) &amp;amp; = (2,2,2)^T, \\[1.5ex]&lt;br /&gt;
&amp;amp; 1 &amp;amp; = \sum\limits_{i=1}^{3}w_i(t), \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in  \{0, 1\}, \quad i=1\ldots 3.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt; T=12, c_1=1, c_2=2, c_3=0.8, k_1=2, k_2=3, k_3 = 1, k_4 = 3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of direct optimal control and the CIA decomposition. We denote the relaxed control values with &amp;lt;math&amp;gt;a(t)\in[0, 1]&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=100, \, n_u=100  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;8.775979&amp;lt;/math&amp;gt;. The objective value of the binary controls obtained by Combinatorial Integral Approimation (CIA) is &amp;lt;math&amp;gt;8.789487&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:three_tank_relaxed_solution.png| Optimal relaxed controls and states determined by an direct approach with python 3.6 and CasADi, applied Multiple Shooting, 4th order Runge Kutta scheme and &amp;lt;math&amp;gt;n_u=100&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:three_tank_binary_solution.png| According optimal binary controls and states determined by the direct approach. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
 Image:three_tank_rounding_solution.png| Binary and relaxed control values as part of the Combinatorial Integral Approximation problem&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Three_tank_rounding_solution.png&amp;diff=2332</id>
		<title>File:Three tank rounding solution.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Three_tank_rounding_solution.png&amp;diff=2332"/>
		<updated>2020-03-14T09:05:26Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Solution obtained by pycombina for the three tank OC problem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution obtained by pycombina for the three tank OC problem&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Three_tank_relaxed_solution.png&amp;diff=2331</id>
		<title>File:Three tank relaxed solution.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Three_tank_relaxed_solution.png&amp;diff=2331"/>
		<updated>2020-03-14T09:04:40Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Solution of three tank OC problem with relaxed controls&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution of three tank OC problem with relaxed controls&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Three_tank_binary_solution.png&amp;diff=2330</id>
		<title>File:Three tank binary solution.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Three_tank_binary_solution.png&amp;diff=2330"/>
		<updated>2020-03-14T09:00:40Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Solution of three tank OC problem with binary controls fixed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution of three tank OC problem with binary controls fixed&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Three_tank_binary_solution.pdf&amp;diff=2329</id>
		<title>File:Three tank binary solution.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Three_tank_binary_solution.pdf&amp;diff=2329"/>
		<updated>2020-03-14T08:58:21Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Solution of three tank OC problem with binary controls fixed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Solution of three tank OC problem with binary controls fixed&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2328</id>
		<title>Three Tank multimode problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Three_Tank_multimode_problem&amp;diff=2328"/>
		<updated>2020-03-14T07:48:51Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;{{Dimensions |nd        = 1 |nx        = 3 |nw        = 3 |nre       = 2 }}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...  --&amp;gt;This site describ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Double tank problem variant with three binary controls instead of only one control and three tanks, i.e., three differential states representing different compartments. &lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
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}{llll}&lt;br /&gt;
 \displaystyle \min_{x,w} &amp;amp;  \displaystyle \int_{0}^{T} &amp;amp; k_1(x_2-k_2)^2 + k_3(x_3-k_4)^2  \; \text{d}t\\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp;  \dot{x}_1 &amp;amp; = -\sqrt{x_1}+c_1 w_1 + c_2 w_2 - w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_2 &amp;amp; = \sqrt{x_1}-\sqrt{x_2}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_3 &amp;amp; = \sqrt{x_2}-\sqrt{x_3}+w_3 \sqrt{c_3 x_3}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  x(0) &amp;amp; = (2,2,2)^T, \\[1.5ex]&lt;br /&gt;
&amp;amp; 1 &amp;amp; = \sum\limits_{i=1}^{3}w_i(t), \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in  \{0, 1\}, \quad i=1\ldots 3.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt; T=12, c_1=1, c_2=2, c_3=0.8, k_1=2, k_2=3, k_3 = 1, k_4 = 3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=100  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.59106823&amp;lt;/math&amp;gt;. The objective value of the binary controls obtained by Combinatorial Integral Approimation (CIA) is &amp;lt;math&amp;gt;2.59121008&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:MmdoubletankRelaxed 12000 120 1.png| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=100&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:MmdoubletankCIA_12000_120_1.png| Optimal binary controls and states determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=100&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Double_Tank_multimode_problem&amp;diff=2327</id>
		<title>Double Tank multimode problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Double_Tank_multimode_problem&amp;diff=2327"/>
		<updated>2020-03-14T07:37:53Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 2&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Double tank problem variant with three binary controls instead of only one control. &lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
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}{llll}&lt;br /&gt;
 \displaystyle \min_{x,w} &amp;amp;  \displaystyle \int_{0}^{T} &amp;amp; k_1(x_2-k_2)^2  \; \text{d}t\\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp;  \dot{x}_1 &amp;amp; = \sum\limits_{i=1}^{3} c_{i}\; w_i,-\sqrt{x_1}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_2 &amp;amp; = \sqrt{x_1}-\sqrt{x_2}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  x(0) &amp;amp; = (2,2)^T, \\[1.5ex]&lt;br /&gt;
&amp;amp; 1 &amp;amp; = \sum\limits_{i=1}^{3}w_i(t), \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in  \{0, 1\}, \quad i=1\ldots 3.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt; T=10, c_1=1, c_2=0.5, c_3=2, k_1=2, k_2=3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=100  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;2.59106823&amp;lt;/math&amp;gt;. The objective value of the binary controls obtained by Combinatorial Integral Approimation (CIA) is &amp;lt;math&amp;gt;2.59121008&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:MmdoubletankRelaxed 12000 120 1.png| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=100&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:MmdoubletankCIA_12000_120_1.png| Optimal binary controls and states determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=100&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model description is available in&lt;br /&gt;
* [[:Category:AMPL | AMPL code]] at [[Double Tank multimode problem (AMPL)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Double_Tank&amp;diff=2326</id>
		<title>Double Tank</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Double_Tank&amp;diff=2326"/>
		<updated>2020-03-14T07:34:17Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 2&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The double tank problem is a basic example for a switching system. It contains the dynamics of an upper and a lower tank, connected to each other with a pipe. The goal is to minimize the deviation of a certain fluid level &amp;lt;math&amp;gt;k_2&amp;lt;/math&amp;gt; in the lower tank. The problem was introduced and discussed in a variety of publications for the optimal control of constrained switched systems, e.g. &amp;lt;bib id=&amp;quot;Henrion2014&amp;quot; /&amp;gt; (Link: [http://homepages.laas.fr/henrion/papers/switch.pdf Henrion et al.]) and &amp;lt;bib id=&amp;quot;Vasudevan2013&amp;quot; /&amp;gt; (Link: [http://epubs.siam.org/doi/pdf/10.1137/120901507 Vasudevan et al.]).&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llll}&lt;br /&gt;
 \displaystyle \min_{\sigma} &amp;amp;  \displaystyle \int_{0}^{T} &amp;amp; k_1(x_2-k_2)^2  \; \text{d}t\\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &amp;amp;  \dot{x}_1 &amp;amp; = c_{\sigma(t)}-\sqrt{x_1}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \dot{x}_2 &amp;amp; = \sqrt{x_1}-\sqrt{x_2}, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  x(0) &amp;amp; = (2,2)^T, \\[1.5ex]&lt;br /&gt;
 &amp;amp;  \sigma(t) &amp;amp; \in \{1,2\} \qquad &amp;amp;\text{for } t\in[0,T].\\[1.5ex]&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;
The two states of the system correspond to the fluid levels of an upper and a lower tank.&lt;br /&gt;
The output of the upper tank flows into the lower tank, the output of the lower&lt;br /&gt;
tank exits the system, and the flow into the upper tank is restricted to either &amp;lt;math&amp;gt;c_1&amp;lt;/math&amp;gt; [lt/s]&lt;br /&gt;
or &amp;lt;math&amp;gt;c_2&amp;lt;/math&amp;gt; [lt/s].  The dynamics in each mode are then derived using [https://en.wikipedia.org/wiki/Torricelli&#039;s_law Torricelli’s law], as&lt;br /&gt;
shown in constraints 1 and 2. The objective of the optimization is to have the fluid level in the&lt;br /&gt;
lower tank equal to &amp;lt;math&amp;gt;k_2&amp;lt;/math&amp;gt; [m], as reflected in the cost function.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
In an exemplary test, the parameters were chosen to be:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;k_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;k_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;c_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;c_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference Solution ==&lt;br /&gt;
The problem is solved in Python with [[:Category: Gekko | GEKKO]] or Matlab (version 2014b) with [[:Category: switch | Switch]]. The switch codes rely on [http://homepages.laas.fr/henrion/software/gloptipoly3/ GloptiPoly 3] and the solver [http://sedumi.ie.lehigh.edu/ SeDuMi 1.3] (optimization over symmetric cones). &lt;br /&gt;
By introducing the lifts &amp;lt;math&amp;gt;l_i=\sqrt{x_i}&amp;lt;/math&amp;gt;, algebraically constrained as &amp;lt;math&amp;gt;l_i^2=x_i, \; l_i\geq 0,&amp;lt;/math&amp;gt; the problem is recast with polynomial data. In this way way switch in connection with GloptiPoly3 can be applied. GloptiPoly 3 is a Matlab package developed by Didier Henrion for generalized problems of moments and needs polynomial input data. The exact code used to solve the problem can be found under [[Double Tank (switch)]]. The calculated objective is 4.7296 with the following trajectories of states and controls:&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:State_sequence_Tank.jpg| State trajectory over time.&lt;br /&gt;
 Image:Control_sequence_Tank.jpg| Control sequence over time.&lt;br /&gt;
&amp;lt;/gallery&amp;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;
* different control functions for the two tanks, see [[Double Tank multimode problem]]&lt;br /&gt;
* a three tank problem with 3 modes, see [[Three Tank multimode problem]]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Gekko | GEKKO Python code]] at [[Double Tank (GEKKO)]]&lt;br /&gt;
* [[:Category: switch | switch code]] at [[Double Tank (switch)]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;biblist /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 CLAEYS, Mathieu; DAAFOUZ Jamal; HENRION Didier Modal occupation measures and LMI relaxations for nonlinear switched systems control. arXiv preprint arXiv:1404.4699 (2014)&lt;br /&gt;
&lt;br /&gt;
 VASUDEVAN, Ramanarayan, et al. Consistent Approximations for the Optimal Control of Constrained Switched Systems---Part 2: An Implementable Algorithm. SIAM Journal on Control and Optimization, 2013, 51. Jg., Nr. 6, S. 4484-4503.&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: Tracking objective]]&lt;br /&gt;
[[Category: State dependent switches]]&lt;br /&gt;
[[Category:Bang bang]]&lt;br /&gt;
[[Category:Path-constrained arcs]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Quadrotor_(binary_variant)&amp;diff=2325</id>
		<title>Quadrotor (binary variant)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Quadrotor_(binary_variant)&amp;diff=2325"/>
		<updated>2019-10-14T14:29:39Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;{{Dimensions |nd        = 1 |nx        = 6 |nw        = 4 |nre       = 6 }}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...  --&amp;gt;This site describ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 6&lt;br /&gt;
|nw        = 4&lt;br /&gt;
|nre       = 6&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Quadrotor helicoptor problem variant where the continuous control is replaced via outer convexification with binary controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x,u, w} &amp;amp;  5(x_1(t_f)-6)^2&amp;amp;+&amp;amp;5(x_3(t_f)-1)^2+(\sin(x_5(t_f)0.5))^2 +\int\limits_{t_0}^{t_f} 5( (w_2(\tau)+w_4(\tau)+w_6(\tau))^2  \ d \tau   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp;  x_2(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; g \sin( x_5(t)) + \sum\limits_{i\in [4]}c_{1,i}w_i(t)\frac{\sin(x_5(t))}{M},   \\&lt;br /&gt;
 &amp;amp; \dot{x}_3 &amp;amp; = &amp;amp; x_4(t),   \\&lt;br /&gt;
 &amp;amp; \dot{x}_4 &amp;amp; = &amp;amp; g \cos( x_5(t))-g+  \sum\limits_{i\in [4]}c_{1,i}w_i(t)\frac{\cos(x_5(t))}{M},   \\&lt;br /&gt;
 &amp;amp; \dot{x}_5 &amp;amp; = &amp;amp; x_6(t),   \\&lt;br /&gt;
 &amp;amp; \dot{x}_6 &amp;amp; = &amp;amp;  \sum\limits_{i\in [4]}c_{2,i}w_i(t)L \frac{1}{I}  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0, 0, 1, 0 , 0, 0)^T, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, i=1,\ldots,4 \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{4}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
&amp;amp; x_3(t) &amp;amp; \geq &amp;amp; 0, \quad t\in[t_0,t_f].&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 7.5],\\&lt;br /&gt;
(g, M, L, I) &amp;amp;=&amp;amp; (9.8, 1.3, 0.305, 0.0605),\\&lt;br /&gt;
c_1 &amp;amp;=&amp;amp; (0,0.001,0,0),\\&lt;br /&gt;
c_2 &amp;amp;=&amp;amp; (0,0,-0.001,0.001),&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference Solutions ==&lt;br /&gt;
&lt;br /&gt;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; is in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; rather than being binary, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=25  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;13.0907346&amp;lt;/math&amp;gt;. The objective value of the solution with binary controls obtained by Combinatorial Integral Approximation (CIA) is &amp;lt;math&amp;gt;15.5787932&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:Quadrotor_bin_Relaxed_12000_25.pdf| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=25&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:Quadrotor_bin_CIA_12000_25.pdf| Differential states and binary cotnrol determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=25&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Quadrotor_bin_CIA_12000_25.pdf&amp;diff=2324</id>
		<title>File:Quadrotor bin CIA 12000 25.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Quadrotor_bin_CIA_12000_25.pdf&amp;diff=2324"/>
		<updated>2019-10-14T14:28:48Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Numerical results for the outer convexified problem &amp;quot;Quadrotor Helicoptor&amp;quot; with nt=12000, nu=25 and binary controls obtained via CIA decomposition.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerical results for the outer convexified problem &amp;quot;Quadrotor Helicoptor&amp;quot; with nt=12000, nu=25 and binary controls obtained via CIA decomposition.&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Quadrotor_bin_Relaxed_12000_25.pdf&amp;diff=2323</id>
		<title>File:Quadrotor bin Relaxed 12000 25.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Quadrotor_bin_Relaxed_12000_25.pdf&amp;diff=2323"/>
		<updated>2019-10-14T14:28:16Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Numerical results for the outer convexified problem &amp;quot;Quadrotor Helicoptor&amp;quot; with nt=12000, nu=25 and relaxed binary controls.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerical results for the outer convexified problem &amp;quot;Quadrotor Helicoptor&amp;quot; with nt=12000, nu=25 and relaxed binary controls.&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Quadrotor_helicopter_control_problem&amp;diff=2322</id>
		<title>Quadrotor helicopter control problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Quadrotor_helicopter_control_problem&amp;diff=2322"/>
		<updated>2019-10-14T13:44:09Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 6&lt;br /&gt;
|nu        = 1&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 6&lt;br /&gt;
|nrc       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The mixed-integer optimal control problem of a quadrotor helicopter in two dimensions is taken from (Link: [https://pdfs.semanticscholar.org/75a0/211476ddc21363cfb3262c04d18794ad06ef.pdf Gillula et al.]) and from (Link: [http://epubs.siam.org/doi/pdf/10.1137/120901507 Vasudevan et al.]). The evolution&lt;br /&gt;
of the quadrotor can be defined with respect to a fixed two dimensional reference&lt;br /&gt;
frame using six dimensions, where the first three dimensions represent the position&lt;br /&gt;
along a horizontal axis, the position along the vertical axis, and the roll angle of the&lt;br /&gt;
helicopter, respectively, and the last three dimensions represent the time derivative of&lt;br /&gt;
the first three dimensions.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x,u, w} &amp;amp;  5(x_1(t_f)-6)^2&amp;amp;+&amp;amp;5(x_3(t_f)-1)^2+(\sin(x_5(t_f)0.5))^2 +\int\limits_{t_0}^{t_f} 5u(\tau)^2 \ d \tau   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp;  x_2(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; g \sin( x_5(t)) + w_1(t)u(t)\frac{\sin(x_5(t))}{M},   \\&lt;br /&gt;
 &amp;amp; \dot{x}_3 &amp;amp; = &amp;amp; x_4(t),   \\&lt;br /&gt;
 &amp;amp; \dot{x}_4 &amp;amp; = &amp;amp; g \cos( x_5(t))-g+ w_1(t)u(t)\frac{\cos(x_5(t))}{M},   \\&lt;br /&gt;
 &amp;amp; \dot{x}_5 &amp;amp; = &amp;amp; x_6(t),   \\&lt;br /&gt;
 &amp;amp; \dot{x}_6 &amp;amp; = &amp;amp; -w_2(t)L \frac{u(t)}{I}+w_3(t)L \frac{u(t)}{I}   \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0, 0, 1, 0 , 0, 0)^T, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, i=1,\ldots,3 \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{3}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
&amp;amp; u(t) &amp;amp; \in&amp;amp; [0,0.001], \quad t\in[t_0,t_f],\\&lt;br /&gt;
&amp;amp; x_3(t) &amp;amp; \geq &amp;amp; 0, \quad t\in[t_0,t_f].&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 7.5],\\&lt;br /&gt;
(g, M, L, I) &amp;amp;=&amp;amp; (9.8, 1.3, 0.305, 0.0605),&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;
A reference solution can be found in [http://epubs.siam.org/doi/pdf/10.1137/120901507 Vasudevan et al.] based on the embedding transformation technique for switched systems.&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;
* [[Quadrotor (binary variant)]]: The quadrotor helicoptor problem, where the continuous control is replaced via partial outer convexification by binary controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Quadrotor_helicopter_control_problem&amp;diff=2321</id>
		<title>Quadrotor helicopter control problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Quadrotor_helicopter_control_problem&amp;diff=2321"/>
		<updated>2019-10-14T13:43:36Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 6&lt;br /&gt;
|nu        = 1&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 6&lt;br /&gt;
|nrc       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The mixed-integer optimal control problem of a quadrotor helicopter in two dimensions is taken from (Link: [https://pdfs.semanticscholar.org/75a0/211476ddc21363cfb3262c04d18794ad06ef.pdf Gillula et al.]).&lt;br /&gt;
 and from (Link: [http://epubs.siam.org/doi/pdf/10.1137/120901507 Vasudevan et al.]). The evolution&lt;br /&gt;
of the quadrotor can be defined with respect to a fixed two dimensional reference&lt;br /&gt;
frame using six dimensions, where the first three dimensions represent the position&lt;br /&gt;
along a horizontal axis, the position along the vertical axis, and the roll angle of the&lt;br /&gt;
helicopter, respectively, and the last three dimensions represent the time derivative of&lt;br /&gt;
the first three dimensions.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x,u, w} &amp;amp;  5(x_1(t_f)-6)^2&amp;amp;+&amp;amp;5(x_3(t_f)-1)^2+(\sin(x_5(t_f)0.5))^2 +\int\limits_{t_0}^{t_f} 5u(\tau)^2 \ d \tau   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp;  x_2(t), \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; g \sin( x_5(t)) + w_1(t)u(t)\frac{\sin(x_5(t))}{M},   \\&lt;br /&gt;
 &amp;amp; \dot{x}_3 &amp;amp; = &amp;amp; x_4(t),   \\&lt;br /&gt;
 &amp;amp; \dot{x}_4 &amp;amp; = &amp;amp; g \cos( x_5(t))-g+ w_1(t)u(t)\frac{\cos(x_5(t))}{M},   \\&lt;br /&gt;
 &amp;amp; \dot{x}_5 &amp;amp; = &amp;amp; x_6(t),   \\&lt;br /&gt;
 &amp;amp; \dot{x}_6 &amp;amp; = &amp;amp; -w_2(t)L \frac{u(t)}{I}+w_3(t)L \frac{u(t)}{I}   \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0, 0, 1, 0 , 0, 0)^T, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, i=1,\ldots,3 \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{3}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
&amp;amp; u(t) &amp;amp; \in&amp;amp; [0,0.001], \quad t\in[t_0,t_f],\\&lt;br /&gt;
&amp;amp; x_3(t) &amp;amp; \geq &amp;amp; 0, \quad t\in[t_0,t_f].&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 7.5],\\&lt;br /&gt;
(g, M, L, I) &amp;amp;=&amp;amp; (9.8, 1.3, 0.305, 0.0605),&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;
A reference solution can be found in [http://epubs.siam.org/doi/pdf/10.1137/120901507 Vasudevan et al.] based on the embedding transformation technique for switched systems.&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;
* [[Quadrotor (binary variant)]]: The quadrotor helicoptor problem, where the continuous control is replaced via partial outer convexification by binary controls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2320</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2320"/>
		<updated>2019-10-14T13:42:03Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; looks for an optimal fishing strategy to be performed on a fixed time horizon to bring the biomasses of both predator as prey fish to a prescribed steady state. The problem was set up as a small-scale benchmark problem. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra Lotka Volterra equations] for a predator-prey system have been augmented by an additional linear term, relating to fishing by man. The control can be regarded both in a relaxed, as in a discrete manner, corresponding to a part of the fleet, or the full fishing fleet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory &amp;lt;bib id=&amp;quot;Sager2011d&amp;quot; /&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:ACADO | ACADO code]] at [[Lotka Volterra fishing problem (ACADO)]]&lt;br /&gt;
* [[:Category:AMPL | AMPL code]] at [[Lotka Volterra fishing problem (AMPL)]]&lt;br /&gt;
* [[:Category:APMonitor | APMonitor code]] at [[Lotka Volterra fishing problem (APMonitor)]]&lt;br /&gt;
* [[:Category:Bocop | Bocop code]] at [[Lotka Volterra fishing problem (Bocop)]]&lt;br /&gt;
* [[:Category:Casadi | Casadi code]] at [[Lotka Volterra fishing problem (Casadi)]]&lt;br /&gt;
* [[:Category:Gekko | GEKKO Python code]] at [[Lotka Volterra fishing problem (GEKKO)]]&lt;br /&gt;
* [[:Category:JModelica | JModelica code]] at [[Lotka Volterra fishing problem (JModelica)]]&lt;br /&gt;
* [[:Category:Julia/JuMP | JuMP code]] at [[Lotka Volterra fishing problem (JuMP)]]&lt;br /&gt;
* [[:Category:Muscod | Muscod code]] at [[Lotka Volterra fishing problem (Muscod)]]&lt;br /&gt;
* [[:Category:switch | switch code]] at [[Lotka Volterra fishing problem (switch)]]&lt;br /&gt;
* [[:Category:TomDyn/PROPT | PROPT code]] at [[Lotka Volterra fishing problem (TomDyn/PROPT)]]&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;
* a prescribed time grid for the control function &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt;, see also [[Lotka Volterra fishing problem (AMPL)]],&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;, see [[Lotka Volterra multi-arcs problem]]&lt;br /&gt;
* different fishing control functions for the two species, see [[Lotka Volterra Multimode fishing problem]]&lt;br /&gt;
* different fishing control functions that fish an absolute value from the two species, see [[Lotka Volterra absolute fishing problem]]&lt;br /&gt;
* a terminal constrained formulation, where a violation is penalized via slack variables, see [[Lotka Volterra (terminal constraint violation)]]&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt; and revisited in his PhD thesis &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;biblist /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Quadrotor_helicopter_control_problem&amp;diff=2319</id>
		<title>Quadrotor helicopter control problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Quadrotor_helicopter_control_problem&amp;diff=2319"/>
		<updated>2019-10-14T13:11:06Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;{{Dimensions |nd        = 1 |nx        = 6 |nu        = 1 |nw        = 3 |nre       = 6 |nrc       = 3 }}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the l...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 6&lt;br /&gt;
|nu        = 1&lt;br /&gt;
|nw        = 3&lt;br /&gt;
|nre       = 6&lt;br /&gt;
|nrc       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The mixed-integer optimal control problem of a quadrotor helicopter in two dimensions is taken from [7] and [8]. The evolution&lt;br /&gt;
of the quadrotor can be defined with respect to a fixed two dimensional reference&lt;br /&gt;
frame using six dimensions, where the first three dimensions represent the position&lt;br /&gt;
along a horizontal axis, the position along the vertical axis, and the roll angle of the&lt;br /&gt;
helicopter, respectively, and the last three dimensions represent the time derivative of&lt;br /&gt;
the first three dimensions.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w, s} &amp;amp; x_2(t_f) + 10s   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x_0 &amp;amp; \geq &amp;amp; 1.1 - s,  \\&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}, \\&lt;br /&gt;
&amp;amp; s &amp;amp; \geq &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. This problem variant penalizes a biomass x(0) that is below 1.1 at the end of the time horizon.&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_{0}, c_{1}) &amp;amp;=&amp;amp; (0.4, 0.2),&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; is in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; rather than being binary, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=200  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;x_2(t_f) =1.36548113&amp;lt;/math&amp;gt;. The objective value of the solution with binary controls obtained by Combinatorial Integral Approximation (CIA) is &amp;lt;math&amp;gt;x_2(t_f) =1.38756111&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:Lotka_term_ineq_Relaxed_12000_200.pdf| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=200&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:Lotka_term_ineq_CIA_12000_200.pdf| Differential states and binary cotnrol determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=200&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2318</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2318"/>
		<updated>2019-10-14T13:07:26Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; looks for an optimal fishing strategy to be performed on a fixed time horizon to bring the biomasses of both predator as prey fish to a prescribed steady state. The problem was set up as a small-scale benchmark problem. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra Lotka Volterra equations] for a predator-prey system have been augmented by an additional linear term, relating to fishing by man. The control can be regarded both in a relaxed, as in a discrete manner, corresponding to a part of the fleet, or the full fishing fleet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory &amp;lt;bib id=&amp;quot;Sager2011d&amp;quot; /&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:ACADO | ACADO code]] at [[Lotka Volterra fishing problem (ACADO)]]&lt;br /&gt;
* [[:Category:AMPL | AMPL code]] at [[Lotka Volterra fishing problem (AMPL)]]&lt;br /&gt;
* [[:Category:APMonitor | APMonitor code]] at [[Lotka Volterra fishing problem (APMonitor)]]&lt;br /&gt;
* [[:Category:Bocop | Bocop code]] at [[Lotka Volterra fishing problem (Bocop)]]&lt;br /&gt;
* [[:Category:Casadi | Casadi code]] at [[Lotka Volterra fishing problem (Casadi)]]&lt;br /&gt;
* [[:Category:Gekko | GEKKO Python code]] at [[Lotka Volterra fishing problem (GEKKO)]]&lt;br /&gt;
* [[:Category:JModelica | JModelica code]] at [[Lotka Volterra fishing problem (JModelica)]]&lt;br /&gt;
* [[:Category:Julia/JuMP | JuMP code]] at [[Lotka Volterra fishing problem (JuMP)]]&lt;br /&gt;
* [[:Category:Muscod | Muscod code]] at [[Lotka Volterra fishing problem (Muscod)]]&lt;br /&gt;
* [[:Category:switch | switch code]] at [[Lotka Volterra fishing problem (switch)]]&lt;br /&gt;
* [[:Category:TomDyn/PROPT | PROPT code]] at [[Lotka Volterra fishing problem (TomDyn/PROPT)]]&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;
* a prescribed time grid for the control function &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt;, see also [[Lotka Volterra fishing problem (AMPL)]],&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;, see [[Lotka Volterra multi-arcs problem]]&lt;br /&gt;
* different fishing control functions for the two species, see [[Lotka Volterra Multimode fishing problem]]&lt;br /&gt;
* different fishing control functions that fish an absolute value from the two species, see [[Lotka Volterra absolute fishing problem]]&lt;br /&gt;
* a terminal constrained formulation, where a violation is penalized via slack variables, see [[Lotka Volterra (terminal constraint violation)]]&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
* [[Quadrotor helicopter control problem]]&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt; and revisited in his PhD thesis &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;biblist /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_(terminal_constraint_violation)&amp;diff=2317</id>
		<title>Lotka Volterra (terminal constraint violation)</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_(terminal_constraint_violation)&amp;diff=2317"/>
		<updated>2019-10-14T11:48:38Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;{{Dimensions |nd        = 1 |nx        = 2 |nw        = 1 |nre       = 2 |nri       = 1 }}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...  --&amp;gt;Th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 2&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 2&lt;br /&gt;
|nri       = 1&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Lotka Volterra variant where a terminal inequality constraint on the differential states is added. A violation of this constraint is penalized as part of the Mayer objective.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w, s} &amp;amp; x_2(t_f) + 10s   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x_0 &amp;amp; \geq &amp;amp; 1.1 - s,  \\&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}, \\&lt;br /&gt;
&amp;amp; s &amp;amp; \geq &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. This problem variant penalizes a biomass x(0) that is below 1.1 at the end of the time horizon.&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_{0}, c_{1}) &amp;amp;=&amp;amp; (0.4, 0.2),&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; is in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; rather than being binary, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=200  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;x_2(t_f) =1.36548113&amp;lt;/math&amp;gt;. The objective value of the solution with binary controls obtained by Combinatorial Integral Approximation (CIA) is &amp;lt;math&amp;gt;x_2(t_f) =1.38756111&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:Lotka_term_ineq_Relaxed_12000_200.pdf| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=200&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:Lotka_term_ineq_CIA_12000_200.pdf| Differential states and binary cotnrol determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=200&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Lotka_term_ineq_CIA_12000_200.pdf&amp;diff=2316</id>
		<title>File:Lotka term ineq CIA 12000 200.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Lotka_term_ineq_CIA_12000_200.pdf&amp;diff=2316"/>
		<updated>2019-10-14T11:47:03Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Numerical results for Lotka Volterra Problem with terminal inequality constraint violation. Results are based on binary control obtained via CIA and nt=12000, nu=200.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerical results for Lotka Volterra Problem with terminal inequality constraint violation. Results are based on binary control obtained via CIA and nt=12000, nu=200.&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Lotka_term_ineq_Relaxed_12000_200.pdf&amp;diff=2315</id>
		<title>File:Lotka term ineq Relaxed 12000 200.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Lotka_term_ineq_Relaxed_12000_200.pdf&amp;diff=2315"/>
		<updated>2019-10-14T11:46:33Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Numerical results for Lotka Volterra Problem with terminal inequality constraint violation. Results are based on relaxed control and nt=12000, nu=200.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Numerical results for Lotka Volterra Problem with terminal inequality constraint violation. Results are based on relaxed control and nt=12000, nu=200.&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2314</id>
		<title>Lotka Volterra absolute fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2314"/>
		<updated>2019-10-14T11:36:33Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Mathematical formulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 5&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Lotka Volterra variant with five binary controls that all represent fishing of an absolute biomass.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{0,i}\;  w_i, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{1,i}\;  w_i,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{5}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, \quad i=1\ldots 5.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. This problem variant allows to choose between five different fishing options.&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_{0,1}, c_{1,1}) &amp;amp;=&amp;amp; (0.2, 0.1),\\&lt;br /&gt;
(c_{0,2}, c_{1,2}) &amp;amp;=&amp;amp; (0.4, 0.2),\\&lt;br /&gt;
(c_{0,3}, c_{1,3}) &amp;amp;=&amp;amp; (0.01, 0.1),\\&lt;br /&gt;
(c_{0,4}, c_{1,4}) &amp;amp;=&amp;amp; (0, 0),\\&lt;br /&gt;
(c_{0,5}, c_{1,5}) &amp;amp;=&amp;amp; (-0.1, -0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; is in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; rather than being binary, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=150  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;x_2(t_f) =0.345768563&amp;lt;/math&amp;gt;. The objective value of the solution with binary controls obtained by Combinatorial Integral Approximation (CIA) is &amp;lt;math&amp;gt;x_2(t_f) =0.348617982&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:Lotka_abs_fish_relaxed_12000_80.pdf| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=150&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:Lotka_abs_fish_CIA_states_12000_80.pdf| Differential states determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=150&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
 Image:Lotka_abs_fish_CIA_controls_12000_80.pdf| Binary control determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=150&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation. The fishing control shows a lot of chattering.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2313</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2313"/>
		<updated>2019-10-14T11:27:39Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; looks for an optimal fishing strategy to be performed on a fixed time horizon to bring the biomasses of both predator as prey fish to a prescribed steady state. The problem was set up as a small-scale benchmark problem. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra Lotka Volterra equations] for a predator-prey system have been augmented by an additional linear term, relating to fishing by man. The control can be regarded both in a relaxed, as in a discrete manner, corresponding to a part of the fleet, or the full fishing fleet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory &amp;lt;bib id=&amp;quot;Sager2011d&amp;quot; /&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:ACADO | ACADO code]] at [[Lotka Volterra fishing problem (ACADO)]]&lt;br /&gt;
* [[:Category:AMPL | AMPL code]] at [[Lotka Volterra fishing problem (AMPL)]]&lt;br /&gt;
* [[:Category:APMonitor | APMonitor code]] at [[Lotka Volterra fishing problem (APMonitor)]]&lt;br /&gt;
* [[:Category:Bocop | Bocop code]] at [[Lotka Volterra fishing problem (Bocop)]]&lt;br /&gt;
* [[:Category:Casadi | Casadi code]] at [[Lotka Volterra fishing problem (Casadi)]]&lt;br /&gt;
* [[:Category:Gekko | GEKKO Python code]] at [[Lotka Volterra fishing problem (GEKKO)]]&lt;br /&gt;
* [[:Category:JModelica | JModelica code]] at [[Lotka Volterra fishing problem (JModelica)]]&lt;br /&gt;
* [[:Category:Julia/JuMP | JuMP code]] at [[Lotka Volterra fishing problem (JuMP)]]&lt;br /&gt;
* [[:Category:Muscod | Muscod code]] at [[Lotka Volterra fishing problem (Muscod)]]&lt;br /&gt;
* [[:Category:switch | switch code]] at [[Lotka Volterra fishing problem (switch)]]&lt;br /&gt;
* [[:Category:TomDyn/PROPT | PROPT code]] at [[Lotka Volterra fishing problem (TomDyn/PROPT)]]&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;
* a prescribed time grid for the control function &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt;, see also [[Lotka Volterra fishing problem (AMPL)]],&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;, see [[Lotka Volterra multi-arcs problem]]&lt;br /&gt;
* different fishing control functions for the two species, see [[Lotka Volterra Multimode fishing problem]]&lt;br /&gt;
* different fishing control functions that fish an absolute value from the two species, see [[Lotka Volterra absolute fishing problem]]&lt;br /&gt;
* a terminal constrained formulation, where a violation is penalized via slack variables, see [[Lotka Volterra (terminal constraint violation)]]&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt; and revisited in his PhD thesis &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;biblist /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2312</id>
		<title>Lotka Volterra absolute fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2312"/>
		<updated>2019-10-14T11:10:19Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Reference Solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 5&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Lotka Volterra variant with five binary controls that all represent fishing of an absolute biomass.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{0,i}\;  w_i, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{1,i}\;  w_i,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{5}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, \quad i=1\ldots 5.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. This problem variant allows to choose between three different fishing options.&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_{0,1}, c_{1,1}) &amp;amp;=&amp;amp; (0.2, 0.1),\\&lt;br /&gt;
(c_{0,2}, c_{1,2}) &amp;amp;=&amp;amp; (0.4, 0.2),\\&lt;br /&gt;
(c_{0,3}, c_{1,3}) &amp;amp;=&amp;amp; (0.01, 0.1),\\&lt;br /&gt;
(c_{0,4}, c_{1,4}) &amp;amp;=&amp;amp; (0, 0),\\&lt;br /&gt;
(c_{0,5}, c_{1,5}) &amp;amp;=&amp;amp; (-0.1, -0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; is in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; rather than being binary, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=150  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;x_2(t_f) =0.345768563&amp;lt;/math&amp;gt;. The objective value of the solution with binary controls obtained by Combinatorial Integral Approximation (CIA) is &amp;lt;math&amp;gt;x_2(t_f) =0.348617982&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:Lotka_abs_fish_relaxed_12000_80.pdf| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=150&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:Lotka_abs_fish_CIA_states_12000_80.pdf| Differential states determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=150&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
 Image:Lotka_abs_fish_CIA_controls_12000_80.pdf| Binary control determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=150&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation. The fishing control shows a lot of chattering.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Lotka_abs_fish_CIA_controls_12000_80.pdf&amp;diff=2311</id>
		<title>File:Lotka abs fish CIA controls 12000 80.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Lotka_abs_fish_CIA_controls_12000_80.pdf&amp;diff=2311"/>
		<updated>2019-10-14T11:08:34Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Results of Lotka Volterra Problem with absolute fishing controls obtained via CIA, control values&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Results of Lotka Volterra Problem with absolute fishing controls obtained via CIA, control values&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Lotka_abs_fish_CIA_states_12000_80.pdf&amp;diff=2310</id>
		<title>File:Lotka abs fish CIA states 12000 80.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Lotka_abs_fish_CIA_states_12000_80.pdf&amp;diff=2310"/>
		<updated>2019-10-14T11:08:14Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Results of Lotka Volterra Problem with absolute fishing controls obtained via CIA, differential states&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Results of Lotka Volterra Problem with absolute fishing controls obtained via CIA, differential states&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Lotka_abs_fish_relaxed_12000_80.pdf&amp;diff=2309</id>
		<title>File:Lotka abs fish relaxed 12000 80.pdf</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Lotka_abs_fish_relaxed_12000_80.pdf&amp;diff=2309"/>
		<updated>2019-10-14T11:03:51Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Results of Lotka Volterra absolute fishing problem with relaxed controls.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Results of Lotka Volterra absolute fishing problem with relaxed controls.&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2308</id>
		<title>Lotka Volterra absolute fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2308"/>
		<updated>2019-10-14T10:56:25Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 5&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Lotka Volterra variant with five binary controls that all represent fishing of an absolute biomass.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{0,i}\;  w_i, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{1,i}\;  w_i,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{5}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, \quad i=1\ldots 5.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. This problem variant allows to choose between three different fishing options.&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_{0,1}, c_{1,1}) &amp;amp;=&amp;amp; (0.2, 0.1),\\&lt;br /&gt;
(c_{0,2}, c_{1,2}) &amp;amp;=&amp;amp; (0.4, 0.2),\\&lt;br /&gt;
(c_{0,3}, c_{1,3}) &amp;amp;=&amp;amp; (0.01, 0.1),\\&lt;br /&gt;
(c_{0,4}, c_{1,4}) &amp;amp;=&amp;amp; (0, 0),\\&lt;br /&gt;
(c_{0,5}, c_{1,5}) &amp;amp;=&amp;amp; (-0.1, -0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; is in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; rather than being binary, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=150  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;x_2(t_f) =0.345768563&amp;lt;/math&amp;gt;. The objective value of the solution with binary controls obtained by Combinatorial Integral Approximation (CIA) is &amp;lt;math&amp;gt;x_2(t_f) =0.348617982&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:MmlotkaRelaxed_12000_30_1.png| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=400&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:MmlotkaCIA 12000 30 1.png| Optimal binary controls and states determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=400&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2307</id>
		<title>Lotka Volterra absolute fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_absolute_fishing_problem&amp;diff=2307"/>
		<updated>2019-10-14T07:24:38Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: Created page with &amp;quot;{{Dimensions |nd        = 1 |nx        = 3 |nw        = 5 |nre       = 3 }}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...  --&amp;gt;This site describ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 5&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;This site describes a Lotka Volterra variant with five binary controls that all represent fishing of an absolute biomass.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{0,i}\;  w_i, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; \sum\limits_{i=1}^{5} c_{1,i}\;  w_i,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; \sum\limits_{i=1}^{5}w_i(t) &amp;amp;=&amp;amp; 1, \\&lt;br /&gt;
 &amp;amp; w_i(t) &amp;amp;\in&amp;amp;  \{0, 1\}, \quad i=1\ldots 5.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. This problem variant allows to choose between three different fishing options.&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_{0,1}, c_{1,1}) &amp;amp;=&amp;amp; (0.2, 0.1),\\&lt;br /&gt;
(c_{0,2}, c_{1,2}) &amp;amp;=&amp;amp; (0.4, 0.2),\\&lt;br /&gt;
(c_{0,3}, c_{1,3}) &amp;amp;=&amp;amp; (0.01, 0.1),\\&lt;br /&gt;
(c_{0,4}, c_{1,4}) &amp;amp;=&amp;amp; (0, 0),\\&lt;br /&gt;
(c_{0,5}, c_{1,5}) &amp;amp;=&amp;amp; (-0.1, -0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
The optimal objective value of the relaxed problem with  &amp;lt;math&amp;gt; n_t=12000, \, n_u=400  &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;x_2(t_f) =1.82875272&amp;lt;/math&amp;gt;. The objective value of the binary controls obtained by Combinatorial Integral Approimation (CIA) is &amp;lt;math&amp;gt;x_2(t_f) =1.82878681&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:MmlotkaRelaxed_12000_30_1.png| Optimal relaxed controls and states determined by an direct approach with ampl_mintoc (Radau collocation)  and &amp;lt;math&amp;gt;n_t=12000, \, n_u=400&amp;lt;/math&amp;gt;.&lt;br /&gt;
 Image:MmlotkaCIA 12000 30 1.png| Optimal binary controls and states determined by an direct approach (Radau collocation) with ampl_mintoc and &amp;lt;math&amp;gt;n_t=12000, \, n_u=400&amp;lt;/math&amp;gt;. The relaxed controls were approximated by Combinatorial Integral Approximation.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2306</id>
		<title>Lotka Volterra fishing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Lotka_Volterra_fishing_problem&amp;diff=2306"/>
		<updated>2019-10-14T06:34:26Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Variants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 3&lt;br /&gt;
|nw        = 1&lt;br /&gt;
|nre       = 3&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The &#039;&#039;&#039;Lotka Volterra fishing problem&#039;&#039;&#039; looks for an optimal fishing strategy to be performed on a fixed time horizon to bring the biomasses of both predator as prey fish to a prescribed steady state. The problem was set up as a small-scale benchmark problem. &lt;br /&gt;
The well known [http://en.wikipedia.org/wiki/Lotka_volterra Lotka Volterra equations] for a predator-prey system have been augmented by an additional linear term, relating to fishing by man. The control can be regarded both in a relaxed, as in a discrete manner, corresponding to a part of the fleet, or the full fishing fleet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]]. The interior point equality conditions fix the initial values of the differential states.&lt;br /&gt;
&lt;br /&gt;
The optimal integer control functions shows [[:Category:Chattering|chattering]] behavior, making the Lotka Volterra fishing problem an ideal candidate for benchmarking of algorithms.&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The mixed-integer optimal control problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llclr}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp; x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_0 &amp;amp; = &amp;amp;  x_0 - x_0 x_1 - \; c_0 x_0 \; w, \\&lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp; - x_1 + x_0 x_1 - \; c_1 x_1 \; w,  \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; (x_0 - 1)^2 + (x_1 - 1)^2,  \\[1.5ex]&lt;br /&gt;
 &amp;amp; x(0) &amp;amp;=&amp;amp; (0.5, 0.7, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0, 1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the differential states &amp;lt;math&amp;gt;(x_0, x_1)&amp;lt;/math&amp;gt; describe the biomasses of prey and predator, respectively. The third differential state is used here to transform the objective, an integrated deviation, into the Mayer formulation &amp;lt;math&amp;gt;\min \; x_2(t_f)&amp;lt;/math&amp;gt;. The decision, whether the fishing fleet is actually fishing at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is denoted by &amp;lt;math&amp;gt;w(t)&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;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcl}&lt;br /&gt;
[t_0, t_f] &amp;amp;=&amp;amp; [0, 12],\\&lt;br /&gt;
(c_0, c_1) &amp;amp;=&amp;amp; (0.4, 0.2).&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;
If the problem is relaxed, i.e., we demand that &amp;lt;math&amp;gt;w(t)&amp;lt;/math&amp;gt; be in the continuous interval &amp;lt;math&amp;gt;[0, 1]&amp;lt;/math&amp;gt; instead of the binary choice &amp;lt;math&amp;gt;\{0,1\}&amp;lt;/math&amp;gt;, the optimal solution can be determined by means of [http://en.wikipedia.org/wiki/Pontryagin%27s_minimum_principle Pontryagins maximum principle]. The optimal solution contains a singular arc, as can be seen in the plot of the optimal control. The two differential states and corresponding adjoint variables in the indirect approach are also displayed. A different approach to solving the relaxed problem is by using a direct method such as collocation or Bock&#039;s direct multiple shooting method. Optimal solutions for different control discretizations are also plotted in the leftmost figure.&lt;br /&gt;
&lt;br /&gt;
The optimal objective value of this relaxed problem is &amp;lt;math&amp;gt;x_2(t_f) = 1.34408&amp;lt;/math&amp;gt;. As follows from MIOC theory &amp;lt;bib id=&amp;quot;Sager2011d&amp;quot; /&amp;gt; this is the best lower bound on the optimal value of the original problem with the integer restriction on the control function. In other words, this objective value can be approximated arbitrarily close, if the control only switches often enough between 0 and 1. As no optimal solution exists, two suboptimal ones are shown, one with only two switches and an objective function value of &amp;lt;math&amp;gt;x_2(t_f) = 1.38276&amp;lt;/math&amp;gt;, and one with 56 switches and &amp;lt;math&amp;gt;x_2(t_f) = 1.34416&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:lotkaRelaxedControls.png| Optimal relaxed control determined by an indirect approach and by a direct approach on different control discretization grids.&lt;br /&gt;
 Image:lotkaindirektStates.png| Differential states and corresponding adjoint variables in the indirect approach.&lt;br /&gt;
 Image:lotka2Switches.png| Control and differential states with only two switches.&lt;br /&gt;
 Image:lotka56Switches.png| Control and differential states with 56 switches.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:ACADO | ACADO code]] at [[Lotka Volterra fishing problem (ACADO)]]&lt;br /&gt;
* [[:Category:AMPL | AMPL code]] at [[Lotka Volterra fishing problem (AMPL)]]&lt;br /&gt;
* [[:Category:APMonitor | APMonitor code]] at [[Lotka Volterra fishing problem (APMonitor)]]&lt;br /&gt;
* [[:Category:Bocop | Bocop code]] at [[Lotka Volterra fishing problem (Bocop)]]&lt;br /&gt;
* [[:Category:Casadi | Casadi code]] at [[Lotka Volterra fishing problem (Casadi)]]&lt;br /&gt;
* [[:Category:Gekko | GEKKO Python code]] at [[Lotka Volterra fishing problem (GEKKO)]]&lt;br /&gt;
* [[:Category:JModelica | JModelica code]] at [[Lotka Volterra fishing problem (JModelica)]]&lt;br /&gt;
* [[:Category:Julia/JuMP | JuMP code]] at [[Lotka Volterra fishing problem (JuMP)]]&lt;br /&gt;
* [[:Category:Muscod | Muscod code]] at [[Lotka Volterra fishing problem (Muscod)]]&lt;br /&gt;
* [[:Category:switch | switch code]] at [[Lotka Volterra fishing problem (switch)]]&lt;br /&gt;
* [[:Category:TomDyn/PROPT | PROPT code]] at [[Lotka Volterra fishing problem (TomDyn/PROPT)]]&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;
* a prescribed time grid for the control function &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt;, see also [[Lotka Volterra fishing problem (AMPL)]],&lt;br /&gt;
* a time-optimal formulation to get into a steady-state &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;,&lt;br /&gt;
* the usage of a different target steady-state, as the one corresponding to &amp;lt;math&amp;gt; w(t) = 1&amp;lt;/math&amp;gt; which is &amp;lt;math&amp;gt;(1 + c_1, 1 - c_0)&amp;lt;/math&amp;gt;, see [[Lotka Volterra multi-arcs problem]]&lt;br /&gt;
* different fishing control functions for the two species, see [[Lotka Volterra Multimode fishing problem]]&lt;br /&gt;
* different fishing control functions that fish an absolute value from the two species, see [[Lotka Volterra absolute fishing problem]]&lt;br /&gt;
* different parameters and start values.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous and Further Reading ==&lt;br /&gt;
The Lotka Volterra fishing problem was introduced by Sebastian Sager in a proceedings paper &amp;lt;bib id=&amp;quot;Sager2006&amp;quot; /&amp;gt; and revisited in his PhD thesis &amp;lt;bib id=&amp;quot;Sager2005&amp;quot; /&amp;gt;. These are also the references to look for more details.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;biblist /&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:Tracking objective]]&lt;br /&gt;
[[Category:Chattering]]&lt;br /&gt;
[[Category:Sensitivity-seeking arcs]]&lt;br /&gt;
[[Category:Population dynamics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Testing Graphviz&lt;br /&gt;
&amp;lt;graphviz border=&#039;frame&#039; format=&#039;svg&#039;&amp;gt;&lt;br /&gt;
digraph G {Hello-&amp;gt;World!}&lt;br /&gt;
&amp;lt;/graphviz&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2304</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2304"/>
		<updated>2019-09-02T10:11:39Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2303</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2303"/>
		<updated>2019-09-02T10:11:16Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10 &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2302</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2302"/>
		<updated>2019-09-02T10:02:31Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2301</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2301"/>
		<updated>2019-09-02T09:52:45Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{19} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2300</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2300"/>
		<updated>2019-09-02T09:52:18Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{9\ } &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2299</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2299"/>
		<updated>2019-09-02T09:51:54Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{19} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2298</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2298"/>
		<updated>2019-09-02T09:51:39Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{11} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2297</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2297"/>
		<updated>2019-09-02T09:51:24Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{8} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2296</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2296"/>
		<updated>2019-09-02T09:51:06Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^8 &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2295</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2295"/>
		<updated>2019-09-02T09:50:11Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^9 &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2294</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2294"/>
		<updated>2019-09-02T09:49:52Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2293</id>
		<title>Continuously Stirred Tank Reactor problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Continuously_Stirred_Tank_Reactor_problem&amp;diff=2293"/>
		<updated>2019-09-02T09:49:34Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 4&lt;br /&gt;
|nu        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Continuously Stirred Tank Reactor problem considers a chemical reaction that produces cyclopenthenol while using up cyclepentadiene &amp;quot;by an acid-catalyzed electrophilic hydration in aqueous solution&amp;quot;, an exothermal reaction which needs to be cooled. This problem can e.g. be found in &amp;lt;bib id=&amp;quot;Diehl2001&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The inflow into the tank contains only cyclopentadiene (substance &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;) with temperature &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; and the flow rate &amp;lt;math&amp;gt; \dot{V} &amp;lt;/math&amp;gt; can be controlled. The outflow rate is the same as the inflow rate to keep the liquid level in the tank constant.&lt;br /&gt;
&amp;quot;The outflow contains a remainder of cyclopentadiene, the wanted product cyclepentenol (substance &amp;lt;math&amp;gt; B &amp;lt;/math&amp;gt;) and two unwated by-products, cyclopentanediol (substance &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;) and dicyclopentadiene (substance &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt;) with concentrations &amp;lt;math&amp;gt; c_A, c_B, c_C, c_D &amp;lt;/math&amp;gt;.&amp;quot; The latter two are not tracked in the problem as the substances are not of use.&lt;br /&gt;
The reaction scheme is given as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{ccccc}&lt;br /&gt;
A &amp;amp; \overset{k_1}\rightarrow &amp;amp; B \overset{k_2}\rightarrow &amp;amp; C\\&lt;br /&gt;
2A &amp;amp; \overset{k_3}\rightarrow &amp;amp; D&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the reaction rates &amp;lt;math&amp;gt; k_i &amp;lt;/math&amp;gt; are a function of the reactor temperature &amp;lt;math&amp;gt; \theta &amp;lt;/math&amp;gt; via an Arrhenius law&lt;br /&gt;
&amp;lt;math&amp;gt; k_i(\theta) = k_{i0} \cdot \exp ( \frac{E_i}{\theta / ^\circ C + 273.15} ), \quad i=1,2,3. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The temperature &amp;lt;math&amp;gt; \theta_K &amp;lt;/math&amp;gt; in the cooling jacket is held down by an external heat exchanger whose heat removal rate &amp;lt;math&amp;gt; \dot{Q}_K &amp;lt;/math&amp;gt; can be controlled.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \max_{\dot{V}, \dot{Q}_K} &amp;amp; c_B &amp;amp; &amp;amp; \text{ at the end of reaction}   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{c_A} &amp;amp; = &amp;amp;  \frac{\dot{V}}{V_R} (c_{A0} - c_A) -  k_1 c_A - k_3 c_A^2, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{c_B} &amp;amp; = &amp;amp; -\frac{\dot{V}}{V_R} c_B + k_1 c_A - k_2 c_B, \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta} &amp;amp; = &amp;amp; \frac{\dot{V}}{V_R} ( \theta_0 - \theta) + \frac{k_w A_R}{\rho C_p V_R} (\theta_K - \theta) - \frac{1}{\rho C_p} (k_1 c_A H_1 + k_2 c_B H_2 + k_3 c_A^2 H_3),  \\[0.5cm]&lt;br /&gt;
 &amp;amp; \dot{\theta_K} &amp;amp; = &amp;amp; \frac{1}{m_K C_{PK}} ( \dot{Q}_K + k_w A_R (\theta - \theta_K)),\\[0.7cm]&lt;br /&gt;
 &amp;amp; c_A(0) &amp;amp; = &amp;amp; c_{A0},\\&lt;br /&gt;
 &amp;amp; c_B(0) &amp;amp; = &amp;amp; 0.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
where the various values are given in the Parameters section.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
These fixed values are used within the model.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Parameters&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Symbol&lt;br /&gt;
|Value&lt;br /&gt;
|Unit&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{20}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 1.287 \cdot 10^{12} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;k_{30}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; 9.043 \cdot 10^{19} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; h^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; -9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-9758.3&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Arrhenius coefficient&lt;br /&gt;
|&amp;lt;math&amp;gt;E_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-8560&amp;lt;/math&amp;gt;&lt;br /&gt;
|[-]&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_2&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-11.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reaction enthalpy&lt;br /&gt;
|&amp;lt;math&amp;gt;H_3&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;-41.85&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{mol} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solution density&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.9342&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kg}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of aqueous solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_p&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;3.01&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Heat transfer coefficient for cooling jacket&lt;br /&gt;
|&amp;lt;math&amp;gt;k_w&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;4032&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{h \cdot m^2 \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor surface area&lt;br /&gt;
|&amp;lt;math&amp;gt;A_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;0.215&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; m^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Reactor volume&lt;br /&gt;
|&amp;lt;math&amp;gt;V_R&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; l &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Coolant mass&lt;br /&gt;
|&amp;lt;math&amp;gt;m_K&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; kg &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Capacity of coolant solution&lt;br /&gt;
|&amp;lt;math&amp;gt;C_{PK}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;2.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{kJ}{kg \cdot K} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Starting concentration of subs. &amp;lt;math&amp;gt; A &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;c_{A0}&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;5.1&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{mol}{l} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Inflow temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;\theta_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;104.9&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; ^\circ C &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Reference solution ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The result of a steady state optimization of the yield &amp;lt;math&amp;gt; = \frac{c_B |_S}{c_{A0}} &amp;lt;/math&amp;gt; with respect to the design parameter &amp;lt;math&amp;gt; \theta_0 &amp;lt;/math&amp;gt; (feed temperature) and the two controls yields the steady stae and controls&amp;quot;&lt;br /&gt;
&amp;lt;math&amp;gt; c_A = 2.1402 \frac{mol}{l}, c_B = 1.0903\frac{mol}{l}, \theta = 114.19^\circ C, \theta_K = 112.91^\circ C &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \frac{\dot{V}}{V_R} = 14.19 h^{-1}, \dot{Q}_K = -1113.5 \frac{kJ}{h} &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Continuously Stirred Tank Reactor (TACO)]]&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Catalyst_mixing_problem&amp;diff=2237</id>
		<title>Catalyst mixing problem</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Catalyst_mixing_problem&amp;diff=2237"/>
		<updated>2018-01-12T19:15:36Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Dimensions&lt;br /&gt;
|nd        = 1&lt;br /&gt;
|nx        = 2&lt;br /&gt;
|nu        = 1&lt;br /&gt;
|nc        = 2&lt;br /&gt;
|nre       = 2&lt;br /&gt;
}}&amp;lt;!-- Do not insert line break here or Dimensions Box moves up in the layout...&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;The Catalyst mixing problem seeks an optimal policy for mixing two catalysts &amp;quot;along the length of a tubular plug &lt;br /&gt;
ow reactor involving several reactions&amp;quot;. (Cite and problem taken from the [http://www.mcs.anl.gov/~more/cops/ COPS library])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mathematical formulation ==&lt;br /&gt;
&lt;br /&gt;
The problem is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{llcl}&lt;br /&gt;
 \displaystyle \min_{x, w} &amp;amp;-1 + x_1(t_f) + x_2(t_f)   \\[1.5ex]&lt;br /&gt;
 \mbox{s.t.} &lt;br /&gt;
 &amp;amp; \dot{x}_1 &amp;amp; = &amp;amp;  w(t) ( 10 x_2(t) - x_1(t)), \\&lt;br /&gt;
 &amp;amp; \dot{x}_2 &amp;amp; = &amp;amp; w(t) ( x_1(t) - 10 x_2(t)) - (1 - w(t)) \, x_2(t) ,  \\&lt;br /&gt;
 &amp;amp; x(t_0) &amp;amp;=&amp;amp; (1, 0)^T, \\&lt;br /&gt;
 &amp;amp; w(t) &amp;amp;\in&amp;amp;  \{0,1\}.&lt;br /&gt;
\end{array} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
In this model the parameters used are &amp;lt;math&amp;gt; t_0 = 0, \, \, t_f = 1 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Reference Solution ==&lt;br /&gt;
If the problem is relaxed, i.e., we demand that w(t) be in the continuous interval [0, 1] instead of the binary choice \{0,1\}, the optimal solution can be determined by means of direct optimal control. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Reference solution plots&amp;quot; widths=&amp;quot;180px&amp;quot; heights=&amp;quot;140px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
 Image:Catalyst_Mixing_Problem_Performance.png| Results with relaxed controls and collocation from the [http://www.mcs.anl.gov/~more/cops/ COPS library]&lt;br /&gt;
 Image:Catalyst Mixing Controls.png| Optimal relaxed controls showing a bang-bang structure.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
Model descriptions are available in&lt;br /&gt;
&lt;br /&gt;
* [[:Category:AMPL/TACO | AMPL/TACO code]] at [[Catalyst mixing problem (TACO)]]&lt;br /&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:Chemical engineering]]&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Catalyst_Mixing_Controls.png&amp;diff=2236</id>
		<title>File:Catalyst Mixing Controls.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Catalyst_Mixing_Controls.png&amp;diff=2236"/>
		<updated>2018-01-12T19:14:49Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=File:Catalyst_Mixing_Problem_Performance.png&amp;diff=2235</id>
		<title>File:Catalyst Mixing Problem Performance.png</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=File:Catalyst_Mixing_Problem_Performance.png&amp;diff=2235"/>
		<updated>2018-01-12T19:13:01Z</updated>

		<summary type="html">&lt;p&gt;ClemensZeile: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>ClemensZeile</name></author>
	</entry>
</feed>