You are on page 1of 74

IFP Training

———
PDVSA
Venezuela

MSc in Refining, Engineering and Gas

Module 29
Optimization of Refining Operations
Linear Programming
PDVSA – Module 29 - Linear Pogramming Manual

Elements of linear
programming applied to refining
Christian TISON

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Contents

Introduction

Chapter I - Machine problem

Chapter II - First refining problem


Formation of the equations - Algebraic and graphical resolution

Chapter III - The array method

Chapter IV - First refiner's problem


Analysis of marginal costs

Chapter V - Second refiner's problem


Minimizing costs

Chapter VI - Duality

Chapter VII - Matrix formulation

Glossary

Appendices

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

INTRODUCTION

1. PRESENTATION
Linear programming is one of the areas of Operational Research and aims to provide solutions to decision-making
methods.

Linear problems or linear optimization problems are without a doubt the most frequent. A traditional, and very simple
example is the miner's problem. Two astronauts are riding in a spaceship. Their vessel breaks down. But they are
very lucky: first, they are near an asteroid where they are able to land; then they succeed in repairing their ship;
finally, they discover that the asteroid is rich in gold and silver. Of course, they try to bring back as much gold and
silver as possible, since one kilo of gold is worth $3 and one kilo of silver is worth $2. However, their vessel can only
take on a certain amount of weight and volume, up to 100 kilos as long as the volume does not exceed 150 liters.
Since one kg of gold is equivalent to a volume of 2 liters and 1 kg of silver takes up 1 liter, the problem can be written
as follows by taking the quantity of gold X1 and the quantity of silver X2 (we do not know what quantity they have).

Maximize: 3 X1 + 2 X2
with X1 + X2 ≤ 100
and 2 X1 + X2 ≤ 150

Note: X1 and X2 have to be positive.

The linear combination 3 X1 + 2 X2 is called the cost function (or objective function). The two inequalities are called
constraints.

A linear problem therefore consists in maximizing a linear combination of variables subject to constraints (inequalities)
which themselves are linear.

Before discussing the applications of linear programming, let us analyze a few of the essential (linear) programming
characteristics we just described.

• In general, the variables (here X1 and X2, the quantities of gold and silver) must be positive. Very often,
linear problems are used to maximize production obtained by consuming resources. Here, the “production” is
gold and silver, and the resources are the weight and volume that the space vessel can carry. In a refining
problem, the production is finished products; the resources are crude oils and the refining units' capacity. In
these different cases, the variables must keep their positive values.

• Proportionality: this rather obvious property means that if a variable's value is multiplied by a constant, its
contribution to the cost function and the constraints where it appears is also multiplied by the same constant.

• Additivity: additivity means that the cost function's and the constraints' value are equal to the sum of the
different variables' contributions. Again, this is a traditional property of linear programming. But let us look at a

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

water-alcohol mixture: if we combine one volume v1 of water and one volume v2 of alcohol, the resulting
mixture will take up a volume inferior to v1 + v2. This problem is also found in refining problems: 50-50
mixture of two gasoline pool components whose octane numbers are 92 and 98 respectively will not have an
octane number equal to 95. Either a certain amount of approximation or the use of "indices" is necessary to
linearize this constraint.

• Divisibility: in principle, the variables can take any value between 0 and infinity. In the miner's problem, this
constraint is respected in a traditional refining problem. It is possible to take, for example, 39,873 kilos of gold
or to process 5,863,230 tons of oil in a refinery. However, many problems cannot respect the divisibility
constraint: for example, it is not possible to manufacture 1.5 airplanes. For this reason, it is sometimes
necessary to use integer programming. In the same way, problems related to building units in a new refinery
require the use of integer programming; or binary integer programming (special case in which a variable can
only have two values: 0 or 1).

Before concluding this paragraph, we feel we should insist on the following notion: a linear program consists in
optimizing the use of limited resources (the spaceship's weight and volume in the miner's problem, quantities of
crude and unit capacity in the refining model) to make products that consume resources. In programs of this type, the
objective is to maximize the products' overall value, since each product has a value (a price). However, the resources'
values (costs) are not necessarily needed. Later, we will see that beyond determining optimal production values
(revenues), linear programming allows us to determine the value of resources by calculating marginal costs.

2. THE USE OF LINEAR PROGRAMMING


Linear programming has several uses in industry:
- Defining alloys in the metal industry;
- optimizing mixtures in the food industry; for example, making pet food, using several different cost
components and respecting quality constraints (nutritional value, for example);
- optimizing raw materials in the cement industry;
- planning schedules (crew rosters) in airlines;
- optimizing assembly lines in the automotive industry;
- optimizing provisioning and manufacture in the oil refining industry.

There are several other applications: In particular transport problems (minimizing transport costs between various
sources and various product demand areas). Issues related to putting together financial portfolios can also be
handled using linear programming.

3. DEVELOPMENTS IN THE USE OF LINEAR PROGRAMMING


As we will see, the methods for solving linear problems involve difficult calculations that can only be done quickly by
computers.

For this reason, the field of linear programming developed considerably starting at the end of the 1950s. In the oil
industry, the first refining models were designed at this time. They could not exceed a few dozen constraints. Very
quickly, in the 1960s, more and more complex models could be designed thanks to greater computer power.
© IFP Training - 2009
PDVSA – Module 29 - Linear Pogramming Manual

In the area of refining, “base model” is a refinery. But very quickly, companies with several refining sites designed
“multi-refinery” models then “multirefinery-multiperiod” models (to account for seasonal variations in supply, demand,
and processing capacity). A “single refinery - single period” model usually has several hundred lines. A “multi” model
therefore has several thousand constraints.

In the mid-1970s, the use of linear programming stagnated slightly after reaching peak levels in the sectors in which it
was used. This was due to limited computing resources, the emergence of artificial intelligence and expert systems.
The break was particularly visible in France, the linear programming stronghold in the '60s (IBM's MPSX program, the
reference in optimization software was designed in France). A few sectors, including refining, still continued to widely
use this technique.

There was renewed interest in the field in the late 1980s, when artificial intelligence techniques began to show signs
of slowing and as personal computing began to take off and it became possible to develop linear programming
applications on faster, smaller and less expensive machines. In the refining industry, simpler refining models could be
moved to other locations, instead of centralizing all processing on the head office mainframe.
Of course, in parallel to improved hardware performance, more powerful software was released and could be used on
large systems as well as on desktop computers and workstations.

4. PROFITABILITY
As is often the case in Operational Research, the use of linear programming can optimize systems and achieve
savings of around 5-10% (often more!) in system operating costs.
Sometimes this percentage is much lower: for example, a major automobile manufacturer's optimized tire purchase
saves 0.5% of a monthly cost of 12 million francs, which comes to 600,000 F/month, which more than covers the
career salary of the engineer who wrote the study...
It is not rare for optimization done using linear programming to yield annual gains of up to 200 or 300 times the cost of
the study.

5. BACKGROUND
The first mathematicians to focus on “linear programs” (LP), although they were not called that at the time, were:
Laplace (1749-1827) and Baron Fourier, who, in 1825, proposed an elimination method to process systems of linear
inequalities and defined a geometric method to reach the lowest point of a solid bound by plane facets (a
“polyhedron”), a very similar idea to that behind the "Simplex" algorithm (the most common currently used to solve
LP.); Fourier is much better known for his trigonometric series and his resolution of the heat equation. However, the
economic importance of this work was not yet apparent, and the studies fell into oblivion.

Similarly, in 1911, some astronomers gave Charles de Lavallee-Poussin, a Belgian mathematician, a minimal
approximation problem that solved a linear program; he solved it through a basic change method (as in the simplex);
but he was too early, and his method was only spoken of by astronomers.

We had to wait until the Second World War to see modeling and logistical problem resolution formulated as LP.: In
1939, Russia's Kantorovitch imagined a method inspired by Lagrange multipliers, a classic of mechanics, to resolve

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

“transport programs”. Patience is a virtue: it was not until 1975 that his body of work was awarded by a Nobel Prize in
Economics, which he shared with the American Koopmans.

The decisive contribution was the invention of the Simplex algorithm, developed starting in 1947 by G. B. Dantzig and
the mathematician von Neumann. This algorithm was later introduced to the first computers and perfected (“revised
simplex method”) to improve the precision of results and reduce the volume of memory necessary to solve problems.

Around 1975-1979, the Soviet mathematicians Schorr and Khachiyan developed a theoretical breakthrough on the
complexity of linear programming, but without finding a more advanced algorithm than the Simplex.

In the mid 1980s, Indian Karmarkar proposed a new method, created at Bell Laboratories, used to solve very long
linear problems by a method “inferior” to the polyhedron. Given the immense economic and financial repercussions of
this discovery, the method was only partially released; but the international scientific community now confirms the
validity of Karmarkar's algorithm; it should be noted though that for small and medium LP, the Simplex could still offer
an advantage.

6. SCOPE OF PROBLEMS SOLVED


In general, we consider that LP in which m = 1,000 constraints and n = 3,000 variables have an ordinary dimension
(for the simplex algorithm). Large problems have m = 5,000 constraints and n = 10,000 variables. Some enormous
problems have been solved operationally: an LP with m = 30,000 and n = 300,000 for integrated management at
American Nabisco and n = 35,000 and m = 512,000 at NASA. For one airline, a problem with n = 5,500,000 variables
(but only m = 850 constraints) was solved.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- CHAPTER I -
MACHINE PROBLEM - FORMALIZATION

1. MACHINE PROBLEM - STATEMENT


A company uses three machines (called 1, 2 and 3) to manufacture three products (called A, B and C). To
manufacture one unit of product A, machine 1 has to run 4 hours, machine 2 for 2 hours, and machine 3 for 1 hour.
The table below gives the number of hours each machine has to run to manufacture each product.

Product A B C
Machine 1 4 2 0
Machine 2 2 1 1
Machine 3 1 3 1

Also, the sale of one unit of product A brings in $2, the sale of one unit of product B brings in $4, and the sale of one
unit of product C brings in $0.5.
Finally, each machine cannot run more than 100 hours a week.

The problem can therefore be expressed as:

Maximize 2 X1 + 4 X2 + 0.5 X3
with 4 X1 + 2 X2 ≤ 100
2 X1 + X2 + X3 ≤ 100
X1 + 3 X2 + X3 ≤ 100
X1 ≥ 0X2 ≥ 0X3 ≥0

2. GENERALIZATION
Our linear problem can be expressed as follows:

Maximize Z= c1 X1 + c2 X2 + c3 X3
a11 X1 + a12 X2 + a13 X3 ≤ b1
a21 X1 + a22 X2 + a23 X3 ≤ b2
a31 X1 + a32 X2 + a33 X3 ≤ b3
with X1 ≥0 X2 ≥ 0 X3 ≥0

--------------------------------
Note: § 1 is inspired by D. Solow's book. § 2 to 6 are inspired by the article by B. LEMAIRE - Programmation linéaire
- Algorithme du simplexe (November 1991 Seminar)

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

By assuming a problem with m restrictions and n variables:

n
MAX Z = ∑c
j =1
j Xj

n
with ∑ aij X j ≤ bi i = 1 to m
j =1

Of course, the following is possible:

n
Min Z = ∑c
j =1
j Xj

n
with ∑ a ij X j ≥ bi i = 1 to m
j =1

We note that maximize Z equals minimize -Z.


Also, in usual problems, we simultaneously see greater or equal constraints, lesser or equal constraints and
constraints in equality.

Use of the standard form. It is still possible to represent inequalities as equalities by introducing slack variables.

∑a
j=1
ij X j + X i' = bi

In this case, the variables Xj are called structural variables.


The problem becomes:

n
MAX Z = ∑c
j =1
j Xj

n
with ∑ a ij X j = bi i = 1 to m
j =1

(including in Xj structural variables and slack variables).

Of course, m, the number of constraints, must be inferior to n, the number of variables.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Definitions:

• Solution: any set of n numerical values of variables that satisfy all of the constraints (or acceptable solution).

• Feasible solution: any solution in which all the numerical values of variables are positive.

• Base: any set of m variables taken from X1, X2, ... Xn, as determined by coefficients aij associated with these m
variables, i.e. not equal to zero.

• Basic solution: any solution with n - m zero variables, so that the other variables form a base. We then refer to a
non-base variable and a base variable respectively. Note that to obtain a basic solution, cancel n - m variables
and resolve a system of m equations with m unknowns (which assumes a single solution except if two constraints
are redundant, which means that the related determinant is zero).

• Feasible (or acceptable) basic solution: any basic solution in which all the numerical values of variables are
positive.

• Optimal solution: basic feasible solution that maximizes or minimizes the cost function Z.
Some statements will be justified below.

3. SOLVING THE MACHINE PROBLEM


To make it easier to solve the problem, we replace the inequalities with equations by introducing slack variables.

Respectively X’1, X’2 and X'3 the number of hours machines 1, 2 and 3 are not used. The problem is expressed as
follows:

Maximize 2 X1 + 4 X2 + 0.5 X3
with (Equation 2) 4 X1 + 2 X2 + + X’1 = 100
(Equation 3) 2 X1 + X2 + X3 + X’2 = 100
(Equation 4) X1 + 3 X2 + X3 + X’3 = 100

We can, for example, decide to only manufacture products B. It is possible to manufacture 100/3 units of them, which
would saturate use of machine 3 and bring in $400/3. It is not possible to manufacture products A and C because
machine 2 is saturated.
We can also empirically determine a vast quantity of feasible solutions and compare them, but finding the optimal
solution will be a long and random process.

To solve the problem, we will start with a feasible solution and try to improve it.

• Initial solution

There is a simple, obvious initial solution:

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

X1 = 0, X2 = 0, X3 = 0, X’1 = 100, X’2 = 100 X’3 = 100

This solution consists in doing nothing. It does not result in any profits.

The variables X’1, X’2 and X'3 make up the base of the problem. X’1, X’2 and X'3 are also called base variables. X1,
X2 and X3 are the non-base variables. We observe that since we have a problem with 3 equations and 6 unknowns, it
is still possible to find a base with three non-zero variables (except in the case of degeneracy which we examine
below). Three non-base, therefore zero, variables.

Let us try to improve the cost function. For that, we are going to increase the value of the variable X2, which has the
highest coefficient in the cost function. Is it possible to indefinitely increase the value of X2? No, because the
"machine resources" necessary to manufacture product B are limited.

The equation (2) indicates that X2 must remain inferior to 100/2 .


The equation (3) indicates that X2 must remain inferior to 100/1.
The equation (4) indicates that X2 must remain inferior to 100/3.

X2 can therefore take a maximum value of 100/3. Any greater value would require making another variable negative,
which is impossible.

We can therefore give X2 the value of 100/3. The equation (4) leads us to give X1, X3 and X'3 the value of 0. The
values of X’1 and X’2 are subtracted from the equations (2) and (3).

We therefore have X2 = 100/3, X’1 = 100/3, X’2 = 200/3


X1 = X3 = X’3 = 0

The value of the cost function is Z = 400/3

The new solution is better than the initial solution. Is it optimal?

• Iteration

To see if the solution obtained is optimal, we are going to express the cost function as a function of the zero variables
(X1, X3 and X’3). If one (or several) coefficient(s) of the variables remain positive, it is still possible to improve the
cost function.

Let us, using the equation (4), express X2 as a function of X1, X3 and X'3, then substitute X2 in the equations (2) and
(3) and in the cost function.

(4) X2 = 100/3 - 1/3 X1 - 1/3 X3 - 1/3 X’3


(2) X’1 = 100 - 4 X1 - 2 (100/3 - 1/3 X1 - 1/3 X3 - 1/3 X’3)
(3) X’2 = 100 - 2 X1 - (100/3 - 1/3 X1 - 1/3 X3 - 1/3 X’3) - X3
Z = 2 X1 + 4 (100/3 - 1/3 X1 - 1/3 X3 - 1/3 X’3) + 0.5 X3

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

After simplification, it is expressed as follows:

Z = 400/3 + 2/3 X1 - 5/6 X3 - 4/3 X’3


(2) X’1 = 100/3 - 10/3 X1 + 2/3 X3 + 2/3 X’3
(3) X’2 = 200/3 - 5/3 X1 - 2/3 X3 + 1/3 X’3
(4) X2 = 100/3 - 1/3 X1 - 1/3 X3 - 1/3 X’3

Since the coefficient of X1 in the cost function is positive, we can, by giving X1 a positive value, increase the value of
this cost function.

X1 can increase up to: - 100/10 subject to (2)


- 200/5 subject to (3)
- 100/1 subject to (4)

Therefore X1 can increase up to 100/10 = 10, which is the smallest value of the three limits obtained.

We have a new solution:

X1 = 10 X3 = 0 X’1 = 0 X’3 = 0 subject to (2)


X’2 = 50 subject to (3) - X2 = 30 subject to (4)

To check if this solution is optimal, we are going to express Z, X1, X2 and X’2 as a function of X3, X’1 and X'3 which
are zero.

Subject to (2) X1 = 10 + 1/5 X3 - 3/10 X’1 + 1/5 X’3

and by replacing X1 by its value in the other equations we get

After simplification, we have:

Z = 140 - 7/10 X3 - 1/5 X’1 - 6/5 X’3


(2) X1 = 10 + 1/5 X3 - 3/10 X’1 + 1/5 X’3
(3) X’2 = 50 - X3 + 1/2 X’1
(4) X2 = 30 - 2/5 X3 + 1/10 X’1 - 2/5 X’3

This solution is optimal because it cannot be improved.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- CHAPTER II -
FIRST REFINING PROBLEM
FORMATION OF THE EQUATIONS - ALGEBRAIC AND GRAPHICAL RESOLUTION

1. THE PROBLEM
A refiner has two crudes to produce gasoline, gas oil and fuel oil. These two crudes have the following yield:

Crude A B
Gasoline 0.2 0.4
Gas oil 0.4 0.2
Fuel oil 0.4 0.4

Of course, this is a simplified problem: we only consider three products and there is no internal loss or consumption.

Due to storage constraints, each product's production is limited as follows:


Gasoline 1,200 tons
Gas oil 1,200 tons
Fuel oil 1,400 tons

Processing one ton of crude A brings in $140. Processing one ton of crude B brings in $150.

What quantities of crude A and B should be processed to maximize revenues? (processing costs are not taken into
account).

2. FORMATION OF THE EQUATIONS


We can decide only to process crude A. The maximum quantity is 3,000 tons (processing is limited by gas oil
production). Revenues are $420,000.
We can decide only to process crude B. We can then process a maximum of 3,000 tons and revenues are $450,000.
But processing a mixture of crude A and crude B may be more beneficial. How can this combination be determined?

X1 quantity of crude A and X2 the quantity of crude B to be processed. The objective is to maximize:

(Z) 140 X1 + 150 X2


with 0.2 X1 + 0.4 X2 ≤ 1,200 (gasoline constraint)
0.4 X1 + 0.2 X2 ≤ 1,200 (gas oil constraint)
0.4 X1 + 0.4 X2 ≤ 1,400 (fuel oil constraint)
with X1 ≥ 0 and X2 ≥ 0

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

To make it easier to solve the problem, we replace the inequalities with equations by introducing additional variables,
slack variables. We rewrite the problem as follows:

Maximize (Z) 140 X1 + 150 X2


with (Equation 2) 0.2 X1 + 0.4 X2 + X’1 = 1,200
(Equation 3) 0.4 X1 + 0.2 X2 + X’2 = 1,200
(Equation 4) 0.4 X1 + 0.4 X2 + X’3 = 1,400
with X1 ≥0 X2 ≥ 0 X’1 ≥ 0 X’2 ≥ 0 X’3 ≥0
X’1 is the difference between maximum production and actual gasoline production. In the same way, X’2 and X’3 are
the difference between maximum production and actual gas oil and fuel oil production.
X'1, X'2 and X'3 are the slack variables.

3. INITIAL SOLUTION. BASE VARIABLES. NON-BASE VARIABLES


We have a system of 3 equations with 5 unknowns (X1, X2, X’1, X’2, X’3). A system like this has an infinite number of
solutions. However, if we arbitrarily set the value of two variables, the values of the three other variables are
determined exactly.

For example, we can write:


(Equation 2) X’1 = 1,200 - 0.2 X1 - 0.4 X2
(Equation 3) X’2 = 1,200 - 0.4 X1 - 0.2 X2
(Equation 4) X’3 = 1,400 - 0.4 X1 - 0.4 X2

If for example X1 = 1,000 and X2 = 1,000 we have:


X’1 = 600 X’2 = 600 X’3 = 600

We have a solution to our problem. This solution is acceptable since it satisfies the problem's constraints (including
the variable non-negativity constraints). However, we check that this solution is not optimal because revenues are:
1,600 x 140 + 1,000 x 500 = 290,000
and lower than what we could obtain processing a single crude.

To try to determine the optimal solution, we must start with a basic feasible solution and improve it progressively.

One obvious feasible initial solution is:


X1 = 0 X2 = 0 X’1 = 1,200 X’2 = 1,200 X’3 = 1,400
This solution consists in "doing nothing". We do not process crude (X1 = X2 = 0) and of course the slack variables are
equal to the various products' maximum productions. Revenues or the objective function (cost function) are zero.

X’1 = 1,200, X’2 = 1,200, X’3 = 1,400 is a base for the linear problem. X’1, X’2, X’3 which are not zero are called base
variables. X1 and X2, which are zero, are called non-base variables.

We observe that since we have a problem with three equations and five variables, it is still possible to find a base with
two non-base (zero) variables and three base variables (not zero, except in the case of degeneracy - cf. infra).

Let us try to improve the cost function starting with this initial solution. To do this, we will increase the value of X2,
currently zero and with the highest coefficient in the cost function (processing one ton of crude B brings in $150 and
© IFP Training - 2009
PDVSA – Module 29 - Linear Pogramming Manual

processing one ton of crude A only brings in $140). Is it possible to indefinitely increase the value of X2? No,
because, practically speaking, in our problem, gasoline, gas oil and fuel production is limited.

For example, let us assume that we processed 4,000 tons of crude B; we would get:
800 tons of gasoline therefore X’1 = 400
but 1,600 tons of gas oil therefore X’2 = -400
and 1,600 tons of fuel therefore X’3 = -200

The negative values of X’2 and X’3 simply mean that we exceeded maximum productions of gas oil and fuel.

The maximum value of X’2 must therefore be such that:


(Equation 2) X’1 ≥ 0 therefore 0.4 X2 ≤ 1,200 X2 ≤ 3,000
(Equation 3) X’2 ≥ 0 0.2 X2 ≤ 1,200 X2 ≤ 6,000
(Equation 4) X’3 ≥ 0 0.4 X2 ≤ 1,400 X2 ≤ 3,500

X2 must therefore be less than or equal to 3,000. Any greater value means that at least one of the two other slack
variables is negative.

We therefore increase X2 up to 3,000. X1 is zero. The other variables take the following values:
X’1 = 0
X’2 = 600
X’3 = 200

We have therefore done the following conversion:


Initial solution (0) New solution (1)
X1 = 0 X1 = 0
X2 = 0 X2 = 3,000
X’1 = 1,200 X’1 = 0
X’2 = 1,200 X’2 = 600
X’3 = 1,400 X’3 = 200
Z = 0 Z = 3,000 x 150 = 450,000

In the new solution, a variable has been “taken out of the base”: X’1, and one variable went “into the base”: X2.

4. ITERATION
The new solution is better than the initial solution, but is it optimal? To confirm it or invalidate it, we will
express the cost function as a function of the two now-zero variables, X1 and X’1. If one of these variables has a
positive coefficient in the cost function, it is possible to improve the value currently attained by this function.

The equation (2), which limits the progression of X2, makes it possible to write X2 as a function of X1 and X’1:
X2 = (1,200 - 0.2 X1 - X’1) / 0.4
X2 = 3,000 - 0.5 X1 - 2.5 X’1

By substituting X2 in equations (3) and (4) and in the cost function, we get:

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Z = 450,000 + 65 X1 - 375 X’1


X2 = 3,000 - 0.5 X1 - 2.5 X’1 (Equation 2)
X’2 = 600 - 0.3 X1 + 0.5 X’1 (Equation 3)
X’3 = 200 - 0.2 X1 + X’1 (Equation 4)

By increasing X1 we can improve the cost function (the coefficient of X1 in this function is positive). Increasing X1 is
limited to:
3,000 / 0.5 = 6,000 (X2 ≥ 0 - Equation 2)
600 / 0.3 = 2,000 (X’2 ≥ 0 - Equation 3)
200 / 0.2 = 1,000 (X’3 ≥ 0 - Equation 4)

We can therefore increase X1 up to 1,000. The other variables take the following values:
X’3 = 0 (Equation 4)
X’ 2 = 300 (Equation 3)
X2 = 2,500 (Equation 2)
X’1 = 0 (does not change value)

The value of the cost function becomes:


450,000 + 65 x 1,000 = 515,000
(we check that 515,000 = 1,000 x 140 + 2,500 x 150)

We have just performed the following conversion:


Solution 1 Solution 2
X1 = 0 X1 = 1,000
X2 = 3,000 X2 = 2,500
X’1 = 0 X’1 = 0
X’2 = 600 X’2 = 300
X’3 = 200 X’3 = 0
Z = 450,000 Z = 515,000
X’3 is out of the base. X1 is in the base.

Is the solution obtained optimal? To check it (or invalidate it), we express the cost function as a function of X’1 and
X’3:
Equation 4 X1 = ( 200 + X’1 - X’3 ) / 0.2
X1 = 1,000 + 5 X’1 - 5 X’3

By substitution in the other equations, we get:


Z = 515,000 - 50 X’1 - 325 X’3
(Equation 2) X2 = 2,500 - 5 X’1 + 2.5 X’3
(Equation 3) X’2 = 300 - X’1 + 1.5 X’3
(Equation 4) X1 = 1,000 + 5 X’1 - 5 X’3

This solution is optimal. It is no longer possible to increase the cost function because the cost function variable
coefficients are negative.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

5. ANALYSIS OF THE OPTIMAL SOLUTION

First, let us check the concrete meaning of optimal.


The optimum consists in processing 1,000 tons of crude A and 2,500 tons of crude B. Given the yield, we get the
following quantities of products:

Crude A: 1,000 Crude B: 2,500 Total


Yield Quantity Yield Quantity
Gasoline 0.2 200 0.4 1,000 1,200
Gas oil 0.4 400 0.2 500 900
Fuel oil 0.4 400 0.4 1,000 1,400
Total 1.0 1,000 1.0 2,500 3,500

We can compare these three products' actual and maximum productions:

Actual production Maximum production Difference


Gasoline 1,200 1,200 0
Gas oil 900 1,200 300
Fuel oil 1,400 1,400 0

We note that maximum production of gasoline and fuel oil is met, which means that the slack variables (X’1 and X’3)
are zero. Optimally, both these variables are zero.
Conversely, we can only produce 900 tons of gas oil for a possible maximum of 1,200 tons. The difference is
therefore 300. We note that optimally, X’2 (gas oil's slack variable) equals 300.

6. GRAPHICAL RESOLUTION
Let us look back at our problem, written as follows:

Maximize 140 X1 + 150 X2


with 0.2 X1 + 0.4 X2 ≤ 1,200 Equation 2
0.4 X1 + 0.2 X2 ≤ 900 Equation 3
0.4 X1 + 0.4 X2 ≤ 1,400 Equation 4

Each of the equations 2, 3 and 4 correspond, once they are turned into an equality, into a straight line in a plane.
Each line splits the plane into two half-planes. The points of one of the half-planes has the coordinates X1 and X2,
which satisfy the constraint shown, whereas other points do not satisfy it.
If we draw the three straight lines corresponding to the equations 2, 3 and 4, we get the figure 1. On this figure, the
three straight lines determine an OABCD set, all of whose points are feasible solutions to the constraint system, while
the points outside this set do not satisfy it (to check this simply, check that the initial point, X1 = 0, X2 = 0 satisfies the
three constraints).
The point that corresponds to the optimal problem is therefore in (or at the boundary of) the OABCD set, but, at the
same time, it must have coordinates that maximize the cost function 140 X1 + 150 X2.

For example, let us draw the line for the equation:


140 X1 + 150 X2 = 750,000

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

This straight line does not cross the OABCD set, the feasible solution set. No point on this straight line can therefore
be the solution to our problem.
However, the solution to our problem can be easily obtained if we note that the distance from the origin to the straight
line representing the cost function is proportional to this function's value.
If we write 140 X1 + 150 X2 = m, the distance OH from the origin to the straight line represented by this equation
is:

m
OH =
140 2 + 150 2
X2

X1
O 140 X1 + 150 X2 = m

We will therefore move the straight line representing the cost function, parallel to itself, by moving it closer to the
feasible set. Note that point B is the first point in this set. It is the farthest point from the origin and is therefore the
optimal point.

We check that the coordinates of point B are:


X1 = 1,000
X2 = 2,500

7. GEOMETRIC INTERPRETATION OF THE SIMPLEX METHOD

The successive solutions to the problem determined using the algebraic method are:

1 2 3

X1 0 0 1000
X2 0 3000 2500
X'1 1200 0 0
X''2 1200 600 300
X''3 1400 200 0
Z 0 450,000 515,000

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

If we refer to the graph, solutions 1, 2, 3 correspond to points O, A and B respectively. These points are extremities in
the feasible solution set.

This result can be generalized as follows:

FIRST REFINER'S PROBLEM

GRAPHICAL RESOLUTION

X1
8000
7000

6000
Cost function
5000
4000
3000 C
D
2000
B
1000
A
0 X2
-1000 0 1000 2000 3000 4000 5000 6000 7000 8000 9000
Ga s oil
Gasoline Fuel oil

OPTIMAL: B

- the various constraints of a linear model define hyperplanes in an area with n dimensions. These hyperplanes define
a feasible solution set (this set is convex).

- a basic feasible solution (BFS) is an extremity of this set.

- the simplex method consists in successively exploring extreme points in the feasible solution set while ensuring that
the cost function is improved when moving from one extremity to another.

- the extremity that corresponds to the optimal point is the point of tangency between the hyperplane that corresponds
to the cost function and the feasible solution set when this hyperplane is farthest from the origin.

8. GENERALIZATION

In our example, we have 3 equations with 5 unknowns as constraints. The solutions we studied include 3 non-zero
variables (in the base) and 2 zero variables (outside the base).

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

This principle can easily be generalized. After introducing the slack variables, we have a system of n equations with m
unknowns (n < m). To find a solution, we have to give the m-n variables a zero value (if the determinant related to the
remaining n variables is not zero). These m-n variables are outside the base. The n other variables are in the base.
Except in the event of degeneracy (if the related determinant is zero), they are not zero. If they are positive, they
constitute a basic feasible solution. The simplex algorithm is used to move from a basic feasible solution to another
basic feasible solution, while ensuring that the cost function is improved. When it is no longer possible to improve the
cost function, the optimal has been met.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- CHAPTER III -
THE ARRAY METHOD

This practical method aims to lighten up the algebraic method (by substitution) and to make it systematic. However,
we should specify that it is not a new method, but a different presentation of the simplex method calculations.

Let us take our example from Chapter II. After introducing the slack variables, the problem is written as follows:

Maximize 140 X1 + 150 X2


0.2 X1 + 0.4 X2 + X’1 = 1,200
0.4 X1 + 0.2 X2 + X’2 = 1,200
0.4 X1 + 0.4 X2 + X’3 = 1,400

Let us represent this problem in a table:

X1 X2 X’1 X’2 X’3 b


X’1 0.2 0.4 1 0 0 1,200
X’2 0.4 0.2 0 1 0 1,200
X’3 0.4 0.4 0 0 1 1,400
140 150 0 0 0 0

Each column corresponds to one of the variables.


Each line corresponds to a constraint. Since it initially defines a base variable, we will give it the name of this base
variable.
The right-hand side is represented in the form of a column.
The cost function is represented in the form of a line.

We will seek the optimal through iterations as in the algebraic method. The initial solution is X1 = 0, X2 = 0,
X’1 = 1,200, X’2 = 1,200, X’3 = 1,400. The base therefore consists of X'1, X'2 and X'3. We determine the variable
entering the base by applying Dantzig's first criterion: it is the variable with the highest coefficient in the cost function:
X2 goes into the base.
Then we apply Dantzig's second criterion to select the variable that leaves the base. On each line, we calculate the
ratio between the right-hand side and the coefficient of X2. We get:
(X’1) 1,200 / 0.4 = 3,000
(X’2) 1,200 / 0.2 = 6,000
(X’3) 1,400 / 0.4 = 3,500

We keep the smallest value of these ratios, which corresponds to line X’1. Therefore X2 enters the base and X’1
leaves the base. The coefficient of column X2 (input variable) in line X’1 (output variable) is called PIVOT. It plays a
key role in the calculations given below.

We are going to divide all the coefficients in line X’1 by the pivot coefficient. We get the new table:

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

X1 X2 X’1 X’2 X’3 b


X2 0.5 1* 2.5 0 0 3,000
X’2 0.4 0.2 0 1 0 1,200
X’3 0.4 0.4 0 0 1 1,400
Z 140 150 0 0 0 0

The first line is now called X2 because it defines this variable.


The pivot (more specifically, the pivot divided by itself to get the unit coefficient) is marked with a star.
In the algebraic substitution method, we then replace X2 by its value obtained in the line that limits its growth, in other
equations (including the cost function). We say that we “eliminate” X2.
In the array method, this elimination is done using a linear combination of lines. For example, line X’3 is written as:
0.4 X1 + 0.4 X2 + X’3 = 1,400

To eliminate X2 (so that X’3 - base variable - is now expressed as a function of the new non-base variables X1 and
X’1) we perform a linear combination of lines X2 and X'3.
If we write:
(0.4 X1 + 0.4 X2 + X’3) + K (0.5 X1 + X2 + X’1) = 1,400 + K 3,000
we must set k = -0.4 to eliminate X2.

Let us develop:

line X’3 0.4 0.4 0 0 1 1,400


-0.4 line X2 0.2 0.4 1 0 0 1,200
Result of the combination 0.2 0 -1 0 1 200

In other words, the coefficient of a column X in a line L is replaced by a new coefficient obtained as follows:
N = A - C1 x C2
N: new coefficient of column X in line L
A: former coefficient
C1: coefficient of the pivot column in line L
C2: coefficient of the pivot line in column X.

We can visualize this calculation as follows:

X1 X2 X’1 X’2 X’3 b


X2 0.5 C2 1* 2.5 0 0 3,000
X’2 0.4 0.2 0 1 0 1,200
X’3 0.4 0.4 C1 0 0 1 1,400
140 150 0 0 0 Z

A = 0.4
C1 = 0.4 C2 = 0.5
N = 0.4 - 0.4 x 0.5 = 0.2

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

By performing this calculation for all the coefficients in the table, including the right-hand side and the cost function,
we get:

X1 X2 X’1 X’2 X’3 b


X2 0.5 1 2.5 0 0 3,000
X’2 0.3 0 -0.5 1 0 600
X’3 0.2 0 -1 0 1 200
65 0 -375 0 0 Z - 450,000

We note:
- that the coefficients in the pivot column are zero, except for the pivot itself. This corresponds to the fact that
X2 = 3,000;
- that the pivot line remains unchanged;
- that the cost function should read Z = 450,000.

We determine the calculation using a new iteration:


- Dantzig's first criterion: X1 enters the base;
- Dantzig's second criterion: X’3 is out of the base (the minimum bi/ci ratio is 1,000, provided by the equation
X’3).

After dividing line X’3 by 0.2 (pivot), we get:

X1 X2 X’1 X’2 X’3 b


X2 0.5 1 2.5 0 0 3,000
X’2 0.3 0 -0.5 1 0 600
X1 1* 0 -5 0 5 1,000
65 0 -375 0 0 Z - 450,000

By applying the rules given above, the new array is:

X1 X2 X’1 X’2 X’3 b


X2 0 1 5 0 -2.5 2,500
X’2 0 0 1 1 -1.5 300
X1 1* 0 -5 0 5 1,000
0 0 -50 0 -325 Z - 515,000

Of course, we get the results of the algebraic method by substitution.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- CHAPTER IV -
FIRST REFINER'S PROBLEM - ANALYSIS OF MARGINAL COSTS

1. ANALYSIS OF MARGINAL COSTS


It is very interesting to know that the optimal solution to our problem (the maximum benefit we can attain) consists in
processing 1,000 tons of crude A and 2,500 tons of crude B, but it is also interesting to be able to answer the
following question: what happens if I change the maximum possible gasoline, gas oil or fuel oil production slightly?

The answer is in the optimal simplex array, written as:


Z = 515,000 - 50 X’1 - 325 X’3
X2 = 2,500 - 5 X’1 + 2.5 X’3 Equation 2
X’2 = 300 - X’1 + 1.5 X’3 Equation 3
X1 = 1,000 + 5 X’1 - 5 X’3 Equation 4

Let us suppose that I can produce one more ton of gasoline. The constraint equation is expressed as follows:
0.2 X1 + 0.4 X2 + X’1 = 1,201 Equation 2
or 0.2 X1 + 0.4 X2 + (X’1 - 1) = 1,200

In other words, an increase in a unit's possible gasoline production corresponds to a decrease of a unit with slack
variable X’1. Now, if we consider the expression of the cost function Z, we observe that this change in X’1 causes the
cost function to increase by 50.

In other words, if we can increase a unit's gasoline production, the cost function (our profit) increases by 50.

In the same way, if we can increase a unit's fuel oil production, the cost function increases by 325.

It is obvious that if, conversely, we reduce possible gasoline or fuel oil production, the cost function is reduced
symmetrically.

The marginal cost is related to a cost function variation constraint resulting from a variation in one unit of this
constraint. Given what was described above, this variation may be positive or negative.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

We note that this analysis is only valid if the variation in gasoline or fuel oil production is low (marginal). Later, we will
look at how we can determine how we can change one of these productions while retaining cost validity.

2. MARGINAL COSTS AND SUBSTITUTION COEFFICIENTS


Let us look back at the case in which we add one unit to the maximum possible gasoline production. We just saw that
the cost function (our profits) increases by $50 per additional ton of gasoline we are authorized to make (note that this
is true for a few additional tons, but doubtlessly not for very high quantities).

To make this ton of additional gasoline, we certainly have to change crude processing. Can we determine the new
optimal quantities of crude A and crude B to be processed without taking all the simplex calculations? Yes, once
again by using the optimal simplex array. This array is expressed as follows:

X2 = 2,500 - 5 X’1 + 2.5 X’3 Equation 2


X’2 = 300 - X’1 + 1.5 X’3 Equation 3
X1 = 1,000 + 5 X’1 - 5 X’3 Equation 4

If X’1 changes by -1, our optimal will be (X’3 remains zero):

X2 = 2,500 + 5 = 2,505 Equation 2


X1 = 1,000 - 5 = 995 Equation 3
X’2 = 300 + 1 = 301 Equation 4

In other words processing becomes:

Crude A 995
Crude B 2,505
3,500

Productions become:

Gasoline 1,201
Gas oil 899 (1,200 - 301)
Fuel oil 1,400
3,500

To summarize, to make one additional ton of gasoline, we have to process five additional tons of crude B (the crude
that yields the most gasoline). To adjust the productions, we can then reduce crude A processing by five tons. We
can simply get the marginal cost of the ton of gasoline. So:

5 additional tons of crude B at $150 = 750


5 fewer tons of crude A at $140 = - 700
Net cost 50

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

We also get the new material balance by taking into account the two crudes' yields:
Crude A: Crude B: Net
- 5 tons + 5 tons
Gasoline (0.2) - 1 (0.4) + 2 +1
Gas oil (0.4) - 2 (0.2) + 1 -1
Fuel oil (0.4) - 2 (0.4) + 2 0

In particular, we note that fuel oil production has not changed.

In the same way, if we increase possible fuel oil production by one ton, the cost function increases by $325. The
optimal quantities of crude to be processed become:

Crude A 1,000 + 5 = 1,005


Crude B 2,500 - 2.5 = 2,497.5

The material balance becomes:


Processing Crude A 1,005.0
Crude B 2,497.5
Total 3,502.5

Production Gasoline 1,200.0


Gas oil 901.5
Fuel oil 1,401.0
Total 3,502.5

Gasoline production is not modified, as seen in the marginal change in production due to the crude processing
change:
Crude A: Crude B: Change
+ 5 tons - 2.5 tons net
Gasoline (0.2) + 1 (0.4) - 1 0
Gas oil (0.4) + 2 (0.2) - 0.5 + 1.5
Fuel oil (0.4) + 2 (0.4) - 1 +1

We also check that the change in the cost function, the marginal cost of fuel oil, corresponds to the change in
profits due to changes in crude processing:
5 tons of crude A at $140 700
- 2.5 tons of crude B at $150 375
325

3. MARGINAL COST VALIDITY SET: CHANGE IN THE RIGHT-HAND SIDE


We now have the optimal solution to the problem. We also have the marginal costs for the constraints and we are
able to evaluate changes in optimal variable values, from simplex array coefficients, when, for example, we slightly
modify one of the constraints.

However, the reasoning we used in the previous paragraph is most likely not valid if the change in one of the
constraints is very high.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

To illustrate this situation using an absurd example, let us assume that gasoline demand vanishes. We have
Δ X’1 = 1,200, which leads us, using the final array, to:
X2 = 2,500 - 5 x 1,200
X1 = 1,000 + 5 x 1,200

This solution is obviously not acceptable because X2 becomes negative.

Let us try to determine the possible maximum value of Δ X’1 (change in the maximum possible gasoline production)
for the current base variables to remain positive.

According to the final simplex array, we need:


X2 = 2,500 - 5 Δ X’1 ≥ 0 Δ X’1 ≤ 500
X’2 = 300 - Δ X’1 ≥ 0 Δ X’1 ≤ 300
X1 = 1,000 + 5 Δ X’1 ≥ 0 Δ X’1 ≥ -200

Therefore -200 is necessary ≤ Δ X’1 ≤ 300

Remember that Δ X’1 ≥ 0 means a decrease in the constraint. In other words, since the maximum "reference"
gasoline production is 1,200, the final simplex array equation system remains valid as long as:

900 ≤ maximum gasoline production ≤ 1 400

Let us specify this result:


- as long as maximum gasoline production remains between 900 and 1,400, the base variables remain X1, X2
and X’2, the non-base variables X’1 and X’3;
- the marginal costs remain unchanged;
- the optimal base variable values may be calculated from the optimal simplex array equations.

We note (cf. graphical resolution of the problem) that for a maximum gasoline production of 1,400, the optimal
consists in only processing crude B (3,500). Processing A is zero, and we produce a maximum of gasoline and fuel
oil. If maximum gasoline production exceeds 1,400, the optimal solution remains processing 3,500 tons of crude B.
Fuel oil production is equal to the possible maximum. However, the maximum gas oil and gasoline productions are
not met.

If maximum gasoline production falls under 900, X’2 leaves the base: in other words, we produce a maximum of gas
oil and gasoline and a surplus of fuel oil. For this gasoline production of 900, we have:

X2 = 1,000
X’2 = 0
X1 = 2,500
X’1 = X’3 =0

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

4. PARAMETRIZING THE RIGHT-HAND SIDE


We are going to look at how the solution to our problem changes as gasoline production changes. We just showed
that when this production falls between 900 and 1,400 tons, the problem is solved using the simplex array on page 26
in optimal. We are going to look at the results we get outside that range.

4.1 Gasoline production over 1,400 tons

Problem solving for a maximum possible production of 1,600 tons, for example, yields

X2 = 3500 - X1 - 2.5 X'3


X'1 = 200 + 0.2 X1 + X'3
X'2 = 500 - 0.2 X1 + 0.5 X'3
Z = 525,000 - 10 X1 - 375 X'3

Concretely, the solution consists in only processing crude X2, which gives a maximum of gasoline. The solution
corresponds to point A in the graph. We note that this solution does not change if we increase the possibility of
producing gasoline. Improving the cost function hinges on the fuel oil production constraint, and this constraint alone.

4.2 Gasoline production between 900 and 1400 tons

We have seen that if we call Δ = gasoline demand - 900,

X1 = 2500 - 5 Δ
X2 = 1000 + 5 Δ
X'1 = 0
X'2 = Δ
X'3 = 0
Z = 500,000 + 50 Δ

4.3 Gasoline production under 900 tons

Problem solving for a maximum possible production of 800 tons of gasoline, for example, yields:

X1 = 8000/3 + 5/3 X'1 - 10/3 X'2


X2 = 2000/3 - 10/3 X'1 + 5/3 X'2
X'3 = 200/3 + 2/3 X'1 + 2/3 X'2
Z = 1,420,000/3 - 800/3 X'1 - 650/3 X'2

This solution is restricted by maximum gasoline and gas oil productions.

It remains valid as long as

X1 = 8000/3 + 5/3 Δ X'1 ≥ 0 Δ X'1 ≥ - 1,600


X2 = 2000/3 - 10/3 Δ X'1 ≥ 0 Δ X'1 ≤ 200
X'3 = 200/3 + 2/3 Δ X'1 ≥ 0 Δ X'1 ≥ - 100
© IFP Training - 2009
PDVSA – Module 29 - Linear Pogramming Manual

Therefore for 600 ≤ gasoline demand ≤ 900


By using the value 600 as a reference and calling ∆ the change in gasoline demand (over 600) and 600, we have:

X1 = 3000 - 5/3 Δ
X2 = 10/3 Δ
X'1 = 0
X'2 = 0
X'3 = 200 - 2/3 Δ
Z = 420,000 + 800/3 Δ

4.4 Maximum possible gasoline production under 600 tons

If we assume a maximum gasoline production of 400 tons, for example, the problem resolution gives:

X1 = 2000 - 2X2 - 5 X'1


X2 = 0
X'1 = 0
X'2 = 400 + 0.6 X2 + 2X'1
X'3 = 600 + 0.4 X2 + 2X'1
Z = 280,000 - 130X2-700X'1

This solution is only restricted by gasoline production and only depends on gasoline production.

If we call Δ (between 0 and 600) maximum gasoline production, we get

X1 = 5 Δ
X2 = 0
X'1 = 0
X'2 = 1200 - 2 Δ
X'3 = 1400 - 2 Δ
Z = 700 Δ

We note that if Δ > 600, the variable X'2 becomes negative and this value for maximum gasoline production leads
to a basic change.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

PARAMETRIZING MAXIMUM GASOLINE PRODUCTION

Gasoline production < 600 600 < Gasoline production < 900

X1 X1

A : optimum A : optimum

A
A

X2 X2
FO
1 FO GO
2 GO 2
1 1 Essence 400 1 Essence 800
2 Essence 600 2 Essence 900
900 < gasoline production < 1,400 gasoline production > 1,400

X1
X1

A : optimum
A : optimum

X2
X2 A
FO 2 GO
1 2 FO GO 1
1 Essence 1200 1 Essence 1400
2 Essence 1400 2 Essence 1600

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

5. SOLUTION VALIDITY SET: CHANGE IN COST FUNCTION COEFFICIENTS


If we vary one of the crude values, it is certain that the cost function will vary, and that, above a certain change in
these values, some base variables will leave the base.

Let us assume, for example, that the value of crude A is zero, and the value of B is 150. The optimal solution consists
in processing 3,500 tons of B. This result is obvious from an arithmetic perspective and from a graphical perspective.

Let us try to determine, as in the case of a change in the right-hand side, in which price range we can vary the value
of crude A without changing the final simplex array.

The final array in our conclusion remains valid as long as the marginal costs of the non-base variables are positive.
Let us assume that the value of crude A is V1.

For the marginal cost of a constraint to be positive (increase in the value of the cost function), we must assume an
increase in the value of a right-hand side (cf. § 1), for example, ΔX 1' = − 1 . But ΔX 1' = − 1 results in:
- a 5 decrease in X1 - Value V1
- a 5 increase in X2 - Value 150.
The marginal cost is therefore 5 x 150 - 5 V1 and this marginal cost has to be positive.
Therefore 750 - 5 V1 ≥ 0 - V1 ≤ 150.

In the same way ΔX 3 = 1 results in:


'

- an 5 increase in X1 - Value V1
- a 2.5 decrease in X2 - Value 150.
The marginal cost is therefore 5 V1 - 2.5 x 150 and this marginal cost has to be positive.
Therefore 5 V1 - 375 ≥ 0 or V1 ≥ 75.

If we refer to the graphical solution, we note that if the value of A exceeds 150, the optimal moves to point C
(processing 2,500 tons of A and 1,000 tons of B). NOTE: if the value of A continues to increase, the optimal will move
to D (processing only crude A, 3,500 tons).
Conversely, if the value of A falls below 75, the optimal moves from B to A and consists in only processing crude B
(3,500 tons).

It is important to note that as long as A stays at a value between 75 and 150 ($/T), the optimal remains unchanged
and consists in processing 1,000 tons of crude A and 2,500 tons of crude B. The other variables' values are not
changed either: gas oil production stays under the maximum possible production of 300 tons (X’2 = 300) and
maximum gasoline and fuel oil productions are met (X’1 = X’3 = 0).
However, the value of the cost function and the marginal costs change as a function of the value of crude A.
In the same way, if the value of crude B, V2, changes, the value of A remains constant, and we show that the optimal
solution does not change as long as:
140 ≤ V2 ≤ 280.

We note on the graphical solution that if V2 ≥ 180, the solution moves from B to A (only processing crude B, 3,500
tons).
Conversely, if V2 ≤ 140, the solution moves from B to C (NOTE: for a very low B, the solution moves from C to D:
only processing crude A).

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

SENSITIVITY ANALYSIS

SUMMARY

Variation of a right-hand side Variation of a coefficient


of the cost function
Within a certain variation range: Within a certain variation range:
- the final simplex array remains valid. - the final simplex array remains valid.
THEREFORE: THEREFORE:
- the base variables stay the same; - the base variables stay the same;
- the non-base variables stay the same; - the non-base variables stay the same;
- the base variables' new values may be calculated - the variables' values do not change;
using the final array;
- the marginal costs do not change; - the new marginal costs are calculated using the
final array;
- the cost function is changed. - the cost function is changed.

6. OPPORTUNITY COST
Let us look back at the sensitivity study of the solution to our problem and change one of the cost function
coefficients. Let us change V1 again, price of crude 1. We demonstrated that

- if 75 < V1 < 150, the optimal solution is at point B on the graph.

- if V1 < 75, the optimal solution is at point A.

For a value slightly higher than 150, the solution to the problem is as follows

V1 = 160

Z = 550,000 - 50 X'2 - 350 X'3


X1 = 2,500 - 5 X'2 + 2.5 X'3
X2 = 1,000 + 5 X'2 - 5 X'3
X'1 = 300 - X'2 + 1.5 X'3

(Point C on the graph)

By supposing the V1 variable again, we note that for the marginal costs of X'2 and X'3 to stay positive we need

≥0
5 V1 - 5 x 150 V1 ≥ 150
- 2.5 V1 + 5 x 150 ≥ 0 V1 ≤ 300

If V1 exceeds 300, we change solution again. This solution is represented by point D on the graph.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

The solution to the problem, for V1 = 310 for example, is expressed as:

Z = 930,000 - 5X2 - 775 X'2


X1 = 3,000 - 0.5 X2 - 2.5 X'2
X'2 = 500 - 0.2 X1 + 0.5 X'2
X'3 = 200 - 0.2 X2 + X'2

Opportunity cost: the opportunity cost is the marginal cost associated with a revenue variable (in this case X2, the
quantity of crude 2) when it is non-base.

It is interpreted as follows: crude 2 is not processed because its value is too low. If I process one ton of this crude.

- I earn 150 (value of X2)


- But I "lose" 0.5 x310, or 155

If the value of X2 exceeds 150 + 5 = 155, X2 "enters the base"

7. DEGENERACY
Let us adapt our problem slightly, assuming that maximum gas oil production is 900 tons.

We notice (cf. appendix 1A) that, although the physical solution remains the same, there are several "paths" to get
there. In addition, the optimal: X'2 = 0 (instead of 300).

We therefore have an optimal solution:

X1 = 1000, X2 = 2500
X'1 = X'2 = X'3 = 0

in which one of the base variables becomes zero, but there are three possible cost systems

Marginal cost 1 2 3

X'1 50 800/3 0
X'2 0 650/3 50
X'3 325 0 - 400

Graphically, this result corresponds to a situation in which the three constraints meet at a single point and in which the
optimal corresponds to this point. We also note that, in this case, one of the three constraints is deducted from the
two others by linear combination: the determinant associated with the base variables is zero.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

CHANGE IN A COST FUNCTION COEFFICIENT

◙ X1 X1

V2 = 150 V2 = 150
V1 < 75 75 < V1 < 150
A : optimum
B : optimum

1000
1000 B
X
1000 A
E F G 2 X2
1000 E F G
---------------------- cost function
X1
X
1

V2 = 150
V2 = 150
300 < V1
150 < V1 < 300
D : optimum
C : optimum

D
C
1000 1000
X X2
A 2
1000 E G 1000 E F G
F

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

8. CASE IN WHICH THE COST FUNCTION IS PARALLEL TO A CONSTRAINT


Let us assume that processing one ton of Crude A brings in $150 (instead of 140).

The simplex method (appendix 1B) results in two solutions:

Solution 1 2

Z 525,000 525,000
X1 1000 2500
X2 2500 1000
X'1 0 300
X'2 300 0
X'3 0 0
Marginal cost
X'1 0 0
X'2 0 0
X'3 - 375 - 375

We note that the cost function slope is the same as the straight line that corresponds to the fuel oil production
constraint. All the points in segment BC therefore correspond to an optimal. (Later, we will note that the dual solution
is degenerate).

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- CHAPTER V -
SECOND REFINER'S PROBLEM - MINIMIZING COSTS

1. THE PROBLEM
A refiner has to manufacture minimum quantities of three products:
Gasoline 1,600 tons
Gas oil 2,000 tons
Fuel oil 2,800 tons

The refiner can process one of the three following crudes, or a combination of these three crudes:
Crude A B C
Yield (% weight)
Gasoline 0.20 0.25 0.40
Gas oil 0.40 0.25 0.20
Fuel oil 0.40 0.50 0.40
Price ($/T) 150 140 160

What quantities of crudes A, B and C should be processed to minimize the cost of manufacturing these products?
(We will only consider the cost of crudes, not any other operating costs).

2. FORMATION OF THE EQUATIONS


X1, X2 and X3 the quantities (unknowns) of crude A, B and C respectively to be processed. We must have:
0.20 X1 + 0.25 X2 + 0.40 X3 ≥ 1,600
0.40 X1 + 0.25 X2 + 0.40 X3 ≥ 2,000
0.40 X1 + 0.25 X2 + 0.40 X3 ≥ 2,800
with 150 X1 + 140 X2 + 160 X3 minimum

Let us change the inequality system into an equation system. To do this, we introduce slack variables. For example,
X’1 is the difference between actual gasoline production and minimum required production (this slack variable is often
called the surplus variable in this case).

We get:
0.20 X1 + 0.25 X2 + 0.40 X3 - X’1 = 1,600
0.40 X1 + 0.25 X2 + 0.20 X3 - X’2 = 2,000
0.40 X1 + 0.50 X2 + 0.40 X3 - X’3 = 2,800
with 150 X1 + 140 X2 + 160 X3 minimum

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

3. FIRST PROBLEM RESOLUTION


The basic initial solution, which consists in making variables X1, X2 and X3 zero and in making the slack variables
equal to the right-hand side, is not practicable because these slack variables would take negative values.

X1 = X2 = X3 = 0 results in X’1 = - 1,600


X’2 = - 2,000
X’3 = - 2,800

In this case, it is possible to find an initial solution empirically using, for example, X2 = X3 = 0 and by determining the
minimum value of X1 to make the slack variables positive or zero. We get:

0.20 X1 - X’1 ≥ 1,600 => X1 ≥ 8,000


0.40 X1 - X’2 ≥ 2,000 => X1 ≥ 5,000
0.40 X1 - X’3 ≥ 2,800 => X1 ≥ 7,000

In this case, we have to choose X1 = 8,000 (X1 = 5,000 for example would result in X’1 < 0 and X’3 < 0).
We then get a basic initial solution of:

X2 = X3 = 0
X1 = 8,000
X’1 = 0
X’2 = 1,200
X’3 = 400

We can then solve the problem traditionally using the simplex method:

Table 1 X1 X2 X3 X’1 X’2 X’3 b


X’1 0.20 0.25 0.40 -1 0 0 1,600
X’2 0.40 0.25 0.20 0 -1 0 2,000
X’3 0.40 0.50 0.40 0 0 -1 2,800
(Z) 150 140 160 0 0 0 0

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

We start by breaking down the cost function by increasing X1 up to 8,000. After an initial iteration, we get the
following array:

Table 2 X1 X2 X3 X’1 X’2 X’3 b


X1 1 1.25 2 -5 0 0 8,000
X’2 0 0.25 0.60 -2 1 0 1,200
X’3 0 0 0.40 -2 0 1 400
(Z) 0 -47.5 -140 750 0 0 1,200,000

This gives us an initial solution of:

X1 = 8000, X'2 = 1200, X'3 = 400

We are now faced with a well-known problem in which the cost function has to be reduced as much as possible. By
noting that this cost function has negative coefficients, we can continue as follows: we decide to increase X3
(Dantzig's first criterion). This increase is limited to 1,000 (minimum values: 8,000 / 2 = 4,000, 1,200 / 0.6 = 2,000,
400 / 0.4 = 1,000). X3 enters the base and X’3 leaves the base. After iteration, we get:

Table 3 X1 X2 X3 X’1 X’2 X’3 b


X1 1 1.25 0 5 0 -5 6,000
X’2 0 0.25 0 1 1 -1.5 600
X3 0 0 1 -5 0 2.5 1,000
(Z) 0 -47.5 0 50 0 350 1,060,000

It is still possible to reduce the cost function by increasing X2 whose value is limited to 2,400 (minimum of
6,000 / 1.25 = 4,800, 600 / 0.25 = 2,400, 1,000 / 0 = ∞). After iteration, we get:

Table 4 X1 X2 X3 X’1 X’2 X’3 b


X1 1 0 0 0 -5 2.5 3,000
X2 0 1 0 4 4 -6 2,400
X3 0 0 1 -5 0 2.5 1,000
(Z) 0 0 0 240 190 65 946,000

4. PROBLEM SOLVING USING THE ARTIFICIAL VARIABLE METHOD: INTRODUCTION


It is simple to determine an initial solution empirically in our example because all the constraints have the same
sign, and we just have to choose a large enough value for one of the revenue variables.

But in problems with both ≥ and ≤ constraints, and in particular in large-scale problems, it is necessary to find a more
systematic method of determining an initial solution.

For each ≥ constraint (for the three constraints in our case), we introduce an additional variable, called an artificial
variable.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

The problem is expressed as follows:


0.20 X1+ 0.25 X2 + 0.40 X3- X’1 + T1 = 1,600
0.40 X1 + 0.25 X2 + 0.20 X3 - X’2 + T2 = 2,000
0.40 X1 + 0.50 X2 + 0.40 X3 - X’3 + T3 = 2,800

An initial solution consists in taking:


T1 = 1,600, T2 = 2,000, T3 = 2,800
with X1 = X2 = X3 = X’1 = X’2 = X’3 = 0

To obtain an initial solution for our initial problem, we have to find a solution such that T1 = T2 = T3 = 0, or, since T1,
T2 et T3 must be positive:
T1 + T2 + T3 = 0

But by adding the three constraints in our program, we get:


X1 + X2 + X3 - X’1 - X’2 - X’3 + T1 + T2 + T3 = 6,400
T1 + T2 + T3 = 6,400 - X1 - X2 - X3 + X’1 + X’2 + X’3

We will therefore initially try to solve the following problem:


0.20 X1 + 0.25 X2 + 0.40 X3 - X’1 + T1 = 1,600
0.40 X1 + 0.25 X2 + 0.20 X3 - X’2 + T2 = 2,000
0.40 X1 + 0.50 X2 + 0.40 X3 - X’3 + T3 = 2,800
by minimizing
- X1 - X2 - X3 + X’1 + X’2 + X’3 = 6,400

If we get a solution for which the cost function is zero, this solution will be the initial solution for our problem.
Otherwise, our problem will not have a solution and will be called unfeasible.

5. PROBLEM SOLVING USING THE ARTIFICIAL VARIABLE METHOD: FROM THE


INITIAL SOLUTION TO THE OPTIMAL SOLUTION

Appendix 2 shows that the simplex method can be used to get the following solution:
(X’3) 0.4 X3 - 2 X’1 + X’3 + 2 T1 - T3 = 400
(X1) X1 + 1.25 X2 + 2 X3 - 5 X’1 + 5 T1 = 8,000
(X’2) 0.25X2+ 0.6 X3 - 2 X’1 + X’2 + 2 T1 - T 2 = 1,200
(Z) T1 + T2 + T3 = 0

The initial solution to our problem is therefore:


X1 = 8,000 X’2 = 1,200 X’3 = 400 X2 = X3 = X’1 = 0

The cost function is:


150 X1 + 140 X2 + 160 X3

But X1 = 8,000 - 1.25 X2 - 2 X3 + 5 X’1.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Therefore the cost function is expressed as follows, as a function of the non-base variables:
(Z) 1,200,000 - 47.5 X2 - 140 X3 + 750 X’1
with the following constraints:
(X’3) 0.4 X3 - 2 X’1 + X’3 = 400
(X1) X1 + 1.25 X2 + 2 X3 - 5 X’1 = 8,000
(X’2) 0.25 x 2 + 0.6 X3 - 2 X’1 + X’2 = 1,200

The calculation for the optimal solution is given in Appendix 3.

Comment: the initial solution obtained using the artificial variable method is identical to the one determined empirically
in § 3.

6. SOLVING THE PROBLEM USING THE “DUAL INVERSE” METHOD


Another way of solving the problem consists in starting with an unacceptable solution.
X’1 = -1,600
X’2 = -2,000
X’3 = -2,800
and progressively replacing these negative "base" variables by positive variables.

The problem is (recap):


0.20 X1 + 0.25 X2 + 0.40 X3 - X’1 = 1,600
0.40 X1 + 0.25 X2 + 0.20 X3 - X’2 = 2,000
0.40 X1 + 0.50 X2 + 0.40 X3 - X’3 = 2,800

The "most negative" variable is X’3 (= -2,800). To make it zero, we can increase X1, X2 or X3. To do this, we need:
X1 = 2,800 / 0.4 = 7,000
X2 = 2,800 / 0.5 = 5,600
X3 = 2,800 / 0.4 = 7,000

But, if possible, we also need to break down the cost function as little as possible. The previously calculated values of
X1, X2 and X3 lead to the following cost function values:
X1 = 7,000 => Z = 7,000 x 150 = 1,050,000
X2 = 5,600 => Z = 5,600 x 140 = 784,000
X3 = 7,000 => Z = 7,000 x 160 = 1,120,000

We therefore decide to increase X2 up to 5,600. We get the following solution:


X1 = 0 X2 = 5,600 X3 = 0
X’1 = -200 X’2 = -600 X’3 = 0

We are going to express X2, X’1 and X’2 as well as Z as a function of X1, X3 and X’3 then cancel a new "base"
variable, X’2, which is the most negative. The detailed calculation is given in Appendix 4. Of course, we get the same
solution as the one we get using the artificial variable method.

This method consists in:


- successively releasing the negative variables from the base, starting with the most negative;

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- breaking down the cost function as little as possible by choosing to increase the non-base variable xi (zero)
for which the ratio pi/ci is the lowest (in which pi is the coefficient of the variable xi in the cost function and ci is
the coefficient of the same variable in the equation that defines the output variable).

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- CHAPTER VI -
DUALITY

The principle of duality is a fundamental principle of linear programming (without a doubt the fundamental principle).
In sum, the duality associated with a linear problem for optimizing concrete revenues (primal problem), another
symmetrical linear problem for optimizing costs (or prices) associated with the first problem's constraints. The detailed
analysis of both problems and their results is vast.

1. PROBLEM STATEMENT
Let us look back at the first refiner's problem, which consists in maximizing revenues under the constraint of
maximum production. Or:
Maximize 140 X1 + 150 X2
with 0.2 X1 + 0.4 X2 ≤ 1,200
0.40 X1 + 0.20 X2 ≤ 1,200
0.40 X1 + 0.40 X2 ≤ 1,400

Let us recall one of the main results of this problem. The optimal solution consists in processing 1,000 tons of crude A
(X1) and 2,500 tons of Crude B (X2). In addition, the value of one ton of additional gasoline to the refiner is $50 and
the value of one ton of additional fuel oil is $325. The value of one additional ton of gas oil is zero, because optimally,
only 900 tons of this product are made.

In a trade economy, and in particular in a market economy, the refiner aims to sell the products he manufactures.

The problem is setting prices for the products. A client tries to minimize the purchase price for all the products.
Conversely, the refiner only accepts to sell the products if the revenues from this sale are at least equal to the profit
obtained by processing crudes.

The problem is expressed as follows, calling U1, U2 and U3 the prices of gasoline, gas oil and fuel oil respectively:
Minimize 1,200 U1 + 1,200 U2 + 1,400 U3 } (client's objective)

with 0.20 U1 + 0.40 U2 + 0.40 U3 ≥ 140 } (refiner's objectives)


0.40 U1 + 0.20 U2 + 0.40 U3 ≥ 150 }

If slack variables are introduced, the problem is expressed as follows:


Minimize 1,200 U1 + 1,200 U2 + 1,400 U3
0.20 U1 + 0.40 U2 + 0.40 U3 - U’1 = 140
0.40 U1 + 0.20 U2 + 0.40 U3 - U’2 = 150

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

2. SOLUTION AND INTERPRETATION


Optimally, the cost function and constraints are expressed as follows:
Z = 515,000 + 300 U2 + 1,000 U’1 + 2,500 U’2
U1 = 50 + U2 - 5 U’1 + 5 U’2
U3 = 325 - 1.5 U2 + 5 U’1 - 2.5 U’2

The optimal solution consists in selling gasoline for $50/ton and fuel oil for $325/ton. The price (value) of gas oil is
zero (U2 is a non-base variable, therefore zero).

We check that:
1,200 (quantity of gasoline) x 50
+ 1,400 (quantity of fuel oil) x 325
= 515,000

We observe that:
- the value of the optimal dual cost function is equal to the value of the optimal primal cost function;
- the optimal prices from the dual problem are equal to the marginal costs of the primal problem;
- the “marginal costs” associated with the constraints of the dual problem are identical to the right-hand side of
the primal problem;
- the “marginal cost” (opportunity cost) associated with the “price of gas oil” variable is identical to the value of
the slack variable associated with the gas oil production constraint in the primal problem.

Let us analyze the meaning of the marginal costs in the dual problem:

- If we increase the value of crude A by $1/T, U’1 also increases by 1, therefore:


- U1 the price of gasoline decreases by 5;
- U3 the price of fuel oil increases by 5.
So, we have to sell 1,200 tons of gasoline and 1,400 tons of fuel oil. The change in revenue is therefore:
1,200 x -5 + 1,400 x 5 = 1,000
The coefficient of U’1 in the cost function is 1,000.
In the same way, in the primal problem, since we are processing 1,000 tons of crude A, the change in
revenues will be 1,000 (1,000 x +1).
- If we increase the value of crude B by $1/T, we also note that U1 (the price of gasoline) increases by
5 and U3 (the price of fuel oil) decreases by 2.5, which causes a change in revenues of:
1,200 x 5 + 1 400 x -2.5 = 2,500
The coefficient of U’3 in the cost function is 2,500.
We recall that in the primal problem, the optimal quantity of crude B to be processed is 2,500 tons. Therefore
the change in revenues is 2,500.

It is slightly more complex to interpret U2 (the price of gas oil).


A 1 increase in U2 leads to:
- a 1 increase in U1 (price of gasoline);
- a 1.5 reduction in U3 (price du fuel oil).

Overall, the change in revenues (for the refiner) / cost (for the client) is:
1,200 (quantity of gasoline) x 1
+ 1,200 (quantity of gas oil) x 1
© IFP Training - 2009
PDVSA – Module 29 - Linear Pogramming Manual

- 1,400 (quantity of fuel oil) x 1.5


= 300
We find the coefficient of U2 in the cost function.

In the primal problem, increasing the value of gas oil by 1 is the equivalent of adding a value of 1,200 to the cost
function but subtracting a value of 0.4 from crude A and a value of 0.2 from crude B. We get:
1,200 - 0.4 x 1,000 - 0.2 x 2,500 = 300

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

FIRST REFINER'S PROBLEM

PRIMAL DUAL

MAX 140X1 + 150 X2 MIN 1200U1+1200U2+1400U3


0.2X1+0.4X2 ≤ 1200 0.2U1+0.4U2+0.4U3 ≥ 140
0.4X1+0.4X2+ ≤ 1200 0.4U1+0.4U2+0.4U3 ≥ 150
0.4X1+0.4X2 ≤ 1400

X1 X2 X'1 X'2 X'3 RHS U1 U2 U3 U'1 U'2 RHS


140 150 0 0 0 1200 1200 1400 0 0
0.2 0.4 1 0 0 1200 0.2 0.4 0.4 -1 0 140
0.4 0.2 0 1 0 1200 0.4 0.2 0.4 0 -1 150
0.4 0.4 0 0 1 1400

140 150 0 0 0 1200 1200 1400 0 0


0.5 1 2.5 0 0 3000 0.2 0.4 0.4 -1 0 140
0.4 0.2 0 1 0 1200 1 0.5 1 0 -2.5 375
0.4 0.4 0 0 1 1400

65 0 -375 0 0 450000 0 600 200 0 3000 450


0.5 1 2.5 0 0 3000 0 0.3 0.2 -1 0.5 65
0.3 0 -0.5 1 0 600 1 0.5 1 0 -2.5 375
0.2 0 -1 0 1 200

65 0 -375 0 0 450000 0 600 200 0 3000 450000


0.5 1 2.5 0 0 3000 0 1.5 1 -5 2.5 325
0.3 0 -0.5 1 0 600 1 0.5 1 0 -2.5 375
1 0 -5. 0 5 1000

0 0 -50 0 -325 515000 0 300 0 1000 2500 515000


0 1 5.0 0 -2.5 2500 0 1.5 1 -5 2.5 325
0 0 1 1 -1.5 300 1 -1 0 5 -5 50
1 0 -5 0 5. 1000

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

GLOSSARY

• Coefficient of substitution: coefficient of a variable in a line. In particular, these coefficients


make it possible to analyze variations in revenues resulting from a constraint variation
(“substitutions” between revenues) and to analyze marginal costs.

• Opportunity cost (Reduced cost): marginal cost associated with an optimal non-base activity
(zero).

• Marginal cost (dual cost): the marginal cost associated with a constraint.

• Marginal costs: synonym: marginal values, opportunity costs.


Marginal cost, reduced cost, dual cost: costs (value) associated with the constraints of a linear
model.

• Dantzig's second criterion: selection criterion for the output variable in the simplex method.

• Feasible set: space set with n dimensions bound by the hyperplanes that correspond to the
linear program constraints.

• Duality: combination of two symmetrical problems that correspond to revenue optimization


(primal problem) and to optimizing the cost/price of constraints or resources (dual problem).
E.g.: while the primal problem consists in optimizing a refinery's revenues, quantities of crude
to be processed, processing capacities, etc. without product manufacturing constraints, the
dual problem consists in optimizing the cost/price of these products.

• Equations: synonym:
- constraints
- lines.

• Cost function: synonym: objective function.

• Interior point method: method developed by Karmarkar in the early 1980s.

• Simplex method: method defined by Dantzig in 1947.

• Extremity of the feasible solution set: synonym: peak.

• Dantzig's first criterion: selection criterion for the input variable in the simplex method.

• Linear programming: system used to optimize revenues subject to linear constraints.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

• Linear program: set of constraints (equations or inequalities) that connect variables that
correspond to revenues linearly, plus a cost function to be optimized (maximized or
minimized).

• Right-hand side.

• Optimal solution: feasible solution that optimizes the cost function.

• Feasible solution: synonym: feasible solution.


Set of values for variables that satisfy the problem's constraints.

• Basic feasible solution: feasible solution that corresponds to a peak in the feasible solution
set.

• Final simplex array: matrix array that corresponds to the last iteration in the simplex method.
In particular, it includes the coefficients of substitution.

• Slack variable: variable added in an inequality to turn it into an equation.

• Variables: synonym:
- activities
- columns.

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- APPENDIX 1A-
DEGENERACY

X1 X2 X’1 X'2 X'3


Max 140 150 0 0 0
X’1 0.2 0.4 1 0 0 1,200
X’2 0.4 0.2 0 1 0 900
X’3 0.4 0.4 0 0 1 1,400

X2 ≤ 1,200/0.4*; 900/0.2; 1400/0.4

R 140 150 0 0 0 0
X’1 0.5 1* 2.5 0 0 3,000
X’2 0.4 0.2 0 1 0 900
X’3 0.4 0.4 0 0 1 1,400

S 65 0 -375 0 0 Z - 450,000
X2 0.5 1 2.5 0 0 3,000
X’2 0.3 0 -0.5 1 0 300
X’3 0.2 0 -1 0 1 200

X1 X1 ≤ 3000/0.5 300/0.3* 200/0.2*

Two possibilities for output variables

X’2 leaves:

R 65 0 -375 0 0 Z - 450,000
X2 0.5 1 2.5 0 0 3,000
X’2 1* 0 -5/3 10/3 0 1,000
X’3 0.2 0 -1 0 1 200

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

S 0 0 -800/3 -650/3 0 Z - 515,000


X2 0 1 10/3 -5/3 0 2,500
X1 1 0 -5/3 10/3 0 1,000
X’3 0 0 -2/3 -2/3 1 0

Solution CM
Check -800/3 = -10/3 x 150 + 5/3 x 140 X1 = 1,000
- 650/3 = -10/3 x 140 + 5/3 x 150 X2 = 2,500
X’1 = 0 - 800/3
X’2 = 0 - 650/3
X’3 = 0

X’3 leaves:

Solution 0 0 -50 0 -325 Z - 515,000


X2 0 1 5 0 -2.5 2,500
X’2 0 0 1 1 -1.5 0
X1 1 0 -5 0 5 1,000

Now let us suppose that I initially start to increase X1

X1 X2 X’1 X’2 X’3


Max 140 150 0 0 0 0
X’1 0.2 0.4 1 0 0 1,200
X’2 0.4 0.2 0 1 0 900
X’3 0.4 0.4 0 0 1 1,400

I increase X1: X1 ≤ 6,000, 2,250, 3,500

R 140 150 0 0 0 0
X’1 0.2 0.4 1 0 0 1,200
X’2 1* 0.5 0 2.5 0 2,250
X’3 0.4 0.4 0 0 1 1,400

S 0 80 0 -350 0 Z - 315,000
X’1 0 0.3 1 -0.5 0 750
X1 1 0.5 0 2.5 0 2,250
X’3 0 0.2 0 -1 1 500

I increase X2: X2 ≤ 2,500, 4,500, 2,500

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

I choose X’3 or:

R 0 80 0 -350 0 Z - 315,000
X’1 0 0.3 1 -0.5 0 750
X1 1 0.5 0 2.5 0 2,250
X’3 0 1* 0 -5 5 2,500

S 0 0 0 50 -400 Z - 515,000
X’1 0 0 1 1 -1.5 0
X1 1 0 0 5 -2.5 1,000
X2 0 1 0 -5 5 2,500

X’2 has a positive coefficient, but it cannot be increased because X’2 ≤ 0 subject to line (X’1).
We therefore have three possibilities for marginal costs:

X’1 - 800/3 - 50 0
X’2 - 650/3 0 50
X’3 0 -325 -400

The optimal solution is:

X1 = 1,000 X2 = 2,500 X’1 = 0 X’2 = 0 X’3 = 0

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

DEGENERACY

Graphical interpretation
0.2 X1 + 0.4 X2 ≤ 1200
0.4 X1 + 0.2 X2 ≤ 900
0.4 X1 + 0.2 X2 ≤ 1400

X
10 1
9

1 B

0 X2
0 1 2 3 4 5 6 7 8 9 10
Eq 2 Eq 4
Eq 3

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- APPENDIX 1B -
COST FUNCTION PARALLEL TO A CONSTRAINT

X1 X2 X'1 X'2 X'3


Max 150 150 0 0 0 0
X'1 0.2 0.4 1 0 0 1200
X'2 0.4 0.2 0 1 0 1200
X'3 0.4 0.4 0 0 1 1400

First step:

Let us increase X2 X2 is limited to 1200/0.4 (X'1)


1200/0.2 (X'2)
1400/0.4 (X'3)

R 150 150 0 0 0 0
X2 0.5 1* 2.5 0 0 3000
X'2 0.4 0.2 0 1 0 1200
X'3 0.4 0.4 0 0 1 1400

S 75 0 -375 0 0 450,000
X2 0.5 1* 2.5 0 0 3000
X'2 0.3 0 - 0.5 1 0 600
X'3 0.2 0 -1 0 1 200

Let us increase X2 X2 is limited to 3000/0.5 (X2)


600/0.3 (X'2)
200/0.2 (X'3)

R 75 0 - 375 0 0 450,000
X2 0.5 1 2.5 0 0 3000
X'2 0.3 0 - 0.5 1 0 600
X'3 1* 0 -5 0 5 1000

S 0 0 0 0 - 375 525,000
X2 0 1 5 0 - 2.5 2,500
X'2 0 0 1 1 - 1.5 300
X1 1 0 -5 0 5 1000

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Other step

I increase X1 X1 ≤ 1200/0.2, 1200/0.4*, 1400/0.4

R 150 150 0 0 0 0
X'1 0.2 0.4 1 0 0 1200
X1 1* 0.5 0 2.5 0 3000
X'3 0.4 0.4 0 0 1 1400

S 0 75 0 -375 0 450,000
X'1 0 0.3 1 -0.5 0 600
X1 1 0.5 0 2.5 0 3000
X'3 0 0.2 0 -1 1 200

I increase X2 X2 ≤ 600/0.3, 3000/0.5, 200/0.2*

R 0 75 0 - 375 0 450,000
X'1 0 0.3 1 - 0.5 0 600
X1 1 0.5 0 2.5 0 3000
X'3 0 1* 0 -5 5 1000

S 0 0 0 0 - 375 525,000
X'1 0 0 1 1 - 1.5 300
X1 1 0 0 5 - 2.5 2500
X2 0 1 0 -5 5 1000

We therefore have two identical solutions from an economic perspective

X1 = 1000 X2 = 2500 X'2 = 300 X'1 = 0 X'3 = 0


(marginal costs 0 0 375)

X'1 = 2500 X2 = 1000 X'1 = 300 X'2 = 0 X'3 = 0


(marginal costs 0 0 375)

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

COST FUNCTION PARALLEL TO A CONSTRAINT

X Deux solutions
10 1 (C. marg.)
Point B X1 = 1000 -
9 X2 = 2500 -
X'1 = 0 0
X'2 = 300 0
8
X'3 = 0 375
(Productions contraignantes : essence et fuel)
7
Point C X1 = 2500 -
6 X2 = 1000 -
X'1 = 300 0
X'2 = 0 0
5 X'3 = 0 375
(productions contraignantes : gas oil et fuel)
4

3
D
2 C

1
B
0 X2
0 1 A3 4 9 10
2 5 6 7 8
Eq 2 Eq 4 Eq 3

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- APPENDIX 2 -
SECOND REFINER'S PROBLEM
DETERMINING A BASIC FEASIBLE SOLUTION USING ARTIFICIAL VARIABLES

X1 X2 X3 X'1 X'2 X'3 T1 T2 T3


(T1) 0.2 0.25 0.4 -1 0 0 1 0 0 1,600
(T2) 0.4 0.25 0.2 0 -1 0 0 1 0 2,000
(T3) 0.4 0.50 0.4 0 0 -1 0 0 1 2,800
Obj.F -1 -1 -1 +1 +1 +1 0 0 0 6,400

Let us increase X1 X1 is limited to 8,000 (T1)


5,000 (T2) *
7,000 (T3)

Rewriting

X1 X2 X3 X'1 X'2 X'3 T1 T2 T3


(T1) 0.2 0.25 0.4 -1 0 0 1 0 0 1,600
(T2) 1* 0.625 0.5 0 -2.5 0 0 2.5 0 5,000
(T3) 0.4 0.5 0.4 0 0 -1 0 0 1 2,800
Obj.F -1 -1 -1 1 1 1 0 0 0 6,400

FIRST SIMPLEX

X1 X2 X3 X'1 X'2 X'3 T1 T2 T3


(T1) 0 0.125 0.3 -1 0.5 0 1 -0.5 0 600
(X1) 1 0.625 0.5 0 -2.5 0 0 2.5 0 5,000
(T3) 0 0.25 0.2 0 1* -1 0 -1 1 800
0 -0.375 -0.5 1 -1.5 1 0 2.5 0 1,400

Let us increase X'2 X'2 is limited to 1,200 (T1)


___ (X1)
800 (T3)*

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

SECOND SIMPLEX

X1 X2 X3 X'1 X'2 X'3 T1 T2 T3


(T1) 0 0 0.2 -1 0 0.5 1 0 -0.5 200
(X1) 1 1.25 1 0 0 -2.5 0 0 2.5 7,000
(X'2) 0 0.25 0.2 0 1 -1 0 -1 1 800
Obj. F 0 0 -0.2 1 0 -0.5 0 1 1.5 200

Let us increase X'3 X'3 is limited to 400 (T1)

Rewriting

(T1) 0 0 0.4 -2 0 1* 2 0 -1 400


(X1) 1 1.25 1 0 0 -2.5 0 0 2.5 7,000
(X'2) 0 0.25 0.2 0 1 -1 0 -1 1 800
Obj. F 0 0 -0.2 1 0 -0.5 0 1 1.5 200

THIRD SIMPLEX

(X'3) 0 0 0.4 -2 0 1 2 0 -1 400


(X1) 1 1.25 2 -5 0 0 5 0 0 8,000
(X'2) 0 0.25 0.6 -2 1 0 2 -1 0 1,200
Obj. F 0 0 0 0 0 0 1 1 1 0

We have T1 + T2 + T3 = 0
Therefore X'3 = 400
X1 = 8,000
X'2 = 1,200 is a basic feasible solution

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- APPENDIX 3 -
SECOND REFINER'S PROBLEM
FROM A BASIC FEASIBLE SOLUTION TO THE OPTIMAL SOLUTION

X1 X2 X3 X'1 X'2 X'3


(X'3) 0 0 0.4 -2 0 1 400
(X1) 1 1.25 2 -5 0 0 8,000
(X'2) 0 0.25 0.6 -2 1 0 1,200
Obj. F 0 -47.5 -140 750 0 0 1,200,000

Let us increase X3 X3 is limited to 1,000 (1) *


4,000
2,000

Rewriting

(X'3) 0 0 1* -5 0 2.5 1,000


(X1) 1 1.25 2 -5 0 0 8,000
(X'2) 0 0.25 0.6 -2 1 0 1,200
Obj. F -47.5 -140 750 0 0 1,200,000

FIRST SIMPLEX

(X3) 0 0 1 -5 0 2.5 1,000


(X1) 1 1.25 0 5 0 -5 6,000
(X'2) 0 0.25 0 1 1 -1.5 600
Obj. F 0 -47.5 0 50 0 350 1,060,000

The new solution is X1 = 6,000 X'1 = 0


X2 = 0 X'2 = 600
X3 = 1,000 X'3 = 0

The cost function is: 6,000 x 150 + 1,000 x 160 = 1,060,000

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Let us increase X2 X2 is limited to _____ (X3)


4,800 (X1)
2,400 (X'2)

Rewriting

X1 X2 X3 X'1 X'2 X'3


(X3) 0 0 1 -5 0 2.5 1,000
(X1) 1 1.25 0 5 0 -5 6,000
(X'2) 0 1* 0 4 4 -6 2,400
Obj. F 0 -47.5 0 50 0 350 1,060,000

SECOND SIMPLEX

(X3) 0 0 1 -5 0 2.5 1,000


(X1) 1 0 0 0 -5 2.5 3,000
(X2) 0 1 0 4 4 -6 2,400
Obj. F 0 0 0 240 190 65 946,000

OPTIMAL SOLUTION

X1 = 3,000
X2 = 2,400
X3 = 1,000

Gasoline production 3,000 x 0.2 + 2,400 x 0.25 + 1,000 x 0.4 = 1,600


Gas oil production 3,000 x 0.4 + 2,400 x 0.25 + 1,000 x 0.2 = 2,000
Fuel oil production 3,000 x 0.4 + 2,400 x 0.50 + 1,000 x 0.4 = 2,800

Marginal cost:

Gasoline $240
Diesel oil $190
Fuel oil $65

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- APPENDIX 4 -
SECOND REFINER'S PROBLEM
SOLVING THE PROBLEM USING THE "DUAL INVERSE" METHOD

Minimize 150 X1 + 140 X2 + 160 X3

with 0.2 X1 + 0.25 X2 + 0.4 X3 - X'1 = 1,600


0.4 X1 + 0.25 X2 + 0.2 X3 - X'2 = 2,000
0.4 X1 + 0,50 X2 + 0.4 X3 - X'3 = 2,800

Initial solution (not feasible):


X'1 = - 1,600 X'2 = - 2,000 X'3 = - 2,800

To make X'3 zero, we need:


X1 = 7,000 So X2 = 5,600 So X3 = 7,000

But X1 = 7,000 increases the cost function by 1,050,000


X2 = 5,600 " " 784,000
X3 = 7,000 " " 1,120,000

Therefore X2 = 5,600 and let us continue.

X1 X2 X3 X'1 X'2 X'3


(X'1) 0.2 0.25 0.4 -1 = 1,600
(X'2) 0.4 0.25 0.2 -1 = 2,000
(X'3) 0.8 1* 0.8 -2 = 5,600
Obj. F 150 140 160 0 0 0 0

FIRST SIMPLEX

(X'1) 0 0 0.2 -1 0 0.5 = 200


(X'2) 0.2 0 0 0 -1 0.5 = 600
(X2) 0.8 1 0.8 0 0 -2 = 5,600
Obj. F 38 0 48 0 0 280 = 784,000

The new solution (not feasible) is:


X2 = 5,600, X'1 = - 200, X'2 = - 600

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Let us remove X'2 from the base. We can have:


X1 = 3,000 Cost function = 114,000
X'3 = 1,200 Cost function = 336,000

Therefore X1 = 3,000 and let us continue.

Rewriting

X1 X2 X3 X'1 X'2 X'3


(X'1) 0 0 0.2 -1 0 0.5 = 200
(X'2) 1* 0 0 0 -5 2.5 = 3,000
(X2) 0.8 1 0.8 0 0 -2 = 5,600
Obj. F 38 0 48 0 0 280 = 784,000

SECOND SIMPLEX

0 0 0.2 -1 0 0.5 = 200


(X1) 1 0 0 0 -5 2.5 = 3,000
(X2) 0 1 0.8 0 4 -4 = 3,200
0 0 48 0 190 185 = 898,000

The new solution is X1 = 3,000, X2 = 3,200, X'1 = - 200

Let us remove X'1 from the base. We have:


X3 = 1,000 Cost function = 48,000
X'3 = 400 Cost function = 74,000

ThereforeX3 = 1000

rewriting:

X1 X2 X3 X'1 X'2 X'3


(X'1) 0 0 1* -5 0 2.5 = 1,000
(X1) 1 0 0 0 -5 2.5 = 3,000
(X2) 0 1 0.8 0 4 -4 = 3,200
Obj. F 0 0 48 0 190 185 = 898,000

THIRD SIMPLEX

(X3) 0 0 1 -5 0 2.5 = 1,000


(X1) 1 0 0 0 -5 2.5 = 3,000
(X2) 0 1 0 4 4 -6 = 2,400
Obj. F 0 0 0 240 190 65 = 946,000

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

- APPENDIX 5 -
SECOND REFINER'S PROBLEM
SOLVING THE DUAL PROBLEM

Maximize 1,600 U1 + 2,000 U2 + 2,800 U3


0.2 U1 + 0.4 U2 + 0.4 U3 + U'1 = 150
0.25 U1 + 0.25 U2 + 0.5 U3 + U'2 = 140
0.4 U1 + 0.2 U2 + 0.4 U3 + U'3 = 160

Initial solution U'1 = 150


U'2 = 140
U'3 = 160

Let us increase U3 U3 is limited to 150/0.4 (U'1), 140/0.5* (U'2), 160/0.4 (U'3)

Therefore U'2 leaves the base, U3 enters the base

U1 U2 U3 U'1 U'2 U'3


(U'1) 0.2 0.4 0.4 1 0 0 150
(U'2) 0.25 0.25 0.5 0 1 0 140
(U'3) 0.4 0.2 0.4 0 0 1 160
Obj. F 1,6 2,0 2,8 0 0 0

Rewriting

(U'1) 0.2 0.4 0.4 1 0 0 150


(U'2) 0.5 0.5 1* 0 2 0 280
(U'3) 0.4 0.2 0.4 0 0 1 160
1,600 2,000 2,800 0 0 0

FIRST SIMPLEX

(U'1) 0 0.2 0 1 -0.8 0 38


(U3) 0.5 0.5 1 0 2 0 280
(U'3) 0.2 0 0 0 -0.8 1 48
Obj. F 200 600 0 0 -5,600 0 784,000

Let us increase U2 U2 is limited to 38/0.2* (U'1) 280/0.5 (U3)

© IFP Training - 2009


PDVSA – Module 29 - Linear Pogramming Manual

Therefore U'1 leaves the base; U2 enters the base

Rewriting

U1 U2 U3 U'1 U'2 U'3


(U'1) 0 1* 0 5 -4 0 190
(U3) 0.5 0.5 1 0 2 0 280
(U'3) 0.2 0 0 0 -0.8 1 48
Obj. F 200 600 0 0 -5,600 0 784,000

SECOND SIMPLEX

(U2) 0 1 0 5 -4 0 190
(U3) 0.5 0 1 -2.5 4 0 185
(U'3) 0.2 0 0 0 -0.8 1 48
Obj. F 200 0 0 -3,000 -3,200 0 898,000

Let us increase U1 U1 is limited to 185/0.5 (U3), 48/0.2* (U'3).

Therefore U'3 leaves the base, U1 enters the base.

Rewriting

(U2) 0 1 0 5 -4 0 190
(U3) 0.5 0 1 -2.5 4 0 185
(U3) 1* 0 0 0 -4 5 240
Obj. F 200 0 0 -3,000 -3,200 0 898,000

THIRD SIMPLEX

(U2) 0 1 0 5 -4 0 190
(U3) 0 0 1 -2.5 6 -2.5 65
(U'3) 1 0 0 0 -4 5 240
Obj. F 0 0 0 -3,000 -2,400 -1,000 946,000

© IFP Training - 2009


PDVSA - Module 29 - Case study 1.

STUDY CASE PRESENTATION

1. REFINING SCHEME PRESENTATION


We want to optimise the refining plan of a typical conversion refinery. Its flow plan
can be seen in attachment 1. The refinery can processed 3 crudes and operates the
following units:

atmospheric and vacuum distillation


catalytic reforming
isomerisation
catalytic cracking
gas oil hydrodesulphurisation (both straight run and
cracked)

Units yields and refinery fuel oil consumptions can be seen in attachment 2; the units
capacity limitations and crude oil availabilities in attachment 3.

ƒ Reforming:
The catalytic reforming can be operated at low (95 RON reformate) or high (100
RON reformate) severity

ƒ Catalytic cracking:
The Cat Cracker can be operated at maximum gasoline (minimum distillate) or
maximum distillate (minimum gasoline)

ƒ The refinery can import reforming feed and cat cracking feedstocks (see
attachment 3).

2. REFINERY OUTPUTS
The refinery can produce:
LPG (Liquefied petroleum gas)
naphtha
2 unleaded gasolines ( Premium gasoline 98, Eurosuper 95)
jet fuel
automotive diesel oil
heavy fuel oil

© IFP Training - 2009


PDVSA - Module 29 - Case study 2.

The finished products demand for the area and the imports/exports capabilities of the
refinery are shown in attachment 4.
The Jet Fuel can be produced according to two formulas or recipes. These typical
blends are shown in attachment 5.

The qualities of the various streams of the refinery and the specifications to be met
are presented in attachment 5. The specifications are limited to C4, RVP, octane and
sensitivity for the gasolines, to sulphur for the gas oil and to viscosity for the heavy
fuel oil.
All quality blending (except the sulphur) will be done on a volumetric basis.

3. ECONOMICAL DATA

The economical data are includeded in attachment 7. They includes :

ƒ The variable operating costs of each units.


ƒ Crudes and feedstocks prices
ƒ Imports and exports price of the commercial products. When short the refinery has
to import to meet the demand.

© IFP Training - 2009


PDVSA - Module 29 - Case study 3.

Attachment 1

REFINERY FLOW PLAN

B
REFINERY FUEL
RG
LG LG
LN
LN
35
C4
30 IS PG98 PG98
ISOM ERIZATION
RG
25 LG B
HN
REFORM ER R95 EXP
20 Food
R100 ES95 ES95
DIST Gas IMP
15 B Motel
ATM
EXP
10
F1
JP
KE F2
5
IMP
C1 0 RG
C2 Jan Feb Mar Apr May Jun
GO1, GO2 EXP
GO
DESGO1, 2
GO IMP
RG
DESULFURIZATION
LG DESCGO
VGO
CRACKING CN
DIST CGO B
B S/V B EXP
VR1 , VR2 FUEL
HF
IMP

© IFP Training - 2009


PDVSA - Module 29 - Case study 4.

Attachment 2

YIELDS & RECIPE

ƒ Distillation Yields wt%


(feed : crudes) Crude 1 Crude2

Refinery Gas RG 0,1 0,2


Liquefied Gas LG 1,2 1,5
Light Naphtha LN 4,0 4,0
Heavy naphtha HN 14,5 7,5
Kerosene KE 15,0 9,0
Gasoil 1 GO1 31,0
Gasoil 2 GO2 20,3
Vac. Gasoil VGO 21,2 27,5
Vac. Residuum 1 VR1 13,0
Vac. Residuum 2 VR2 30,0

total 100,0 100,0


Refinery Fuel 1,8 1,8

ƒ Isomerization Yields wt%


(feed : light naphtha LN)

Refinery Gas RG 3,0


Isomerate IS 97,0

total 100,0
Refinery Fuel 4,0

ƒ Reforming Yields wt%


(feed : heavy naphtha HN)

Severity 95 100

Refinery Gas RG 8,0 9,0


Liquefied Gas LG 9,0 12,0
Reformate 95 R95 83,0
Reformate 100 R100 79,0

total 100,0 100,0


Refinery Fuel 1,9 2,6

© IFP Training - 2009


PDVSA - Module 29 - Case study 5.

ƒ Desulphurization (97% Sulphur) Yields wt%


(feed : gasoil GO)
GO1 GO2 GO3 CGO

Refinery Gas RG 2,0 3,0 3,0 4,0


Desulphurized product DS 98,0 97,0 97,0 96,0

total 100,0 100,0 100,0 100,0


Refinery Fuel 2,0 2,0 2,0 2,0

ƒ Catalytic Cracking Yields wt%


(feed : VGO)
Max production Naphtha Gasoil

Refinery Gas RG 1,5 1,2


Liquefied Gas LG 5,3 4,6
Cracked Naphtha CN 43,6 38,1
Cracked Gas oil LCO 44,6 51,1
Coke (burnt on the unit) 5,0 5,0

total 100,0 100,0


Refinery Fuel (*) 0,7 0,7

ƒ Heat contents
1 ton of refinery gas ~ 1,3 ton of liquid heavy fuel
1 ton of liquefied gas ~ 1,2 ton of liquid heavy fuel
1 ton of light naphtha ~ 1,1 ton of liquid heavy fuel

definition : 1 ton of liquid heavy fuel = 1 ton Fuel Oil Equivalent (1t FOE)

© IFP Training - 2009


PDVSA - Module 29 - Case study 6.

Attachment 3

CRUDES AVAILABILITY, UNITS CAPACITIES

Crudes Availabilities (kT)


Min Max

Crude 1 400
Crude 2 260 unlimited

Capacity Limitations

Unit Max

Distillation 700
Isomerization 30
Reforming 60
Catalytic Cracking 135
Desulphurization 150

Unit: KT over the period

© IFP Training - 2009


PDVSA - Module 29 - Case study 7.

Attachment 4

DEMAND AND IMPORT EXPORT CAPABILITIES

Domestic Market Commercial Products Demands (kT)


Liquified Gas 11
Light Naphtha 6
Premium Gasoline 98 20
Eurosuper 95 80
Jet Fuel 70
Diesel / Heating Oil 160
Heavy Fuel 148

Memo : fixed Refinery Fuel 15,2

Imports exports

All products or feedstocks can be imported


Import export

Liquified Gas yes yes


Light Naphtha yes yes
Premium Gasoline 98 yes no
Eurosuper 95 yes yes
Jet Fuel yes yes
Diesel / Heating Oil yes yes
Heavy Fuel yes yes

MTBE yes no
Heavy naphtha yes no
VGO yes no

Attachment 5

JET FUEL RECIPE

Wt%
Components Formula F1 Formula F2

Light Naphtha LN 5,0 3,5


Heavy Naphtha HN 10,0 7,5
Kerosene KE 85,0 89,0

Total 100,0 100,0

© IFP Training - 2009


PDVSA - Module 29 - Case study 8.

Attachment 6

QUALITIES AND SPECIFICATIONS

Qualities of components and bases


Specifications to be met by commercial products

Base or product Specific Vapor Octane Sulfur (% wt) Viscosity Heat


Gravity Pressure number before after Index Content
(bar) RON MON HDS HDS (T.FOE)
Refinery Gas RG 1,3
Liquefied Gas LG 0,54 1,2
of which C4 0,58 4,30 94 90
Light Naphtha LN 0,65 0,80 71 68 1,1
Heavy Naphtha HN 0,74
Kerosene KE 0,77 0,1
GO of crude 1 GO1 0,83 0,2 0,006
GO of crude 2 GO2 0,86 1,5 0,045
GO of crude 3 GO3 0,85 1,0 0,020
VGO VGO 0,92
Vac. Resid (Crude 1) VR1 0,98 38
Vac. Resid (Crude 2) VR2 1,02 43
Vac. Resid (Crude 3) VR3 1,00 40
Reformate 95 RE95 0,77 0,50 95 86
Reformate 100 RE100 0,80 0,50 100 91
Isomerate IS 0,665 0,40 91 86
Cracked Naphta CN 0,75 0,65 93 82
Cracked GO LCO 0,95 2,0 0,06 12
MTBE MTBE 0,74 0,50 118 102

Min Max Min Max Min Max


Premium Gasoline 98 (1) (2) 0,50 0,86 98
Eurosuper 95 (1) (2) 0,45 0,80 95
Diesel Oil - HO 0,05
Liquid Fuel 30 33 1

(1) Butane content =< 5% volume


(2) Sensibility = Research Octane Number - Motor Octane Numbe10

© IFP Training - 2009


PDVSA - Module 29 - Case study 9.

Attachment 7

ECONOMICAL DATA

Operating Costs of Units ($/t of feed)


Unit Severity / Feed Cost

Distillation 1,0
Reforming Severity 95 2,7
Severity 100 3,2
Cracking 3,0
Isomerization 0,6
Desulphurization GO1 1,0
GO2 1,0
GO3 1,0
Cracked GO (CGO) 1,4

Crudes and Products prices ($/T)

Price CIF Price FOB


Products (Import) (Export)

Crude 1 183,0
Crude 2 155,0
Crude 3 170,0
Liquified Gas 230,0 220,0
Light Naphtha 215,0 205,0
Reformer Feed 216,0
Cracker Feed 200,0
Premium Gasoline 98 258,0
Eurosuper 95 255,0 245,0
Jet Fuel 250,0 240,0
Gasoil 230,0 220,0
Heavy Fuel 125,0 115,0
MTBE 295,0

© IFP Training - 2009


PDVSA - Module 29 - Case study 10.

Attachment 8
VARIABLES & ROWS LIST

VARIABLES

DIS C1 Crude 1 to distillation


DIS C2 Crude 2 to distillation
REF95 Heavy naphtha to reformer 95
REF100 Heavy naphtha to reformer 100
FCC NA VGO to FCCU (Naphtha max)
FCC GO VGO to FCCU (Gas oil max)
ISOM Light Naphtha to isomerisation
DESGO1 Gasoil 1 to Desulphurization
DESGO2 Gasoil 2 to Desulphurization
DESCGO Cycle GO to Desulphurization
JP F1 Jet fuel ex recipe 1
JP F2 Jet fuel ex recipe 2
C PG98 C4 to PG 98
LN PG98 Light naphtha to PG 98
IS PG98 Isomerate to PG 98
R95PG98 Reformate 95 to PG 98
R100PG98 Reformate 100 to PG 98
CN PG98 Cracked naphtha to PG 98
PG98VO Volume of PG98
C ES95 C4 to ES95
LN ES95 Light naphtha to ES95
IS ES95 Isomerate to ES95
REF95ES95 Reformate 95 to ES95
REF100ES95 Reformate 100 to ES95
CN ES95 Cracked naphtha to ES95
ES95VO Volume of ES95
KE GO Kerosene to gasoil
G1 GO GO 1 to gasoil
G2 GO GO 2 to gasoil
CG GO Cracked GO to Gasoil
DSG1GO Desulfurized GO 1 to Gasoil
DSG2GO Desulfurized GO 2 to Gasoil
DSCGGO Desulfurized cracked GO to Gasoil
GO WT Gasoil production in tons
CG HF Cracked GO vers HFO
V1 HF Vac Resid 1 to HFO
V2 HF Vac Resid 2 to HFO
HF VO HFO production in cm3
RGRF Refinery Gas to refinery fuel
LGRF Liquefied Gas to refinery fuel
LNRF Light Naphtha to refinery fuel
HFRF Heavy Fuel Oil to refinery fuel
IM HN Reformer feed (Heavy Naphtha) imports
IM VG Cat Cracker feed (VGO) imports

© IFP Training - 2009


PDVSA - Module 29 - Case study 11.

IM ES95 Eurosuper (ES95) import

EXES95 Eurosuper (ES95) export


IM JF Jet Fuel import
EX JF Jet Fuel export
IM GO Gasoil import
EX GO Gasoil export
IM HF Heavy Fuel Oil import
EX HF Heavy Fuel Oil export

© IFP Training - 2009


Case nº1 - refinery flow plan

B BURNING

RG
LG LPG’S
LN
LIGHT NAPHTHA
C4
ISOMERIZATION ISOMERATE PG98 PR. GAS 98
IMP RG
LG
B
C1 HN REFORMING ES95 EXP
R95
R100
ATM EUROSUPER 95
C2
DIST
B IMP
EXP
F1
or JET FUEL
KE
F2
C3 IMP
RG
GO1
GO2
B EXP
RG DO
LG HO GO = DO + HO
DESULFURIZATION
VGO CN (Cracked naphtha)
CRACKING
B IMP
CGO (cracked gas-oil)
EXP

VAC. IMP
B HF HEAVY FUEL
DIST VR1

© 2009 - IFP Training


VR2
IMP

MTBE

SEG

You might also like