Introduction to Process Optimization
Optimization
• Optimization is a mathematical and engineering approach used to find the
best possible solution to a problem that is underspecified, meaning the
system has more unknown variables than defining equations
• You have a design choice to make -> means that the system is underspecified
• If the system is fully specified, you wouldn’t have to choose/decide anything- the
governing equations will take care of everything
The diameter of a pipe
• Small diameter-> Larger pressure drop -> Larger pumping cost
• Large diameter-> Increased weight-> increased material cost
• Hence, “optimization”
Remember (for turbulent flow in commercial steel pipe):
∆𝑃 10 1.84 0.16 −4.84 −1
= 4.07 × 10 𝑚ሶ 𝜇 𝐷𝑖 𝜌
𝐿
Some other examples
• Shell &Tube heat exchanger:
• Baffle-spacing
• Tube-pitch
• Centrifugal pump:
• “Best-efficiency point”
• Separation columns
• Number of trays/height of packing
• Column diameter
• Other examples you can think of?
The thermal insulation of a pipe/tube
Blending of Petrol
• Blend petrol with reformates, alkylates, light naphtha Butane to maximise profit
• Within the constraints:
• Octane no. ≥ target
• Reid Vapour Pressure ≤ limit
• Benzene ≤ limit
Formulation of an optimization problem
• Variables (x) : The total set of variables involved in a given system or process
• Decision variables (d) : A specific subset of total variables that the designer selects and adjusts to achieve the optimal
outcome
• Objective function (f(x)) : A mathematical measure of "goodness“ or “badness” that needs to be maximised (e.g., return
on interest) or minimised (e.g., costs).
• Equality constraints (c(x) : Equality constraints are mathematical conditions in optimization problems requiring that specific
functions of the decision variables equal zero, expressed as
𝑐𝑖 𝑥 = 0
• Inequality constraints g(x) : Inequality constraints are optimization conditions restricting model variables to specific bounds
(e.g., ≥ or≤) rather than exact values
• Feasible region : The restricted operational space established by the combination of all equality constraints,
inequality constraints, and lower/upper bounds
• Local optimal solution : A feasible solution that minimizes or maximizes the objective function within a specific, local
area of the feasible region
• Global optimal solution : The feasible solution that maximises/minimizes the objective function across the entire feasible
region
Consider a one-variable optimization problem
Objective function:
• Minimise f(x)
Decision variable: x
f(x)
• What is the feasible region?
• What is the global optimal solution?
If there is an inequality constraint:
x>=a
• What is the feasible region now?
x=a
x • What is the global optimal solution now?
Classification of Optimization Problems
• Linear Programming (LP): An optimization problem where the objective function, equality
constraints, and inequality constraints are all strictly linear with respect to the variables
• Nonlinear Programming (NLP): An optimization problem where the objective function, or
any of the equality or inequality constraints, are nonlinear
• Mixed-Integer Programming (MILP / MINLP): Formulations that include both continuous and
integer (often binary) decision variables, commonly used to select flowsheet structures
alongside operating conditions
Solution to Linear Optimisation Problem
The Simplex Method: Developed in the 1940s, this method begins with initial values that
satisfy the problem's constraints at one of the vertices of the feasible region.
It then systematically moves from one vertex of the feasible region to an adjacent vertex,
finding an improved value for the objective function each time, until the optimal solution
vertex is found
The Interior-Point Method: Developed in the 1980s, this alternative is often more efficient for
complex problems where the simplex method might require an exponentially increasing
number of iterations
• Unlike the simplex method, its iterates are not required to be located on the vertices
• Instead, they are points situated within the interior of the feasible region, allowing the
algorithm to cut directly across the feasible space to locate the optimal point more quickly
The Simplex Method
A plant can produce two products in a reactor. Product A earns Rs. 7 per batch and uses 2 hours of reactor time and 3
hours of purification time. Product B earns Rs. 6 per batch and uses 4 hours of reactor time and 2 hours of purification
time. The plant can have a maximum of 16 reactor hours and 12 purification hours available on any given day. Decide
how many batches of each product should be made to maximise profit.
Variables? x1: Batches of product A
x2: Batches of product B
Objective function? Maximise 𝑓 𝑥 = 7𝑥1 + 6𝑥2
Constraints:
For the reactor: 2𝑥1 + 4𝑥2 ≤ 16
For purification: 3𝑥1 + 2𝑥2 ≤ 12
Non-negativity: 𝑥1 , 𝑥2 ≥ 0
The Simplex Method
The optimization problem
Maximise 𝑓 𝑥 = 7𝑥1 + 6𝑥2 𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
With constraints: 2𝑥1 + 4𝑥2 ≤ 16 2𝑥1 + 4𝑥2 + S1 = 16
SLACK VARIABLES
3𝑥1 + 2𝑥2 ≤ 12 3𝑥1 + 2𝑥2 + S2 = 12
𝑥1 , 𝑥2 ≥ 0 𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐 Set x1=0, x2=0 Non-basic variables
2𝑥1 + 4𝑥2 + S1 = 16 S1= 16
Basic variables
3𝑥1 + 2𝑥2 + S2 = 12 S2= 12 Feasible Solution
X1=0,X2=0,S1=16,S2=12
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Simplex Table:
x1 x2 S1 S2
Basis CB 7 6 0 0 b
S1 0 2 4 1 0 16
S2 0 3 2 0 1 12
Zj 0 0 0 0 0
x1 x2 S1 S2
Basis CB 𝐜𝐣 7 6 0 0 b 𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
S1 0 2 4 1 0 16
2𝑥1 + 4𝑥2 + S1 = 16
S2 0 3 2 0 1 12
3𝑥1 + 2𝑥2 + S2 = 12
(𝑧𝑗 = 𝑐𝐵 𝑇 ∙ 𝑎𝑖𝑗 ) Zj 𝟎×𝟐 𝟎×𝟒 𝟎×𝟏 𝟎×𝟎 𝟎 × 𝟏𝟔
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
+𝟎 × 𝟑 +𝟎 × 𝟐 +𝟎 × 𝟎 +𝟎 × 𝟏 + 𝟎 × 𝟏𝟐
𝒂𝒊𝒋
• Cj – Zj: Net evaluation row (How
the objective function changes
x1 x2 S1 S2
when a unit of variable enters
Basis CB 7 6 0 0 b the basis)
S1 0 2 4 1 0 16 Initial simplex tableau
x1=x2=0,S1=16, S2=12
S2 0 3 2 0 1 12
• For optimal solution, we iterate until all
Zj 0 0 0 0 0 Cj – Zj ≤ 0
Cj - Zj 7 6 0 0
• To find which non-basic variable has to be made
Iterations New Basic Variable: x1 basic:
• Find the column with the maximum value
x1 x2 S1 S2
for Cj – Zj -> variable that provodes largest
Basis CB 7 6 0 0 b improvement to the objective function
when it enters the basic variables
S1 0 2 4 1 0 16
• If there is a tie between two column, you
0 3 2 0 1 12 may choose either. (But for consistency, it
S2
is advisable to choose the left most
Zj 0 0 0 0 0 column in the case of a tie)
Cj - Zj 7 6 0 0 • Which current basic variable will x1 replace?
S1 or S2?
Key column (Also called pivot column)
x1 x2 S1 S2 • Find the ratio of b/ai,pivot in the
corresponding row of the pivot column
Basis CB 7 6 0 0 b ratios
16
• Choose the row with the minimum
S1 0 2 4 1 0 16 =8 positive value.
Key 2
• x1 will replace this row to become a
S2 0 3 element
2 0 1 12 12
=4 basic variable
3
Zj 0 0 0 0 0 Key row (Also called pivot row)
Cj - Zj 7 6 0 0
x1 x2 S1 S2
Basis CB 7 6 0 0 b 𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
S1 0 2 4 1 0 16
2𝑥1 + 4𝑥2 + S1 = 16
x1 S2 0 3 2 0 1 12
Zj 0 0 0 0 0
3𝑥1 + 2𝑥2 + S2 = 12
Cj - Zj 7 6 0 0 𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
x1 x2 S1 S2
• Cj row-> coefficients in the objective function
Basis CB 7 6 0 0 b
• CB column-> Coefficients of basis variables in
S1 0 0 the objective function
• Perform elementary operations such that the aij
x1 7 1 values of the basis vectors become a unit column
Zj • Convert pivot element to 1 and other
elements to 0
Cj - Zj
Old x1 x2 S1 S2
Basis CB 7 6 0 0 b 𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
S1 0 2 4 1 0 16
2𝑥1 + 4𝑥2 + S1 = 16
x1 0 3 2 0 1 12
Zj 0 0 0 0 0
3𝑥1 + 2𝑥2 + S2 = 12
Cj - Zj 7 6 0 0 𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
New x1 x2 S1 S2
• Cj row-> coefficients in the objective function
Basis CB 7 6 0 0 b
• CB column-> Coefficients of basis variables in
S1 0 the objective function
• Perform elementary operations such that the aij
x1 7 3/3 2/3 0/3 1/3 12/3 values of the basis vectors become a unit column
Zj • Convert pivot element to 1 and other
elements to 0
Cj - Zj
𝒏𝒆𝒘
𝑹𝟐 𝒐𝒍𝒅
→ 𝑹𝟐
𝟑
Old x1 x2 S1 S2
Basis CB 7 6 0 0 b 𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
S1 0 2 4 1 0 16
2𝑥1 + 4𝑥2 + S1 = 16
x1 0 3 2 0 1 12
Zj 0
3𝑥1 + 2𝑥2 + S2 = 12
Cj - Zj 𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
New x1 x2 S1 S2
• Cj row-> coefficients in the objective function
Basis CB 7 6 0 0 b
• CB column-> Coefficients of basis variables in
S1 0 0 8/3 1 -2/3 8 the objective function
• Perform elementary operations such that the aij
x1 7 1 2/3 0 1/3 4 values of the basis vectors become a unit column
Zj • Convert pivot element to 1 and other
elements to 0
Cj - Zj
𝒏𝒆𝒘
−𝟐 × 𝑹𝟐 𝒏𝒆𝒘 + 𝑹𝟏 𝒐𝒍𝒅 → 𝑹𝟏
x1 x2 S1 S2
• Cj row-> coefficients in the objective function
Basis CB 7 6 0 0 b
• CB column-> Coefficients of basis variables in
S1 0 0 8/3 1 -2/3 8 the objective function
• Perform elementary operations such that the aij
x1 7 1 2/3 0 1/3 4 values of the basis vectors become a unit column
Zj 7 14/3 0 7/3 28 • Convert pivot element to 1 and other
elements to 0
Cj - Zj
𝑇
Calculate zj: (𝑧𝑗 = 𝑐𝐵 ∙ 𝑎𝑖𝑗 )
First iteration done!
x1 x2 S1 S2
• Cj row-> coefficients in the objective function
Basis CB 7 6 0 0 b
• CB column-> Coefficients of basis variables in
S1 0 0 8/3 1 -2/3 8 the objective function
• Perform elementary operations such that the aij
x1 7 1 2/3 0 1/3 4 values of the basis vectors become a unit column
Zj 7 14/3 0 7/3 28 • Convert pivot element to 1 and other
elements to 0
Cj - Zj 0 4/3 0 -7/3
Maximum value of Cj - Zj > 0 → Further iterations
Calculate Cj- zj
𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
2𝑥1 + 4𝑥2 + S1 = 16
3𝑥1 + 2𝑥2 + S2 = 12
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Next Iteration
x1 x2 S1 S2
• Cj row-> coefficients in the objective function
Basis CB 7 6 0 0 b
• CB column-> Coefficients of basis variables in
S1 0 0 8/3 1 -2/3 8 the objective function
• Perform elementary operations such that the aij
x1 7 1 2/3 0 1/3 4 values of the basis vectors become a unit column
Zj 7 14/3 0 7/3 28 • Convert pivot element to 1 and other
elements to 0
Cj - Zj 0 4/3 0 -7/3
Key column? -> Column with the maximum value for Cj - Zj
x2 will enter the basis -> But which one will it replace?
Next Iteration
x1 x2 S1 S2
• Cj row-> coefficients in the objective
Basis CB 7 6 0 0 b ratio function
S1 0 0 8/3 1 -2/3 8 8/(8/3) • CB column-> Coefficients of basis
variables in the objective function
• Perform elementary operations such that
x1 7 1 2/3 0 1/3 4 4/(2/3) the aij values of the basis vectors become
Zj 7 14/3 0 7/3 28 a unit column
Cj - Zj 0 4/3 0 -7/3 • Convert pivot element to 1 and othe
elements to 0
Pivot column? -> Column with the maximum value for Cj - Zj
x2 will enter the basis -> But which one will it replace? -> Calculate the ratios of b/ai,pivot
Next Iteration
Key element
x1 x2 S1 S2
• Cj row-> coefficients in the objective
Basis CB 7 6 0 0 b ratio function
S1 0 0 8/3 1 -2/3 8 3 • CB column-> Coefficients of basis
variables in the objective function
• Perform elementary operations such that
x1 7 1 2/3 0 1/3 4 6 the aij values of the basis vectors become
Zj 7 14/3 0 7/3 28 a unit column
Cj - Zj 0 4/3 0 -7/3 • Convert pivot element to 1 and othe
elements to 0
Pivot column? -> Column with the maximum value for Cj - Zj
x2 will enter the basis -> But which one will it replace? -> Calculate the ratios of b/aij
Choose the row with the lowest ratio S1 will leave the basic variables
x1 x2 S1 S2
Basis CB 7 6 0 0 b
x 2 S1 6 0 0 8/3 1 -2/3 8
x1 7 1 2/3 0 1/3 4
Zj
Cj - Zj
x2 will enter the basis
S1 will leave the basic variables
x1 x2 S1 S2
Basis CB 7 6 0 0 b
x2 6 0 8/3 1 -2/3 8
x1 7 1 2/3 0 1/3 4 𝟑
𝐑 𝟏 𝐧𝐞𝐰= 𝐑 𝟏 𝐨𝐥𝐝 ×
𝟖
Zj
Cj - Zj
x2 will enter the basis
S1 will leave the basic variables
Perform elementary operations such that the pivot element becomes 1 and pivot column becomes a unit column
x1 x2 S1 S2
Basis CB 7 6 0 0 b
x2 6 0 1 3/8 -1/4 3
x1 7 1 2/3 0 1/3 4 𝟑
𝐑 𝟏 𝐧𝐞𝐰= 𝐑 𝟏 𝐨𝐥𝐝 ×
𝟖
Zj 7 14/3 0 7/3 28
Cj - Zj 0 4/3 0 -7/3
x2 will enter the basis
S1 will leave the basic variables
Perform elementary operations such that the pivot element becomes 1 and pivot column becomes a unit column
x1 x2 S1 S2
Basis CB 7 6 0 0 b 𝟑
𝐑 𝟏 𝐧𝐞𝐰= 𝐑 𝟏 𝐨𝐥𝐝 ×
x2 0 1 3/8 -1/4 3 𝟖
6
x1 7 1 2/3 0 1/3 4 𝟐 𝐧𝐞𝐰
𝐧𝐞𝐰 𝐨𝐥𝐝
𝐑𝟐 = 𝐑𝟐 − 𝐑
Zj 𝟑 𝟏
Cj - Zj
x2 will enter the basis
S1 will leave the basic variables
Perform elementary operations such that the pivot element becomes 1 and pivot column becomes a unit column
x1 x2 S1 S2
Basis CB 7 6 0 0 b 𝟑
𝐑 𝟏 𝐧𝐞𝐰= 𝐑 𝟏 𝐨𝐥𝐝 ×
x2 0 1 3/8 -1/4 3 𝟖
6
x1 7 1 0 -1/4 1/2 2 𝟐 𝐧𝐞𝐰
𝐧𝐞𝐰 𝐨𝐥𝐝
𝐑𝟐 = 𝐑𝟐 − 𝐑
𝟑 𝟏
Zj
Cj - Zj
x2 will enter the basis
S1 will leave the basic variables
Perform elementary operations such that the pivot element becomes 1 and pivot column becomes a unit column
x1 x2 S1 S2
Basis CB 7 6 0 0 b
x2 6 0 1 3/8 -1/4 3 𝒙𝟐 = 𝟑
x1 7 1 0 -1/4 1/2 2 𝒙𝟏 = 𝟐
Zj 7 6 ½ 2 32
Cj - Zj 0 0 -1/2 -2
Calculate zj: (𝑧𝑗 = 𝑐𝐵 𝑇 ∙ 𝑎𝑖𝑗 )
Maximum value of Cj – Zj ≤ 𝟎
Maximisation is complete!
𝑓 𝑥 = 7𝑥1 + 6𝑥2 + 0𝑺𝟏 + 0𝑺𝟐
2𝑥1 + 4𝑥2 + S1 = 16
3𝑥1 + 2𝑥2 + S2 = 12
𝑥1 , 𝑥2, 𝑆1, 𝑆2 ≥ 0
Basic solutions labelled 1 to 6
Note: some of them are outside the
feasible region
Basic feasible solutions 1 to 4
Classroom Problem Set #10
Problem 1. A refinery plans to optimize the production rates of gasoline and diesel to maximise profit.
• Gasoline yields a profit of Rs. 60 per barrel.
• Diesel yields a profit of Rs. 45 per barrel.
The refinery faces the following constraints:
• Total production is limited to at most 800 barrels per day due to crude supply
• Market demand restricts gasoline production to at most 400 barrels per day
Determine the number of barrels of gasoline and diesel to produce each day in order to maximise total profit, subject to
these constraints. Also calculate the maximum profit it can make.
Variables? x1: barrels of Gasoline
x2: barrels of Diesel
Objective function? Maximise 𝑓 𝑥 = 60𝑥1 + 45𝑥2
Constraints:
Market limit 𝑥1 ≤ 400
Availability of crude: 𝑥1 + 𝑥2 ≤ 800
Non-negativity: 𝑥1 , 𝑥2 ≥ 0
x1 x2 S1 S2
Basis CB 60 45 0 0 b
S1 0 1 0 1 0 400
S2 0 1 1 0 1 800
Zj 0 0 0 0 0
Cj - Zj 60 45 0 0
x1 x2 S1 S2
Basis CB 60 45 0 0 b ratio
S1 0 1 0 1 0 400 400
S2 0 1 1 0 1 800 800
Zj 0 0 0 0 0
Cj - Zj 60 45 0 0
𝑹𝟏 𝒏𝒆𝒘 → 𝑹𝟏 𝒐𝒍𝒅
𝑹𝟐 𝒏𝒆𝒘 → 𝑹𝟐 𝒐𝒍𝒅 - 𝑹𝟏 𝒏𝒆𝒘
x1 x2 S1 S2
Basis CB 60 45 0 0 b
x1 60 1 0 1 0 400
S2 0 0 1 -1 0 400
Zj 60 0 60 0 24000
Cj - Zj 0 45 -60 0
x1 x2 S1 S2
Basis CB 60 45 0 0 b ratio
x1 60 1 0 1 0 400 ∞
S2 0 0 1 -1 0 400 400
Zj 60 0 60 0 24000
Cj - Zj 0 45 -60 0
𝑹𝟐 𝒏𝒆𝒘 → 𝑹𝟐 𝒐𝒍𝒅
𝑹𝟏 𝒏𝒆𝒘 → 𝑹𝟏 𝒐𝒍𝒅
x1 x2 S1 S2
Basis CB 60 45 0 0 b
x1 60 1 0 1 0 400
x2 45 0 1 -1 1 400
Zj 60 45 15 45 42000
Cj - Zj 0 0 -15 -45
𝒙𝟏 =? 𝒙𝟐 =? Maximum profit =?