Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

A ROBUST GASOLINE RECIPE UNDER NONLINEAR MIXING RULE AND

UNCERTAINTIES

A THESIS

Presented to the University Honors Program

California State University, Long Beach

In Partial Fulfillment

of the Requirements for the

University Honors Program Certificate

Loren dela Rosa

May 2020
I, THE UNDERSIGNED MEMBER OF THE COMMITTEE,

HAVE APPROVED THIS THESIS

A ROBUST GASOLINE RECIPE UNDER NONLINEAR MIXING RULE AND

UNCERTAINTIES

BY

Loren dela Rosa

Yu Yang, Ph.D. (Thesis Advisor) Chemical Engineering Department

California State University, Long Beach

May 2020

ii
ABSTRACT

A ROBUST GASOLINE RECIPE UNDER NONLINEAR MIXING RULE AND

UNCERTAINTIES

By

Loren dela Rosa

May 2020

A scenario-based optimization approach is developed to acquire robust blending recipes

for gasoline productions that suffer from significant variability in feedstock quality. The

proposed method considers nonlinear correlations to estimate the octane number of gasoline,

uses Monte Carlo method to simulate variations in properties of feedstocks, and develops a

sequential approach with reduced relative gap threshold to obtain a near-global optimal solution.

This framework offers three advantages: First, introducing nonlinear functions into the

optimization provides a more realistic representation of the blending process, which in turn

improves prediction on key properties of the blend. Second, accounting for uncertainty in model

parameters obtains a solution with best expected quality under several possible conditions,

therefore reducing the probability of re-blending for off-specification gasoline. Third, the

sequential algorithm determines the near-global optimal solution faster than directly using a

state-of-the-art optimization software. A case study with 9 feedstocks and 2 desired grades of

gasoline is presented to demonstrate the effectiveness of the proposed method.

iii
ACKNOWLEDGMENTS

To my parents, thank you for your undying love and support. I hope I can continue to

make you proud and set a good example for my siblings.

To Dr. Yu Yang, thank you for giving me the opportunity to work with you on this

project, as well as several other projects. I am also grateful to you for making my doctoral

studies in Chemical Engineering a reality. I am humbled by your kindness and generosity.

To Jared Jetter, thank you for always believing in me, even at times when I did not

believe in myself. You taught me to never settle for anything less than what I deserve. Because

of you, I will continue to dream big and work hard.

To the CSULB Office of Research and Sponsored Programs, thank you for granting me

the highly competitive and prestigious 2019 CSULB Summer Student Research Award, and for

allowing me to compete in the 2020 CSULB Student Research Competition. You have given me

a platform for funding and sharing scientific discoveries.

To the CSULB Chemical Engineering faculty, thank you for giving me the tools that I

need to become a successful chemical engineer. It has been an honor learning from you and

exchanging laughs with you.

To the CSULB Engineering Honors Program and University Honors Program, thank you

for allowing me to share my research work with the public. May my honors thesis inspire people

to pursue STEM careers and engage in scholarly research, so that they may be properly equipped

to help solve the world’s toughest challenges.

At ang pinakamahalaga sa lahat, salamat sa Iyo Panginoon sa lahat ng biyaya at

pagsubaybay sa akin. Inaalay ko po sa Iyo ang aking tagumpay.

iv
TABLE OF CONTENTS

Page

ABSTRACT.................................................................................................................................. iii

ACKNOWLEDGMENTS ............................................................................................................ iv

LIST OF TABLES ........................................................................................................................ vi

CHAPTER

1. INTRODUCTION ............................................................................................................ 1

2. PROBLEM FORMULATION.......................................................................................... 3

3. SCENARIO-BASED OPTIMIZATION APPROACH .................................................... 6

4. CASE STUDY .................................................................................................................. 10

5. CONCLUSION ................................................................................................................. 16

REFERENCES ............................................................................................................................. 17

v
LIST OF TABLES

TABLE Page

1. Nominal Feed Properties................................................................................................... 10

2. Feedstock Availability ...................................................................................................... 10

3. Product Specifications ...................................................................................................... 10

4. Results of (SP1) ................................................................................................................ 14

5. Solution Time of Each Iteration ........................................................................................ 14

6. Blending Recipe ................................................................................................................ 15

vi
CHAPTER 1

INTRODUCTION

Gasoline, one of the largest-volume products of refineries, is a major revenue generator

for the oil industry. It is produced by mixing several feedstocks in accordance to a pre-defined

recipe in a blender system. With increasingly stringent fuel standards, the gasoline produced

must have optimal engine performance and satisfy all environmental regulations. Producers must

achieve a good balance between product quality and expenses to prevent unnecessary costs that

can significantly reduce their profitability. Hence, optimization techniques must be applied to

gasoline blending operations to effectively determine how much of each feedstock must be

allocated to each blend so that product specifications are met, and total profit is maximized.

In the last decade, linear programming (LP) and mixed-integer linear programming

(MILP) have been used to determine robust gasoline recipes for gasoline blending processes.

Despite LP and MILP’s ability to reduce computing efforts, these methods rely on linear

blending assumptions to predict gasoline properties [1]. Because of this, they may not be

applicable to the prediction of gasoline’s octane number, which has non-linear dependence on

blend composition. Therefore, nonlinear blending models must be used instead of conventional

linear models to improve estimation of gasoline properties [2].

Besides improving gasoline blending prediction models, uncertainty in feed properties

must also be considered in the optimization to reduce the probability of re-blending for

unqualified products. The uncertainty in feed properties is caused by fluctuations that occur in

refinery operating conditions, such as temperature, pressure, and catalyst activities. Furthermore,

feed properties are difficult to measure in real time due to inherent variability of measurement

devices [3]. If uncertainties are not considered in the blending model, such that the model solely

1
relies on nominal parameters, then a mismatch between the process model and practical

production occurs, and the resulting gasoline could be off-specification [4]. Several approaches

have since been proposed to handle uncertainty in blending optimization. For example, chance-

constrained programming (CCP) guarantees that constraints under uncertainties are satisfied to a

high probability [5],[6],[7]. CCP is non-conservative, but is difficult to solve, especially when it

has nonconvex terms. Robust optimization (RO) is another methodology that can handle

uncertainties. RO finds a solution with an “acceptable” performance under most realizations of

the uncertainty inputs. The robust optimization community is currently investigating ways to

incorporate probabilistic guarantees in RO to reduce conservativeness [8],[9],[10].

In this paper, a gasoline blending recipe that satisfies probabilistic quality constraints are

achieved as follows: First, the nonlinear octane prediction model is incorporated in the gasoline

blending model. Second, Monte Carlo simulation is used to generate stochastic constraints,

which are then integrated with the nominal model to resemble fluctuations of feedstock

properties. Third, a sequential optimization algorithm is proposed to reduce problem size and

obtain a robust blending recipe within a short time period.

The rest of this paper is organized as follows: the problem formulation is outlined in

Chapter 2. The proposed solution is discussed in Chapter 3. The case study is presented in

Chapter 4. Lastly, conclusions are drawn in Chapter 5.

Notation. Throughout this paper, vectors (matrices) are denoted by lowercase

(uppercase) boldface letters.

2
CHAPTER 2

PROBLEM FORMULATION

Refinery blending is the final opportunity to maximize production profit and ensure that

the resulting blend will satisfy all product specifications. In this paper, the nonlinearity of

blended octane and uncertainty in feed properties are accounted for in the blending model.

An optimization formulation of the gasoline blending problem is shown below:

where 𝑥 is the decision variable, and is used to represent the volume of the gasoline blend; 𝐾𝑖,𝑗 is

the profit acquired from gasoline 𝑖 that was prepared using feedstock 𝑗; there are 𝐿 products and

𝐼 feedstocks; g refers to deterministic constraints; h represents constraints incorporating

parametric uncertainty 𝜽; both g and h can be non-convex; z is the total profit, which is desired

to be maximized.

Besides maximizing refinery profitability, satisfying constraints must also be prioritized

when determining the optimal gasoline blending recipe. Blending optimization is subject to

different types of constraints, but typically include the following:

Product Property Constraint – this refers to fuel standards that the gasoline must

comply to. Specifications may be imposed on the gasoline’s density, Reid Vapor Pressure

(RVP), sulfur content and octane number, among other things [11].

3
Component Volume Availability Constraint – this refers to the finite volume of

feedstocks that are available for gasoline blending operations [11].

Blend Volume Constraint – this requires the total volume of the gasoline to be above

and/or below a specified quantity [11].

Among all gasoline properties, the octane number shows significant nonlinearity in the

blending. Let 𝑟𝑗 , 𝑚𝑗 , 𝑠𝑗 , 𝑜𝑗 and 𝑎𝑗 denote the research octane number (RON), motor octane

number (MON), sensitivity, olefin and aromatic content of feedstock 𝑗, respectively. Then, the

RON of the gasoline blend is calculated using the formula below [12]:

∑𝑗 𝑥𝑖,𝑗 𝑟𝑗
where 𝑅 is the RON of the produced gasoline; 𝑅1 = ∑𝑗 𝑥𝑖,𝑗
is the volume average of RON; 𝑅2 =

∑𝑗 𝑥𝑖,𝑗 𝑟𝑗 𝑠𝑗 ∑𝑗 𝑥𝑖,𝑗 𝑠𝑗
∑𝑗 𝑥𝑖,𝑗
is the volume average of product of RON and sensitivity; 𝐽𝑋 = ∑𝑗 𝑥𝑖,𝑗
is the volume

∑𝑗 𝑥𝑖,𝑗 𝑂𝑗 2
average of sensitivity; 𝑂1 = ∑𝑗 𝑥𝑖,𝑗
is the volume average of squared olefin content; 𝑂2 =

∑𝑗 𝑥𝑖,𝑗 𝑂𝑗 2 ∑𝑗 𝑥𝑖,𝑗 𝑎𝑗 2
( ∑𝑗 𝑥𝑖,𝑗
) is the square of volume average olefin content; 𝐴1 = ∑𝑗 𝑥𝑖,𝑗
is the volume average of

∑𝑗 𝑥𝑖,𝑗 𝑎𝑗 2
squared aromatic content; 𝐴2 = ( ∑𝑗 𝑥𝑖,𝑗
) is the square of volume average aromatic content;

𝐶1 , 𝐶2 , and 𝐶3 are the RON equation coefficients.

For the MON of the blend, the formula is as follows [12]:

4
∑𝑗 𝑥𝑖,𝑗 𝑚𝑗
where 𝑀 is the MON of the produced gasoline; 𝑀1 = ∑𝑗 𝑥𝑖,𝑗
is the volume average of MON; 𝑀2

∑𝑗 𝑥𝑖,𝑗 𝑚𝑗 𝑠𝑗
= ∑𝑗 𝑥𝑖,𝑗
is the volume average of product of MON and sensitivity; 𝐺1 , 𝐺2 , and 𝐺3 are the MON

equation coefficients.

The first term of Equations (1) and (2) represent linear blending, with three correction

terms added to account for the deviations that occur from linear mixing. The first additional term

is called the sensitivity function, and it serves as a correction of octane due to the change of

compression ratio after blending. The second and third additional terms account for the chemical

interactions that occur among the components of the blend [12].

The RON equation coefficients are [12]:

𝐶1 = 0.04307, 𝐶2 = 0.00061, and 𝐶3 = −0.00046

The MON equation coefficients are [12]:

𝐺1 = 0.04450, 𝐺2 = 0.00081, and 𝐺3 = −0.00645

The RON and MON coefficients were determined from a regression analysis of RON and

MON data from actual laboratory blends. The average of Equations (1) and (2) represents the

octane number of gasolines, which is required to be above specific values depending on the type

of gasoline being produced [12].

5
CHAPTER 3

SCENARIO-BASED OPTIMIZATION APPROACH

The solution to Problem (P) that satisfies constraints under all possible scenarios may be

too conservative or not exist [13]. To alleviate this conservatism, chance-constrained program

(CCP) is employed to soften the constraints of h:

where 𝜖 is the risk level, which indicates the probability of constraint violation and is normally

determined by refinery operators. Problem (CCP) solves the blending problem, with the resulting

gasoline products being on-specification by a probability greater than or equal to 1 − 𝜖 [3].

Using chance constraints can significantly increase refinery profitability while keeping the

quality loss within a tolerable range. Solving (CCP) is nontrivial, especially when it contains

nonconvex terms and θ is not normally distributed.

We propose a scenario-based approximation to (CCP):

6
where N is the number of scenarios generated; 𝜃𝑘 , ∀𝑘 ∈ {1,…,N} are independent and

identically distributed samples of uncertain parameters 𝜃. Before we can solve problem (SP1),

we need to determine the minimum value of N. Assuming that problem (P) can be convexified,

the following Lemma is introduced [14].

Lemma 1: The following condition for N must hold to guarantee that the near-global

optimal solution 𝑥 ∗ of (SP1) satisfies the chance constraints in (CCP) by a probability of 1 − 𝛽:

where 𝐷𝑥 is the dimension of the decision variable; 𝐷𝑦 is the number of newly introduced

variables for convex relaxation; 𝐷𝐸 is the number of equality constraints which can be eliminated

through substitutions; 𝛽 is the confidence parameter, which has a value of 10-6. In order to solve

Equation 3, problem (P) must first be convexified.

(SP1) is a large-scale, nonconvex optimization problem, mainly because it accounts for

the nonlinear nature of blended octane and uncertainty in feed properties. To reduce the

complexity of the problem, and to acquire the near-global optimal solution in a relatively short

period of time, a sequential algorithm is developed [15]:

7
where Ω is a set that contains only a few scenarios from N. The rational is that only a few

constraints are active at the local optimal solution. If these constraints can be identified, then we

could disregard other constraints to substantially reduce the time to find the near-global optimal

solution. The sequential approach starts by finding a solution to (SP2) that satisfies all of its

normal constraints, and one constraint that has arbitrarily been chosen to be in set Ω, referred to

as α0 . Initially, only α0 is present in Ω. The solution to (SP2) is then evaluated for all N

scenarios. The scenario with the largest constraint violation is added to Ω, and therefore become

active in (SP2). Every time a new scenario is added to Ω, a new solution for (SP2) will be

calculated until a solution that satisfies all N scenarios is found. The near-global optimal solution

to (SP2) is also the optimal solution to (SP1). However, it takes a shorter amount of time to find

the solution to (SP2) since it only considers a few scenarios in the optimization, compared to

(SP1) that accounts for all scenarios.

To solve (SP2), we employ a global-optimization solver SCIP 4.0 [16], which

simultaneously searches for the upper and lower bound solutions. The near-global optimal

solution is enclosed by these bounds. The relative gap is also calculated to characterize the

quality of each solution. The formula of relative gap is shown below:

A satisfied solution of (SP2) must have a relative gap that is smaller than a pre-specified

threshold 𝛾.

A summary of the sequential optimization scheme is provided below:

Step 1: Generate N scenarios and set a value for threshold 𝛾

Step 2: Randomly select one scenario α0 to be active in (SP2); Ω = α0

8
Step 3: In phase-I, solve (SP2) to find a local optimal solution that satisfies all of its nominal

constraints and scenarios within set Ω; In phase-II, solve a 𝛾-optimal solution

Step 4: Evaluate the resulting solution of (SP2) for all N scenarios

Step 5: Find the scenario with the largest constraint violation, denoted by 𝛼ℎ ,

Ω ← Ω ∪ {𝛼ℎ }, ℎ ← ℎ + 1. If αℎ = null, switch from phase-I to II, or from phase-II to

the algorithm termination

Repeat steps 3-5 until a solution that meets all constraints of N are found and the threshold 𝛾

reaches a value equal to or smaller than 10%. Compared to previous works [3],[14], this paper

develops a two-phase optimization method. Although our main objective is to determine the

near-global optimal solution, it is not necessary to find it in the early iterations because the active

scenarios are still being fully identified and global optimization for nonconvex programs is time

consuming. As more scenarios are added to set Ω, the threshold is decreased to force the solver to

search for a high quality solution. We found that the reduced threshold can substantially reduce

the computational time of the sequential optimization approach.

9
CHAPTER 4: CASE STUDY

A multi-product blending problem is solved using the proposed method. The problem is

as follows: A refinery needs to produce 2 gasoline products (𝐼 = 2) using nine feedstocks (𝐽 =

9). The nominal feed properties are listed in Table I, feedstock availability is listed in Table II,

and product specifications are mentioned in Table III. The blending optimization problem is

solved using GAMS 24.9.1 with global optimization solver SCIP 4.0, and local search solver

IPOPT [17]. The effectiveness of the proposed method is determined by comparing its results to

the results gained from the direct use of SCIP.

10
The total profit acquired from the production of the two gasoline products can be

mathematically expressed as:

where 𝐾𝑖,𝑗 is the profit acquired from gasoline 𝑖 that was prepared using feedstock 𝑗.

The gasoline products must fulfill constraints on product specification and volume

availability. Before we develop the constraints, it must be noted that the following assumptions

were made for this problem:

̶ Although most mixing operations are nonlinear, we only consider the nonlinear blending

of octane to provide a simple demonstration on how to deal with non-convex blending

constraints in the optimization. All other mixing processes are assumed to follow linear

mixing rule.

̶ Despite most property prediction models being prone to parameter uncertainty, the

density and RVP constraints will be based only on nominal parameters to simplify the

problem, while the prediction models of octane number and sulfur constraint will account

for parametric uncertainty.

It is also important to realize the following facts:

̶ Density and RVP are based on volume blending equations and

̶ Sulfur content are based on mass blending equations

̶ For this case study, we specify the risk level 𝜖 to be 5%.

̶ There are 26 independent variables and nonconvex terms, which tell us that 𝐷𝑥 + 𝐷𝑦 +

𝐷𝑧 = 26 in Lemma 1. Solving Lemma 1 gives us 𝑁 = 1224


11
The nominal constraints of density and RVP are shown below:

The sulfur constraint is provided below:

𝑘
where (𝜃𝑠𝑢𝑙 )𝑗 is normally distributed. The mean of its Gaussian distribution is the nominal value

of the sulfur content, and the standard deviation is specified to be 3% of the nominal value.

The octane constraint is shown below:

Here, 𝑅𝑘 refers to the RON of the blend using feedstocks from sample 𝑘; 𝑀𝑘 refers to the MON

of the blend using feedstocks from sample 𝑘. 𝑅𝑘 and 𝑀𝑘 are computed using Equations (1) and

12
(2), respectively. The uncertainties for Equations (1) and (2) are modeled by 𝑟𝑗 = 𝑟̅𝑗 +

(𝜃𝑜𝑐𝑡 )𝑗 and 𝑚𝑗 = ̅̅
𝑚̅̅𝑗 + (𝜃𝑜𝑐𝑡 )𝑗 , where 𝑟̅𝑗 and ̅𝑚
̅̅̅𝑗 represent the nominal value of RON and MON

of feedstock 𝑗, respectively. The uncertainty (𝜃𝑜𝑐𝑡 )𝑗 is Gaussian distributed with a mean of zero

0.01(𝑟̅𝑗 + ̅̅̅̅̅
𝑚𝑗)
and a standard deviation: .
2

The market capacity constraint is as follows:

where 𝑄1 = 50 × 103 bbl and 𝑄2 = 40 × 103 bbl.

The feedstock availability constraint is modeled as:

where 𝑇𝑗 = 10 × 103 bbl, ∀𝑗.

Formulating the blending problem in the form of (SP1), we have:

13
The solution obtained for (SP1-EXAMPLE) by the proposed method and the direct use of SCIP

are compared. For the sequential method, the initial threshold 𝛾 = 0.2. As the threshold reduced

to 0.1, eventually a solution that satisfies all constraints has been found, and the algorithm

terminates. For the method where SCIP is directly used, we let it run for an hour and recorded its

results. Comparison of results between the sequential optimization approach and direct use of

SCIP is shown in Table IV. For both methods, the same lower bound solution ($424,789) was

found by both methods fairly quickly. The majority of the solution time was spent searching for

the upper bound solution and reaching the threshold 𝛾. Referring to Table 4, it shows that SCIP

was not able to reduce the relative gap within an hour, whereas our sequential method achieved

10% relative gap in about forty minutes. In general, if the relative gap cannot be reduced, then

the quality of the solution cannot be guaranteed. It is worth noting that for each iteration, we

solve a near-global optimization problem with reduced 𝛾. The objective value for each iteration

of the sequential optimization approach is presented in Table V.

14
The resulting solution of the sequential approach is shown in Table VI. Finally, we need to verify

that the solution in Table VI meets the chance constraints. To do this, a set of 100,000 scenarios

have been generated and the solution in Table VI is substituted for each of these scenarios to

check the constraint violation. The test empirically verifies that the optimal blend recipe only has

0.41% chance of producing off-specification gasoline, which is far smaller than our desired risk

level 𝜖 = 5%.

15
CHAPTER 5: CONCLUSION

We formulate the gasoline blending problem as a nonlinear chance-constrained program,

and a scenario-based method was used to acquire its deterministic approximation. Then, the

large-scale optimization program was efficiently solved to near-global optimum using a

sequential approach with reduced relative gap threshold. A multi-product blending problem is

presented and used to demonstrate the superiority of our proposed method over the immediate

use of a state-of-the-art optimization software. A set of 100,000 scenarios have been generated to

test the robustness of the solution. The solution is substituted for each of these scenarios, and we

found that only 410 were violated. This implies that our solution is empirically verified to

produce off-specification gasoline by only 0.41%, which is much lower than our specified risk

level 𝜖 = 5%. The future work will investigate how the proposed solution can handle non-

Gaussian characteristics of gasoline blending.

16
REFERENCES

[1] S. Jiang, “Optimisation of diesel and gasoline blending operations”, PhD thesis,

Department of Chemical Engineering and Analytical Science, The University of

Manchester, 2016.

[2] P.A. Castillo, P.M. Castro, and V. Mahalec, “Global Optimization of nonlinear blend-

scheduling problems”, Engineering, vol. 3, pp. 188-201, 2017.

[3] Y. Yang, P. Vayanos, and P.I. Barton, “Chance-constrained optimization for refinery

blend planning under uncertainty”, Industrial and Engineering Chemistry Research, vol.

56, pp. 12139-12150, 2017.

[4] D. Wang, Z. Li, Q.E. Chang, and Y. Li, “On-line optimization model design of gasoline

blending system under parametric uncertainty”, 2007 Mediterranean Conference on

Control & Automation, Athens, Greece, 2007.

[5] F.E. Curtis, A. Wachter, and V.M. Zavala, “A sequential algorithm for solving nonlinear

optimization problems with chance constraints”, SIAM Journal on Optimization, vol. 28,

pp. 930-958, 2018.

[6] J. Luedtke and S. Ahmed, “A sample approximation approach for optimization with

probabilistic constraints”, SIAM Journal on Optimization, vol. 19, pp. 674-699, 2008.

[7] P. Li, H. Arellano-Garcia, and G. Wozny, “Chance constrained programming approach to

process optimization under uncertainty”, Computers & Chemical Engineering, vol. 32, pp.

25-45, 2008.

[8] Z. Li, Q. Tang, and C.A. Floudas, “A comparative theoretical and computational study on

robust counterpart optimization: II. Probabilistic guarantees on constraint satisfaction”,

Industrial and Engineering Chemistry Research, vol. 51, pp. 6769-6788, 2012.

17
[9] A. Ben-Tal, L. El Ghaoui and A. Nemirovski, Robust Optimization. Princeton University

Press, 2009.

[10] D. Bertsimas and M. Sim, “The price of robustness”, Operations Research, vol. 52, pp.

35-53, 2004.

[11] A. Purohit and T. Suryawanshi, “Integrated Product Blending Optimization for Oil

Refinery Operations”, IFAC Proceedings Volumes, vol. 46, pp. 343-348, 2013.

[12] S. Parkash, Refining Processes Handbook. Burlington, MA: Elsevier, 2003, pp. 308-309.

[13] E. Roos and D.d. Hertog, “Reducing conservatism in Robust Optimization”, 2018.

[14] Y. Yang and C. Sutanto, “Chance-constrained optimization for nonconvex programs

using scenario-based methods”, ISA Transactions, vol. 90, pp. 157-168, 2019.

[15] C. Sutanto and Y. Yang, “A scenario-based approach for smart system control and

optimization”, 2017 IEEE Green Energy and Smart Systems Conference, Long Beach,

CA, USA, 2017.

[16] S.J. Maher et al., “The SCIP Optimization Suite 4.0”, ZIB-Report 17-12, Zuse Institute

Berlin, Takustr 7, 14195 Berlin, March 2017.

[17] A. Wachter and L.T. Biegler, “On the implementation of a primal-dual interior point

filter line search algorithm for large-scale nonlinear programming”, Mathematical

Programming, vol. 106, no. 1, pp. 25-57, 2006.

18

You might also like