(430b) Optimal Control Laws for Batch and Semi-Batch Reactors Using the Concept of Extents | AIChE

# (430b) Optimal Control Laws for Batch and Semi-Batch Reactors Using the Concept of Extents

Conference

Year

Proceeding

Group

Session

Time

## Authors

EPFL
EPFL

Optimal Control Laws for Batch and Semi-batch Reactors
Using the Concept of Extents

D. Rodrigues, J. Billeter and D. Bonvin

EPFL â€“ Station 9, 1015 Lausanne, Switzerland

dominique.bonvin@epfl.ch

In the context of dynamic optimization of batch and
semi-batch reactors, this contribution presents a method that uses the concept
of extents to generate solutions that satisfy the necessary conditions of optimality
given by Pontryaginâ€™s maximum principle. The method is
divided in two parts. In the first part, the reactor model is written in terms
of decoupled extents, and adjoint-free optimal control laws are generated for
all possible types of arcs that may occur in the optimal solution. In the
second part, the correct sequence of arcs is determined, and, for each sequence,
the optimal switching times and initial conditions are computed numerically.

The optimal control problems (OCPs) are formulated in Mayer
form, with nu piecewise-continuous inputs u(t),
nx states x(t) described by the differential
equations xÌ‡(t) = f(x(t),u(t)), x(t0)
= x0, the cost function Ï†(tf,x(tf)),
the nt terminal constraints Ïˆ(tf,x(tf))
â‰¤ 0, the ng mixed path constraints g(x(t),u(t))
â‰¤ 0 and the nh first-order pure-state constraints h(x(t))
â‰¤ 0. Note that this class of OCPs is not restrictive in most dynamic optimization
problems dealing with reactors.

The optimal input trajectories are composed of a (typically finite) number of arcs.
For each arc and for each input, the optimal input is determined by either an
active path constraint or a condition that expresses a physical compromise that
depends exclusively on the dynamics of the system [1].

Let the input uj be one element of u.
The goal is to find an expression that relates the optimal input uj,
or one of its time derivatives, to the states, the inputs or the time
derivatives of the inputs, thus resulting in an adjoint-free optimal control law. For each arc, one of the following
cases is possible:

1. The optimal
input uj is determined by the active path constraint gk(x,u)
= 0.

2. The
optimal input uj is determined by the active path constraint hk(x)
â‰¤ 0, and uj is obtained such that âˆ‚hk/âˆ‚x(x) f(x,u)
= 0.

3. Otherwise,
the optimal input uj is determined by the condition det(â„³uâ±¼) = 0, where

â„³uâ±¼Â := [âˆ‚fuâ±¼/âˆ‚uj(x,u)
Î”j âˆ‚fuâ±¼/âˆ‚uj(x,u)
â‹¯
Î”jÏâ±¼-1
âˆ‚fuâ±¼/âˆ‚uj(x,u)],

and the operators Î”j,â€¦, Î”jÏâ±¼-1
are defined as

Î”j v := âˆ‚v/âˆ‚x
f(x,u) - âˆ‚fuâ±¼/âˆ‚xuâ±¼(x,u) v + âˆ‘nâ‰¥0 âˆ‚v/âˆ‚u(n)u(n+1),

Î”jl v := Î”j
(Î”jl-1 v),
if l = 2,â€¦, Ïj-1,

for any vector field v of dimension Ïj,
with xuâ±¼Â being the Ïj-dimensional
vector of states that can be influenced by manipulating uj,
and fuâ±¼(x,u) such that xÌ‡uâ±¼Â = fuâ±¼(x,u).

However, the input uj and its time
derivatives may not appear explicitly in the function det(â„³uâ±¼). Hence, as a general approach to find the optimal input uj
when it is not determined by an active path constraint, the function det(â„³uâ±¼) is subject to time differentiation until uj
or one of its time derivatives appears in drâ±¼(det(â„³uâ±¼))/dtrâ±¼, for some rj. Let uj(Î¾â±¼) be the
highest-order time derivative of uj that appears in drâ±¼(det(â„³uâ±¼))/dtrâ±¼. Then, the optimal input uj(Î¾â±¼) is obtained such
that drâ±¼(det(â„³uâ±¼))/dtrâ±¼Â = 0.

The mass and heat balances for batch and semi-batch reactors
can be written using the concept of extents [2]. Let us consider a homogeneous
batch or semi-batch reactor with R independent reactions and p
independent inlets (p = 0 for batch reactors), where uin(t)
is the p-dimensional vector of inlet flowrates, and qex(t)
is the exchanged heat power. The numbers of moles n(t) and the
heat Q(t) can be expressed as a linear combination of
extents, according to

n(t) = NTxr(t)
+ Win xin(t) + n0,

Q(t) = (-Î”H)Txr(t)
+ TÌŒinT xin(t)
+ xex(t) + Q0,

where n0 is the S-dimensional
vector of initial numbers of moles, Q0 is the initial heat, N is the RÃ—S stoichiometric matrix, Î”H is the R-dimensional vector of heats of
reaction, Win is the SÃ—p inlet-composition matrix, TÌŒin is the p-dimensional vector of inlet specific
enthalpies, xr(t) is the R-dimensional
vector of extents of reaction, xin(t) is the p-dimensional
vector of extents of inlet, and xex(t) is the extent
of heat exchange.

The state vector of dimension nx := R + p + 1 is

x(t) := [xr(t)T
xin(t)T
xex(t)]T,

while the input vector of dimension nu := p + 1 is

u(t) := [uin(t)T
qex(t)]T.

The dynamic equations can be
written compactly as

xÌ‡(t) = f(x(t),u(t)), x(t0) = 0R+p+1,

by defining

f(x(t),u(t)) := [rv(x(t))T
u(t)T]T,

where rv(x(t)) is
the R-dimensional vector of reaction rates. In batch and semi-batch reactors, with xÌ‡j
= fj(x,u) := uj, it is possible to define the following vectors of
dimension Ïj := R+1:

xuâ±¼Â := [xrT
xj]T,

fuâ±¼(x,u) := [rv(x)T
uj]T.

Note that, since this system is input-affine, det(â„³uâ±¼) and its time derivatives are polynomial functions of uj
and its time derivatives, thus resulting in a finite number of solutions, and typically a single solution
that satisfies the condition in Case 3.

Let us define the state vector xÌŒj
as the complement of the state xj (all states x except
xj), and the vector fÌŒj(x,u)
as the corresponding complement of fj(x,u).
Then, one can prove that, when the optimal input uj is not
determined by an active path constraint:

1. For reactors with a single independent reaction, the
input uj is determined by

d(det(â„³uâ±¼))/dt = âˆ‚(âˆ‚rv/âˆ‚xj(x))/âˆ‚xj
uj + âˆ‚(âˆ‚rv/âˆ‚xj(x))/âˆ‚xÌŒj
fÌŒj(x,u),

since uj and its time derivatives do not
appear in

det(â„³uâ±¼) = âˆ‚rv/âˆ‚xj(x).

2. For reactors with 2 independent reactions, the input uj
is determined by

det(â„³uâ±¼) = det([âˆ‚rv/âˆ‚xj(x)
âˆ‚(âˆ‚rv/âˆ‚xj(x))/âˆ‚xj]) uj

+ det([âˆ‚rv/âˆ‚xj(x)
-âˆ‚rv/âˆ‚xr(x)
âˆ‚rv/âˆ‚xj(x) + âˆ‚(âˆ‚rv/âˆ‚xj(x))/âˆ‚xÌŒj
fÌŒj(x,u)])

One can use
symbolic computation software to evaluate the function det(â„³uâ±¼) and its time derivatives and obtain the optimal input uj
or one of its time derivatives when it is not determined by an active path
constraint.

The advantage of the proposed approach is that it reduces
the set of possible arcs to a finite
number of possibilities. This, in turn, results in a finite number of arc
sequences if one assumes an upper bound on the number of arcs present in the
optimal solution. Hence, instead of solving the original infinite-dimensional
problem, one can simply perform numerical optimization for each arc sequence,
using the switching times between arcs and the initial conditions as decision variables.

Note that the dynamic state equations
can be integrated forward in time, since it is possible to evaluate the
corresponding inputs without knowledge of the adjoint variables. Once the
forward integration is complete, one can integrate backward in time to obtain
the corresponding adjoint variables, which enables the computation of the
gradients with respect to the switching times and initial conditions of the
arcs.

The proposed approach will be
illustrated to maximize the final quantity
of product in an acetoacetylation reaction, subject to constraints on the final
concentration of reactants and by-products [3].

[1] B. Srinivasan, S. Palanki, and D. Bonvin. Dynamic
optimization of batch processes: I. Characterization of the nominal solution, Comput.
Chem. Eng.
, 27:1-26, 2003.

[2] D. Rodrigues, S. Srinivasan, J. Billeter, and D.
Bonvin. Variant and invariant states for chemical reaction systems, Comput.
Chem. Eng.
, 73:23-33, 2015.

[3] B. Chachuat, B. Srinivasan, and D.
Bonvin. Adaptation strategies for real-time optimization, Comput. Chem. Eng.,
33:1557-1567, 2009.