DNSaraf Notes SERC2008
DNSaraf Notes SERC2008
continuous and that y(i) exists in a given range of x. Then, the analytical conditions for
optimization can be developed by considering the Taylor series:
y ( a + h) y ( a
=
)
h2 "
h3 "'
hy ( a ) +
y (a) +
y ( a ) + ........... + 0( h j );
2!
3!
ji
(1.1)
'
(1.2)
y ( a ) < 0 maxima
=
y ( a ) 0; y ( a ) 0 saddle point
"
"'
(a)
(b)
(c)
(1.3)
It is seen that if Eq.1.3a holds, Eq. 1.2 predicts that y(a+h) > y(a) for both positive and
negative values of h, and so the point x= a is indeed, a minimum.
function is unimodal in this interval. Several unvariate search techniques are available to
narrow down this interval.
1.2a: Simultaneous (or Preplanned) Search Plan
Let us consider several equispaced points, x1 , x2 , x3 ,..............., in the range a x b .
Evaluate y(x) at x1 , x2 , x3 ,...............,. One of these points will give the optimal (say
maxima) value of y.
Let us say that the highest value occurs at x3 (see Fig.1.1). Thus, the maximum must lie
in the range x2 x x4 . This becomes our new interval of uncertainty, I n . Here
In =
2 Io
n +1
(1.4)
(n: integer)
(1.5)
x1= a +
1
Io
3
x2= a +
2
Io
3
(1.6)
2
2
Io
3
(1.7)
It is easy to see that in the next iteration, two equispaced points are put in the new range
2
2
2
of the maximum and =
I2 =
I1 I o
3
3
(1.8)
k
2
After the kth iteration, the interval of uncertainity I k = I o
3
Ik 2
The shrinkage, after k iteration, is thus
= =
I o 3
(1.9)
(1.10)
F=
1
1
Fn =
Fn 1 + Fn 2 ; n 2
(1.11)
1 1 + 5
5 2
n +1
1 5
n +1
(1.12)
In the Fibonacci search techniques, one specifies the number, n, of function evaluations.
Then, in the ith iteration, one locates two points, x3i and x4i as
=
x3i
Fn (i +1)
x4i
=
Fn i
x2i 1 x1i 1 + x1i 1
Fn ( i 1)
is
the
current
interval
under
search
x2o x1o , thus represents the original interval of uncertainty, Io . See Eq. 1.13 has been
written so that the search points satisfy some interesting conditions.
If can easily be shown (using Eq.1.13 and 1.11) that the points x3i and x4i are located
symmetrically from the two ends of the interval of uncertainty. Fig 1.4 shows the next
iteration if the new interval of uncertainty lies in x1o x x14 . It can easily be shown that
point x42 is going to be the same point as x31 . This is true at every iteration. Thus, we
save on one function evaluation per iteration by the choice of the search points as per
Eq.1.13
1.4 :
Note that after two function evaluations in the first iteration, one has
I=
I o I1
1
I1 =
Io
F Fn 1
Fn 2
Io =
I o 1 n 2 =
Io
Fn
Fn Fn
(1.14)
After one more function evaluation (point x32 in Fig.1.4) in the second iteration, one has
I 2 = I1 I 2 = I1
=
F F
Fn 3
I1 = I1 1 n 3 = n 2 I1
Fn 1
Fn 1 Fn 1
Fn 2
Io
Fn
(1.15)
For m total function evaluations, we find that the interval of uncertainty has been reduced
to
I m 1 =
Fn ( m 1)
Fn
(1.16)
Io
F1
Io
Fn
(1.17)
I n 1 F1
1
= =
Io
Fn Fn
(1.18)
No other univariate search technique can guarantee an interval reduction factor as large
as F n in n function evaluations. This explains the popularity of this technique. The
following table compares different methods in regard to the computational effort required
for the same reduction in the interval of uncertainty.
Search method
Technique
Pre-planned
Sequential (two point)
Fibonacci
The Fibonacci search technique
=0.01
=0.0001
in advance, and all the search points depend on this choice. If one wishes to change
in-between (or obtain results for, say, a lower ), one must go back to the beginning of
the computational cycle.
experimental schemes. It may be noted that after n-1 locations of search points, the next
point, x3n 1 , comes out at exactly the midpoint of the interval left:
5
F
x n 2 + x1n 2
x3n 1 = o = x2n 2 x1n 2 + x1n 2 = 2
F2
2
(1.19)
The next point is going to be identical to this point and we must switch over to
dichotomous search (i.e., choose a point distance & away from x3n 1 and halve the
interval of uncertainty.
Fn ( j +1)
l j =
I j 1 0.3820
=
Fn ( j 1) asymp
(1.20)
I j 1 ; all j
In the last few stages, one could switch to the true Fibonacci sequence. The expression
for is given by
= (0.6180) n 1
(1.21)
Ij =
I j 1 0.3820 I j 1 =
0.6180 I j 1
I j 1
1
=
= 1.618
Ij
0.6180
(1.22)
Fig.1.5 shows the locations of points at two stages. It is easily seen that
1. 5 :
=
l j +1 0.236
=
I j 1 0.382
=
I j 0.382 *(0.618 I j 1 )
(1.23)
Example 1.1: Locate the minimum value of y ( x 30) 2 to 1 % accuracy is a=0, b=100.
Use the golden section method.
LECTURE 2
MULTIVARIATE SEARCH TECHNIQUES1,2
2.1 Introduction
Multivariate search techniques are used when the dependent variable, y, is a function of
several independent variables, i.e., y ( x1 , x 2 ,.......) . Several multivariate search techniques
are available to obtain the optimal value of y. These methods are of two kinds-those that
do not involve gradient computations, and those that do. Some of the techniques are
described here. Most of these are illustrated through two-variable examples, because
these can be well represented in terms of contour-diagrams(see Fig.2.1)
.
.
.
= (0,0,.............,0,1) for j = n, 2n, 3n........
(2.1)
In other words, one explores one direction or variable at a time (keeping the others fixed).
Unidirectional search techniques discussed in Lecture 1 can be used. Thus, in Fig.2.1,
one starts, say, at point a, and searches in the x 1 direction till one reaches the local
maxima, point b. Thereafter, one searches in the x 2 - direction point to c, and so on. This
procedure is repeated till the improvement is below a specified tolerance.
8
If the contours are elongated in some direction (see Fig.2.2) the search can be quite slow.
Also, if we get stuck on a
sharp ridge (see Fig.2.3) we can get a false local maxima or minima. For example, in
Fig.2.3, changing x 1 or x 2 leads to lower values than at b, and so point b is the false
maxima obtained by this technique.
(k )
search). Optimum point along this line is, say, x1 (B in Fig.2.4). Search along
the line passing through x1( k ) and parallel to 2( k ) , and find the optimum point,
(k )
x2 (C), etc. continue till all n-directions ae explored.
2) Find point xm( k ) leading to the greatest improvement of y in a step, from among the
n moves taken in 1).
9
Determine xn( k ) xo( k ) ( AC ) . Point C will represent the best point after n
searches.
(2.2)
2. 4
(2.3)
yo( k ) y xo( k )
yn( k ) y xn( k )
4) If yt( k ) yo( k ) (for minima) i.e., explore ahead, D is worse than A, i.e., new
direction does not produce a better value, reject the move.
and/or
y
(k )
o
2y
(k )
n
+ y y
(k )
t
(k )
o
(k )
n
yo( k ) yt( k )
(2.4)
than reject and start again at xo( k +1) xn( k ) (from point C) using same directions
as .
The second condition ensures that the function does not rise sharply when we go
from C to D after dropping (minimization) from A to C.
5) If both inequalities are violated then search to find best point; this, E is xo( k +1) .
( k +1)
6) After reaching xo , new search directions are chosen:
(k )
=
i( k +1) =
:i
1, 2,.......m -1 ( same as earlier )
i
10
( k +1)
=
i(+k1) =
m, m + 1, ......., n -1
:i
i
( k +1)
=
i
=
:i
n
i.e., replace the old mth direction which gave largest change by .
( k +1)
( k +1)
7) Repeat the entire procedure from xo , using
(ds ) 2 = (dxi ) 2
(2.5)
i =1
(2.6)
2. 5 :
We need to find a set of displacement (dx i ) which minimize or maximize dy/ds (keeping
the constraint given in Eq.2.5 in mind). Use a Lagrangian variable (one for each
constraint). Define a modified objective function:
11
2
n
y dxi
dxi
=
+ 1
F
xi ds
=i 1 =
i 1 ds
n
(2.7)
(2.8)
or
dx j
ds
1 y
;
2 x j
(2.9)
j=1,2.......,n
x1 x2
(2.10)
y
x j
mj =
1/ 2
n y 2
j =1 x j
(2.11)
mj =
y
x j
(2.12)
1/ 2
n y 2
j =1 x j
The equation of the line of steepest ascent from point xo x1,o , x2,o , x3,o ,.........xn ,o is, thus,
given in parametric form, by
x j =
x j ,o m j ,0S =
; j 1, 2,..........., n
(2.13)
At times, the functional relation for y(x) is quite complex, and grad y cannot be easily
determined. Numerical estimates using Eq.2.12 can then be used.
A popular technique using the steepest decent direction is the Fletcher-Reeves. The
algorithm is given below:
i) Select a base point x(o) (see Fig.2.6)
12
2. 6
y
xi
x( o )
mi( o ) = yx(io )
Move in this direction till objective function, y, is minimized. This point is x(1).
iv) Define a new direction of search (conjugate direction)using gradients at that new
base point and at the previous base point:
y x(ik ) + ( k 1) mi( k 1)
mi( k ) =
where
n
( k 1) =
y
i =1
y
i =1
(k )
xi
( k 1)
xi
yx(ik )
yx(ik 1)
Search along this new direction m1( k ) , m2( k ) ,.......mn( k ) till optimum is reached.
v) After each n+1 stages, discard all previous experiences (directions become nearly
parallel and base points become closely spaced). Start again in direction of
steepest descent.
This technique guarantees optimum location for a quadratic function
y = y ( x* ) +
1 n n
aij ( xi xi* )( x j x*j )
2
=i 1 =j 1
(2.14)
in, at most, n stages. For other functions, which are not necessarily quadratic,
more than n stages will be required. Near the optimum point, most functions are
near-quadratic. The method converges more rapid than Rosenbrocks technique
13
14
LECTURE 3
KUHN-TUCKER CONDITIONS OF OPTIMALITY1,2,3
Optimization techniques such as steepest descent, Flatcher and Reeves (conjugate
directions) or Powells method are all useful for optimization of objective
functions without any constraints. However, engineering systems of significance
seldom work without constraints which must be honored while maximizing or
minimizing the objective function. Constraints are formulated as equations or
equality constraints (rate of reaction r = kC A ) or inequality (e.g. reactor
temperature T<500oC since the catalyst will deactivate beyond this temperature).
Objective functions with equality constraints: Consider the problem
Maximize
=
y y=
(3.1)
( x ) y ( x1 , x2 ..............xn )
Subject to g k=
(3.2)
k 1,............m
( x ) 0,=
m<n must be satisfied for the problem to be under-determined. This problem can
be solved by several methods such as a) Direct substitution,
b) Langrange
(a)
s.t. g ( x1 , x2 ) = x1 x22 + 1 = 0
(b)
or
x22= x1 + 1
(c)
(d)
Maximize L ( x=
, ) y ( x ) + k g k
k =1
(3.3)
The constraints have been built in the objective function itself but at the expense
of increased dimensionality.
0=
i 1,...............n
(3.4)
0=
k 1,.............m
(3.5)
=
y y=
Maximize
( x ) y ( x1 , x2 ,...........xn )
subject to g k ( x ) 0; k=1,..............m
(3.6)
(3.7)
The inequalities are first converted to equalities by adding slack variables to the
constraint equations. These are non-negative constants added to pick-up the slack
provided by the inequalities.
g k ( x ) + S k = 0; k = 1,..........m
(3.8)
S k 0;
k=
1,..........m
(3.9)
We now have equality constraints and an augmented Lagrangian function can be
constructed as before
m
L ( x, S , ) =
y ( x ) k g k ( x ) + S k
k =1
(3.10)
Once again, function L can be maximized without constraints. Let us examine the
necessary conditions for optimality.
derivatives to disappear at the optimum.
16
( )
*
m
g
L y x
= k* k x* =
0; j =
1,.......n
x j
x j
x j
k =1
(3.11)
L
= g k x* + Sk* = 0; k = 1,.....................m
k
(3.12)
L
=
k* 0;
Sk
k=
1,.....................m
(3.13)
L
* *
k 1,.....................m
and Sk* = S=
0; =
k k
Sk
(3.14)
( )
( )
( )
( )
y x* k*g k x* =
0
k =1
(3.15)
( )
g k x* 0; k =
1,...........m
k* 0;
k = 1,...........m
(3.16)
(3.17)
k* g k ( x* ) =
0 k=1,.......m
(3.18)
(3.19)
Equations (3.15), (3.17) and (3.19) constitute the Kuhn-Tucker (K-T) conditions
of optimality.
These K-T conditions are necessary conditions and imply that at the optimal
solution, x* to the inequality constrained optimization problem, there must exist
generalized Lagrange Multipliers, * such that Eqs. (3.15), (3.17) and (3.19) are
satisfied.
These K-T conditions serve as the basis for design of some optimization
algorithms for non-linear programming (NLP) problems and as termination
criteria for others. However, there is one additional condition which must be
included in the necessary conditions for optimality which is called constraint
qualification, which must be satisfied. This simply implies that the region of
search is accessible from a feasible solution of the NLP. Consider the following
example:
17
(3.20)
Max. f ( x )
x = ( x1 , x2 ,.............xn )
1,.............m
s.t. gi ( x ) 0
i=
(3.21)
remain in feasible territory throughout such a move, however small, then for
every i such that gi ( x ) = 0 (this means x is on the boundary of these g i i.e. active
g i ( x ) ; h 0
if h points in an immediately feasible region.
n
g
For g ( x ) 0,=
dg
dxi 0
c =1 xi 0
Suppose there exists a stationary point
(3.22)
(3.23)
( xo ) of
qualification is satisfied.
In figure below point A is accessible feasible point but B is not.
Fig.3.1
To check for constraint qualification a simple method is to check that the Jacobian
matrix of the linearized constraints at x* is of full rank. Here only active
constraints are considered and one wants to ensure that the gradients of active
18
c1g1 + c2g 2 =
0
then c1 and c2 must be zero for above to hold. This condition shows g1 and
( )
xT 2 L x* x < 0
If this holds we have a local maximum but if does not hold we may still have a
local maximum.
Under certain circumstance, Kuhn-Tucker conditions are also sufficient.
Following theorem enunciates this.
Theorem: Let f ( x ) be a concave function and all the gi ( x ) be convex in the
mathematical program,
Maximize f ( x ) ;
x = ( x1 , x2 ............xn )
1,.................m
s.t. gi ( x ) 0; i =
global maximum.
19
s.t. gi ( x ) 0
(3.24)
=
then
L f ( x ) i gi
i =1
i 0
Maximize. f ( x )
st. gi ( x ) 0
(3.25)
then
L f ( x ) + i gi
=
i =1
i 0
Minimize f ( x )
gi ( x ) 0
(3.26)
then
L f ( x ) + i gi
=
i =1
i 0
Minimize f ( x )
st. gi ( x ) 0
then
=
L f ( x)
(3.27)
m
g
i
i =1
i 0
20
LECTURE 4
SUCCESSIVE QUADRATIC PROGRAMME (SQP)2,4
Quadratic Programming
Quadratic programming (QP) is a special case of nonlinear programming (NLP) where
the objective function is quadratic and constraints, equality and/or inequality, are linear.
It is often encountered in practical situations such as constrained least squares, optimal
control of linear systems with quadratic cost functions, solution of algebraic and
differential equations etc. Additionally, one can use QP as a sub problem to solve a
general NLP by successive or sequential quadratic programming (SQP)
If the constraints are equality constraints, then QP technique reduces to Linear
Programming (LP) problem where optimum lies at the intersection of linear equations
and hence QP become a vertex searching procedure. When in-equality constraints are
present, then a constraint is either satisfied as an equality (i.e. binding) or it is not
involved in the solution of the QP problem (non-operative or inactive).
The QP problem is formulated as:
1
Minimize f (=
x ) d T x + xT Qx
2
subject to Ax b
x0
(4.1)
(4.2)
(4.3)
(4.4)
21
where T and u T are non-negative Lagrange multiplier vectors for the constraints Ax b
and x 0 respectively.
Take the gradient of L with respect of xT and set it equation to zero i.e.
T
(4.5)
xT L = d + Qx A u = 0
The other KT conditions are
Ax b 0
T ( Ax =
b ) 0; j 0
x0
=
uT x 0 ; u j 0
(4.6)
The set of variables x* , u * , * that satisfy above equations is the optimal solution to the
QP.
Several codes based on LP Simplex method are available to solve QP problems.
subject to Ax = b
Gradient of f =f =d + Hx
2
f =
H
(4.7)
(4.8)
(4.9)
( 4.10)
*
and Ax = b
or Hx* AT * =
d
and Ax*
=b
(4.11)
(4.12)
(4.13)
In matrix notation
H
*
AT x d
* =
O b
(4.14)
22
H
The matrix
A
AT
is called Karush-Kuhn-Tucker (KKT) matrix,K
O
These are n + m set of coupled linear algebraic equations in x* and * which can be
*
step p ( = x ) i.e . x + p = x
(4.15)
A x+ p =
b
or Ap= b Ax
(4.16)
(4.17)
or ( d + Hx ) + Hp =
AT *
(4.18)
AT p d + Hx
* =
O Ax b
(4.19)
These are a set of linear algebraic equations and can be solved for p which gives
*
x = x + p etc.
Inequality constrained Quadratic Programming (IQP)
Consider the following problem
1
(4.20)
f (=
x ) d T x + xT Hx
2
subject to Ax b or c ( x ) = Ax b 0
(4.21)
A is coefficient matrix m x n of constants, x is a vector of (n x 1) variables and b is a
dispensed with. We now have a working set of active constraints giving rise to an EQP
problem. EQP technique, described earlier, can be used to generate a search direction
and the solution to the first EQP gives an improved feasible point. At this point the
working set of constraints is updated and search continued.
The search proceeds through following steps.
1. Obtain an initial feasible point x such that Ax b . The point could be either totally
inside the boundaries (in which case we have an unconstrained problem) or may lie
on some boundaries. Let, latter be the case.
2. A w is the working set of equality constraints which are active and let bw be the subset
of b corresponding to A w . Then,
(4.22)
Aw x = bw
3. We now have an EQP problem which can be solved by solving following set of linear
algebraic equations as before.
AwT p d + Hx
(4.23)
=
O * Aw x bw
Solution of above equations gives p and we remain on the constraint surface that we
Aw
(If, however, the initial feasible point is totally inside the region i.e. none of the
constraints are operative then we can find p =
H 1d x )
4. The new point, x + p , will satisfy the s equality constraints of the working set (active
constraints at x )- since it has been obtained using an EQP algorithm. However, it
may or may not satisfy the remaining m-s constraints (which were originally
inactive), since p may not be really small.
24
Fig. 4.1
So we need to check if the constraints not included in the EQP problem are violated
or not.
There are several possibilities that could occur. We consider them one by one:
a) Case I: As in figure above point x + p violates one or more constraints NOT
present in Aw ( we substitute x + p in the m-s constraint equations and see if they
are satisfied or violated)
What do we do: its obvious from above Fig.4.1 that we must retrace our step and go
to point D- the farthest point in the direction of p that we can take before violating a
constraint.
Mathematically:
We choose a point x + p
Check originally inactive constraints-if any is negative and tune so that one (or
some) of these m-s constraints just become active. We incorporate these into our
updated active set and go back to Step 2 above.
b) Case II: x + p does not violate any of the m-s constraints that were inactive at
point x and w1 , w 2,...................... ws are all > 0 then x + p is a local minimum (Point
E in Fig. 4.1)
c) Case III: x + p does not violate any of the m-s constraints but some
wi < 0 (Recall wi corresponds to ith active constraint).
Course of action: We remove the ith active constraint from A w and go to step 2.
25
Example :
f ( x=
) x12 + x22
Subject to g1= 2 x1 + 3 x2 6 0
Minimize
g2 =
x1 + 8 x2 8 0
x1 0; x2 0
As an initial starting point let us choose the intersection of g 1 = 0 and g 2 = 0 i.e. both
constraints are active. This results in an EQP.
We first check if the chosen point is an optimum by applying K.T. conditions.
Our EQP is
Min. f ( x=
) x12 + x22
st.
2 x1 + 3 x2 6 =
0
x1 + 8 x2 8 =
0
L ( x, ) =x12 + x22 1 ( 2 x1 + 3 x2 6 ) 2 ( x1 + 8 x2 8 )
L
K .T .C.
= 2 x1 2 1 2 = 0
x1
L
= 2 x2 31 82 = 0
x2
2 x1 + 3 x2 6 =
0
x1 + 8 x2 8 =
0
24
10
28
8
=
, x2 =
, 1
=
, 2
13
13
13
13
Since 2 is ve, the initial point is not optimal. Clearly g 1 =0 is active constraint and we
release g 2 ( x ) as inactive.
st. g1 ( x )= 2 x1 + 3 x2 6= 0
12
18
12
=
, x2 =
, 1
13
13
13
26
M=
( ) f ( x ) + ci ( x )
i=
(4.24)
2 x1 + 4 x2 2
x1 0, x2 0
The constraints are rewritten as
g1 = x12 x22 + 3 0
g 2 = x1 + 2 x2 1 0
g=
x1 0
3
g=
x2 0
4
Let us start the search from x 0 = (0, 2)
27
Quadratic approximation of f ( x ) at x 0 is
1
=
f x
f ( x 0 ) + T f ( x 0 ) p + pT H f ( x 0 ) p
()
p 1
6 0
=
f x [3, 0] 1 pT
p
p2 2 0 0
()
The constant term f ( x o ) which is -1 has been dropped as that does not change location
of the optimum.
The linearized constraints are
p
4] 1 [1] 0
p2
p
=
g 2 [1, 2] 1 [ 3] 0
p2
g1=
[0,
p
=
g3 [1, 0] 1 [ 0] 0
p2
p
=
g 4 [1, 0] 1 [ 2] 0
p2
The constraints can be rewritten as
0
1
4
1 0
2 p1 3 0
0 p2 0 0
1
2 0
( )
Min. =
f p
0
1
Subject to
1
[3, 0] p +
1 T 6 0
p
p
2 0 0
4
1 0
2 p1 3 0
0 p2 0 0
1
2 0
1
Solve the IQP as discussed earlier and update x k +=
x k + k xk where k is the step size
28
M (=
k ) f ( x ) + ci ( x )
i =1
29
LECTURE-5
ON-LINE OPTIMIZING CONTROL OF PMMA REACTORS5
5.1 Introduction
Manufacturing on an industrial scale requires that the operating conditions be maintained
at desired optimal levels to ensure economic operation. In actual practice, however, the
operating conditions may vary from batch to batch because of changes in the quality of
the feedstock, difficulty in maintaining actual temperature histories, and some
disturbances due to manual or machine errors. It is, therefore, necessary to carry out online optimizing control of these reactors to negate the effect of disturbances on the quality
of the product. One important aspect in on-line optimizing control is to sense the state of
the system on-line as the polymerization proceeds. Unfortunately, hardware sensors to
measure the state of the system are generally not available, particularly for bulk
polymerizations, while off-line analyses have the disadvantage of long and variable
response times. Therefore, easy to measure secondary variables are required to provide
reliable estimates of product quality on-line. Such sensors are called soft sensors.
Commonly used secondary measurements for soft sensing include viscosity, agitator
power, refractive index, etc. These measurements are used to tune the parameters of the
kinetic model to obtain improved estimates of the state of the system, e.g., monomer
conversion, average molecular weights, etc. It has been shown that the data on the
viscosity, (t), and the temperature, T(t), as a function of time, t, can be used to uniquely
predict the state of the polymerization mass provided we use a kinetic model.
Alternatively, one can also use on-line experimental data on the agitator current (at
constant RPM), C(t), and T(t) to soft-sense the state of the reaction mass, and then carry
out on-line optimizing control in the presence of a simulated disturbance, namely, heater
failure. Bulk polymerization of MMA in a batch reactor is used as an example system,
though the methodologies developed are quite general.
5.2 Theoretical Formulation
We first obtain the (off-line) optimal temperature history that produces poly methyl
methacrylate (PMMA) having the desired product properties. In the most general
optimization problem, two requirements are imposed: the final value, x mf , of the
30
(a)
subject to (s.t.)
End point constraint:
x m (t = t f ) = x md (stopping condition)
(b)
Constraints:
Rate of heating/cooling DTDt
(c)
Bounds:
T min T(t) T max
(d)
(e)
x(t = 0) = x 0
(f)
(g)
T(t init ) = T 1
(h)(5.1)
initial period. Thus, T op (t) really applies over t init t t f . The model equations are solved
using the D02EJF package (Gears algorithm) from the NAG library while the aJG
adaptation of the elitist genetic algorithm, GA-II, is used to obtain the solution of the
optimization problem in Eq. 5.1. In order to satisfy the end-point constraint on x m , the
integration is carried out till x m = x md , at which point, t = t f , while the constraint on M w is
handled by using the penalty function method [see Eq. 5.1 (a)]. Details of the model
equations (ordinary differential equations) along with the initial conditions are given in
Bhat et al (2006).
The initial estimate of the maximum reaction time up to which integration is to be
performed is taken as 166.67 min (the integration actually stops before this when x m =
x md ). Since the available code maximizes the objective function, any objective, I, that is
to be minimized is transformed into a function, F, which is maximized, using:
Max F[T(t)] =
(5.2)
1 + I [ T(t) ]
=
ktd ktd o exp ( A1 + A2 xm + A3 xm 2 + A4 xm3 )
(a)
k p k p o exp ( B1 + B2 xm + B3 xm 2 + B4 xm3 )
=
(b)
Ai =
Ai1 (T 273.15) + Ai 2 ; i = 1, 2, 3, 4
(c)
Bi =
Bi1 (T 273.15) + Bi 2 ; i = 1, 2, 3, 4
(d)
(5.3)
Eq. 5.3 has been found to explain a considerable body of experimental data under
isothermal, non-isothermal and semi-batch conditions, and so is being used here. The
second part of the complete model is a correlation for the agitator current, C(t), for a
specified T(t). The following modified form of the Martin equation is used
C = K = Ksol [1+int Cpolym exp{d 0 +d1 (int Cpolym )+d 2 (int Cpolym ) 2 }]
32
(5.4)
In Eq. 5.4, sol is the viscosity of the pure solvent (monomer in this case) in Pa s, int is
the intrinsic viscosity (related to M w ), C polym is the polymer concentration (related to x m ),
and K, d 0 , d 1 and d 2 are empirical parameters. The values of x m (t) and M w (t) required in
Eq. 5.4 are obtained from the kinetic model. The detailed expressions for int , sol and
C polym are also given in Bhat et al.(2006).
As the polymerization takes place under T op (t), data on T(t) and C(t) are acquired
continuously every 20 s and 50 s, respectively. This data is used to re-tune eight of the
(more sensitive) sixteen parameters in Eq. 5.3. Such a (periodic) update of the kinetic
parameters using experimental data on C(t) and T(t) as they become available, is
necessary since no model for the Trommsdorff effect is perfect. This procedure is known
as on-line soft-sensing. It enables one to predict x m (t) and M w (t) more accurately. The
following optimization problem is solved to obtain the re-tuned values of the eight
parameters at any time, t m :
C (t ) -C (t ) 2
exp i
mod i
Min M [A 11 , A 12 , A 21 , A 22 , B 11 , B 12 , B 21 , B 22 ]
C
(t
)
exp i
i =1
(5.5)
In Eq. 5.5, subscripts, exp and mod, represent the experimental and model-predicted
values, respectively. The values of C mod (t i ) are obtained using Eq. 5.4 [and the kinetic
model,which gives x m (t) and M w (t)] with the experimental temperature history, T expt (t).
(a)
subject to (s.t.)
End point constraint:
x m (t = t f,i *) = x md (stopping condition)
(b)
Constraint:
Rate of heating/cooling DTDt
(c)
Bounds:
33
(d)
(e)
x(t = 0) = x 0
(f)
intermediate heater failure in this experiment, nor is there any intermediate re-tuning of
the model parameters, nor any re-optimization. The speed of rotation is maintained
constant at 50 RPM. Fig.5.1a shows that the experimental temperature history, T expt (t),
tracks T op (t) quite well. Experimental values of x m (t), M w (t) and C(t) with this
temperature history are shown in Figs. 5.1b-d.
60
55
45
T ( C)
50
40
35
30
25
0
20
40
60
80
100
120
140
Time (min)
Fig.5.1 a)
2.50E+06
Mw (kg/kmol)
2.00E+06
1.50E+06
1.00E+06
5.00E+05
0.00E+00
0
20
40
60
80
100
120
140
120
140
Time (min)
Fig. 5.1 b)
2.50E+06
Mw (kg/kmol)
2.00E+06
1.50E+06
1.00E+06
5.00E+05
0.00E+00
0
20
40
60
80
100
Time (min)
35
Fig. 5.1 c)
C (A)
0.1
0.01
80
90
110
100
120
130
140
Time (min)
Fig. 5.1 d)
The model predictions (using the original kinetic parameters shown in Column 2 of Table
5.1) are shown by the solid curves. These predictions are not in too good an agreement
with experimental data, particularly for C(t). After the run is completed, the entire set of
data on T expt (t) and C(t) is used for a single re-tuning of the model parameters. The retuned values of the eight kinetic parameters are given in Column 3 of Table 5.1
Table 5.1
Results corresponding to a run with a single re-tuning (Fig. 5.1; no disturbances) and with
three re-tuning and re-optimizations (Fig. 5.2; no external disturbances)
Parameters
With
T op (t)14
With single
re-tuning
With
T reop,2 (t)
With
T reop,3 (t)
t f or t f,i *
(min)
x mf
M wf (kg
kmol-1)+
PDI f
A 11 (K-1)
A 12
A 21 (K-1)
A 22
1.2588 102
2.2000 10-1
1.2101 102
2.2000 10-1
1.2139 102
2.2000 10-1
1.2182 102
2.2000 10-1
1.2210 102
2.2000 10-1
7.0513 105
2.1166
-2.2417 10-2
8.1508 10-1
-2.5305 10-1
9.4254
7.1186 105
2.1248
-2.3878 10-2
8.7634 10-1
-2.6792 10-1
9.3539
7.3198 105
2.1346
-2.4191 10-2
7.2114 10-1
-2.2008 10-1
10.4918
7.2260 105
2.1161
-2.1020 10-2
7.1741 10-1
-2.8067 10-1
9.6718
7.2279 105
2.1346
-2.5143 10-2
9.7350 10-1
-2.4089 10-1
8.0636
B 11 (K-1)
-4.8857 10-3
-4.6173 10-3
-5.8695 10-3
-4.6120 10-3
-4.0814 10-3
36
B 12
B 21 (K-1)
B 22
t m,i (min)
1.2111 10-1
1.4492 10-1
-1
-2.7817 10
-3.0868 10-1
9.4639
1.0428 10-1
1.2588 102
+
5
M wd = 7.0 10 1 % (kg kmol-1)
1.0224 10-1
-2.8155 10-1
1.1155 101
1.0303 102
1.4492 10-1
-2.6868 10-1
8.1753
1.0836 102
1.3851 10-1
-3.2388 10-1
1.1276 101
1.1303 102
No re-optimization is done in this experiment. The dotted curves in Figs. 5.1b-d give the
model predictions with these improved values of the kinetic parameters. A slight
improvement in the agreement between the experimental results and the model
predictions (using re-tuned values) is observed for x m (t), while a considerable
improvement is observed for C(t).
In the second experiment, intermediate re-tuning of the model as well as intermediate reoptimization are carried out, but there are no disturbances. In this experimental run, the
off-line computed optimal history, T op (t), is implemented in the reactor from t > t init ,
when the polymerization is started. On-line re-tuning of the parameters of the kinetic
model, followed by the evaluation of the re-optimized temperature history, T reop,1 (t), is
then carried out, starting from t trigger . Two computers are used for this purpose. One of
these, the master machine, is used for the continuous on-line monitoring and recording of
the temperature, RPM and the agitator current. The other computer, the slave machine, is
used to perform the re-tuning and re-optimization operations, using the on-line data on
C(t) and T(t) transferred from the master machine. The value of the flag is initialized to 0
and remains at that value till the value of C(t) reaches 0.10 A (at t trigger ). After t trigger , the
flag is switched to 1 and the re-tuning is initiated using experimental values of T expt (t)
and of C(t) between 0.02 A (at t sense ) and 0.10 A. The re-tuned kinetic parameters are
used to compute T reop,1 (t) using Eq.5.6. The values of x md , M wd , T max , T min and DTDt
used in Eq.5.6 are the same as before. This re-optimized temperature history, T reop,1 (t), is
passed on to the master machine at time (t trigger + 6 min), for implementation on the
reactor (as the new set-point history). This operation is repeated continuously.
Fig. 5.2 gives the results for the case when the set point, T sp (t), is updated thrice during
polymerization, with re-tuning as well as re-optimization, but with no disturbances.
37
60
55
T (0C)
50
45
40
35
30
25
0
20
40
60
80
Time (min)
100
120
140
Fig. 5.2 a)
55
T (0C)
54
53
52
51
50
80
90
100
110
120
130
Time (min)
Fig. 5.2 b)
0.30
0.25
xm
0.20
0.15
0.10
0.05
0.00
0
20
40
60
80
Time (min)
Fig. 5.3 c)
38
100
120
140
2.50E+06
Mw (kg/kmol)
2.00E+06
1.50E+06
1.00E+06
5.00E+05
0.00E+00
0
20
40
60
80
Time (min)
100
120
140
Fig. 5.2 d)
C (A)
1.00
0.10
0.01
80
90
100
110
120
130
Time (min)
Fig. 5.2 e)
The first re-tuning/re-optimization starts at 103.03 min (t trigger t m,1 ) and the re-optimized
temperature history, T reop,1 (t), is implemented as the next set point only at 109.03 min (at
t m,1 + 6 min, since a cycle time of 6 min is used). This is followed by two such cycles of
re-tuning and re-optimization. Fig. 5.2a shows the actual set point temperature history
used, with these four segments of T(t) (see Fig. 5.2b), along with the experimental
temperature history. Excellent tracking is observed again. Interestingly, the final
temperature history comprising of the four segments is quite different from the original,
T op (t), even though there is no disturbance. Clearly, on-line re-tuning helps improve the
performance of the reactor Fig. 5.2b gives the re-optimized temperature histories for all
the segments using an expanded scale, showing the parts of the three re-optimized
histories that are implemented. These histories may or may not be identical depending on
the extent of the improvement in the model predictions after re-tuning. Table 5.1 gives
the values of x mf , M wf , and t f (or t f,i *) for the four segments of the temperature history,
along with the original and re-tuned values of the kinetic parameters.
39
The experimental results and the model-predictions for this case, using T expt (t), are shown
in Figs. 5.2 c - e. The constraint on M wf (M wd = 7.0 105 1 %) is not satisfied for these
cases. This is because the agitator current is insensitive to the viscosity during almost 70 80 % of t f , and soft-sensing can be started only after this time. This leaves very little
reaction time for manipulating the final molecular weight, using the re-optimized
temperature history (with re-tuned parameters). We have also verified, through off-line
trials, that the value of w = 108 in the penalty function (Eq.5.1a) is large enough and not
responsible for this constraint-violation. The re-optimized solution is the best of the
possible solutions. However, the final values of M wf are found to be within about 4 % of
M wd , which is acceptable.
Fig. 5.2c shows that good agreement is observed between the experimental value of x m (t)
and the model predictions, using T expt (t). Fig. 5.2e gives the experimental values of C(t)
along with the model predictions after re-tuning. A considerable improvement in the
prediction of C(t) is observed after re-tuning. It is observed that the desired value of x m
(= 0.22) is obtained at t = 122.10 min, as compared to 125.88 min with T op (t). Thus, softsensing followed by re-optimization not only improves the agreement between model
predictions and experimental data, but, in this case, also reduces the reaction time (the retuning and re-optimization exercise could have increased the reaction time, too).
However, the new re-optimized temperature history will be more realistic because of the
use of improved kinetic parameters.
5.2.2. On-Line Optimizing Temperature Control in the Presence of an External
Disturbance
On-line optimizing control in the presence of a simulated heater failure is now studied.
An additional step (of curve-fitting the experimental temperature history over a short
period around t m,i ) is necessary in this case, for each cycle. T op (t) is used as the set point
at the beginning. The heater failure is simulated by changing T sp (t) at time, t dist , so as to
incorporate a decreasing ramp of slope, S (K min-1). This is done to ensure replicability in
the experimental runs, and also to give a reasonable drop in the temperature (else, the
temperature will not decrease significantly since the reactor is quite well insulated). The
soft sensing is initiated at time, t m,1 = t trigger , when C crosses 0.1 A (obviously, the
disturbance is assumed to start before this happens). The experimental temperature
40
history in a short duration before t m,1 , namely, during (t m,1 - t reg ) < t < t m,1 , is first curvefitted using
T(t) = k 1 + k 2 t
(5.7)
where k 1 and k 2 are linear regression coefficients, and t reg is the time interval selected
for regression. This is to be used in Eq. 5.6h for re-optimization as T sp,previous (note that
the implemented T sp has a slope of S). It is assumed that Eq. 5.7 can be extrapolated and
applies for values of t beyond t m,1 . Re-tuning and re-optimization is started at t m,1 . The reoptimized temperature history, T reop,1 (t), is implemented at t m,1 + 6 min. At this time,
there would be a sudden jump in T sp (t), since earlier it had a slope of S, and after
regression, re-tuning and re-optimization, the value would be different. However, this is
taken care of in subsequent re-optimization cycles.
Fig. 5.3 shows experimental results for the on-line optimizing control of a PMMA
reactor, in
the presence of
heater
failure.
T op (t) is
70
60
T (0C)
50
40
30
20
10
0
0
20
40
60
80
100
120
140
Time (min)
Fig.5.3 a)
55
T (0C)
50
45
40
80
90
100
110
120
130
Time (min)
41
140
used
as
the initial
Fig. 5.3 b)
0.25
0.2
xm
0.15
0.1
0.05
0
0
20
40
60
80
100
120
140
120
140
Time (min)
Fig.5.3 c)
2.50E+06
Mw (kg/kmol)
2.00E+06
1.50E+06
1.00E+06
5.00E+05
0.00E+00
0
20
40
60
80
100
Time (min)
Fig. 5.3 d)
C (A)
0.1
0.01
80
90
100
110
120
130
140
Time (min)
Fig.5.3 e)
0.23
0.22
0.21
xm
0.2
0.19
0.18
0.17
0.16
0.15
100
105
110
115
120
125
130
Time (min)
42
135
Fig.5.3 f)
set point history. The disturbance is initiated at t dist = 88.82 min (before C attains 0.1 A).
S is taken as -0.6197 K min-1 while t reg is taken as 10 min. The first on-line re-tuning
and re-optimization cycle starts at t m = t trigger = 102.41 min and T reop,1 (t) is implemented
at 108.41 min (at which point the disturbance is assumed to stop). This is followed by
four more re-tunings and re-optimizations (in the absence of further heater failure), to
give, finally, T reop,5 (t). Table 5.2 summarizes the details of this experimental run. Fig.
5.3a shows T sp (t). This is a combination of the six segments (see Fig. 5.3 b). Values of
x mf , M wf , t f (or t f,i *) and the re-tuned kinetic parameters for each segment of the set-point
temperature history are given in Table 5.2. Fig. 5.3b gives the re-optimized temperature
histories for all the segments using an expanded scale. Figs. 5.3c and d give the
experimental values of x m (t) and M w (t), along with the model predictions using T expt (t)
and the final tuned parameters. Not much difference is observed in these plots when the
currently available kinetic parameters are used provided T expt (t) is used. Fig. 5.3e shows
the values of C(t) and the model predictions corresponding to T expt (t). Improved
predictions are obtained for all the re-tuning cycles. Fig. 5.3f shows model predictions of
x m (t) for the case where the original T op (t) is implemented as soon as the simulated
disturbance is removed (this involves a jump in the temperature). These predictions are
compared with the results shown in Fig. 5.3 c. Clearly, the desired value of the monomer
conversion is not obtained if on-line optimizing control is not used in the presence of
heater failure.
Table 5.2
Results corresponding to the run involving on-line regression, re-tuning and reoptimization (with heater failure)
Parameters With T op (t)
With
With
With
With
T reop,1 (t)**
T reop,2 (t)
T reop,3 (t)
T reop,4 (t)
t f , t f,i *(min) 1.2588 102
1.2877 102 1.2866 102
1.2951 102
1.3138 102
x mf
2.2000 10-1
2.2000 10-1 2.2000 10-1
2.2000 10-1
2.2000 10-1
M wf (kg
kmol-1)+
7.0513 105
8.0301 105 7.7453 105 7.7978 105
7.9297 105
PDIf
2.1166
2.2598
2.1928
2.2098
2.2514
t m,i (min)
A 11 (K-1)
A 12
A 21 (K-1)
A 22
-2.2417 10-2
8.1508 10-1
-2.5305 10-1
9.4254
1.0241 102
-1.8629 10-2
7.2726 10-1
-2.8067 10-1
10.0216
1.0774 102
-2.1503 10-2
6.9255 10-1
-2.1408 10-1
7.5798
43
1.1307 102
-2.3878 10-2
8.7634 10-1
-2.6792 10-1
9.3539
1.1841 102
-2.1582 10-2
6.5645 10-1
-2.0741 10-1
10.4922
With
T reop,5 (t)
1.3058 102
2.2000 10-1
7.6511 105
2.1894
1.2374 102
-2.4023 10-2
8.7557 10-1
-2.5659 10-1
10.0430
B 11 (K-1)
B 12
B 21 (K-1)
B 22
-5.8695 10-3
1.2738 10-1
-2.7211 10-1
10.9335
-5.2245 10-3
1.3872 10-1
-2.3825 10-1
7.6704
S = -0.6197 K min-1
References
1. Beveridge,G.S.G and Schechter,R.S., Optimization: Theory and Practice,
McGraw Hill Kogakusha Ltd, Tokyo,1970
2. Edgar,T.F.,
and
Wright,M.H.,
in
Handbooks
in
Regulation:
Experimental
Ind.Eng.Chem.Res.,45,2006,7530-7539
44
Study
on
1-L
Batch.,