Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
5 views23 pages

Chapter 2. Optimisation With MATLAB

Chapter 2 discusses optimization techniques implemented in MATLAB, focusing on linear and nonlinear programming. It includes numerical examples for linear programming involving production optimization and cutting plans, as well as various MATLAB functions for nonlinear optimization. The chapter concludes with an application in the hydrocarbons field, detailing constraints and optimal transportation plans for crude oil networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views23 pages

Chapter 2. Optimisation With MATLAB

Chapter 2 discusses optimization techniques implemented in MATLAB, focusing on linear and nonlinear programming. It includes numerical examples for linear programming involving production optimization and cutting plans, as well as various MATLAB functions for nonlinear optimization. The chapter concludes with an application in the hydrocarbons field, detailing constraints and optimal transportation plans for crude oil networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Chapter 2: Optimization with implementation in MATLAB

2.1. Linear programming

 The general form

max⁡(⁡𝑜𝑟 min)⁡∑ f T ∗ X
Subject to constraints
𝐴𝑋 ≤ 𝑏 … … 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑒𝑑⁡𝑖𝑛𝑒𝑞𝑢𝑎𝑙𝑖𝑡𝑦
{ 𝐴𝑒𝑞 = 𝑏𝑒𝑞 … … . 𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑒𝑑⁡𝑒𝑞𝑢𝑎𝑙𝑖𝑡𝑦
𝑙𝑏 ≤ 𝑋 ≤ 𝑢𝑏 … … 𝑏𝑜𝑢𝑛𝑑⁡𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠⁡𝑜𝑛⁡𝑡ℎ𝑒⁡𝑑𝑒𝑐𝑖𝑠𝑖𝑜𝑛⁡𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠

Numerical example 1

 Posed problem: A production company produces two types of products (P1 and P2) using
three different types of raw materials (m1, m2 and m3), with the following distribution:

P1 P2 Availability in stock
M1 2 1 800
M2 1 2 700
M3 0 1 300

Question: Establish an optimal production plan knowing that the unit prices of production are
respectively: 4 thousand DA and 5 thousand DA.

 Modelization
Here, we seek to maximize the total cost (maximize the profit)
We denote P1 by x1 and P2 by x2

max⁡(4𝑥1 + 5𝑥2 )
𝑠𝑢𝑏𝑗𝑒𝑐𝑡⁡𝑡𝑜
2𝑥1 + 𝑥2 ≤ 800
𝑥1 + 𝑥2 ≤ 700
𝑥2 ≤ 300
{ 𝑥1 , 𝑥2 , 𝑥3 ≥ 0
 MATLAB programming( in command window: with linprog function)

Remark: the linprog command is programmed only by a min objective. For this purpose, to
maximize it is enough to change the sign.

Numerical example 2:

 Posed problem: A valve manufacturing company has in stock a quantity of 500 pieces
of piping measuring (5mx12''). These must be cut into two types of pieces denoted by
A=2m and B=1.5m, to manufacture valves which require 3 units of A and 2 units of B.
Question: establish an optimal cutting plan.
 Modelization
- Here, we seek to minimize the falls (the faults) which is equivalent with to maximizing
the production.
- We denote by x1, X2 and X3 the numbers of cutting according to cases N°1, N°2 and
N°3 respectively.
- Finally, we obtain the following plan:

Cutting case denoted A=2m B=1.5m C={0, 0.5, 1}m


N°1 X1 2 0 1
N°2 X2 0 3 0.5
N°3 X3 1 2 0
Production X4 3 2

From the above table, we can establish the following mathematical model:
max⁡(𝑥4 ) max⁡(𝑥4 )
𝑠𝑢𝑏𝑗𝑒𝑐𝑡⁡𝑡𝑜 𝑠𝑢𝑏𝑗𝑒𝑐𝑡⁡𝑡𝑜
2𝑥1 + 0. 𝑥2 + 1. 𝑥3 ≥ 3𝑥4 −2𝑥1 − 0. 𝑥2 − 1. 𝑥3 + 3𝑥4 ≤ 0

0𝑥1 + 3. 𝑥2 + 2. 𝑥3 ≥ 2𝑥4 −0𝑥1 − 3. 𝑥2 − 2. 𝑥3 + 2𝑥4 ≤ 0
𝑥1 + 𝑥2 + 𝑥3 = 500 +𝑥1 + 𝑥2 + 𝑥3 = 500
{ 𝑋≥0 𝑋≥0
 MATLAB programming

Remark: here, we have used the integer function (intlinprog), because the variables are
integers.
Finally, we will produce 166 products with this optimal solution.

2.2. Nonlinear optimization

In this section we’ll investigate 04 types of MATLAB functions:

1) fminbnd : for solving nonlinear optimization with only one decision variable(function
of a single variable).
2) fminsearch : for solving nonlinear optimization without constraints (unconstrained
problem). However the ‘’fminsearch’’ is not performing well in high dimensional
space (is performing only for lower dimensions. For example at must three decisions
variables).
3) fminunc: for unconstrained problem. The ‘’fminuc’’ is generally batter than
‘’fminsearch’’ .
4) fmincon: for constrained problem ( with constraints).

2.2.1. Optimization of function of one variable without constraints

 Theatrical frame:
Let 𝑓: 𝐷 ⊆ 𝑅𝑛 → 𝑅 be function of class 𝐶 2 . If 𝑥 ∗ ∈ 𝑅 is critical point
( i.e. ∇𝑓(𝑥 ∗ ) = 0) and 𝐻𝑓(𝑥 ∗ ) is positive, then 𝑥 ∗ is local minimum
Example: min 𝑓 (𝑥 ) = 𝑥 3 − 5𝑥 + 1
𝑥

 First, let’s plot and define this function

 search of local minimum on for example [-1,5]

Moreover, we can use also ‘’fminsearch’’ to find of solutions of this function

 Let’s see the documentation of ‘’fminsearch’’


 We use ‘’fminsearch’’ with initial value

 Then, we can use also ‘’fminunc’’

2.2.2. Optimization of function of two variables without constraints

Let’s define anathor optimization problem of two variables, for example we take ‘’ROSENBROCK
function’’ as follows

𝑓(𝑥1 , 𝑥2 ) = 100 ∗ (𝑥2 − 𝑥12 )2 + (1 − 𝑥1 )2


Let’s plot the surface (x1,x2,f): on the domain [0, 2] x [0, 2] with a mesh of length h=0.2
( discretization)

For optimization, we use fminsearch or fminunc ( not fminbnd)

Remark: for plot we use (x, y f) must b a matrix not scalar. But for optimization we use x(1) and
x(1) be scalar.

2.2.3. Nonlinear optimization with constraints

Example1: We assume a reservoir of box form with volume v=x*y*z, as follows


We want to maximize the tank volume as a function of (x, y and z) with knowing that the
surface area of the materials to be stored does not exceed 150 m*m. We give s=2(xy+xz+yz)
We seek the optimal (x, y,z) which satisfies the following model

max (𝑥𝑦𝑧)
(𝑥,𝑦,𝑧)
𝑠𝑢𝑏𝑗𝑒𝑐𝑡⁡𝑡𝑜
𝑠 ≤ 150
{ 𝑥, 𝑦, 𝑧 ≥ 0

 Mtalab programming with ‘’fmincon’’


 Let’s Let’s see the documentation of ‘’fmincon’’
We use the syntax: x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon), such that ‘’nonlcon’’ means
nonlinear constraints ( i.e. C and ceq victors)

But, we know that the functions are programmed only by the min command not max. to
transform this into max, simply change the sign of the objective function:
Now if we add another constraint as follows:

max (𝑥𝑦𝑧)
(𝑥,𝑦,𝑧)
𝑠𝑢𝑏𝑗𝑒𝑐𝑡⁡𝑡𝑜
𝑠 ≤ 150
2𝑦 − 𝑧 ≤ 0
{ 𝑥, 𝑦, 𝑧 ≥ 0

It’s just add a vector ( 2*x(2)-x(3) ) of this constraint in the function ’’mycons’’
*************Application in the hydrocarbons field******************
Problem1 :( Optimization of collection networks (from production to storage):
We consider a synoptic diagram of the transport network of crude oil hydrocarbons (or
condensate) from the production point (for example, oil drilling in southern, Algeria) to the
storage point or demand points towards the northern network.
We seek to establish the optimal transportation plan. In other words, calculate the following
optimal quantities:
 𝑝𝑖 ⁡ Optimal production of crude oil to produce from a deposit (i), [⁡(𝑚 3 /𝑑𝑎𝑦)]
 𝑓𝑐𝑗⁡ Optimal flow (volume flow) of oil on pipe (j) of a collection network, [(𝑚 3 /𝑑𝑎𝑦)].
 𝑓𝑚𝑙⁡ Optimal flow (volume flow) of oil on pipe (l) of a main network, [(𝑚 3 /𝑑𝑎𝑦)].
 𝑞𝑡𝑘 Optimal amount of treatment to treat in a treatment center k (k).
 𝑞𝑠𝑚 Optimal quantity to store in a storage bin HEH.
 𝑑𝑚 Optimal demand for crude oil or condensate to be evacuated towards demand
points.
We therefore seek to determine quantities by minimizing the total cost and respecting certain
constraints for the proper functioning of the transport network.

 The constraints to be respected

1- Constraint on production capacity: For any deposit fixed (i), the production quantity must be
less than or equal to its maximum production and greater than its minimum production.

𝑝𝑚𝑖𝑛 ≤ 𝑝𝑖 ≤ 𝑝𝑚𝑎𝑥 ,⁡⁡⁡⁡⁡∀𝑖 = 1, … , 𝐼.

2- Constraints relating to transport capacities in a collection network: The quantity


transported via each fixed pipe (j) of the collection network must be less than or equal to its
transport capacity.

𝑓𝑐𝑗 ≤ 𝐹𝑐𝑗 ,⁡⁡⁡⁡⁡∀𝑗1, … , 𝐽.

3- Processing (treatment) capacity constraints: The quantity processed by each processing


center set (k), must be less than or equal to its overall processing capacity.

𝑞𝑡𝑘 ≤ 𝑄𝑡𝑘 ,⁡⁡⁡⁡∀𝑘 = 1, … , 𝐾.


4- Constraints on oil transport capacities in the main network: The quantity of oil transported
in each fixed main pipe (l), must be less than or equal to its maximum transport capacity.

𝑓𝑚𝑙 ≤ 𝐹𝑚𝑙 ,⁡⁡⁡⁡⁡∀𝑙 = 1, … , 𝐿

5- Storage capacity constraints: the quantity of oil stored in each fixed storage point (m), must
be less than or equal to its maximum storage capacity.

𝑞𝑠𝑚 ≤ 𝑄𝑠𝑚 ,⁡⁡⁡⁡⁡𝑚 = 1, … , 𝑀.

6- Constraints relating to Production-processing:

6.1- The total capacity of the collection network must be capable of transporting all the quantities
possibly produced by all the production fields (production deposits). This can be expressed
by the quantities as follows:

∑𝐽𝑗=1 𝑓𝑐𝑗 ≥ ∑𝐼𝑖=1 𝑝𝑖 .

6.2- The total capacity of the processing centers must be able to process any quantity transported
by the collection network. This can be expressed as follows:

𝐾 𝐽

∑ 𝑞𝑡𝑘 ≥ ∑ 𝑓𝑐𝑗
𝑘=1 𝑗=1

7- Constraints relating to transport-processing: the total capacity of the main network pipes
must be capable of evacuating all the quantities treated in the treatment center. This can be
expressed as follows:

𝐿 𝐾

∑ 𝑓𝑚𝑙 ≥ ∑ 𝑞𝑡𝑘
𝑙=1 𝑘=1

8- Constraints relating to transport-storage: The total capacity of the storage tanks (HEH) must
be capable of storing all the quantities evacuated by the main network. This can be
expressed as follows:
𝑀 𝐿

∑ 𝑞𝑠𝑚 ≥ ∑ 𝑓𝑚𝑙
𝑚=1 𝑙=1

9- Constraints relating to Production-Storage: The total capacity of the storage tanks (HEH)
must be capable of storing all the quantities produced in the deposits.
𝑀 𝐼

∑ 𝑞𝑠𝑚 ≥ ∑ 𝑝𝑖
𝑚=1 𝑖=1

10- Market demand constraints: The quantity stored in all (HEH) storage points must satisfy
market demand as much as possible.
𝑀 𝑁

∑ 𝑞𝑠𝑚 ≥ ∑ 𝛼𝑛 𝐷𝑛
𝑚=1 𝑛=1
𝑀 𝑁

∑ 𝑞𝑠𝑚 ≥ ∑ 𝑑𝑛
𝑚=1 𝑛=1

where 𝐷𝑛 is given the demand for crude oil or condensate from each demand point (n)
and 𝛼𝑛 ⁡𝑖𝑠⁡the minimum rate (probability) of demand for crude oil or condensate at demand point
n.

 The objective function:

We seek to minimize the sum costs of production, processing, transport on the collection
network, storage and transport via the main network, in order to satisfy the demand for crude
(refining and export).

𝐼 𝐽 𝐿 𝐾

min [(∑(𝑐𝑝𝑖 . 𝑝𝑖 )) + (∑(𝑐𝑓𝑐𝑗 . 𝑓𝑐𝑗 )) + (∑(𝑐𝑓𝑚𝑙 . 𝑓𝑚𝑙 )) + (∑(𝑐𝑞𝑡𝑘 . 𝑞𝑡𝑘 ))


on⁡all⁡variables
𝑖=1 𝑗=1 𝑙=1 𝑘=1
𝑀

+ ( ∑ (𝑐𝑞𝑠𝑚 . 𝑞𝑠𝑚 ))]


𝑚=1
where (𝑐𝑝𝑖 , 𝑐𝑓𝑐𝑗 , 𝑐𝑓𝑚𝑙 , 𝑐𝑞𝑡𝑘 , 𝑐𝑞𝑠𝑚 )are unit costs

Finally, we obtain the general model for our problem as follows:

𝐼 𝐽 𝐿 𝐾

min [(∑(𝑐𝑝𝑖 . 𝑝𝑖 )) + (∑(𝑐𝑓𝑐𝑗 . 𝑓𝑐𝑗 )) + (∑(𝑐𝑓𝑚𝑙 . 𝑓𝑚𝑙 )) + (∑(𝑐𝑞𝑡𝑘 . 𝑞𝑡𝑘 ))


on⁡all⁡variables
𝑖=1 𝑗=1 𝑙=1 𝑘=1
𝑀

+ ( ∑ (𝑐𝑞𝑠𝑚 . 𝑞𝑠𝑚 ))]


𝑚=1
Subject to
𝑝𝑚𝑖𝑛 ≤ 𝑝𝑖 ≤ 𝑝𝑚𝑎𝑥 ,⁡⁡⁡⁡⁡∀𝑖 = 1, … , 𝐼.
𝑓𝑐𝑗 ≤ 𝐹𝑐𝑗 ,⁡⁡⁡⁡⁡∀𝑗1, … , 𝐽.
𝑞𝑡𝑘 ≤ 𝑄𝑡𝑘 ,⁡⁡⁡⁡∀𝑘 = 1, … , 𝐾.
𝑓𝑚𝑙 ≤ 𝐹𝑚𝑙 ,⁡⁡⁡⁡⁡∀𝑙 = 1, … , 𝐿
𝑞𝑠𝑚 ≤ 𝑄𝑠𝑚 ,⁡⁡⁡⁡⁡𝑚 = 1, … , 𝑀.
𝐽 𝐼

∑ 𝑓𝑐𝑗 ≥ ∑ 𝑝𝑖
𝑗=1 𝑖=1
𝐾 𝐽

∑ 𝑞𝑡𝑘 ≥ ∑ 𝑓𝑐𝑗
𝑘=1 𝑗=1
𝐿 𝐾

∑ 𝑓𝑚𝑙 ≥ ∑ 𝑞𝑡𝑘
𝑙=1 𝑘=1
𝑀 𝐿

∑ 𝑞𝑠𝑚 ≥ ∑ 𝑓𝑚𝑙
𝑚=1 𝑙=1
𝑀 𝐼

∑ 𝑞𝑠𝑚 ≥ ∑ 𝑝𝑖
𝑚=1 𝑖=1
𝑀 𝑁

∑ 𝑞𝑠𝑚 ≥ ∑ 𝛼𝑛 𝐷𝑛
𝑚=1 𝑛=1
𝑀 𝑁

∑ 𝑞𝑠𝑚 ≥ ∑ 𝑑𝑛
𝑚=1 𝑛=1
{ (𝑐𝑝𝑖 , 𝑐𝑓𝑐𝑗 , 𝑐𝑓𝑚𝑙 , 𝑐𝑞𝑡𝑘 , 𝑐𝑞𝑠𝑚 ) ≥ 0

We note that the model obtained is a linear optimization model with constraints.

 Problem data:

The table below gives the data fixed for our problem posed

Notation Designation
The sets
I=9 Number of oil fields ( deposits)
J=07 Number of pipes in the collection network
K=6 Number of treatment ( processing) center
L=6 Number of pipes in the principal (main) network
M=7 Number of storage bins ( tanks)
N=3 Number of demand points
The capacities
[𝑝𝑚𝑎𝑥 , 𝑝𝑚𝑖𝑛 ] Minimum and maximum of production for each deposit (i)
𝐹𝑐𝑗 = {3, 5,2,4,7,6,4}⁡ Maximum flow of crude oil or condensate from the pipe (j) in
Thousand 𝑚 3 /𝑑𝑎𝑦 the collection network.
𝑄𝑡𝑘 = {10, 1,20,5,10,5}⁡ maximum capacity of each processing center (k)
Thousand 𝑚 3 /𝑑𝑎𝑦
𝐹𝑚𝑙 = {10, 20,5,7,12,10} Maximum flow of crude oil or condensate from the pipe (l) in
Thousand 𝑚 3 /𝑑𝑎𝑦 the main network.
𝑄𝑠𝑚 = {12,10,13,9,11,20,20} maximum storage capacity for each storage tank (m)
Thousand 𝑚 3 /𝑑𝑎𝑦
𝐷𝑛 = {20, ; 17, 15} The demand for crude oil or condensate from each demand
Thousand 𝑚 3 /𝑑𝑎𝑦 point (n)
unit costs
𝑐𝑝𝑖 = {𝑜𝑛⁡𝑎𝑣𝑒𝑟𝑎𝑔𝑒⁡94⁡𝑑𝑜𝑙𝑙𝑎𝑟𝑠 Unit cost of production of crude oil or condensate from the
/𝑚 3 } reservoir ( deposit) (i)
𝑐𝑓𝑐𝑗 = {𝑜𝑛⁡𝑎𝑣𝑒𝑟𝑎𝑔𝑒⁡15⁡𝑑𝑜𝑙𝑙𝑎𝑟𝑠 Cost of transporting one cubic meter of crude oil or condensate
/𝑚 3 } from the pipe (j) in the collection network.
𝑐𝑓𝑚𝑙 Cost of transporting one cubic meter of crude oil or condensate
= {𝑜𝑛⁡𝑎𝑣𝑒𝑟𝑎𝑔𝑒⁡18⁡𝑑𝑜𝑙𝑙𝑎𝑟𝑠/𝑚3 } from the pipe (l) in the main network.
𝑐𝑞𝑡𝑘 = {𝑜𝑛⁡𝑎𝑣𝑒𝑟𝑎𝑔𝑒⁡20⁡𝑑𝑜𝑙𝑙𝑎𝑟𝑠 Cost of treatment one cubic meter of crude oil or condensate
/𝑚3 } from the treatment center (k).
𝑐𝑞𝑠𝑚 = {𝑜𝑛⁡𝑎𝑣𝑒𝑟𝑎𝑔𝑒⁡5⁡𝑑𝑜𝑙𝑙𝑎𝑟𝑠 Cost of storage of one cubic meter of crude oil or condensate
/𝑚 3 } from the storage tank (m).

Note that the average price of oil production is 15 dollars for 1 barrel. Since we know that 1 barrel =
159 liters then the average price of oil production is 94 dollars/m3.

 Programming in MATLAB
Optimization using G.A.

For difficult optimization problems (large numbers of variables or infinite-dimensional equations, or


multi-objectives, etc.), it is advisable to apply heuristic algorithms which are suitable for this type of
problem.

Problem 1 (Transportation problem)

 What is transportation problem?

It is a linear program, which can be described as follows:


We assume on the one hand a set of producers (or warehouse or something like suppliers (providers)
and on the other hand a set of consumers (or customers), as indicated in the figure below
𝑥11

The objective is to minimize the total transport cost while respecting demand constraints and
production capacities. Then the model can be defined as follows:

𝑁 𝑀
min ∑ ∑ 𝐶𝑖𝑗 𝑥𝑖𝑗
𝑥𝑖𝑗 𝑖=1 𝑗=1
Subject to
𝑀
∑ 𝑥𝑖𝑗 ≤ 𝑝𝑖⁡⁡ ⁡𝑓𝑜𝑟⁡𝑒𝑎𝑐ℎ⁡𝑖 = 1, … 𝑁,⁡⁡⁡⁡constraints⁡on⁡production⁡capacity⁡
𝑗=1

𝑁
∑ 𝑥𝑖𝑗 ≥ 𝑑𝑗⁡⁡ ⁡𝑓𝑜𝑟⁡𝑒𝑎𝑐ℎ⁡𝑗 = 1, … 𝑁,⁡⁡⁡𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠⁡𝑜𝑛⁡𝑠𝑎𝑡𝑖𝑠𝑓𝑦𝑖𝑛𝑔⁡𝑑𝑒𝑚𝑎𝑛𝑑⁡
𝑖=1

𝑥𝑖𝑗 ≥ 0

 Numerical example:
We apply the transport model in hydrocarbon transport (in the collection network). We set the
number of producers N=2 (here it concerns the wells) and the number of suppliers M=3 (here it
concerns the treatment center).

min 𝑓 𝑇 𝑋 ⟺ min(1⁡2⁡3⁡2⁡4⁡1) ∗ 𝑋
𝑋 𝑋
Subject to
𝑥11
1 1 1 0 0 0 900
𝑥12
0 0 0 1 1 1 800
𝑥13
−1 0 0 −1 0 0⁡ ≤ −500
0 −1 0 0 −1 0 𝑥21
−600
(0 0 −1 0 0 −1 ) (𝑥22) (−300)
𝑥23
 Matlab programming ( first method)

 Second method ( using G.A)

Using Optimization Tool


We compare the results of two methods: the first method uses an exact algorithm (linear
programming) so it gives exact results compared to the genetic method which gives approximate
results. However, the advantage of the genetic method is very useful for very large (difficult)
problems, unlike the first method.

Remark: For the genetic method, we can have several solutions by modifying the parameters in
the options.

 Example of a multi-objective problem


𝐦𝐢𝐧 𝒇𝟏 (𝒙𝟏 , 𝒙𝟐 ) = 𝟒𝒙𝟐𝟏 + 𝟒𝒙𝟐𝟐
(𝒙𝟏,𝒙𝟐 )
{
𝐦𝐢𝐧 𝒇𝟐 (𝒙𝟏 , 𝒙𝟐 ) = (𝒙𝟏 − 𝟓)𝟐 + (𝒙𝟐 − 𝟓)𝟐
(𝒙𝟏 ,𝒙𝟐 )

Subject to
(𝒙𝟏 − 𝟓)𝟐 − 𝒙𝟐𝟐 − 𝟐𝟓 ≤ 𝟎
−(𝒙𝟏 − 𝟖)𝟐 − (𝒙𝟐 + 𝟑)𝟐 + 𝟕. 𝟕 ≤ 𝟎
𝟎 ≤ 𝒙𝟏 ≤ 𝟓
{ 𝟎 ≤ 𝒙𝟐 ≤ 𝟑

 Matlab implementation (using Optimization Tool with G.A)

Step1: multi-objective programming

 Example 2: Optimization of a gas pipeline (Nonlinear optimization with nonlinear


constraints).
o Posed problem:
In this exercise, we are interested in establishing an optimal installation plan for a gas
pipeline which gives an optimal configuration (combination) between the diameter and the
number of compression stations (compression energy) while minimizing project costs.

 Mathematical model:
 The variable of problem:
𝑑𝑖 : The diameter of the section pipe (i)

1⁡⁡if⁡we⁡decide⁡to⁡install⁡a⁡compression⁡station⁡in⁡the⁡pipe⁡section⁡(i)⁡
𝑋𝑖 = {
0⁡⁡Otherwise⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡

 Objective function: The main objective is to minimize the total cost of gas pipeline
construction:
This cost is divided into two parts

Part 1: For the pipeline part (mechanical, civil engineering and telecommunication) :

1- Purchasing and supply of pipe


𝐶𝑝𝑖𝑝𝑒 (𝑑𝑖 ):⁡Consists of the cost of purchasing and supply of pipe depending on its
diameter (𝑑𝑖 ).
We give 𝐶𝑝𝑢𝑟 (𝑑𝑖 ) = 0.025 ∗ (𝑑 − 𝐸𝑑 ) ∗ 𝐸𝑑 ∗ 𝐿 ∗ 𝑐𝑚𝑚
Where 𝐸𝑑 is the thickness of a diameter, 𝐿 : is the length of the pipe section and 𝑐𝑚𝑚 :
the unit price per metric mass.

2- Transport of pipe
𝐶𝑤𝑒𝑙𝑑𝑖𝑛𝑔 (𝑑𝑖 ) = 6 ∗ 𝐿 ∗ 𝑑
3- Welding, coating and radiography of pipe: this cost is estimated by the following
formula
𝐶𝑤𝑒𝑙𝑑𝑖𝑛𝑔 (𝑑𝑖 ) = 35 ∗ 𝐿 ∗ 𝑑
4- Trenching and pipe laying

𝐶𝑙𝑎𝑦𝑖𝑛𝑔 (𝑑𝑖 ) = 15 ∗ 𝐿 ∗ 𝑑
5- Cathodic protection
𝐶𝑐𝑝 (𝑑𝑖 ) = 1.1 ∗ 𝐿 ∗ 𝑑

6- Optical fiber and telecommunications


𝐶𝑜𝑓 (𝑑𝑖 ) = 17 ∗ 𝐿 ∗ 𝑑

7- Hydrostatic test

𝐶ℎ𝑦𝑑𝑟𝑜 (𝑑𝑖 ) = 22 ∗ 𝐿 ∗ 𝑑

In summary we can estimate the total cost of pipeline according to (L and d) as follows
𝑁

𝐶𝑝𝑖𝑝𝑒𝑙𝑖𝑛𝑒 (𝑑𝑖 ) = ∑ 128.11. 103 (𝐿𝑖 ∗ 𝑑𝑖 ) , 𝐿⁡𝑖𝑛⁡𝑘𝑖𝑙𝑜𝑚𝑟𝑡𝑒𝑟, 𝑁⁡𝑖𝑠⁡𝑛𝑢𝑚𝑏𝑒𝑟⁡𝑜𝑓⁡𝑠𝑒𝑐𝑡𝑖𝑜𝑛⁡


𝑖=1

Part 2: Compressor stations : The cost of a compressor station is made up of two terms:
-A fixed term including construction (civil engineering and infrastructure...etc. It is
estimated at $90 million:
- A variable term which depends on the power required.

First, we calculate the station compression power by the following formula:

𝑊𝑖 = 𝑘 ∗ 𝑄 ∗ ln(𝑃𝑟/𝑝𝑎 )2 … … . (1)

where
K: constant compression power;
Q: Gas flow rate (m3/h)
Pd: the discharge pressure of the compressor station
Ps: the suction pressure of the compressor station

Note that, the suction pressure is on the inlet and the discharge pressure is at the outlet of a
compressor.
The flow is assumed to be permanent and the variables p (pressure) and u (velocity) are uniform
in a straight section of the pipe.
Based on the fundamental law of dynamics and by applying the generalized BERNOULLI equation
for section i), we obtain the pressure loss equation (Pressure Drop Formula) between the pipeline
inlet pressure and pipeline outlet pressure in section (i) as follows:

 non-horizontal case (dh/dx≠0) , ie. ∆ℎ ≠ 0

𝑒 𝑆 − 1 16 𝑇𝑚 𝑄0
𝑃𝑖2 (𝑖𝑛𝑙𝑒𝑡) − 𝑒 𝑆 . 𝑃𝑖2 (𝑜𝑢𝑡𝑙𝑒𝑡) = ( ) 2 𝜌0 𝑃0 𝑍𝑚 𝜆𝑚 5 𝐿𝑖
𝑠 𝜋 𝑇0 𝑑𝑖
𝜌0 𝑇0 𝑔
𝑤𝑖𝑡ℎ⁡⁡⁡⁡⁡𝑠 = 2. ∆ℎ
𝑃0 𝑍𝑚 𝑇𝑚

Where
𝜌0 : Mass density under reference conditions (0° c:1 bar) =0.8 kg/m3
𝑃0 ⁡Pressure under reference conditions =1.013125 bar.
𝑇𝑚 ⁡Average temperature (kelvink), for example 288.7056 k°
𝑇0 Temperature under reference conditions =273.15 𝑘 0
𝑍𝑚 Average compressibility coefficient=0.9
𝜆𝑚 Average friction coefficient of the section 0.00015
𝑄0 Mass flow rate of the gas calculated under normal conditions 1500⁡𝑚 3 /ℎ

Also, we can deduce the following relationship

1 𝑒 20.5∆ℎ − 1 2.775. 𝐿𝑖
𝑃𝑖 (𝑜𝑢𝑡𝑙𝑒𝑡) = 𝑓(𝐷𝑖 , 𝑃𝑖 (𝑖𝑛𝑙𝑒𝑡)) = √ 20.5∆ℎ (𝑃𝑖2 (𝑖𝑛𝑙𝑒𝑡) − ( ) ) … … … (2)
𝑒 20.5∆ℎ 𝜋 2 𝑑𝑖5

Using the relationship (2), the station compression power becomes as follows
2
𝑊𝑖 = 𝑘 ∗ 𝑄 ∗ ln (𝑃𝑖 (𝑖𝑛𝑙𝑒𝑡)/𝑓(𝐷𝑖−1 , 𝑃𝑖−1 (𝑖𝑛𝑙𝑒𝑡))) … … . (1)

The cost of a station equal to the number of turbines (Nt) times the unit price of a turbine.
Unit price of a turbine is estimated based on the average power of a turbine (𝑝𝑡 =23 MW):

Finally, we have
𝐶𝑠𝑡𝑎𝑡𝑖𝑜𝑛 = (𝑁𝑡 ∗ 11.5. 106 ) + 91⁡$

𝑊𝑖 1
where 𝑁𝑡 = 𝑝 = 24 (𝑊𝑖 )
𝑡+1

You might also like