Real-Time Optimization and Nonlinear Model Predictive Control of Processes Governed by Differential-Algebraic Equations

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Real-time optimization and nonlinear model predictive control of

processes governed by dierential-algebraic equations


Moritz Diehl
a,
*, H. Georg Bock
a
, Johannes P. Schlo der
a
, Rolf Findeisen
b
,
Zoltan Nagy
c
, Frank Allgo wer
b
a
Interdisciplinary Center for Scientic Computing (IWR), University of Heidelberg, Im Neuenheimer Feld 368, D-69120 Heidelberg, Germany
b
Institute for Systems Theory in Engineering, University of Stuttgart, Pfaenwaldring 9, D-70550, Stuttgart, Germany
c
Faculty of Chemistry and Chemical Engineering, Babes-Bolyai University, Cluj, Romania
Abstract
Optimization problems in chemical engineering often involve complex systems of nonlinear DAE as the model equations. The
direct multiple shooting method has been known for a while as a fast o-line method for optimization problems in ODE and later
in DAE. Some factors crucial for its fast performance are briey reviewed. The direct multiple shooting approach has been suc-
cessfully adapted to the specic requirements of real-time optimization. Special strategies have been developed to eectively mini-
mize the on-line computational eort, in which the progress of the optimization iterations is nested with the progress of the process.
They use precalculated information as far as possible (e.g. Hessians, gradients and QP presolves for iterated reference trajectories)
to minimize response time in case of perturbations. In typical real-time problems they have proven much faster than fast o-line
strategies. Compared with an optimal feedback control computable upper bounds for the loss of optimality can be established that
are small in practice. Numerical results for the Nonlinear Model Predictive Control (NMPC) of a high-purity distillation column
subject to parameter disturbances are presented. # 2002 Published by Elsevier Science Ltd.
Keywords: Predictive control; Nonlinear control systems; Dierential algebraic equations; Numerical methods; Optimal control; Distillation columns
1. Introduction
Real-time control based on the optimization of non-
linear dynamic process models has attracted increasing
attention over the past decade, e.g. in chemical engi-
neering [12]. Among the advantages of this approach
are the exibility provided in formulating the objective
and the process model, the capability to directly handle
equality and inequality constraints, and the possibility
to treat disturbances fast.
One important precondition, however, is the avail-
ability of reliable and ecient numerical optimal control
algorithms.
Direct methods reformulate the original innite
dimensional optimization problem as a nite nonlinear
programming (NLP) problem by a parameterization of
the controls and states. Such a method is called a
simultaneous solution strategy, if the NLPs are solved by
an infeasible point method such as sequential quadratic
programming (SQP) or generalized GaussNewton.
Typical parameterizations are collocation [5], nite
dierences, or direct multiple shooting [6,7]. The latter
is the basic method we treat in this paper.
Direct multiple shooting oers the following advan-
tages in the context of real-time process optimization:
. As a simultaneous strategy, it allows to exploit
solution information in controls, states and deri-
vatives in subsequent optimization problems by
suitable embedding techniques.
. Ecient state-of-the-art DAE solvers are
employed to calculate the function values and
derivatives quickly and accurately.
. Since the integrations are decoupled on dierent
multiple shooting intervals, the method is well
suited for parallel computation.
. The approach allows a natural treatment of control
and path constraints as well as boundary conditions.
The eciency of the approach, which has been
observed in many practical applications, has several
reasons. One of the most important is the possibility to
incorporate information about the behaviour of the
state trajectory into the initial guess for the iterative
0959-1524/02/$ - see front matter # 2002 Published by Elsevier Science Ltd.
PI I : S0959- 1524( 01) 00023- 3
Journal of Process Control 12 (2002) 577585
www.elsevier.com/locate/jprocont
* Corresponding author.
E-mail addresses: [email protected] (M. Diehl),
[email protected] (H.G. Bock).
solution procedure; this can damp the inuence of poor
initial guesses for the controls (which are usually much
less known). In the context of NMPC, where a sequence of
neighbouring optimization problems is treated, solution
information of the previous problem can be exploited
on several levels.
The paper reviews results presented in Bock et al. [8];
Diehl et al. [3]; Bock et al. [4]; Nagy et al. [9], and pre-
sents a new view on real-time optimization in NMPC. It
is organized as follows:
. In Section 2, we introduce a general class of opti-
mal control problems that can be treated by the
current implementation of the real-time direct
multiple shooting method.
. We sketch the direct multiple shooting method in
Section 3, with emphasis on the SQP method spe-
cially tailored to the solution of such highly struc-
tured NLP problems. In Subsection 3.4 we look in
detail at the computations during one SQP iteration
to prepare the real-time strategies of Section 4.
. In Section 4 we describe our real-time embedding
strategy for the ecient solution of subsequent
optimization problems. This strategy allows to
dovetail the iterative solution procedure with the
process development in order to compute fast
approximate closed-loop controls.
. The NMPC of a high-purity distillation column
model of 164 states is treated in Section 5. As a
scenario, disturbances in the feed stream are con-
sidered, which result in changes of the desired
operating point.
2. Real-time optimal control problems
Throughout this paper, we consider optimal control
problems of the following simplied type:
min
u ;x ;z ;p
_
t
f
t
0
L x t ; z t ; u t ; p dt E x t
f
_ _
p
_ _
1
subject to a system of dierential algebraic equations
(DAE) of index one
B x
:
t f x t ; z t ; u t ; p 2
0 g x t ; z t ; u t ; p 3
Here, x and z denote the dierential and the algebraic
state vectors, respectively, u is the vector valued control
function, whereas p is a vector of system parameters.
Matrix Bxt; zt; ut; p is assumed to be invertible, so
that the DAE is of semi-explicit type. Initial values for
the dierential states and values for the system para-
meters are prescribed:
x t
0
x
0
4
p p
0
5
In addition, terminal constraints
r x t
f
_ _
; p
_ _

5
_ _
0 6
as well as state and control inequality constraints
h x t ; z t ; u t p 50 7
have to be satised.
Remark. The reason to introduce the parameters p as a
variable subject to the equality constraint (5) has certain
algorithmic advantages, as will become apparent in Section 4.
Solving this problem we obtain an open-loop optimal
control and corresponding state trajectories, that we may
implement to control a plant. However, during operation
of the real process, both state variables and system
parameters are most likely subject to disturbances, e.g.
due to model plant mismatch. Hence, an optimal closed-
loop or feedback control law
u~ x
0
; p
0
; t
f
t
0
_ _
;
would be preferable, that gives us the optimal control
for a suciently large range of time points t
0
and initial
values x
0
and parameters p
0
. One computationally
expensive and storage consuming possibility would be
to precalculate such a feedback control law o-line on a
suciently ne grid. In contrast to this, the present
paper is concerned with ecient ways to calculate this
feedback control in real-time for progressing t
0
.
One important variant of the optimization problem
(1)(7) arises in NMPC, where the nal time t
f
pro-
gresses with t
0
, i.e.
t
f
t
0
T
p
:
The constant T
p
is called the prediction horizon. In
this case the closed-loop control u~ does no longer
depend on time:
u~ x
0
; p
0
:
3. Direct multiple shooting for optimal control
The solution of the real-time optimal control problem
is based on the direct multiple shooting method, which
is reviewed briey in this section. This review prepares
the presentation of the real-time embedding strategies in
578 M. Diehl et al. / Journal of Process Control 12 (2002) 577585
Section 4. For a more detailed description see e.g. Lei-
neweber [7].
3.1. Parametrization of the innite optimization problem
The parameterization of the innite optimization
problem consists of two steps. For a suitable partition
of the time horizon t
0
; t
f
into N subintervals t
i
; t
i1

with
t
0
< t
1
< . . . < t
N
t
f
we rst discretize the control function u . For simpli-
city, we assume here that it is parametrized as a piece-
wise constant vector function
u t u
i
; for t 2 t
i
; t
i1
;
but every parameterization with local support could be
used without changing the structure of the problem.
In a second step the DAE are parametrized by multiple
shooting. We decouple the DAE solution on the N
intervals t
i
; t
i1
by introducing the initial values s
x
i
and
s
z
i
(combined: s
i
) of dierential and algebraic states at
times t
i
as additional optimization variables.
On each subinterval t
i
; t
i1
we compute the trajec-
tories x
i
t and z
i
t as the solution of an initial value
problem:
B x
:
t f x
i
t ; z
i
t ; u
i
; p 8
0 g x
i
t ; z
i
t ; u
i
; p
i
t g s
x
i
; s
z
i
; u
i
; p
_ _
9
x
i
t
i
s
x
i
_ _
10
Here the subtrahend in (9) is deliberately introduced
to allow an ecient DAE solution for initial values and
controls s
x
i
, s
z
i
, u
i
that may violate temporarily the con-
sistency conditions (3). Therefore, we require for the sca-
lar damping factor that
i
t
i
1. For more details on
the relaxation of the DAE the reader is referred, e.g. to
Leineweber [7] or Schulz et al. [10]. Note that the trajec-
tories x
i
t and z
i
t on the interval t
i
; t
i1
are functions
of the initial values, controls, and parameters s
x
i
, s
z
i
, u
i
; p
only.
Analogously, the integral part of the cost function is
evaluated on each interval independently:
L
i
s
x
i
; s
z
i
; u
i
; p
_ _

_
t
i1
t
i
L x
i
t ; z
i
t ; u
i
; p dt:
3.2. The structured nonlinear programming problem
The parameterization of problem (1)(7) using multiple
shooting and a piecewise constant control representation
leads to the following structured nonlinear program-
ming (NLP) problem
min
u;s;p

N1
i0
L
i
s
x
i
; s
z
i
; u
i
; p
_ _
E S
x
N
; p
_ _
11
subject to the initial value and parameter constraint
s
x
0
x
0
; 12
p p
0
; 13
the continuity conditions
s
x
i1
x
i
t
i1
i 0; 1; . . . ; N 1 ; 14
and the consistency conditions
0 g s
x
i
; s
z
i
; u
i
; p
_ _
i 0; 1; . . . ; N: 15
Control and path constraints are imposed pointwise
at the multiple shooting nodes
h s
x
i
; s
z
i
; u
i
; p
_ _
50 i 0; 1; . . . ; N 16
as well as at the terminal point
r s
x
N
; p
_ _

5
_ _
0: 17
3.3. SQP for multiple shooting
The above NLP problem (11)(17) is solved by a
sequential quadratic programming (SQP) method tai-
lored to the multiple shooting structure.
The NLP can be summarized as
minF w
w
subject to
G w 0
H w 50;
_
18
where w contains all the multiple shooting state vari-
ables and controls as well as the model parameters:
w s
x
0
; s
z
0
; u
0
; s
x
1
; s
z
1
; u
1
; . . . ; s
x
N
; s
z
N
; p
_ _
:
The discretized dynamic model is included in the
equality constraints Gw 0.
Starting from an initial guess w
0
, an SQP method for
the solution of (18) iterates
w
k1
w
k

k
w
k
; k 0; 1; . . . ; 19
M. Diehl et al. / Journal of Process Control 12 (2002) 577585 579
where
k
2 0; 1 is a relaxation factor, and the search
direction w
k
is the solution of the quadratic program-
ming (QP) subproblem
min
w2O
k
rF w
k
_ _
T
w
1
2
w
T
A
k
w 20
subject to
G w
k
_ _
rG w
k
_ _
T
w 0
H w
k
_ _
rH w
k
_ _
T
w50:
A
k
denotes an approximation of the Hessian r
2
w
of
the Lagrangian function , w; l; F w l
T
G w

T
H w ; where l and are the Lagrange multipliers.
Some remarks are in order on how to exploit the
multiple shooting structure in the construction of a tai-
lored SQP method.
Due to our choice of state and control parameteriza-
tions the NLP problem and the resulting QP problems
have a particular structure: the Lagrangian function is
partially separable, i.e. it can be written in the form
w; l;

N
i0

i
w
i
; l;
where w
i
: s
i
; u
i
; p are the components of the primal
variables w which are eective on interval t
i
; t
i1
only.
This separation is possible if we simply interpret the
parameters p as piecewise constant continuous controls.
As a consequence, the Hessian of has a block diag-
onal structure with blocks r
2
w
i

i
w
i
; l; . Similarly, the
multiple shooting parameterization introduces a char-
acteristic block sparse structure of the Jacobian matrices
rGw
T
and rHw
T
.
It is of crucial importance for performance and
numerical stability of the direct multiple shooting
method that these structures of (18) are fully exploited.
A number of specic algorithmic developments con-
tribute to this purpose:
. For the exploitation of the block diagonal struc-
ture of the Hessian, three versions are recom-
mended for dierent purposes:
(a) A numerical calculation of the exact Hessian
corresponds to Newtons method. This version is
recommended if the computation of the Hessian is
cheap, or in the case of neighbouring feedback
control, where the Hessian can be computed and
stored in advance. The use of the exact Hessian
has excellent local convergence properties. For
globalisation, techniques based on trust regions
are needed, since the Hessian may become inde-
nite far from the optimal solution.
(b) Partitioned high rank updates as introduced by
Block and Plitt [6] speed up local convergence with
negligible computational eort for the Hessian
approximation.
(c) A third approach to obtain a cheap Hessian
approximation the constrained GaussNewton
method is recommended in the special case of a
least squares type cost function F w
1
2
C w
_
_
_
_
2
2
.
The matrix fr
w
Cr
w
C
T
is already available from
the gradient computation and provides an excel-
lent approximation of the Hessian, if the residual
Cw of the cost function is suciently small, as it
can easily be shown that
r
w
Cr
w
C
T
r
2
w

_
_
_
_
O C w
_
_
_
_
_ _
:
This method is especially recommended for tracking
problems that often occur in NMPC. However, the
involved least squares terms may arise in integral form:
_
t
i1
t
i
l x; z; u; p
_
_
_
_
2
2
dt:
Specially adapted integrators that are able to compute a
numerical approximation of r
w
Cr
w
C
T
for this type of
least squares term have been developed [11]. This
method was used to compute the Hessian approxima-
tion in the numerical calculations presented in this
paper.
. Special recursive QP solvers are used for problem
(20) that exploit the block sparse structure of (18).
Both active set strategies (as used in this paper)
and interior point methods are available for the
treatment of large systems of inequality con-
straints [6,7,12].
. Leineweber [7] developed a reduction technique
for DAE systems with a large share of algebraic
variables, which is also employed for the compu-
tations in this paper. He exploits the linearized
algebraic consistency conditions for a reduction in
variable space, so that only reduced gradients and
Hessian blocks need to be calculated, which cor-
respond to the dierential variables, controls and
parameters only [13,14].
. The solution of the DAE initial value problems
and the corresponding derivatives are computed
simultaneously by specially designed integrators
which use the principle of internal numerical dif-
ferentiation. In particular, the integrator DAESOL
[15,16], which is based on the backward-dier-
entiation-formulae (BDF), was used in the numer-
ical calculations presented in this paper.
. The DAE solution and derivative generation can
be performed in parallel on the dierent multiple
shooting intervals. The latest parallel implementa-
580 M. Diehl et al. / Journal of Process Control 12 (2002) 577585
tion of the direct multiple shooting method for
DAE shows considerable speedups. For the
numerical example presented in this paper, pro-
cessor eciencies in the range of 80% for 8 nodes
have been observed.
Important for the use of the above methods in the
real-time context is their excellent local convergence
behaviour. By proper strategies to select stepsizes
k
or
trust regions
k
or both, global convergence can be
theoretically proven. Reassuring as this property is, it is
of lesser importance in real-time optimization, as gen-
erally no runtime bounds can be established. For a
detailed description of globalisation strategies available
in the latest version of direct multiple shooting (MUS-
COD2) the reader is referred to Leineweber [7].
3.4. A close look at one full SQP iteration
During each SQP iteration a variety of computations
have to be performed. We will state them here for the
direct multiple shooting variant that is the basis for the
real-time algorithm described in Section 4. We will
describe in detail how to compute the direction w
k
that is needed to proceed from iterate w
k
to the next
iterate w
k1
w
k
w
k
cf. Eq. (19) with
k
1). For
notational convenience we will not employ the index k
for the subvectors of w
k
and write
w
k
s
x
0
; s
z
0
; u
0
; . . . ; p
_ _
:
The computations that are needed to formulate the
quadratic programming subproblem (20), i.e. the calcu-
lation of rF, A, G, rG, H, rH, and those that are needed
to actually solve it, are intertwined. The algorithm pro-
ceeds as follows:
1. Reduction: Linearize the consistency conditions
(15) and resolve the linear system to eliminate the
s
z
i
as a linear function of s
x
i
, u
i
and p.
2. DAE solution and derivative generation: linearize
the continuity conditions (14) by solving the
relaxed initial value problems (8)(10) and com-
puting directional derivatives with respect to s
x
i
,
u
i
and p. Simultaneously, compute the gra-
dient rF of the objective function (11), and the
Hessian approximation A according to the Gauss
Newton approach. Linearize also the remaining
constraints (16) and (17).
3. Condensing: using the linearized continuity condi-
tions (14), eliminate the variables s
x
1
, . . . s
x
N
.
Project the objective gradient rF onto the space of
the remaining variables s
x
0
, u
0
, bm9, u
N1
and
p, and also the Hessian A and the linearized
constraints (16) and (17). This step generates the
so called condensed QP in the variables s
x
0
, u
0
,
. . ., u
N1
and p only.
4. Step generation: solve the condensed QP with an
ecient dense QP solver using an active set strat-
egy. The solution yields the nal values of s
x
0
,
u
0
, . . ., u
N1
and of p. (Note that due to the
linear constraints (12) and (13) s
x
0
x
0
s
x
0
and
p p
0
p.)
5. Expansion: expand the solution to yield nal
values for s
x
1
, . . ., s
x
N
, and for s
z
0
, . . . s
z
N
.
The main computational burden lies in step 2. Note
that all steps before step 4 can be performed without
knowledge of x
0
and p
0
this will be exploited in the
real-time embedding strategy in the following section.
4. A real-time embedding strategy
In a real-time scenario we aim at solving a sequence of
optimal control problems. At each time point t
0
a dif-
ferent optimization problem (1)(7) is treated, with an
initial value x
0
that we do not know in advance. We
must also expect that some of the parameters p
0
, which
are assumed to be constant in the model, are subject to
disturbances.
The time for the solution of each optimization problem
must be short enough to guarantee a suciently fast
reaction to disturbances. Fortunately, we can assume
that we have to solve a sequence of neighbouring opti-
mization problems. Let us assume that a solution of the
optimization problem for values t
0
, x
0
, p
0
is available,
including function values, gradients and a Hessian
approximation, but that at time t
0
the real values of the
process are the deviated values (x
0
0
, p
0
0
)=(x
0
, p
0
) .
How to obtain an updated value for the feedback con-
trol u~ (x
0
0
, p
0
0
, t
f
t
0
) (resp. u~ (x
0
0
, p
0
0
) in the NMPC
case)? A conventional approach would be
. to start the SQP procedure as described above from
the deviated values x
0
0
, p
0
0
and to use the old control
values u
i
for an integration over the complete
interval t
f
t
0
, and
. to iterate until a given (strict) convergence criterion
is satised.
Note that in the meantime the old control variables
will be used, so that no response to the disturbed values
x
0
0
, p
0
0
is applied so far.
In time critical processes this may take much too long
to be able to cope with the nonlinear dynamics.
In contrast to this, the authors suggest an algorithm
which diers from this approach in two important
aspects:
First, we propose to start the SQP iterations from the
solution for the reference values x
0
, p
0
instead of the
deviated values, accepting an initial violation of the
constraints (12), (13). Due to the linearity of these con-
M. Diehl et al. / Journal of Process Control 12 (2002) 577585 581
straints their violation is immediately corrected after the
rst (full) SQP iteration. It turns out that the formula-
tion of these constraints, that can be considered as an
initial value embedding of the optimal control problem
into the manifold of perturbed problems, is crucial for
the real-time performance: an examination of the algo-
rithm of Section 3.4 shows that steps 1, 2 and 3 can be
performed without knowledge of the actual values x
0
0
,
p
0
0
, thus allowing to perform them in advance and
enabling a fast response at the moment when the dis-
turbance occurs. In our approach, the rst iteration is
available in a small fraction of the time of a whole SQP
iteration. This is in sharp contrast to the conventional
approach, where all steps of the rst SQP iteration have
to be performed after x
0
0
, p
0
0
are known.
Moreover, for a Newtons method, it is easy to show
that the error of this rst SQP iteration compared to
the solution of the full nonlinear problem is only
second order in the size of the perturbation . This
property that the rst iterate is already close to the
solution for small holds also for the generalized
Gauss-Newton method. Based on this observation, we
secondly propose not to iterate the SQP iterations to
convergence, but rather use the following real-time
iteration scheme, that repeats the following cycle:
(I) Feedback response: After observation of the cur-
rent values x
0
0
, p
0
0
perform step 4 and apply the
result a rst correction of the controls immedi-
ately to the real process. Maintain these control
values during some process duration which is
suciently long to perform all calculations of one
cycle.
(II) Preparation phase: During this period rst
expand the outcome of step 4 to the full QP solution
(expansion step 5), then calculate a new (full step)
iterate w
k1
w
k
w
k
, and based on this new
iterate, perform the steps 1, 2 and 3 to prepare the
feedback response for the following step. Go back
to I.
In each cycle the same steps as for one classical SQP
iteration are performed, but in a rotated order. Note,
however, that in the middle of the preparation phase,
the transition to a new optimization problem is per-
formed. For shrinking horizon problems e.g. for batch
processes this new problem will be on the remaining
time interval t
0
; t
f
only. The steps 1, 2, and 3 will
then only be performed on this shrunk horizon.
Note that the algorithm is prepared to react to a fur-
ther disturbance after each cycle time , taking the out-
come of the last iteration on the shrunk horizon as a
reference solution.
Remark 1. For moving horizon problems, as they arise
in NMPC, the horizon length T
p
is constant. There exist
two possibilities to perform the transition from the old
horizon t
0
; t
0
T
p
to the new horizon t
0
;
t
0
T
p
, before steps 1, 2 and 3 are performed:
. we either shift all problem variables by a time to
account for the progressing time horizon, or
. we take the iterate w
k1
without a shift for a warm
start.
For short sampling times , both strategies have shown
nearly identical performance [3]. In the numerical simu-
lations presented in Section 5.4 we have adopted the sec-
ond alternative.
Remark 2. Compared to conventional SQP methods,
the solution procedures for the real-time iterations have to
be modied considerably. First, steps 1, 2 and 3, and step
5 need to be clearly separated from step 4. The crucial
step 4 can even be further subdivided into parts that can
be solved without knowledge of the unknown values x
0
0
, p
0
0
;
these parts should actually become part of the preparation
phase to make the feedback response as fast as possible.
Remark 3. The feedback phase itself is typically orders
of magnitude shorter than the preparation phase. Thus,
our algorithm can be interpreted as the successive gen-
eration of immediate feedback laws that take state and
control inequality constraints on the complete horizon into
account. Experience shows that the active set does not
change much from one cycle to the next so that the com-
putation time is bounded in practice.
Remark 4. The time required for a full cycle depends
on the complexity of the model and the optimization pro-
blem, the numerical solution algorithms involved and the
available computer. If is not suciently small, a paral-
lelization of the expensive step 2 may be a remedy.
Remark 5. As the described real-time iterations corre-
spond each to a dierent optimization problem, general
convergence results are dicult to obtain. However, it can
be shown under reasonable assumptions that the correc-
tion steps w
k
will become smaller from cycle to cycle, if,
after an initial disturbance , the process behaves as pre-
dicted by the model. In the case of shrinking horizon pro-
blems, the value of the objective function on the complete
horizon t
0
; t
f
that is obtained by using the the real-time
iterations can be compared to that of an optimal feedback
control. It turns out that for an exact Newtons method
the loss of optimality is of fourth order in the size of the
initial disturbance . A proof that covers also the Gauss-
Newton method will appear in a forthcoming paper [17].
5. NMPC of a high-purity distillation column
As a realistic application example we consider the
control of a high purity binary distillation column with
582 M. Diehl et al. / Journal of Process Control 12 (2002) 577585
40 trays for the separation of Methanol and n-Propanol.
The column is modelled by a DAE with 42 dierential
states and 122 algebraic states, that is described in [9]. The
model assumes constant molar hold up on the trays and
ideal thermodynamics, but takes enthalpy balances into
account to determine the mass ows from tray to tray.
5.1. The distillation column
The binary mixture is fed in the column with ow rate
F and molar feed composition x
F
. Products are removed
at the top and bottom of the column with concentra-
tions x
B
and x
D
. The column is considered in L/V con-
guration, i.e. the liquid reux rate L and the vapor
ow rate V (resp. the heating power Q) are the control
inputs. The control problem is to maintain the speci-
cations on the product concentrations x
B
and x
D
despite
disturbances in the feed concentration x
F
.
As usual in distillation control, the product purities
x
B
and x
D
at reboiler and condenser are not controlled
directly instead, an inferential control scheme which
controls the deviation of the concentrations on trays 14
and 28 from a given setpoint is used. These two con-
centrations are much more sensitive to changes in the
inputs of the system than the product concentrations; if
they are kept constant, the product purities are safely
maintained for a large range of process conditions. As
concentrations are dicult to measure, we consider
instead the tray temperatures, which correspond directly
to the concentrations via the Antoine equation.
5.2. State estimation
To obtain an estimate of the 42 dierential systemstates
and of the model parameter x
F
by measurements of the
three temperatures T
14
, T
21
and T
28
, we have implemented
a variant of an Extended Kalman Filter (EKF).
An EKF is based on subsequent linearizations of the
system model at each current estimate; each measure-
ment is compared with the prediction of the nonlinear
model, and the estimated state is corrected according to
the deviation. The weight of past measurement infor-
mation is kept in a weighting matrix, which is updated
according to the current system linearization.
In contrast to a standard EKF our estimator can
incorporate additional knowledge about the possible
range of states and parameters in form of inequality
constraints. This is especially useful as the tray con-
centrations need to be constrained to be in the interval
[0,1] to make a reasonable simulation possible. The
performance of the estimator was such that step dis-
turbances in the model parameter x
F
were completely
detected after 600 seconds, as can be seen in the second
last graph of Fig. 1 for an example disturbance scenario.
5.3. Controller design
Given an estimate of the system parameters p
0
(here
x
F
), our controller rst determines an appropriate
desired steady-state for states and controls x
s
, z
s
, and u
s
.
This is done by formulating a steady-state constraint
Fig. 1. Closed-loop simulation result for step disturbances in x
F
, using N 5 control intervals.
M. Diehl et al. / Journal of Process Control 12 (2002) 577585 583
f x
s
; z
s
; u
s
; p
0
0 21
g x
s
; z
s
; u
s
; p
0
0 22
y x
s
; z
s
; u
s
; p
0

T
r
14
T
r
28
_ _
23
where the function y extracts the controlled tray tem-
peratures from the system state, so that Eq. (23) restricts
the steady-state to satisfy the inferential control aim of
keeping the temperatures T
14
, T
28
at xed reference
values T
r
14
, T
r
28
.
Secondly, the open-loop optimal control problem is
posed in the form(1)(7), with a quadratic Lagrange term:
L x; z; u; p l x; z; u; p
_
_
_
_
2
2
where
l x; z; u; p :
y x; z; u; p
T
r
14
T
r
28
_ _
R u u
s

_
_
_
_
:
Here, the second component is introduced for reg-
ularization, with a small diagonal weighting matrix R.
The control inputs u (i.e. Q and L) are bounded by
inequality constraints of the form (7) to avoid that
reboiler or condenser run empty.
To ensure nominal stability of the closed-loop system,
an additional prediction interval is appended to the
control horizon, with the controls xed to the setpoint
values u
s
determined by Eqs. (21)(23). The objective
contribution of this interval provides an upper bound of
the neglected future costs that are due after the end of
the control horizon, if its length is suciently close to
innity [18]. A length of 3600 s for this additional
interval was considered to be sucient and was used in
all performed simulations.
In our numerical solution approach, the determina-
tion of the current setpoint for given parameters and the
dynamic optimization problem are performed simulta-
neously, by adding Eqs. (21)(23) as additional equality
constraints to the dynamic optimization problem.
As system state and parameters are the (smoothed)
result of an EKF estimation, they only slightly vary
from one optimization problem to the next, so that
favourable conditions for the real-time iterations with
the initial value embedding strategy are given.
5.4. Numerical results
For a realistic test of the algorithm we have per-
formed closed-loop simulations where the simulation
model equals the optimization model and the three
temperature measurements are disturbed by Gaussian
noise with a standard deviation of 0.01

C.
In the disturbance scenario shown in Fig. 1 we consider
three step changes in the feed concentration x
F
: starting
from the nominal value, x
F
is rst reduced by 20%, later
increased by 40% and at the end reduced by 20% to reach
the nominal value again. In the closed-loop simulation in
Fig. 1 a prediction horizon of 600+3600 s is used, with
ve control intervals each of 120 s length. In the rst two
graphs the controlled tray temperatures T
14
andT
28
are
shown, which should be kept at the specied values
T
r
14
=70

C and T
r
28
88

C. It can be seen that they vary


only by some tenths of centigrades during the whole
scenario, which implicitly ensures highest purity of the
product streams. The control response in Reux and
Heating is shown in the two graphs in the middle,
whereas the estimated and real value for x
F
are both
shown in the second last graph.
At the bottom the CPU time for each optimization
problem is plotted, which is well below the 10 seconds
that are used as a sampling time . Note that this CPU
time does not cause any delay between new state esti-
mate and control response as our embedding strategy
delivers an immediate response requiring only the con-
densed QP solution of step 4 (cf. Section 4). The CPU
time is essentially needed to prepare the linearizations
for the next immediate response.
In Table 1 numerical results for the same scenario are
shown for three simulations with dierent control hor-
izon lengths of 600, 1200 and 2400 s, i.e. with 5, 10 and
20 control intervals. As the computation times vary
from one optimization problem to the next due to inte-
grator adaptivity, we list not only the average CPU time
for one optimization, but also the maximum CPU time
observed for each simulation. The values from Fig. 1
can be found in the rst column. Even for the prediction
horizon of 2400+3600 s with 20 control intervals, the
CPU time meets the requirement to be less or equal the
sampling time of 10 s. All simulations were performed
on a Compaq Alpha XP1000 workstation.
Currently, the presented algorithms and system model
are applied to control a medium scale distillation col-
umn located at the Institute for System Dynamics and
Process Control at the University of Stuttgart. Results
of closed-loop experiments will be presented in a forth-
coming paper [11].
Table 1
Maximum and average CPU times (in s) for the considered example
scenario, using dierent numbers N of control intervals
N=5 N=10 N=20
Maximum Average Maximum Average Maximum Average
2.6 s 1.6 s 5.6 s 3.7 s 9.7 s 4.6 s
584 M. Diehl et al. / Journal of Process Control 12 (2002) 577585
6. Conclusions
New real-time and NMPC schemes based on the direct
multiple shooting method are described. Their features
are an initial value embedding that leads to a negligible
response time after disturbances, and the immediate
application of the computational results after each itera-
tion. These real-time iterations calculate an approxima-
tion of an optimal feedback control with computable
upper bounds on the loss of optimality.
An application of our approach to the NMPC of a
high-purity distillation column shows excellent perfor-
mance with CPU times in the range of a few seconds per
optimization problem. This proves that even the use of
a 164th order model with a prediction horizon of 6000
seconds and 20 control intervals is feasible for real-time
control.
Acknowledgements
Financial support from Deutsche Forschungs-
gemeinschaft in the Schwerpunktprogramm Echtzeit-
Optimierung groer Systeme is gratefully acknowl-
edged. The authors are indebted to Daniel B. Leinewe-
ber for fruitful discussions on real-time problems in
chemical engineering, and to Ilknur Uslu and Stefan
Schwarzkopf for providing helpful insights into the
working of a distillation column. We also want to thank
the anonymous referees for their detailed comments that
helped to improve the paper.
References
[1] C.E. Garc a, D.M. Prett, M. Morari, Model predictive control:
theory and practice a survey, Automatica 25 (1989) 335.
[2] L.T. Biegler, J.B. Rawlings. Optimization approaches to non-
linear model predictive control, in: Y. Arkun, W.H. Ray, (Eds.),
Chemical Process Control CPC IV, The CACHE Corp., Aus-
tin, Texas, 1991.
[3] M. Diehl, H. Bock, D. Leineweber, J. Schlo oder, Ecient direct
multiple shooting in nonlinear model predictive control, in: F.
Keil, W. Mackens, H. Vo, J. Werther (Eds.), Scientic Com-
puting in Chemical Engineering II, Vol. 2, Springer, Berlin, 1999.
[4] H. Bock, M. Diehl, D. Leineweber, J. Schlo der, A direct multiple
shooting method for real-time optimization of nonlinear DAE
processes, in F. Allgo wer, A. Zheng (Eds.), Nonlinear Predictive
Control, Vol. 26 of Progress in Systems Theory, Birkha user,
Basel, 2000.
[5] A. Cervantes, L. Biegler, Large-scale DAE optimization using a
simultaneous NLP formulation, AIChE Journal 44 (5) (1998)
10381050.
[6] H. Bock, K. Plitt, A multiple shooting algorithm for direct solu-
tion of optimal control problems, in: Proceedings of the 9th
IFAC World Congress Budapest, Pergamon, Oxford, 1984.
[7] D. Leineweber, Ecient reduced SQP methods for the optimiza-
tion of chemical processes described by large sparse DAE models,
Vol. 613 of Fortschr.-Ber. VDI Reihe 3, Verfahrenstechnik, VDI
Verlag, Du sseldorf, 1999.
[8] H. Bock, I. Bauer, D. Leineweber, J. Schlo der, Direct multiple
shooting methods for control and optimization in engineering, in:
F. Keil, W. Mackens, H. Vo, J. Werther (Eds.). Scientic Com-
puting in Chemical Engineering II, Vol. 2, Springer, Berlin, 1999.
[9] Z. Nagy, R. Findeisen, M. Diehl, F. Allgo wer, H. Bock, S. Aga-
chi, J. Schlo der, D. Leineweber, Real-time feasibility of nonlinear
predictive control for large scale processes a case study, in:
Proc. of ACC 2000, Chicago, in press.
[10] V.H. Schulz, H.G. Bock, M.C. Steinbach, Exploiting invariants
in the numerical solution of multipoint boundary value problems
for daes, SIAM J. Sci. Comp. 19 (1998) 440467.
[11] M. Diehl, R. Findeisen, S. Schwarzkopf, I. Uslu, F. Allgo wer, H.
Bock, T. Bu rner, E. Gilles, A. Kienle, J. Schlo der, E. Stein, Real-
time optimization of large scale process models: nonlinear model
predictive control of a high purity distillation column, in: M.
Groetschel, S. Krumke, J. Rambau, (Eds.), Online Optimization
of Large Scale Systems: State of the Art, Springer, Berlin, 2001b.
[12] M. Steinbach, Fast Recursive SQP Methods for Large-scale Opti-
mal Control Problems, Phd thesis, University of Heidelberg, 1995.
[13] H. Bock, E. Eich, J. Schlo der. Numerical solution of constrained
least squares boundary value problems in dierential-algebraic
equations, in: K. Strehmel (Ed.), Numerical Treatment of Dier-
ential Equations, Teubner, Leipzig, 1988.
[14] J. Schlo der, Numerische Methoden zur Behandlung hochdi-
mensionaler Aufgaben der Parameteridentizierung, Vol. 187 of
Bonner Mathematische Schriften, University of Bonn, Bonn,
1998.
[15] I. Bauer, F. Finocchi, W. Duschl, H.-P. Gail, J.P. Schlo oder,
Simulation of chemical reactions and dust destruction in proto-
planetary accretion discs, Astron. Astrophys. 317 (1997) 273289.
[16] I. Bauer, Numerische Verfahren zur Losung von Anfangswer-
taufgaben und zur Generierung von ersten und zweiten Ablei-
tungen mit Anwendungen bei Optimierungsaufgaben in Chemie
und Verfahrenstechnik, PhD thesis, University of Heidelberg,
2000.
[17] M. Diehl, H. Bock, J. Schlo der, Newton type methods for the
approximate solution of nonlinear programming problems in real-
time, Technical report, University of Heidelberg, 2001a.
[18] G. De Nicolao, L. Magni, R. Scattolini, Stabilizing nonlinear
receding horizon control via a non quadratic terminal state pen-
alty, in: Symposium on Control, Optimization and Supervision,
CESA96 IMACS Multiconference, Lille, 1996.
M. Diehl et al. / Journal of Process Control 12 (2002) 577585 585

You might also like