OPTIMIZATION TECHNIQUES FOR BLENDING AND SCHEDULING OF OIL-REFINERY OPERATIONS

Similar documents
Chapter 7. Response of First-Order RL and RC Circuits

A Note on Using the Svensson procedure to estimate the risk free rate in corporate valuation

Strategic Optimization of a Transportation Distribution Network

Single-machine Scheduling with Periodic Maintenance and both Preemptive and. Non-preemptive jobs in Remanufacturing System 1

DETERMINISTIC INVENTORY MODEL FOR ITEMS WITH TIME VARYING DEMAND, WEIBULL DISTRIBUTION DETERIORATION AND SHORTAGES KUN-SHAN WU

TEMPORAL PATTERN IDENTIFICATION OF TIME SERIES DATA USING PATTERN WAVELETS AND GENETIC ALGORITHMS

cooking trajectory boiling water B (t) microwave time t (mins)

The Transport Equation

The Application of Multi Shifts and Break Windows in Employees Scheduling

Behavior Analysis of a Biscuit Making Plant using Markov Regenerative Modeling

Multiprocessor Systems-on-Chips

Module 4. Single-phase AC circuits. Version 2 EE IIT, Kharagpur

Appendix A: Area. 1 Find the radius of a circle that has circumference 12 inches.

WATER MIST FIRE PROTECTION RELIABILITY ANALYSIS

4 Convolution. Recommended Problems. x2[n] 1 2[n]

Journal Of Business & Economics Research September 2005 Volume 3, Number 9

The naive method discussed in Lecture 1 uses the most recent observations to forecast future values. That is, Y ˆ t + 1

Real-time Particle Filters

Capacitors and inductors

Acceleration Lab Teacher s Guide

The Grantor Retained Annuity Trust (GRAT)

Usefulness of the Forward Curve in Forecasting Oil Prices

CHARGE AND DISCHARGE OF A CAPACITOR

Chapter 8: Regression with Lagged Explanatory Variables

Mathematics in Pharmacokinetics What and Why (A second attempt to make it clearer)

AP Calculus BC 2010 Scoring Guidelines

µ r of the ferrite amounts to It should be noted that the magnetic length of the + δ

Morningstar Investor Return

PROFIT TEST MODELLING IN LIFE ASSURANCE USING SPREADSHEETS PART ONE

Chapter 5. Aggregate Planning

Chapter 1.6 Financial Management

AP Calculus AB 2010 Scoring Guidelines

Cointegration: The Engle and Granger approach

Vector Autoregressions (VARs): Operational Perspectives

4. International Parity Conditions

ANALYSIS AND COMPARISONS OF SOME SOLUTION CONCEPTS FOR STOCHASTIC PROGRAMMING PROBLEMS

AP Calculus AB 2013 Scoring Guidelines

Appendix D Flexibility Factor/Margin of Choice Desktop Research

Chapter 8 Student Lecture Notes 8-1

INTEREST RATE FUTURES AND THEIR OPTIONS: SOME PRICING APPROACHES

How To Design A Supply Chain

Making Use of Gate Charge Information in MOSFET and IGBT Data Sheets

Planning Demand and Supply in a Supply Chain. Forecasting and Aggregate Planning

Direc Manipulaion Inerface and EGN algorithms

Option Put-Call Parity Relations When the Underlying Security Pays Dividends

Statistical Analysis with Little s Law. Supplementary Material: More on the Call Center Data. by Song-Hee Kim and Ward Whitt

Mechanical Fasteners Tensile and Shear Stress Areas

Permutations and Combinations

Term Structure of Prices of Asian Options

USE OF EDUCATION TECHNOLOGY IN ENGLISH CLASSES

Switching Regulator IC series Capacitor Calculation for Buck converter IC

Market Liquidity and the Impacts of the Computerized Trading System: Evidence from the Stock Exchange of Thailand

Present Value Methodology

Individual Health Insurance April 30, 2008 Pages

Task is a schedulable entity, i.e., a thread

UNDERSTANDING THE DEATH BENEFIT SWITCH OPTION IN UNIVERSAL LIFE POLICIES. Nadine Gatzert

Optimal Investment and Consumption Decision of Family with Life Insurance

Outline. Role of Aggregate Planning. Role of Aggregate Planning. Logistics and Supply Chain Management. Aggregate Planning

How To Calculate Price Elasiciy Per Capia Per Capi

Manufacturing Planning and Control

MTH6121 Introduction to Mathematical Finance Lesson 5

Making a Faster Cryptanalytic Time-Memory Trade-Off

Dynamic programming models and algorithms for the mutual fund cash balance problem

Diagnostic Examination

9. Capacitor and Resistor Circuits

Principal components of stock market dynamics. Methodology and applications in brief (to be updated ) Andrei Bouzaev, bouzaev@ya.

Analysis of Pricing and Efficiency Control Strategy between Internet Retailer and Conventional Retailer

Name: Algebra II Review for Quiz #13 Exponential and Logarithmic Functions including Modeling

BALANCE OF PAYMENTS. First quarter Balance of payments

TSG-RAN Working Group 1 (Radio Layer 1) meeting #3 Nynashamn, Sweden 22 nd 26 th March 1999

Performance Center Overview. Performance Center Overview 1

Option Pricing Under Stochastic Interest Rates

Differential Equations and Linear Superposition

Distributing Human Resources among Software Development Projects 1

Chapter 4: Exponential and Logarithmic Functions

Research on Inventory Sharing and Pricing Strategy of Multichannel Retailer with Channel Preference in Internet Environment

LEVENTE SZÁSZ An MRP-based integer programming model for capacity planning...3

Stock Trading with Recurrent Reinforcement Learning (RRL) CS229 Application Project Gabriel Molina, SUID

Hedging with Forwards and Futures

Markov Chain Modeling of Policy Holder Behavior in Life Insurance and Pension

A New Type of Combination Forecasting Method Based on PLS

SPEC model selection algorithm for ARCH models: an options pricing evaluation framework

A Probability Density Function for Google s stocks

Strategic Planning, Design and Development of the Shale Gas Supply Chain Network

OPERATION MANUAL. Indoor unit for air to water heat pump system and options EKHBRD011ABV1 EKHBRD014ABV1 EKHBRD016ABV1

DYNAMIC MODELS FOR VALUATION OF WRONGFUL DEATH PAYMENTS

Random Walk in 1-D. 3 possible paths x vs n. -5 For our random walk, we assume the probabilities p,q do not depend on time (n) - stationary

Ecodesign Requirements for Electric Motors Towards a System-Approach. Demonstrating the benefits of motor starters for fixed speed applications

Monte Carlo Observer for a Stochastic Model of Bioreactors

Why Did the Demand for Cash Decrease Recently in Korea?

Transcription:

OPTIMIZATION TECHNIQUES FOR BLENDING AND SCHEDULING OF OIL-REFINERY OPERATIONS Carlos A. Mendez, Ignacio E. Grossmann Deparmen of Chemical Engineering - Carnegie Mellon Universiy Pisburgh, USA Iiro Harjunkoski, Pousga Kaboré ABB Corporae Research Cener Ladenburg, Germany Absrac This paper presens a novel MILP formulaion ha addresses he simulaneous opimizaion of he shor-erm scheduling and blending problem in oil-refinery applicaions. Depending on he problem characerisics as well as he required flexibiliy in he soluion, he model can be based on eiher a discree or a coninuous-ime domain represenaion. In order o preserve he model s lineariy, an ieraive procedure is proposed o effecively deal wih non-linear gasoline properies and variable recipes for differen produc grades. Thus, he soluion of a large MINLP formulaion is replaced by a sequenial MILP approximaion. Insead of predefining fixed componen concenraions for producs, preferred blend recipes can be forced o apply whenever i is possible. The proposed opimizaion approach is oriened owards providing an effecive and inegraed soluion for boh he scheduling and he blending problem. In order o provide convenien soluions for all circumsances, differen alernaives o cope wih infeasible problems are presened in deail. The new mehod is illusraed by solving several real world problems wih very low compuaional requiremens. 1. INTRODUCTION The gasoline shor-erm scheduling and blending are criical aspecs in oil refinery operaions. The economic and operabiliy benefis associaed wih obaining beer-qualiy and less expensive gasoline blends, and a he same ime making a more effecive use of he available resources, are numerous and

significan. The main objecive in oil refining is o conver a wide variey of crude oils ino valuable final producs such as gasoline, je fuel and diesel. The major challenge lies on generaing profis for a large process wih high volumes and small margins. Figure 1 shows a diagram of a sandard refinery sysem. The general srucure of his paricular process comprises hree major secions: (1) crude oil unloading and blending, (2) producion uni scheduling and (3) produc blending and delivery of final producs. The firs sub-problem involves he crude oil unloading from vessels, is ransfer o sorage anks and he charging schedule for each crude oil mixure o he disillaion unis. The second sub-problem consiss of he producion uni scheduling, which includes boh fracionaion and reacion processes. Reacions secions aler he molecular srucure of hydrocarbons, in general o improve ocane number, whereas fracionaion secions separae he reacor effluen ino sreams of differen properies and values. Lasly, he hird subproblem is relaed o he scheduling, blending, sorage and delivery of final producs, which is generally agreed as being he mos imporan and complex sub-problem. Is imporance comes from he fac ha gasoline can yield 60-70% of oal refinery s profi. On he oher hand, he complexiy mainly arises from he large number of produc demands and qualiy specificaions for each final produc, as well as he limied number of available resources ha can be used o reach he producion goals. This paper is focused on he gasoline blending and he shor-erm scheduling problem of oil refinery operaions. Mahemaical programming echniques have been exensively used for long-erm planning as well as he shor-erm scheduling of refinery operaions. For planning problems, mos of he compuaional ools have been based on successive linear programming models, such as RPMS from Honeywell, Hi-Spec Soluions (Bonner and Moore, 1979) and PIMS from Aspen Technology (Bechel Corp., 1993). On he oher hand, scheduling problems have been addressed hrough linear and non-linear mahemaical approaches ha make use of binary variables (MILP and MINLP codes) o explicily model he discree decisions o be made (Grossmann e al., 2002 ; Shah, 1998). Shor-erm scheduling problems have been mainly sudied for bach plans. Exensive reviews can be found in Reklaiis (1992), Pino and Grossmann (1998) and Ieraperiou and Floudas (1998). Much less work has been devoed o coninuous plans. Lee e al. (1996) addressed he shor-erm scheduling problem for he crude-oil invenory managemen problem. Nonlineariies of mixing asks were reformulaed ino linear inequaliies wih which he original MINLP model was convered o a MILP formulaion ha can be solved o global opimaliy. This exac linear reformulaion was possible because only mixing operaions were considered (see Quesada and Grossmann, 1995). The objecive funcion was he minimizaion of he oal operaing cos, which comprises waiing ime cos of each vessel in he sea, unloading cos for crude vessels, invenory cos and changeover cos. 2

Several examples were solved o highligh he compuaional performance of he proposed model. Moro e al. (1998) developed a mixed-ineger nonlinear programming planning model for refinery producion. The model assumes ha a general refinery is composed of a number of processing unis producing a variey of inpu/oupu sreams wih differen properies, which can be blended o saisfy differen specificaions of diesel oil demands. Each uni belonging o he refinery is defined as a coninuous processing elemen ha ransforms he inpu sreams ino several producs. The general model of a ypical uni is represened by a se of variables such as feed flowraes, feed properies, operaing variables, produc flowraes and produc properies. The main objecive is o maximize he oal profi of he refinery, aking ino consideraion sales revenue, feed coss and he oal operaing cos. Kelly and Mann (2002) highligh he imporance of opimizing he scheduling of an oil-refinery s crude-oil feedsock from he receip o he charging of he pipesills. The use of successive linear programming (SLP) was proposed for solving he qualiy issue in his problem. More recenly, Kelly (2004) analyzed he underlying mahemaical modeling of complex nonlinear formulaions for planning models of semi-coninuous faciliies, where he opimal operaion of peroleum refineries and perochemical plans was mainly addressed. The gasoline blending problem has also been addressed wih several opimizaion ools. The main objecive is o find he bes way of mixing differen inermediaes producs from he refinery and some addiives in order o minimize blending cos subjec o meeing he qualiy and demand requiremens of differen final producs. The erm qualiy refers o meeing given produc specificaions. Rigby e al. (1995) discussed successful implemenaion of decision suppor sysems for offline muli-period blending problems a Texaco. Since hese sofware packages are resriced o solving he blending problem, resource and emporal decisions mus be made a priori eiher manually or by using a special mehod. To solve boh sub-problems simulaneously, Glismann and Gruhn (2001) proposed a wo-level opimizaion approach where a mixed-ineger linear model (MILP) is uilized for he scheduling problem whereas a nonlinear model is run for he recipe opimizaion. The proposed decomposiion echnique for he enire opimizaion problem is based on solving firs he nonlinear model aiming a generaing he opimal soluion of he blending problem, which is hen incorporaed ino he MILP scheduling model as fixed decisions for opimizing only resource and emporal aspecs. In his way, he soluion of a large MINLP model is replaced by sequenial NLP and MILP models. Jia and Ieraperiou (2003) proposed a soluion sraegy based on decomposing he overall refinery problem in hree subsysems: (a) he crude-oil unloading and blending, (b) he producion uni operaions, and (c) he produc blending and delivery. In order o solve each one of hese sub-problems in he mos efficien way, a se of mixed-ineger linear models (MILPs) 3

were developed, which ake ino accoun he main feaures and difficulies of each case. In paricular, fixed produc recipes were assumed in he hird sub-problem, which means ha blending decisions were no incorporaed ino his model. The MILP formulaion was based on a coninuous ime represenaion and he noion of even poins. The mahemaical formulaion proposed o solve each sub-problem involves maerial balance consrains, capaciy consrains, sequence consrains, allocaion consrains, demand consrains, and a specific objecive funcion. Coninuous variables are defined o represen flowraes as well as saring and ending imes of processing asks. Binary variables are principally relaed o allocaion decisions of asks o even poins, or o some specific aspec of each sub-problem. To conclude, i is worh o menion ha a variey of mahemaical programming approaches are currenly available o he shor-erm scheduling and blending problem. However, in order o reduce he inheren problem difficuly, mos of hem rely on special assumpions ha generally make he soluion inefficien or unrealisic for real world cases. Some of he common assumpions are: (a) fixed recipes for differen produc grades are predefined, (b) componen and produc flow-raes are known and consan and (c) all produc properies are assumed o be linear. On he oher hand, more general Mixed-Ineger Non- Linear Programming (MINLP) formulaions consider he majoriy of he problem feaures, bu he complexiy and he size of he model are grealy increased, making he problem inracable for large or even medium size problems. The major issue here is relaed o non-linear and non-convex consrains wih which he compuaional performance srongly depends on he iniial values and bounds assigned o he variables. Taking ino accoun he principal weaknesses of he available mahemaical approaches, he major goal of his work is o develop a novel mixed-ineger linear programming (MILP) formulaion for he simulaneous gasoline shor-erm scheduling and blending problem of oil refinery operaions. Nonlinear propery specificaions based on variable and preferred produc recipes can be effecively handled hrough he proposed ieraive linear procedure, which allows he model o generae near-opimal soluions wih modes compuaional effor. 4

STANDARD REFINERY SYSTEM crude-oil unloading crude-oil blending fracionaion and reacion processes gasoline can yield 60-70% of refinery s profi!! gasoline blending produc delivery crude-oil marine vessels sorage anks charging anks CRUDE OIL UNLOADING AND BLENDING crude dis. unis oher prod. unis PRODUCTION UNIT SCHEDULING comp. sock anks blend headers finished produc anks PRODUCT BLENDING AND DELIVERY shipping poins Figure 1. Illusraion of a sandard refinery sysem 2. MODELING ISSUES The gasoline blending and shor-erm scheduling problem akes ino accoun wo major issues. The firs one is relaed o aspecs of producion logisics, which mainly involves muliple producion demands wih differen due daes, invenory pumping consrains for producs and componens as well as differen logisic and operaing rules. Mos of hese feaures are par of ypical scheduling problems and are usually modeled as discree and coninuous decisions in an opimizaion framework. On he oher hand, he second issue is he producion qualiy, which represens an addiional difficuly for sandard scheduling problems. This second issue is also known as he blending problem and akes ino accoun variable produc recipes and propery specificaions such as minimum ocane number, maximum sulfur and aromaic conen, ec. Is main objecive is o produce on-spec blends a minimum cos, where produc specificaions are sringen and consanly changing in mos of he markes. Produc qualiies are usually prediced hrough complex correlaions ha depend on he concenraion and he properies of he componens used in he blend. Depending on he produc propery, non-linear correlaions may include linear, bilinear, rilinear and exponenial erms. Deleed: compued using Deleed: which are generally a funcion of Deleed: for insance 5

To deal wih his challenging problem, differen opimizaion echniques have been developed, which are based on differen assumpions and mahemaical mehods. For insance, several approaches ry o solve he enire problem in one sep. However hese approaches usually inroduce several simplificaions o he real problem, such as considering fixed recipes insead of variable produc recipes (Jia and Ieraperiou, 2003). While hese approaches can be compuaionally effecive, heir soluions may be unrealisic for real indusrial problems. Oher approaches have used he idea of decomposing he problem ino differen subproblems. The bes example of his sraegy is o solve he logisics aspec firs, hen fix he emporal and resource decisions o solve for he qualiy par by adjusing he flows appropriaely o mee all produc specificaions. Alhough his mehod is currenly used in several indusrial opimizaion ools, i has he disadvanage ha i may generae infeasible soluions, paricularly when hard consrains are imposed. Non-linear opimizaion models have been developed o circumven he problem of infeasibiliies by explicily modeling non-linear properies for final producs. However, as poined ou by several auhors solving logisics and qualiy aspecs for large-scale problems is no possible in a reasonable ime wih curren mixed ineger non-linear programming (MINLP) codes and global opimizaion echniques (Kelly e al. 2002 ; Jia e al., 2003). For his reason linear approximaions are commonly used for handling he nonlinear properies of final producs. As a resul, near-opimal soluions for indusrial problems can be generaed wih modes compuaional requiremens. On he oher hand, a major aspec of any scheduling model is relaed o iming decisions. Mahemaical formulaions are based on eiher a discree or coninuous ime domain represenaion. The discree ime represenaion only allows evens o occur a cerain ime poins, which correspond o he boundaries of a se predefined ime inervals. The main advanage of using a discree ime grid is ha mass balance and invenory consrains become easier o handle bu a he same ime he soluion loses flexibiliy, unless smaller ime inervals are used, which may significanly decrease he compuaional performance of he mehod. In conras, coninuous ime represenaions are capable of generaing more flexible soluions, alhough wih higher CPU ime requiremens. Also, invenory and mass balance consrains generally become more difficul o model since hey have o be checked a any ime during he scheduling horizon in order o ensure ha a feasible soluion will be generaed. Based on he above issues we will sae more precisely he problem addressed in his paper. 6

3. PROBLEM STATEMENT The general opology for he shor-erm scheduling and blending problem of oil refinery operaions corresponds o a mulisage sysem composed of componen sorage anks, blend headers and produc sorage anks. Specifically, we assume ha we are given he following iems: 1. A predefined scheduling horizon, ypically 7 o 10 days 2. A se of inermediae producs from he refinery (componens) 3. A se of dedicaed sorage anks for each componen wih minimum and maximum capaciy resricions 4. Iniial socks for componens 5. Componen supplies wih known flowraes 6. Properies or qualiies for componens 7. Minimum and maximum flowraes beween componen anks and blend headers 8. A se of final producs wih predefined minimum and maximum qualiy specificaions 9. A se of equivalen blend headers working in parallel ha can be allocaed o each final produc 10. A se of correlaions, mosly non-linear, for predicing he values of properies of each blend. 11. Minimum and maximum componen concenraions in final producs 12. Preferred produc recipes The main goal is o deermine: a) The allocaion of blenders o final producs b) The invenory levels of componens and producs in sorage anks c) The volume fracion of componens included in each produc d) The oal volume of each produc e) The pumping raes for componens and producs f) The opimal iming decisions for producion and sorage asks The objecive is o maximize he producion profi while saisfying he process consrains, final produc demands and qualiy specificaions. The objecive funcion includes he oal produc value, he raw maerial cos and penalies for deviaion from preferred recipes. Addiional erms involving slack 7

variables for handling infeasible soluions can also be incorporaed ino he objecive funcion o provide effecive soluions for all circumsances. 4. PROPOSED OPTIMIZATION APPROACH The main feaures of he proposed approach can be summarized in he following poins: A muliperiod opimizaion mehod ha is able o deal wih muliple produc demands wih differen due daes and qualiy specificaions. Discree or coninuous ime domain represenaions can be used, depending on he problem characerisics. Linear approximaions are used ogeher wih an ieraive procedure o ge beer predicions of all produc properies, even hose naurally non-linear such as he ocane number. Simulaneous soluion of he producion logisics and qualiy specificaions. Fixed or variable produc recipes as well as minimum and maximum limis on componen concenraion. Binary variables are used o represen allocaion decisions as well as any oher logisic or producion rule found in he problem. In order o describe he main model variables, Figure 2 illusraes a simple example of a gasoline scheduling and blending problem, which has radiionally been reaed as wo separae problems. The soluion of he scheduling problem defines he way in which he producs are processed wih respec o ime and available equipmen. On he oher hand, he soluion of he blending problem defines how he available componens are blended or mixed ogeher o produce on-spec producs wih minimum cos. The key decision variables involved in a sandard problem are he following: The coninuous variable F I i, defines he volumeric flow of componen i being ransferred o produc p during he ime inerval whereas F P denoes he volumeric flow of produc p being blended during each ime inerval. The coninuous variables V I i, and V P define he amoun of componen and produc being sored a each ime poin, respecively. Finally, he discree variable A defines which producs are allocaed o blenders in each ime inerval. Addiional coninuous and discree variables can be included ino he mahemaical model o ackle paricular problem characerisics and operaing consrains. 8

f i, i F I i, B1 p p f i, i i F I i, F I i, B2 F P p min/max produc specificaions - pr min k1 pr k1, pr max k1 - pr min k2 pr k2, pr max k2 - pr min kn pr kn, pr max kn f i, componen properies - pr i,k1 - pr i,k2 -- pr i,kn i i componen anks B3 blenders p produc anks Figure 2. Illusraion of he meaning of he principal model variables 5. PRODUCT PROPERTY PREDICTION Before describing he proposed models, we presen in his secion an ieraive scheme for predicing he properies of he producs. A significan number of gasoline properies can be direcly prediced by using a volumeric average as shown in equaion (a): pr I = pri, k v k (a) p, k, i,, i where v I i, is he volume fracion of componen i in produc p a ime, pr k, defines he value of he propery k for produc p in ime and pr i,k is he value of he propery k for componen i. The volume fracion variable v I is linked o he volumeric flow variables F I i, and F P hrough he following equaliy (b), 9

I P I vi, F = Fi, k, (b) Taking ino accoun ha volumeric flowrae variables are required o conrol invenory levels in anks and volume fracion variables are needed o predic produc properies, he general mahemaical model for he scheduling and blending problem is bilinear, even if only linear produc properies are considered. However, in order o preserve he lineariy of he model, he original equaliy (a) can be expressed in an alernaive way by muliplying i by F P pr F I P = pri, kv F k (c) p, k P i,, i Then equaliy (b) can be incorporaed ino equaion (c), yielding he linear equaion (d) pr F I = pri, k F k (d) p, k P i,, i Taking advanage of minimum and maximum propery specificaion consrains for producs, consrain (d) can hen be replaced by consrain (e), in which he variable pr k is subsiued by heir respecive minimum and maximum propery values, which are problem daa. pr F I max P pri, k F pr F k (e) min P k i, k, i In his way, he variable v I i, is no longer required and he model remains linear. This linearizaion is valid only if volumerically compued properies are considered in he blending problem. However, oher gasoline properies can be approximaed by adding minor changes o he previous equaion. For insance, if he correlaion for predicing a paricular produc propery is based on a linear volumeric average plus addiional non-linear erms, such as he case of he ocane number, he non-linear par of he equaion can be removed and replaced by a correcion facor bias k,, as shown in equaion (f), pr F P I max P P + bias k, F pri, k F pr F + bias k, F k (f) min P k i, k, i 10

Thus, nonlinear produc properies can be approximaed hrough he linear equaion (f), which is composed of a volumeric average followed by a correcion facor bias. This correcion facor depends on he produc, propery and ime slo, and i is ieraively calculaed by using he proposed procedure described in he following secion. I should be noed ha produc properies such as oxygen and sulfur conen are blended gravimerically, which means ha componen and produc specific graviies are also aking ino accoun for he predicion, as shown in equaion (g). In his case, ρ i and ρ p define he specific graviy of componen i and produc respecively. Given ha ρ p is a variable ha is no direcly compued hrough he proposed linear approach and wih he inenion of mainaining he model s lineariy, ρ p can be subsiued by an approximaed value grav p, which can be easily compued hrough he ieraive procedure described in he following secion. pr pri, ρiv I k i, i p, k, =, p ρ k Therefore, he proposed linear approximaion for gravimeric blending is as follows, (g) min I prk ρi Fi, min P i max P prp, k F pr k F k, gravp (h) To begin illusraing he ieraive procedure and he proposed linear approximaion, Fig. 3 shows a comparison beween he values of he linear volumeric average, he nonlinear original correlaion and he proposed linear approximaion for a real nonlinear produc propery such as he moor ocane number. In his example, he blend of wo componens A and B is only considered. The final produc propery is a nonlinear funcion of componen concenraions. As shown in Fig. 3, if 40% of componen A is blended wih 60% of componen B, he values of he volumeric average and he real nonlinear correlaion are 88.5 and 88.74, respecively. This difference arises because all non-linear erms involved in he exac moor ocane correlaion are no included in he linear volumeric average. In order o correc his discrepancy, he correcion facor bias is calculaed and used o yield a beer propery predicion in he nex ieraion. For his specific mixure of componens he correcion facor bias is equal o 0.24. The linear approximaion 11

comprising he volumeric average ogeher wih he correcion facor bias will always predic he exac value of he propery if he same componen concenraion is uilized he nex ieraion. Furhermore, i was observed ha he proposed linear approximaion ends o predic a very close value of he real propery if componen concenraions are no significanly changed in nex ieraion, as shown in Figure 3. propery 92 91 BLEND 40% COMPONENT A 60% COMPONENT B 90 Correcion facor bias = 0.24 89 88 Propery value Comp A: 92.1 Comp. B: 86.1 87 86 Componen 'A' volume fracion 0 0.2 0.4 0.6 0.8 1 Non-linear correlaion linear volum. average linear volum. average + bias Figure 3. A non-linear propery and he proposed linear approximaion The proposed ieraive procedure o solve simulaneously he scheduling and blending problem using only linear equaions can be summarized as seeing in Fig. 4. The firs sep is o find an iniial recipe for all producs. If preferred produc recipes are known hey can be proposed as iniial produc recipes. Preferred recipes are he bes alernaive for he blending issue because hey saisfy all produc specificaions wih minimum cos. However, he use of hem srongly depends on he scheduling decisions, componen 12

invenories and produc demands and for his reason, hey should no be reaed as fixed mixures in any blending ool. On he oher hand, if preferred recipes are no defined, one possibiliy for generaing iniial recipes is o solve he MILP model including only linear produc properies. When iniial recipes were generaed, hey will provide he componen volume fracions used in each blend, which can hen been employed as fixed parameers in more realisic non-linear correlaions. The value prediced by he nonlinear correlaion and he linear volumeric average are boh used o calculae he correcion facor bias (see Fig. 3). Given ha we are dealing wih a muliperiod opimizaion problem, he correcion facor will be calculaed for all non-linear properies, producs and ime slos as he difference beween he value prediced by he original non-linear equaion and he linear volumeric average. The specific graviy of each produc and ime slo is also compued. Afer ha, he MILP model including linear approximaion wih he parameer bias for volumeric properies and he parameer grav for gravimeric properies is solved. Subsequenly, he soluion of his problem is revised and he produc recipes for hose producs meeing all specificaions in a specific ime slo are fixed. If differen recipes are used for he same produc in differen ime slos, only hose ha are feasible will be fixed. This process is repeaed unil all produc recipes are fixed or a predefined ieraion limi is reached. The main objecive of his ieraive procedure is o progressively find feasible recipes for all producs while opimizing all emporal and resource consrains. As will be shown laer in he paper only few ieraions are needed o ge a very good soluion for boh sub-problems. This has also been confirmed wih our experience in solving real world problems. I should be noed ha he parameer bias will be equal o zero for all linear properies ha can be compued volumerically. Figure 4 depics a diagram illusraing he ieraive approach proposed as basis of he linearizaion echnique for non-linear properies. 13

Generae iniial produc recipes (only linear produc properies) componen volume fracions in blends Compue non-linear properies (K NL ) for all producs and ime slos pr k, = g k (v i, ), where g k (v i, ) is a non-linear correlaion for predicing produc propery k and v i, is he componen volume fracion Compue correcion facor 'bias' and specific graviy 'grav' bias k, = g(v i, ) - f(v i, ), where f(v i, ) is he linear volumeric average grav = ρ, where ρ p p, is he specific graviy of produc p in ime slo Solve MILP Model (include all produc properies, bias k, and grav ) NO componen volume fracions in blends Compue non-linear properies (K NL ) for all producs and ime slos pr k, = g(v i, ) Fix produc recipes for producs on-spec All producs on-spec or ieraion limi YES Soluion for he Scheduling and Blending problem Figure 4. Proposed ieraive approach 14

6. SCHEDULING MODEL Before presening he proposed mahemaical models he nomenclaure is as follows, Nomenclaure Indices d i p k Ses D I P K T T d Parameers h n B s e c i sp i sp p ply R+ ip ply R- ip ply S+ kp ply S- kp ply SH i d dd pd l min p p p inv i inv p due daes of produc demands inermediaes or componens final producs or gasoline grades properies or qualiies ime slos se of produc due daes se of inermediaes o be blended se of demanded final producs se of properies for inermediaes and producs se of ime slos se of ime slos posulaed for he sub-inerval ending a due dae d (coninuous ime) ime horizon maximum number of blenders ha can be working in parallel in ime slo predefined saring ime of ime slo (discree ime represenaion) predefined ending ime of ime slo (discree ime represenaion) cos of componen i penaly for invenory of componen i penaly for invenory of produc p penaly for excess of componen i in produc p penaly for shorage of componen i in produc p penaly for a deviaion from he minimum specificaion for propery k penaly for a deviaion from he maximum specificaion for propery k penaly for purchasing componen i from hird-pary demand due dae demand of produc p o be saisfied a due dae d minimum ime slo duraion when i is allocaed o produc p price of produc p iniial invenory of componen i iniial invenory of produc p 15

V min i V max i V min p V max p rcp min ip rcp max ip rae min p rae max p rcp ip pr ik pr min pk pr max pk f i bias k, Variables F I i, F P V I i, V P v I i, pr k, S E A D R- i, D R+ i, D S- k, D S+ k, S i, minimum sorage capaciy of componen i maximum sorage capaciy of componen i minimum sorage capaciy of produc p maximum sorage capaciy of produc p minimum concenraion of componen i in produc p maximum concenraion of componen i in produc p minimum flow rae of produc p maximum flow rae of produc p preferred concenraion of componen i in produc p according o produc recipe value of propery k for componen i minimum value of propery k for produc p maximum value of propery k for produc p consan flowrae of componen i correcion facor of he value of propery k of produc p in ime slo amoun of componen i being ransferred o produc p during ime slo amoun of produc p being blended during ime slo amoun of componen i sored a he end of ime slo amoun of produc p sored a he end of ime slo volume fracion of componen i in produc p a ime value of he propery k for produc p in ime saring ime of ime slo (coninuous ime represenaion) ending ime of ime slo (coninuous ime represenaion) binary variable denoing ha produc p is blended in ime slo shorage of componen i ha is used for produc p in ime slo according o he preferred produc recipe excess of componen i ha is used for produc p in ime slo according o he preferred produc recipe deviaion from he minimum specificaion of propery k for produc p deviaion from he maximum specificaion of propery k for produc p amoun of componen i o be purchased in ime slo 16

7. DISCRETE TIME REPRESENTATION In his secion we presen a MILP model ha assumes ha he enire scheduling horizon is divided ino a finie number of consecuive ime slos ha are common for all unis and can be allocaed o differen producs, i.e. blending asks. The proposed model has he following feaures: 1. A discree ime domain represenaion is used where he scheduling horizon is divided ino a se of consecuive ime slos. 2. Equivalen blenders working in parallel are available for differen produc grades 3. A paricular produc demand can be saisfied by one or more ime slos whenever hey are allocaed o his produc and finished before produc due dae. 4. Variable produc recipes are considered and produc properies are prediced by linear approximaions. 5. Consan flow rae of componens is assumed during he enire scheduling horizon 6. Consan flow rae of producs is assumed during he allocaed ime slo. MILP Formulaion Allocaion consrain Consrain (1) defines wih he binary variables A he number of final producs allocaed o ime slo. Given ha a se of equivalen blenders are available o produce differen gasoline grades simulaneously, n B specifies he maximum number of unis ha can be working in parallel during ime inerval. p B A, n (1) p Produc composiion consrain Every final produc or gasoline grade p is a blend of differen componens i, as expressed by consrain (2) I P Fi = F (2), i 17

Noe ha a significan reducion in he number of coninuous variables can be obained if equaion (2) is deleed from he model and F P is replaced by i F I i,. However, in order o make he model easier o undersand, F P has been included in all model equaions. Minimum/maximum componen concenraion In order o saisfy produc qualiies and/or marke condiions, upper and lower bounds can be forced on he componen concenraion for specific gasoline grades. Then, consrain (3) ensures ha produc composiion will always saisfy he predefined componen specificaions. Parameers rcp min max i,p and rcp i,p define he minimum/maximum concenraion of componen i for produc respecively rcp F I max P F rcp F i, p (3) min P i, p i, i, p, I should be noed ha a fixed recipe for a paricular produc p can also be aken ino consideraion by fixing he values of rcp min max ip and rcp ip o he predefined concenraion of componen i for produc p. However, he use of fixed recipes should be avoided unless hey were he only possibiliy o produce a paricular produc. As a beer opion, preferred recipes can be proposed as an iniial soluion of he proposed ieraive procedure. In his way he generaion of infeasible soluions will be avoided. Minimum/maximum volumeric flowraes for producs Consrain (4) specifies ha minimum and maximum volumeric flow raes mus be saisfied when produc p is blended during ime slo. Due o he fac ha a consan produc flow rae is assumed in his work, he volumeric flow rae can be compued by muliplying he upper and lower flowraes by he ime slo duraion whenever produc p is allocaed o a paricular ime slo (A =1). Moreover, since a discree ime represenaion is used, he ime slo duraion is a known parameer compued hrough he predefined saring s and ending imes e of each ime slo. I should be noed ha if produc p is no processed during ime inerval, (A =0), he volumeric flow rae will be also equal o zero. rae P max e s) A F rae ( e s) A p (4) min p ( p, 18

Maerial balance equaion for componens Given ha a discree ime represenaion allows he blending asks o sar and finish a he same ha he ime slo allocaed, invenory limis have only o be checked a he end of each ime slo. Then, as expressed by consrain (5), he amoun of componen i being sored in ank a he end of ime slo is equal o he iniial invenory of componen i plus he componen produced up o he end of ime slo minus he componen ransferred o blenders up o he end of ime slo, I I Vi, = inii + fi e Fi, ' i, ' (5) where he parameer f i specifies he consan producion rae of componen i and e defines he ending ime of ime slo. Given ha a discree ime represenaion is used, boh parameers are known in advance. Componen sorage capaciy Consrain (6) imposes lower/upper bounds V min i and V max i on he oal amoun of componen i being sored in a sorage ank during he scheduling horizon. Given ha consan componen flowraes are assumed, a perfec coordinaion beween he producion of componens and final producs is required o saisfy he sorage consrains hrough he enire scheduling horizon. V I max V V i (6) min i i, i, Maerial balance equaion for producs Consrain (7) compues he amoun of produc p being sored in ank a he end of ime slo aking ino accoun he iniial invenory, producion and demands of produc p V p = inip + F ' dd p P p, pd, ' d (7) Produc sorage capaciy A minimum safey sock and a finie sorage capaciy is assumed for final producs V P max V V p (8) min p p, 19

Minimum/maximum produc qualiies Assuming ha properies are volumerically compued, consrain (9) guaranees ha he value of propery k for produc p in ime inerval will always saisfy minimum and maximum produc specificaions. To mainain he model s lineariy, propery k is no direcly compued and bounds are only imposed on each propery. Oherwise, non-convex bilinear equaions would be generaed in he model, which would hen become non-linear. Alhough his linearizaion is only valid for properies volumerically compued, he original equaion (9) can be slighly modified as equaion (9 ) o accoun for real-word produc properies, as described previously in he paper wih he used of he parameer bias k,p. The bes value of his parameer can be obained hrough he proposed ieraive procedure. In his way, he proposed mahemaical model is able o effecively deal wih he qualiy issue, including variable recipes and nonlinear properies. pr F I max P pri, k F pr F k (9) min P k i, k, i min P I I max P prk F pri, k Fi, + biask, pfi, pr k F k, (9 ) i In urn, Equaion (9 ) defines he proposed linear approximaion for hose produc properies gravimerically prediced. min I prk ρi Fi, min P i max P prp, k F pr k F k, gravp (9 ) Noe ha consrains (9), (9 ) and (9 ) are only required for hose gasoline grades ha can be produced using variable recipes. If a fixed recipe is enforced, produc properies mus be saisfied in advance hrough he predefined componen concenraions. Muliple produc demands 20

Refinery operaions ypically require ha muliple demands for he same gasoline grade be saisfied during he enire scheduling horizon. Consrain (10) denoes ha he oal amoun of produc p available a he end of ime slo mus be enough o saisfy all demands of his paricular produc. d F dd p d P p, d ', d ' d (10) Objecive funcion (Maximize ne profi) While saisfying all qualiy and logisic issues, he main objecive of he scheduling problem is o maximize he ne profi defined as he oal produc value minus he oal componen cos. P I ppfp ci Fi p, Max,, (11) p i The formulaion can also accommodae alernaive objecive funcions. An example is equaion (12), where penalies relaed o componen and produc invenories has been included in order o also reduce sorage coss. P I P I Max ppf ci Fi p p p i i,, sp V, sp V, (12) p i p i 21

8. CONTINUOUS TIME REPRESENTATION The model in he previous secion is based on a discree ime domain represenaion. To generae more flexible schedules capable of maximizing he plan performance wihou significanly increasing he model size, a coninuous ime represenaion will be uilized for he model. However, special aenion mus be paid o he limied sorage capaciy since coninuous ime represenaion ends o make he invenory consrains much more difficul. The main idea here is firs o pariion he enire ime horizon ino a predefined number of sub-inervals. The size of each sub-inerval will depend on he produc due daes. For insance, he firs sub-inerval will sar a he beginning of he scheduling horizon and finish a he firs produc due dae. The second one will be exended from he firs up o he second produc due dae. A similar idea is applied o he nex sub-inervals. Then, he number of sub-inervals will be equal o he number of produc due daes. In his way, he saring and ending ime of each sub-inerval is known in advance. Once he sub-inervals are defined, a se of ime slos wih unknown duraion are posulaed for each one. The number of ime slos for each sub-inerval will depend on he sub-inerval lengh as well as he grade of flexibiliy desired for he soluion. Time slo saring and ending imes will be new model variables, allowing he producion evens o happen a any ime during he scheduling horizon. Figure 5 shows a diagram illusraing he main feaures of he proposed coninuous ime domain represenaion. In his case, four produc demands wih differen due daes are o be saisfied, which means ha 4 subinervals are predefined. Then, nine ime slos can be posulaed for he enire scheduling horizon, where wo ime-slos are defined for each one of he firs hree sub-inervals whereas hree are allocaed o he las one. 22

D 1 D 2 D 3 D 4 Produc Due Daes ime T1 T2 T3 T4 T5 T6 T7 T8 T9 SLOTS Figure 5. Proposed coninuous ime represenaion Formaed: Fon: Bold The proposed model has he following feaures: 1. A coninuous ime domain represenaion is used where he scheduling horizon is divided ino a sub-inervals and a se of ime slos wih unknown duraion are posulaed for each one. 2. Equivalen blenders working in parallel are available for differen produc grades 3. A paricular produc demand can be saisfied by one or more ime slos whenever hey are allocaed o his produc and finished before produc due dae. 4. Final produc properies are based on a volumeric average and a correcion facor compued hrough he proposed ieraive process. 5. A consan flow rae of componens is assumed during he enire scheduling horizon 6. A consan flow rae of produc is assumed during he allocaed ime slo. MILP Formulaion When he mahemaical model is based on a coninuous ime domain represenaion, saring and ending imes for he ime slos are new coninuous decisions variables. For ha reason, par of he original consrains used for discree ime represenaion mus be updaed in order o mainain model s lineariy as well as o accoun new problem feaures. In his secion we describe he se of consrains ha mus be modified as well as he new ones o be added. Consrains ha are no required o change mus be included ino he model in he same way hey were presened in he previous secion, such as equaions (1), (2), (3), (6), (7), (8), (9), (9 ), (9 ), (10), (11). 23

Minimum/maximum volumeric flowraes for producs Consrains (4 ) and (4 ) replace consrain (4) when a coninuous ime represenaion is used. When produc p is no allocaed o ime slo, he binary variable A p is equal o zero and consrain (4 ) enforces he variable FP o be equal o zero as well. On he oher hand, A p will be equal o one whenever produc p is processed during ime slo. In his case, consrain (4 ) becomes redundan and consrain (4 ) imposes minimum and maximum volumeric flow raes depending on he ime slo duraion. rae F min P max ( E S) rae h(1 A ) F rae ( E S) p (4 ) min p p p, max rae ha p (4 ) P p, p, Maerial balance equaion for componens To ensure ha only feasible soluions are generaed, he amoun of componen sored in ank has o be checked no only a he end bu also a he beginning of each ime slo. To make his possible, a new variable V I i, is included ino he model and he original equaion (5) is replaced by consrains (5 ) and (5 ). The same idea for compuing he invenory of componens is applied o hese new consrains. V I = inii + fi E Fi, i I i, ', ' I I V ' i, = inii + fi S Fi, ' i, ' < (5 ) (5 ) Noe ha despie he fac ha E and S are model variables, boh consrains remain linear because a consan producion rae f i is assumed for componens. Componen sorage capaciy An addiional consrain (6.1) is required o impose lower/upper bounds V min i and V max i on he oal amoun of componen i being sored in ank a he beginning of ime slo. V I max V ' V i (6.1) min i i, i, Maerial balance equaion for producs 24

Consrain (7.1) compues he invenory of produc p a he momen of saisfying he producion demand d p. In his way, a minimum safey sock is guaraneed a any ime during he scheduling horizon, even afer a produc delivery is carried ou. V ' = d P p inip + F dd pd ' < d d ' d p (7.1) Consrain (8.1) explicily defines he lower bound on he new invenory variable. V min p ', P V p (8.1) Se of ime slo iming consrains Insead of defining ime slo saring and ending imes as fixed parameers, a coninuous ime represenaion models hese decisions as addiional coninuous variables o be opimized. In order o allow more flexible soluions and avoid overlapping ime slos, a correc order and sequence beween posulaed ime slos mus be esablished hrough he nex se of consrains. Time slo duraion Consrain (13) defines a minimum ime slo duraion when produc p is allocaed o ime slo. I is generally used o model an exising operaing condiion, bu a he same ime permis eliminaing schedules using very shor ime slos, which are usually inefficien in pracice. min E S l A (13) p To ensure ha duraion of a slo is zero if i is no used, equaion (14) is included ino he model. E S h A (14) p Time slo sequencing Consrain (15) esablishes a sequence beween consecuives ime slos and +1. 25

E S + 1 (15) Sub-inerval bounds The se T d comprises all ime slos ha are posulaed for a sub-inerval relaed o a paricular due dae d. This sub-inerval begins a he previous due dae d-1 and finishes a due dae d. Consrain (16) defines ha ime slos pre-allocaed o his sub-inerval mus sar afer due dae d-1 whereas consrains (17) imposes ha hem mus end before due dae d. The main goal of his assumpion is ha neiher addiional variables nor new consrains are required o esablish which ime slos can saisfy a specific produc demand. As a resul, more flexible schedules can be obained wihou increasing he complexiy of invenory consrains. S d 1 Td (16) E d Td (17) Time slo allocaion Consrain (18) imposes an order for using he se of predefined ime slos. In oher words, a ime slo +1 can be only allocaed o a produc p whenever he previous ime slo has been used. A + n A d, (, + 1) T p B 1 d (18) p 9. TREATMENT OF INFEASIBLE SOLUTIONS The shor-erm scheduling and blending of oil refinery operaions is a very complex and highlyconsrained problem, where even feasible soluions are difficul o find in mos of he cases. For ha reason, in his secion we presen an addiional se of variables and equaions ha can be used ogeher wih he proposed model, which are mainly oriened owards relaxing some hard problem consrains ha can generae infeasible soluions when real world problems are addressed. Penaly for preferred recipe deviaion 26

If a preferred combinaion of componens is defined for a paricular produc hrough he parameer rcp ip, he following consrains can be included in he model o ry using he desired recipe whenever i is possible. rcp ip P R F + D Fi, i, p, i, (19) + rcp ip P R F D Fi, i, p, i, (20) Where D R+ i, and where D R- i, define he excess and he shorage of componen i ha is used in produc p in ime slo, according o he preferred produc recipe. Consrain (21) penalizes he slack variables D R+ i, and D R- i, in he objecive o ensure ha deviaions from he preferred recipe are minimized ( ) + + R R R R ply D + ip i ply D ip i, p Penaly =,, (21) p i Penaly for minimum/maximum specificaion deviaion If desired produc qualiies can no be fully achieved and, a he same ime, hey can parially be violaed for cerain producs, he following consrains can be used in order o minimize he deviaion. + min P S I prop, F, D,, pri, k F,, k p k p k p i p, i (22) max P S I propp, k F + Dk, pri, k Fi, k, i (23) where he coninuous variables D S+ k, and D S- k, define a value ha, in some way, represens he deviaion from he minimum and maximum specificaion for propery k, respecively. If propery k for produc p is beween minimum and maximum specificaion values, boh variables will be equal o zero. The corresponding objecive penaly erms are shown in Eq. (24) 27

( ) + + S S S S plyk D + p k, plyk, D p k, p Penaly =,, (24) p k Penaly for inermediae shorage A common source of infeasible soluions is he lack of he minimum amoun of inermediae required o saisfy eiher predefined componen concenraions or cerain marke specificaions. In his case, inermediae producs can be purchased a higher cos from hird-pary. The coninuous variable S i, defines he amoun of inermediae i needed in ime slo, which allows o relax minimum invenory consrains. I I Vi, = inii + prodi e Fi, ' + Si, i, ' (25) The penaly erm (26) includes is direcly proporional o he componen purchase cos. SH ( ply i Si ) Penaly =, (26) i 28

10. NUMERICAL RESULTS The performance of he proposed MILP-based approach for he scheduling and blending problem was esed wih several real-world examples. The daa are shown in Table 2 and 3. The basis of he example comprises nine inermediae produc or componens from he refinery which can be blended in differen ways o saisfy muliple demands of hree gasoline grades wih differen specificaions over a 8-day scheduling horizon. Twelve key componen and produc properies are aken ino consideraion for solving he blending issue, where eigh of hem can be prediced by a linear volumeric average whereas he remainder is based on non-linear correlaions. All he informaion abou componens such as cos, consan producion rae, iniial, minimum and maximum socks and properies is shown in Table 2. Produc daa including price, requiremens, invenory consrains, rae, recipe limis and specificaions are given in Table 3. Dedicaed sorage anks wih limied capaciies for componens and producs and hree equivalen blend headers working in parallel are available in he refinery. The main goal is o maximize he oal profi, considering componen cos, produc values and differen penalies for componen shorages and ou-spec producs. Four differen examples were solved wih he purpose of analyzing he srong ineracion beween scheduling and blending decisions. In order o guaranee finding feasible soluions, slack variables for propery deviaions and inermediae shorages were included in all cases, which were null for all soluions generaed. Example 1 is only focused on he blending problem and is soluion is used as iniial produc recipes for nex cases. Examples 2, 3 and 4 are solved using he proposed model based on boh a discree and a coninuous ime domain represenaion. When he discree ime represenaion is used, he scheduling horizon is divided ino six consecuive ime inervals, where inervals 1, 3, 4 and 6 have 1-day duraion whereas inervals 2 and 6 have 2-day duraion. For he coninuous ime represenaion, one ime slo wih unknown duraion is posulaed for each one of he six subinervals defined by he produc due daes. 29

Table 2. Componen daa Componen C1 C2 C3 C4 C5 C6 C7 C8 C9 Cos ($/bbl) 24.00 20.00 26.00 23.00 24.00 50.00 50.00 50.00 50.00 Prod. rae (Mbbl/day) 15.00 33.00 20.00 14.00 18.00 10.00 0.00 0.00 0.00 Iniial sock (Mbbl) 48.00 20.00 75.00 22.00 30.00 54.00 12.00 20.00 15.00 Min. sock (Mbbl) 5.0 5.0 5.0 5.0 5.0 5.0 0.0 0.0 0.0 Max. sock (Mbbl) 100.00 250.00 250.00 100.00 100.00 100.00 100.00 100.00 100.00 Propery P1 93.00 104.00 104.90 94.80 87.40 118.00 87.30 95.20 93.30 P2 92.10 91.90 91.90 81.50 86.10 100.00 79.50 85.80 81.90 P3 0.7069 0.8692 0.6167 0.6731 0.6540 0.7460 0.7460 0.8187 0.7339 P4 3.60 1.00 100.00 94.90 91.50 15.00 0.00 1.30 34.30 P5 16.30 4.50 100.00 97.10 95.50 100.00 0.00 6.00 57.10 P6 94.30 93.50 100.00 100.00 100.00 100.00 0.00 93.90 95.90 P7 35.00 22.70 351.10 117.10 93.00 31.30 63.30 16.00 52.40 P8 0.007 0.00 0.00 0.009 0.0002 0.05 0.0063 0.1805 0.057 P9 0.00 88.60 0.00 2.30 0.20 0.00 43.98 65.30 21.30 P10 0.00 0.1 61.30 48.90 36.00 0.00 1.04 0.60 33.30 P11 0.00 3.30 0.00 1.10 0.10 0.00 3.33 0.90 0.80 P12 0.00 0.00 0.00 0.00 0.00 15.40 0.00 0.00 0.00 Table 3. Produc daa Produc G1 G2 G3 Price ($/bbl) 31.00 31.00 31.00 Requiremen(Mbbl) MIN MAX LIFT MIN MAX LIFT MIN MAX LIFT Day 1 (Mbbl) 5.00 45.00 10.00 5.00 50.00 12.00 5.00 50.00 10.00 Day 3 (Mbbl) 5.00 50.00 25.00 Day 4 (Mbbl) 5.00 45.00 25.00 5.00 50.00 23.00 Day 5 (Mbbl) Day 7 (Mbbl) 5.00 45.00 30.00 Day 8 (Mbbl) 5.00 45.00 10.00 5.00 50.00 22.00 Invenory (Mbbl) 5.00 150.00 5.00 150.00 5.00 150.00 Rae (Mbbl/day) 5.00 45.00 5.00 50.00 5.00 50.00 Recipe (%) MIN MAX MIN MAX MIN MAX C1 0.00 22.00 0.00 25.00 0.00 25.00 C2 0.00 20.00 0.00 24.00 0.00 24.00 C3 2.00 10.00 0.00 10.00 0.00 10.00 C4 0.00 6.00 0.00 23.00 0.00 23.00 C5 0.00 25.00 0.00 25.00 0.00 25.00 C6 0.00 10.00 0.00 10.00 0.00 10.00 C7 0.00 100.00 0.00 0.00 0.00 0.00 C8 0.00 100.00 0.00 0.00 0.00 0.00 C9 0.00 100.00 0.00 0.00 0.00 0.00 Specificaions MIN MAX MIN MAX MIN MAX P1 95.00 98.00 98.00 P2 85.00 88.00 88.00 P3 0.72 0.775 0.72 0.775 0.72 0.775 P4 20.00 50.00 20.00 48.00 22.00 50.00 P5 46.00 71.00 46.00 71.00 46.00 71.00 P6 85.00 85.00 85.00 P7 45.00 60.00 45.00 60.00 60.00 90.00 P8 0.015 0.015 0.008 P9 42.00 42.00 42.00 P10 18.00 18.00 18.00 P11 1.00 1.00 1.00 P12 2.70 2.70 2.70 30

10.1. Example 1 (Blending Problem) Example 1 is focused on a single-period blending problem of hree producs (G1, G2, G3). Is main goal is o find he bes or preferred recipe for each produc ha minimizes blend cos and simulaneously saisfies all qualiy specificaions. Preferred recipes are used as iniial soluions for subsequen examples. For his paricular problem, emporal, invenory and resource consrains coming from he scheduling problem are disregarded by assuming ha enough resources, componen socks and ime are available as needed o produce 1 Mbbl of each produc once. In his way only he blending problem is aking ino consideraion. Componen cos and properies, variable recipe limis and sringen produc specificaions are he cenral feaures o be considered for solving example 1. The proposed MILP-based ieraive procedure was used o find preferred recipes for all required producs. In his case, iniial produc recipes were generaed aking ino accoun only linear produc properies. Then, he ieraive procedure was performed o updae he iniial recipes wih he purpose of saisfying all produc specificaions. Preferred recipes for producs G2 and G3 were found by execuing jus one ieraion of he proposed procedure, whereas an addiional ieraion was needed o saisfy all specificaions for produc G1, since he maximum sulfur conen was violaed boh in he iniial recipe as in he firs ieraion. In order o generae feasible recipes, componen concenraions for each produc were updaed by he MILP model in each ieraion, which gradually increased he blend cos. The recipe evoluion for produc G1 in erms of componen concenraion is presened in deail in Figure 5. Blend cos and produc properies associaed o each recipe are shown in Table 4. In addiion o he exac values for each propery prediced by nonlinear correlaions, he approximaions prediced by he proposed linear funcions are also presened in Table 4. I should be noed ha predicions of nonlinear properies end o improve when he number of ieraions is increased. Finally, bes produc recipes and bias facors for all producs are repored in Table 5. 31

Figure 5. Convergence o preferred recipe for produc G1 (ieraive procedure) Table 4. Ieraive blending problem for produc G1 Min. Spec. Iniial recipe Ieraion 1 Ieraion 2 Max Spec. Blend cos ($/bbl) 29.30 29.97 29.99 Qualiy Value Value approx. Value Approx. P1 95.00 97.891 97.898 97.7737 97.893 97.8928 P2 85.00 88.417 88.470 88.0493 88.438 88.4335 P3 0.72 0.7418 0.7325 0.7324 0.775 P4 20.00 34.455 35.418 35.409 50.00 P5 46.00 46.00 50.80 50.833 71.00 P6 85.00 96.460 91.797 91.780 P7 45.00 60.00 60.00 60.00 60.00 P8 0.0378 0.0152 0.0150 0.0150 0.0150 0.015 P9 28.458 22.974 22.923 42.00 P10 14.256 15.974 16.005 18.00 P11 0.8964 1.00 1.00 1.00 P12 1.1223 1.5684 1.5488 1.5687 1.5684 2.70 32

Table 5. Preferred produc recipes Produc G1 G2 G3 Blend cos ($/bbl) 29.99 25.28 24.98 Recipe (%) C1 22.00 25.00 25.00 C2 20.00 23.947 24.00 C3 2.00 16.794 1.372 C4 4.847 25.00 16.636 C5 25.00 9.259 25.00 C6 10.00 7.992 C7 5.198 C8 0.958 C9 9.997 Qualiy P1 97.893 (bias =1.527) 98.4122 (bias = 1.5611) 98.2214 (bias=1.5208) P2 88.438 (bias = -0.659) 88.4594 (bias = -1.0439) 88.3310 (bias=-1.0861) P3 0.7324 0.7305 0.7289 P4 35.409 41.3410 42.3734 P5 50.833 54.5932 54.5475 P6 91.780 97.0184 97.0150 P7 60.00 60.00 64.2465 P8 0.0150 0.0079 0.0072 P9 22.923 21.6536 21.6966 P10 16.005 17.2363 18.00 P11 1.00 1.00 1.00 P12 1.5687 1.4561 1.2597 10.2. Example 2 Example 2 addresses he original scheduling and blending example provided by ABB. Preferred produc recipes found in example 1 were used as he iniial soluion for he proposed ieraive procedure. Despie using linear approximaions, he proposed MILP model was capable of finding in jus one ieraion he same soluion generaed by nonlinear opimizaion ools. However, alhough he discree and coninuous ime represenaions obained he same profi in erms of componen cos and produc value (1,611.21 $), he coninuous ime represenaion is able o find a schedule ha operaes he blenders a full capaciy for 2.67 days less han he discree ime represenaion, which can significanly reduce he oal operaing cos. Produc schedules based on a discree and coninuous ime represenaion are repored in Tables 6 and 7, respecively. The invenory evoluion of componens hrough he scheduling horizon is shown in Figure 33

Table 6. Produc schedule (Example 2 - discree ime represenaion) Produc Period Sar End Prod Lif Invenory G1 T1 0.00 1.00 15.02 10.00 5.02 T2 1.00 3.00 0.00 0.00 5.02 T3 3.00 4.00 45.00 25.00 25.02 T4 4.00 5.00 0.00 0.00 25.02 T5 5.00 7.00 45.00 30.00 40.02 T6 7.00 8.00 45.00 10.00 75.02 G2 T1 0.00 1.00 50.00 12.00 38.00 T2 1.00 3.00 50.00 25.00 63.00 T3 3.00 4.00 50.00 23.00 90.00 T4 4.00 5.00 0.00 0.00 90.00 T5 5.00 7.00 0.00 0.00 90.00 T6 7.00 8.00 0.00 0.00 90.00 G3 T1 0.00 1.00 50.00 10.00 40.00 T2 1.00 3.00 0.00 0.00 40.00 T3 3.00 4.00 0.00 0.00 40.00 T4 4.00 5.00 0.00 0.00 40.00 T5 5.00 7.00 0.00 0.00 40.00 T6 7.00 8.00 50.00 22.00 68.00 Table 7. Produc schedule (Example 2 - coninuous ime represenaion) Produc Period Sar End Prod Lif Invenory G1 T1 0.00 1.00 45.00 10.00 35.00 T2 1.00 2.00 0.00 0.00 35.00 T3 3.00 4.00 45.00 25.00 55.00 T4 4.00 5.00 0.00 25.00 55.00 T5 5.00 5.33 15.02 0.00 40.02 T6 7.00 8.00 45.00 10.00 75.02 G2 T1 0.00 1.00 50.00 12.00 38.00 T2 1.00 2.00 50.00 0.00 63.00 T3 3.00 4.00 50.00 23.00 90.00 T4 4.00 5.00 0.00 23.00 90.00 T5 5.00 5.33 0.00 0.00 90.00 T6 7.00 8.00 0.00 0.00 90.00 G3 T1 0.00 1.00 50.00 10.00 40.00 T2 1.00 2.00 0.00 0.00 40.00 T3 3.00 4.00 0.00 0.00 40.00 T4 4.00 5.00 0.00 0.00 40.00 T5 5.00 5.33 0.00 0.00 40.00 T6 7.00 8.00 50.00 22.00 68.00 34

10.3. Example 3 This example inroduces a small change ino example 2 in order o evaluae he effec of predefining minimum and maximum requiremens for each ime inerval. In his way he amoun o be produced in each ime inerval becomes a model variable only resriced by minimum and maximum producion raes. The amoun of produc o be lifed a specific due daes is sill a hard consrain o be saisfied. This modificaion allows he model o increase he oal producion by almos 36%, i.e. from 400.02 Mbbl o 542.02 Mbbl, which represens increasing he oal profi o 2,448.05 ($), which is almos 52% increase (see Table 13). Preferred produc recipes are used for all producs and one ieraion is only execued. Produc schedules based on a discree and coninuous ime represenaion are shown in Tables 8 and 9, respecively. In his example we noe ha he coninuous ime represenaion needs 2.60 days less of oal operaing ime o reach he same producion level as he discree ime model. Figure 7 shows Gan-chars corresponding o examples 2 and 3. Table 8. Produc schedule (Example 3 - discree ime represenaion) Produc Period Sar End Prod Lif Invenory G1 T1 0.00 1.00 45.00 10.00 35.00 T2 1.00 3.00 60.02 0.00 95.02 T3 3.00 4.00 0.00 25.00 70.02 T4 4.00 5.00 0.00 0.00 70.02 T5 5.00 7.00 0.00 30.00 40.02 T6 7.00 8.00 45.00 10.00 75.02 G2 T1 0.00 1.00 50.00 12.00 38.00 T2 1.00 3.00 0.00 25.00 13.00 T3 3.00 4.00 50.00 23.00 40.00 T4 4.00 5.00 0.00 0.00 40.00 T5 5.00 7.00 60.00 0.00 100.00 T6 7.00 8.00 50.00 0.00 150.00 G3 T1 0.00 1.00 50.00 10.00 40.00 T2 1.00 3.00 72.00 0.00 112.00 T3 3.00 4.00 0.00 0.00 112.00 T4 4.00 5.00 0.00 0.00 112.00 T5 5.00 7.00 10.00 0.00 122.00 T6 7.00 8.00 50.00 22.00 150.00 35

Table 9. Produc schedule (Example 3 - coninuous ime represenaion) Produc Period Sar End Prod Lif Invenory G1 T1 0.00 1.00 45.00 10.00 35.00 T2 2.80 3.00 9.00 10.00 44.00 T3 3.00 4.00 45.00 35.00 64.00 T4 4.00 4.80 4.00 35.00 68.00 T5 6.80 7.00 9.00 65.00 47.00 T6 7.00 8.00 38.02 75.00 75.02 G2 T1 0.00 1.00 50.00 12.00 38.00 T2 2.80 3.00 10.00 37.00 23.00 T3 3.00 4.00 50.00 60.00 50.00 T4 4.00 4.80 40.00 60.00 90.00 T5 6.80 7.00 10.00 60.00 100.00 T6 7.00 8.00 50.00 60.00 150.00 G3 T1 0.00 1.00 50.00 10.00 40.00 T2 2.80 3.00 0.00 10.00 40.00 T3 3.00 4.00 50.00 10.00 90.00 T4 4.00 4.80 40.00 10.00 130.00 T5 6.80 7.00 10.00 10.00 140.00 T6 7.00 8.00 32.00 32.00 150.00 240 200 160 120 80 40 0 0 1 2 3 4 5 6 7 Time 8 a) Example 2 (discree ime) b) Example 2 (coninuous ime) 240 240 200 200 160 160 120 120 80 80 40 40 0 0 1 2 3 4 5 6 7 Time 8 0 0 1 2 3 4 5 6 7 Time 8 c) Example 3 (discree ime) d) Example 3 (coninuous ime) Figure 6. Evoluion of componen socks (Examples 2 and 3) 36

a) Example 2 (discree ime) b) Example 2 (coninuous ime) c) Example 3 (discree ime) d) Example 3 (coninuous ime) Figure 7. Gan chars (examples 2 and 3) 10.4. Example 4 Finally, his example deals wih a modified version of he original example where he following changes are inroduced: (1) Properies P1 and P2 are decreased by 1 for componens C1, C2, C3 and C6, (2) he price of G3 is increased o 31.05 $/bbl, (3) componen cos is increased o 27 $/bbl and 23 $/bbl for C1 and C2 and (4) producion raes for C1 and C2 are reduced o 13 Mbbl/day and 31 Mbbl/day respecively. All oher daa remain as in he original example. The main goal here is o analyze he effec of hese changes in he blending and scheduling decisions. Deailed produc schedules for discree and 37

coninuous ime represenaions for Example 4 are shown in Tables 10 and 11, respecively. Regarding he blending decisions, preferred recipes found in example 1 are proposed as he iniial soluion. However, hey have o be updaed because changes in he componen properies make some preferred recipes infeasible. Only one ieraion is required o modify he infeasible recipes relaed o producs G2 and G3. Preferred and updaed recipes for hese producs are compared in Table 12. As shown, he new recipes saisfy all produc specificaions bu a he same ime, updaed componen concenraions increase he blend cos wih which he profi is reduced o 1,234.49 ($). This difference mainly arises because componen coss were increased and ocane numbers were reduced. I should be noed ha key properies such RON and MON are saisfied wih a very small margin, which means ha qualiy giveaway is minimized by using he proposed mehod. Table 10. Produc schedule (Example 4 - discree ime represenaion) Produc Period Sar End Prod Lif Invenory G1 T1 0.00 1.00 45.00 10.00 35.00 T2 1.00 3.00 0.00 0.00 35.00 T3 3.00 4.00 5.00 25.00 15.00 T4 4.00 5.00 0.00 0.00 15.00 T5 5.00 7.00 20.00 30.00 5.00 T6 7.00 8.00 10.00 10.00 5.00 G2 T1 0.00 1.00 50.00 12.00 38.00 T2 1.00 3.00 100.00 25.00 113.00 T3 3.00 4.00 50.00 23.00 140.00 T4 4.00 5.00 0.00 0.00 140.00 T5 5.00 7.00 0.00 0.00 140.00 T6 7.00 8.00 0.00 0.00 140.00 G3 T1 0.00 1.00 50.00 10.00 40.00 T2 1.00 3.00 0.00 0.00 40.00 T3 3.00 4.00 0.00 0.00 40.00 T4 4.00 5.00 0.00 0.00 40.00 T5 5.00 7.00 0.00 0.00 40.00 T6 7.00 8.00 50.00 22.00 68.00 38

Table 11. Produc schedule (Example 4 - coninuous ime represenaion) Produc Period Sar End Prod Lif Invenory G1 T1 0.00 1.00 16.00 10.00 6.00 T2 1.00 3.00 0.00 10.00 6.00 T3 3.00 4.00 45.00 35.00 26.00 T4 4.00 5.00 0.00 35.00 26.00 T5 5.00 5.20 9.00 35.00 5.00 T6 7.00 8.00 10.00 75.00 5.00 G2 T1 0.00 1.00 50.00 12.00 38.00 T2 1.00 3.00 100.00 37.00 113.00 T3 3.00 4.00 50.00 60.00 140.00 T4 4.00 5.00 0.00 60.00 140.00 T5 5.00 5.20 0.00 60.00 140.00 T6 7.00 8.00 0.00 60.00 140.00 G3 T1 0.00 1.00 50.00 10.00 40.00 T2 1.00 3.00 0.00 10.00 40.00 T3 3.00 4.00 0.00 10.00 40.00 T4 4.00 5.00 0.00 10.00 40.00 T5 5.00 5.20 0.00 10.00 40.00 T6 7.00 8.00 50.00 32.00 68.00 Table 12. Updaed produc recipes (Example 4) Produc G2 G3 Preferred Updaed Preferred Updaed Blend cos ($/bbl) 25.28 26.92 24.98 26.67 Recipe (%) C1 25.00 25.00 25.00 25.00 C2 23.947 24.00 24.00 24.00 C3 16.794 0.223 1.372 3.195 C4 25.00 16.09 16.636 14.869 C5 9.259 24.831 25.00 24.269 C6 9.856 7.992 8.640 Qualiy P1 97.8204 98.0235 97.6283 98.052 P2 87.8588 88.0133 87.7294 88.0455 P3 0.7305 0.7309 0.7289 0.7285 P4 41.3408 40.831 42.3734 41.9724 P5 54.5936 54.571 54.5476 54.6305 P6 97.0184 97.015 97.015 97.015 P7 60.00 60.00 64.2473 68.1274 P8 0.0079 0.0081 0.0072 0.0074 P9 21.6533 21.6837 21.6966 21.6546 P10 17.2362 16.968 18.00 18.00 P11 1.00 0.9938 1.00 0.9799 P12 1.4562 1.5491 1.2597 1.3626 Table 1. Comparison of resuls Example Blend value Comp. sock Comp. invenory Toal Profi / BBL producion build Profi 2 12,400.61 22,352.00 11,562.60 1,611.21 4.03 3 16,802.61 22,352.00 7,997.44 2,448.05 4.52 4 11,785.00 23,504.00 12,953.49 1,234.49 3.25 Uni: M$ 39

Table 2. Model size and compuaional requiremens Example Binary vars, con. vars, consrains Objecive CPU ime a funcion 1 -, 127,81 12 0.13 2.a (NLP model*) -, 919,772 1,611.21 1.25 2.a 9, 757, 679 1,611.21 0.26 2.b 9, 841, 832 1,611.21 0.26 3.a 18, 757, 679 2,448.05 0.23 3.b 18, 841, 832 2,448.05 0.26 4.a 9, 757, 679 1,234.49 0.23 4.b 9, 841, 832 1,234.49 0.26 a Seconds on Penium IV PC wih GAMS 21.2/CPLEX 8.1 - * All scheduling decisions are predefined 11. COMPUTATIONAL RESULTS Differen scheduling and blending problems were solved in he previous secion in order o evaluae he efficiency of he proposed mehod. Example 1 deal wih a pure blending problem whereas examples 2, 3 and 4 also accouned scheduling decisions. Examples 3 and 4 correspond o modified versions of he original Example 2 where minimum and maximum requiremens were relaxed (Example 3) and cerain changes in componen properies and cos and produc prices were incorporaed (Example 4). Table 13 summarizes he resuls for examples 2, 3 and 4, while Table 14 provides he compuaional saisics on he four examples. As can be seen, he size of he MILP problems is no very large and involves a modes number of 0-1 variables. For his reason every single problem needs no more han 1 sec a CPU ime wih CPLEX 8.1, hus showing ha he proposed models and he ieraive MILP procedure are very efficien. The mehod found more economic soluions o a combined scheduling and blending opimizaion problem almos an order of magniude faser han i ook o solve only he blending NLP problem wih a predeermined schedule. 12. CONCLUSIONS A new MILP approach o simulaneously solve gasoline shor-erm scheduling and blending problems has been proposed. Alhough he mehod is able o deal wih non-linear produc properies and variable recipes, he use of non-linear consrains was avoided hrough an ieraive procedure ha can be based on a discree or a coninuous ime mahemaical formulaion. As shown in he examples, he proposed model can generae very good soluions in erms of profi wih very low CPU ime requiremens. Acknowledgemens The auhors would like o hank ABB Corporae Research for financial suppor of his work. 40

REFERENCES Bechel Corp. PIMS (Process Indusry Modeling Sysem). User s manual, version 6.0. Houson. TX. 1993. Booner and Moore Managemen Science. RPMS. (Refinery and Perochemical Modeling Sysem). A sysem descripion, Houson, TX, 1979. Glismann K., Gruhn G. Shor-erm scheduling and recipe opimizaion of blending processes Comp. Chem. Eng., 25, 627, 2001. Grossmann I.E., Van den Heever S.A. and Harjunkoski I. "Discree opimizaion mehods and heir role in he inegraion of planning and scheduling," AIChE Symposium Series No. 326, 98, 150, 2002 Ieraperiou M.G., Floudas C.A. Effecive coninuous-ime formulaion for shor-erm scheduling. 1. Mulipurpose bach processes. Ind. Eng. Chem. Res., 37, 4341-4359, 1998. Kelly J.D., Mann J.L. Crude-oil blend scheduling opimizaion: An applicaion wih muli-million dollar benefis. Honeywell Hi-Spec Soluions. Personal Communicaion. Augus 2002. Kelly J.F. Formulaing producion planning models Informaion Technology. 43, January 2004 Lee H., Pino J.M, Grossmann I.E., Park S. Mixed-ineger linear programming model for refinery shor-erm scheduling of crude oil unloading wih invenory managemen. Ind. Eng. Chem. Res. 35, 1630-1641, 1996. Moro L.F.L, Zanin A.C., Pino J.M. A planning model for refinery diesel producion Comp. Chem. Eng., 22, S1039-S1042, 1998. Pino J.M. and Grossmann I.E. Assignmen and sequencing models for he scheduling of chemical processes Ann. of Oper. Res., 81, 433-466, 1998. Quesada I., Grossmann I.E. Global opimizaion of bilinear process neworks wih mulicomponens flows Comp. Chem. Eng., 19, 1219-1242, 1995. Reklaiis G.V. Overview of scheduling and planning of bach process operaions Technical repor, NATO Advanced Sudy Insiue, Analaya, Turkey, 1992. Rigby B., Lasdon L.S., and Waren A.D. The evoluion of Texaco blending sysems from Omega o SarBlend. Inerfaces, 25, 64, 1995. Shah, N. Single- and mulisie planning and scheduling: Curren saus and fuure challenges. AIChE Symposium Series No 320, 94, 75, 1998 Jia Z., Iearaperiou M. Mixed-ineger linear programming for gasoline blending and disribuion scheduling. Ind. Eng. Chem. Res., 42, 825-835, 2003. 41