ADVANCED PROCESS OPTIMISATION CENG0023
NLP Examples 2
Problem 5 correction
Department of Chemical Engineering
University College London
Theory (1/3)
A constrained optimisation problem can be expressed mathematically as:
Minimise 𝒇 𝒙
Subject to 𝒉𝒊 𝒙 = 𝟎 ∀ 𝒊𝝐𝑬 Equality constraints
𝒈𝒊 𝒙 ≤ 𝟎 ∀ 𝒊𝝐𝑰 Inequality constraints
𝒙 ∈ 𝑹𝒏
Lagrangian function stated as:
𝐿 𝑥, 𝜆, 𝜇 = 𝑓 𝑥 + σ𝑖𝜖𝐸 𝜆𝑖 ∗ ℎ𝑖 (𝑥) + σ𝑖𝜖𝐼 𝜇𝑖 ∗ 𝑔𝑖 (𝑥)
Different nomenclature in various textbooks.
Theory (2/3) - Optimality Conditions
◆ Karush-Kuhn-Tucker (KKT) optimality conditions for a constrained minimum
(necessary)
➢ Lagrange Conditions:
∇𝐿 𝑥 ∗ , 𝜆, 𝜇 = ∇𝑓 𝑥 ∗ + 𝜆𝑇 ∇ℎ 𝑥 ∗ + 𝜇𝑇 ∇𝑔(𝑥 ∗ )
➢ Feasibility Conditions:
g ( x* ) 0
h( x * ) = 0
➢ Complementary Conditions:
T g ( x* ) = 0
0
Theory (3/3) - Iterative Active Set Strategy
This is in order to obtain a Karush-Kuhn-Tucker (KKT) point.
Step 1: Assume no active inequalities. Set the index of active inequalities
JA={∅} and the multipliers i = 0, i = 1,......., p
Step 2: Solve m P
f ( x ) + i hi ( x ) + i g i ( x ) = 0
i =1 i =1
iJ A
hi ( x) = 0 i = 1, , m
g i ( x) = 0 i JA
for x, the multipliers i of the equalities and the multipliers i of the active
constraints (1st iteration: none).
Step 3: If gi(x) 0 and i 0, i = 1,..., p; stop: solution found. Else go to step 4.
Step 4: If any gi(x) > 0 (violated) and/or i ≤ 0 (wrong sign), then do the following:
a) If one or more multipliers are negative, remove from JA that active
inequality (largest magnitude).
b) Add to JA any violated inequalities gi(x) > 0
Return to Step 2.
Iterative Active Set Strategy (Summary)
This is in order to obtain a Karush-Kuhn-Tucker (KKT) point.
Step 1: Assume no active inequalities. Set the index of active inequalities
JA={∅} and the multipliers i = 0, i = 1,......., p
Step 2: Solve m P
f ( x ) + i hi ( x ) + i g i ( x ) = 0
i =1 i =1
iJ A
hi ( x) = 0 i = 1, , m
g i ( x) = 0 i JA
for x, the multipliers i of the equalities and the multipliers i of the active
constraints (1st iteration: none).
Step 3: If gi(x) 0 and i 0, i = 1,..., p; stop: solution found. Else go to step 4.
Step 4: If any gi(x) > 0 (violated) and/or i ≤ 0 (wrong sign), then do the following:
a) If one or more multipliers are negative, remove from JA that active
inequality (largest magnitude).
b) Add to JA any violated inequalities gi(x) > 0
Return to Step 2.
Problem 5
In a given chemical process, a gas stream is compressed to a pressure P
(atm) with a centrifugal compressor at a cost of 4·P (£k/yr). This stream is
then mixed with a recycle stream of flowrate R (Kg/hr) and fed to a
reactor whose annualised cost is given by
8 (£k/yr).
P·R
The desired product is removed in a flash unit and the unreacted material
is recycled at a cost of 2·R (£k/yr). The minimum pressure at which the
reaction has to proceed is 3 atm, while with the existing pump and
pipeline, the maximum flowrate that can be recycled is 1.5 (Kg/hr)
(i) Formulate the optimisation problem that will minimise the total annual
cost of the system
(ii) Determine the optimal values of the pressure P and of the recycle R
by finding a Karush-Kuhn–Tucker (KKT) point for the optimisation
problem. (Apply the iterative Active-Set Strategy).
Problem 5 - Solution
(i) The optimisation problem will be formulated as follows:
8
Minimise 𝑓 𝑃, 𝑅 = 𝑃∙𝑅 + 4𝑃 + 2𝑅
s.t. g1 = 3 − 𝑃 ≤ 0
g2 = 𝑅 − 1.5 ≤ 0
g3 = −𝑅 ≤ 0
Problem 5 - Solution
Iteration 1
Step 1: Assume no inequality constraints active (JA = {}, i = 0 (i = 1......3))
Step 2: Solve the system ∇𝑓 𝑥 + σ3𝑖=1 𝜇𝑖 ∇𝑔𝑖 (𝑥) = 0
Since there are no active constraints, we solve ∇𝑓 𝑥 = 0, which
gives:
−8
+4=0
𝑃2 𝑅
−8
+2=0
𝑃𝑅 2
So, P=1 and R=2
Step 3: Check inequalities
g1=1>0 violated
g2=0.5 >0 violated
g3=-1 <0 ok
Step 4: Include g1 in the active set: JA = {g1, g2}, and return to Step 2
Problem 5 - Solution
Iteration 2
Step 2: Solve the system ∇𝑓 𝑥 + σ3𝑖=1 𝜇𝑖 ∇𝑔𝑖 (𝑥) = 0
Since g1 and g2 are active, the stationary conditions of the Lagrangian are:
∇𝑓 𝑥 + 𝜇1 ∇𝑔1 𝑥 + 𝜇2 ∇𝑔2 𝑥 = 0
𝑔1 𝑥 = 0 ; 𝑔2 𝑥 = 0
which corresponds to the following 3x3 linear system:
−8
+ 4 − 𝜇1 = 0
𝑃2 𝑅
−8
+ 2 + 𝜇2 = 0
𝑃𝑅 2
3−𝑃 = 0; 1.5−𝑅 = 0
with solution: P=3, R=1.5 and 1 =3.41; 2 =-0.81
Step 3: Check inequalities and i values.
g1=0≤ 0; 1 =3.41 ≥0 ok
g2= 0 ≤ 0; 2 =-0.81≤0 violated
g3= -1.5 ≤ 0; 3 =0 ≥0 ok
Step 4: Remove g1 from the active set: JA = {g2}, and return to Step 2
Problem 5 - Solution
Iteration 3
Step 2: Solve the system ∇𝑓 𝑥 + σ3𝑖=1 𝜇𝑖 ∇𝑔𝑖 (𝑥) = 0
Since g2 is active, the stationary conditions of the Lagrangian are:
∇𝑓 𝑥 + 𝜇2 ∇𝑔2 𝑥 = 0
𝑔2 𝑥 = 0
which corresponds to the following 3x3 linear system:
−8
+4=0
𝑃2 𝑅
−8
+ 2 + 𝜇2 = 0
𝑃𝑅 2
1.5−𝑅 = 0
with solution: P=1.155, R=1.5 and 2 =1.078
Step 3: Check inequalities and i values.
g1=1.08>0; 1 =0 ≥0 violated
g2= 0 ≤ 0; 2 =1.078 ≥0 ok
g3= -1.5 ≤ 0; 3 =0 ≥0 ok
Step 4: Remove g2 from the active set: JA = {g1}, and return to Step 2
Problem 5 - Solution
Iteration 4
Step 2: Solve the system ∇𝑓 𝑥 + σ3𝑖=1 𝜇𝑖 ∇𝑔𝑖 (𝑥) = 0
Since g1 is active, the stationary conditions of the Lagrangian are:
∇𝑓 𝑥 + 𝜇1∇𝑔1 𝑥 0
𝑔1 𝑥 = 0
which corresponds to the following 3x3 linear system:
−8
+ 4 − 𝜇1 = 0
𝑃2 𝑅
−8
+2=0
𝑃𝑅 2
3−𝑃 = 0
with solution: P=3, R=1.15 and 1 =3.23;
Step 3: Check inequalities and i values.
g1=0≤ 0; 1 =3.23 ≥0 ok
g2= -0.35 ≤ 0; 2 =0 ≥0 ok
g3= -1.15 ≤ 0; 3 =0 ≥0 ok
Solution found: P=3, R=1.15; f(P,R)=16.62 (£k/yr)