WOLFRAM|DEMONSTRATIONS PROJECT

Optimal Control of a Continuous Stirred-Tank Reactor

​
initial conditions
on the control trajectory
temperature
0.05
concentration
0.
​
state vector
control
costates
​
constraints on u
upper bound
1.5
lower bound
0.2
0.0
0.2
0.4
0.6
-0.06
-0.04
-0.02
0.00
0.02
0.04
time
state vector components
performance index: 0.02660

Aris and Amundson [1–3] originally analyzed the design of a continuous stirred-tank reactor (CSTR) with a first-order, irreversible exothermic reaction. The reactor is controlled by varying the flow of a cooling fluid through a coil inside the reactor. The state equations for the CSTR are given by

dT
dt
=-(T+0.25)+(C+0.5)exp
25T
T+2
-u
1
(T+0.25)
,

dC
dt
=0.5-C-(C+0.5)exp
25T
T+2

,

where
C
and
T
are the deviations from steady-state concentration and temperature, respectively, and
u
1
is the control action.

This Demonstration finds the optimal control, which minimizes the performance index given by
J=∫
t
f
0
[T
2
+C
2
+Ru
2
]dt
, where the normalized control action is
u=u
1
-1
and
R=0.1
is a weighting parameter. Assume a final time
t
f
=0.78
of the control [4, 5]. You can set the initial conditions (i.e. both
T(t=0)
and
C(t=0)
) and choose to apply upper and lower bounds on
u
.

We plot the component of the state vector (
T
and
C
shown in red and blue, respectively), the normalized control
u
, and the costates. We also compute the value of the performance index
J
.

For the case where
u
is unbounded, if you select the initial conditions
T(t=0)=0.05
and
C(t=0)=0
, then
J=0.02660
, in close agreement with the result found in [4] and [5].

The costates
λ
1
(t)
and
λ
2
(t)
are plotted in magenta and cyan. The costates verify
λ
1
(t
f
)=0
and
λ
2
(t
f
)=0
(yellow dot).