Process Optimization (LP)
Process Optimization (LP)
PROGRAMMING
Chapter 4
Outcomes
Formulate the objective function (focus for LP)
Perform the graphical method and find solution as well as formulate
complex LP problems.
Solve using simplex method and perform sensitivity analysis
Formulation of the Objective
Function
The formulation of objective function is one of the crucial steps in the
application of optimization to a practical problem.
You must be able to translate a verbal statement or concept of the desired
objective into mathematical terms.
In the chemical industries, the objective function often is expressed in
units of currency because the goal is to minimize costs or maximize profits
subject to a variety of constraints.
Other examples include:
Maximization of the yield of a component in a reactor
Minimization of the use of utilities in a heat exchanger network
Minimization of the volume of a packed column
Minimizing the differences between a model and some data
When formulating the mathematical statement of the objective, functions
that are more complex or nonlinear are more difficult to solve in
optimization use optimization software instead.
Introduction about LP
The goal of linear programming (LP) is to determine the values of decision variables
that maximize or minimize a linear objective function, where the decision variables
are subjected to linear constraints.
Is a special case of general constrained optimization problem.
In general setting, we want to find a point (a value of decision variable) that
minimizes/maximizes the objective function, simultaneously satisfies the constraints.
This point is a feasible point.
In LP, the objective function is linear, and the set of feasible points is determined by
a set of linear equations and/or equalities.
The methods in LP provide a way of choosing the best feasible point among the
many possible feasible points.
Is one of the most widely used optimization techniques and perhaps the most
effective.
Historically, Leonid Kantorovich in 1939 had developed the method as a way to plan
expenditures and returns, as to reduce costs to the army and increase losses
incurred by the enemy (WWII).
Forms
The
basic form of linear programming (LP) is;
min/max f(x)
subject to:
h(x) = 0
g(x) 0
Where x is assumed as a set of continuous variables. The functions of f(x), g(x)
and h(x) are must all linear.
Also, can be written as;
min/max f =
subject to:
= , i = 1,2,,m, j = 1,2,,n
In a standard (matrix) form;
min/max cTx
subject to:
Ax = b and/or Ax b and/or Ax b
x0
Where c Rn, b Rm and A Rmxn.
Let us start with few examples
We have done few examples on how to
formulate optimization problems involving
LP. Now let us learn on how to solve them..
Graphical method
Simplex method
Consider the following
Giapettos Incorporated manufactures wooden soldiers and trains. The data for these
manufacturing are given below:
Each soldier built:
Sold for $27 and uses $10 worth of raw materials.
Increase Giapettos variable labor/overhead costs by $14.
Requires 2 hours of finishing labor.
Requires 1 hour of carpentry labor.
Each train built:
Sold for $21 and uses $9 worth of raw materials.
Increases Giapettos variable labor/overhead costs by $10.
Requires 1 hour of finishing labor.
Requires 1 hour of carpentry labor.
Each week Giapetto can obtain:
All needed raw materials.
Only 100 finishing hours.
Only 80 carpentry hours.
Also:
Demand for the trains is unlimited.
At most 40 soldiers are bought each week.
Giapetto wants to maximize weekly profit (revenues expenses). Develop a mathematical
model for Giapettos situation that can be used to maximize the weekly profit and SOLVE it by
using graphical method.
Cont..
For the Giapetto problem model, combining the sign restrictions x1 0 and x2
0 with the objective function and constraints yields the following optimization
model:
Max z = 3x1 + 2x2 (objective function)
Subject to (s.t.):
2 x1 + x2 100 (finishing constraint)
x1 + x2 80 (carpentry constraint)
x1 40 (constraint on demand for soldiers)
x1 0 (sign restriction)
x2 0 (sign restriction)
3.2 Graphical Solution to a 2-Variable LP
Finding the Feasible Solution
Since the Giapetto LP has two variables, it may be solved
graphically. The feasible region is the set of all points satisfying the
constraints:
Giapetto Constraints
2 x1 + x2 100 (finishing constraint)
x1 + x2 80 (carpentry constraint)
x1 40 (demand constraint)
x1 0 (sign restriction)
x2 0 (sign restriction)
five sided
polygon DGFEH. G
Any point on or
in the interior of z = 100
this polygon carpentry constraint
(the shade
area) is in the
feasible region. F
z = 180
z = 60
E A C
H
10 20 40 50 60 80 X1
3.2 Graphical Solution to a 2-Variable LP
Most LPs have only one optimal solution. However, some LPs
have no optimal solution, and some LPs have an infinite number
of solutions. Section 3.2 shows the optimal solution to the
Giapetto LP is x1 = 20 and x2 = 60. This solution yields an
objective function value of:
x2 100 x2 + s2 = 100
If NBV = {x2} and BV = {x1, x3} are chosen instead, the basic solution
becomes x1 = 3, x2 = 0, and x3 = -1.
Theorem 2 For any LP, there is a unique extreme point of the LPs
feasible region corresponding to each basic feasible solution. Also,
there is at least one bfs corresponding to each extreme point in the
feasible region.
X2
The relationship between D
extreme points and basic
feasible solutions outlined in
Theorem 2, is seen in the
Leather Limited problem. The Labor Constraint
LP (with slack variables) was: B
Feasible Region
max z = 4x1 + 3x2
s.t. x1 + x2 + s1 = 40
Leather Constraint
2x1 + x2 + s2 = 60 E
x1, x2, s1, s2 0
are B, C, E, and F.
Basic Nonbasic Basic Feasible Corresponds to Corner
Variables Variables Solution Point
x1, x2 s1 , s 2 s1 = s2 = 0, x1 = x2 = 20 E
x1, s1 x2 , s 2 x2 = s2 = 0, x1 = 30, s1 = 10 C
x2, s2 x1 , s 1 x1 = s1 = 0, x2 = 40, s2 = 20 B
s1, s2 x1 , x 2 x1 = x2 = 0, s1 = 40, s2 = 60 F
For example in the Leather Limited LP on the previous slide, the bfs
corresponding to point E is adjacent to the bfs corresponding to
point C. These points share (m 1 = 2 - 1 = 1) one basic
variable, x1. Points E (BV = {x1,x2}) and F (BV = {s1,s2}) are not
adjacent since they share no basic variables.
Intuitively, two basic feasible solutions are adjacent if they both lie on
the same edge of the boundary of the feasible region.
General description of the simplex algorithm solving an
LP in a maximization problem:
Step 1 Find a bfs to the LP. We will call this bfs the initial bfs.
In general, the most recent bfs will be called the current
bfs, so at the beginning of the problem, the initial bfs is the
current bfs.
Step 3 Return to Step 2, using the new bfs as the current bfs.
The Simplex Algorithm Procedure for maximization LPs
We call this format the row 0 version of the objective function (row 0 for short).
The Simplex Algorithm (max LPs)
Consider the simplex algorithm applied to the maximization below:
Row 4 x2 + s4 =5 s4 = 5
If we set x1 = x2 = x3 = 0, we can solve for the values s1, s2, s3, s4.
Thus, BV = {s1, s2, s3, s4} and NBV = {x1, x2, x3 }. Since each constraint is
then in canonical form (BVs have a coefficient = 1 in one row and zeros in all
other rows) with a nonnegative rhs, a bfs can be obtained by inspection.
The Simplex Algorithm (max LPs)
Step 2 Obtain a Basic Feasible Solution
For this initial bfs, z = 0, s1= 48, s2= 20, s3 = 8, s4 =5, x1= x2 = x3 = 0.
As this example indicates, a slack variable can be used as a basic
variable if the rhs of the constraint is nonnegative.
The Simplex Algorithm (max LPs)
Step 3 Determine if the Current BFS is Optimal
Once we have obtained a bfs, we need to determine whether it is
optimal. To do this, we try to determine if there is any way z can
be increased by increasing some nonbasic variable from its
current value of zero while holding all other nonbasic variables at
their current values of zero. Solving for z in row 0 yields:
Z = 60x1 + 30x2 + 20x3
For each nonbasic variable, we can use the equation above to determine if
increasing a nonbasic variable (while holding all other nonbasic variables to
zero) will increase z. Increasing any of the nonbasic variables will cause
an increase in z. However increasing x1 causes the greatest rate of
increase in z. If x1 increases from its current value of zero, it will have to
become a basic variable. For this reason, x1 is called the entering
variable. Observe x1 has the most negative coefficient in row 0.
The Simplex Algorithm (max LPs)
Step 4 - We choose the entering variable (in a max problem) to the
nonbasic variable with the most negative coefficient in row 0 (ties
broken arbitrarily). We desire to make x1 as large as possible but as
we do, the current basic variables (s1, s2, s3, s4) will change value.
Thus, increasing x1 may cause a basic variable to become negative.
RATIO
From row 1 we see that s1 = 48 8x1. Since s1 0, x1 48 / 8 = 6
From row 2, we see that s2 = 20 4x1. Since s2 0, x1 20 / 4 = 5
From row 3, we see that s3 = 8 2x1. Since s3 0, x1 8 / 2 =4
From row 4, we see that s4 = 5. For any x1, s4 will always be 0
This means to keep all the basic variables nonnegative, the largest we
can make x1 is min {6, 5, 4} = 4.
The Simplex Algorithm (max LPs)
The Ratio Test
Make the entering variable x1 a basic variable in row 3 since this row
(constraint) was the winner of the ratio test (8/2 =4).
The Simplex Algorithm (max LPs)
To make x1 a basic variable in row 3, we use elementary
row operations (eros) to make x1 have a coefficient
of 1 in row 3 and a coefficient of 0 in all other rows.
This procedure is called pivoting on row 3; and row
3 is called the pivot row. The final result is that x1
replaces s3 as the basic variable for row 3. The term
in the pivot row that involves the entering basic
variable is called the pivot term.
Row 1 - x3 + s1 - 4s3 = 16 s1 = 16
Row 2 - x2 + 0.5 x3 + s2 - 2 s3 =4 s2 = 4
Row 3 x1 + 0.75x2 + 0.25x3 + 0.5s3 =4 x1 = 4
Row 4 x2 + s4 = 5 s4 = 5
In canonical form 1, BV = {z, s1, s2, x1, s4} and NBV = {s3, x2, x3 }. yielding
the bfs z = 240, s1 = 16, s2 = 4, x1 = 4, s4 = 5, s3 = x2 = x3 = 0.
The procedure from going to one bfs to a better adjacent bfs is called
an iteration (or sometime pivot) of the simplex algorithm.
The Simplex Algorithm (max LPs)
Returning to Step 3, we attempt to determine if the current bfs is optimal.
This means to keep all the basic variables nonnegative, the largest
we can make x1 is min {8,16} = 8. So, row 2 becomes the pivot row.
Row 4 x2 + s4 =5 s4 = 5
In Canonical Form 2, BV = {z, s1, x3, x1, s4} and NBV = {s3, s2, x2 },
yielding the bfs z = 280, s1 = 24, x3 = 8, x1 = 2, s4 = 5, s2 = s3 = x2 = 0.
The Simplex Algorithm (max LPs)
We can see that increasing x2, s2, or s3 (while holding the other
NBVs to zero) will not cause the value of z to decrease. The
solution at the end of iteration 2 is therefore optimal. The
following rule can be applied to determine whether a canonical
forms bfs is optimal:
Method 1