# A novel approach to the optimization of refining Schedules for crude oil operations in refinery

Naiqi Wu, Liping Bai, Mengchu Zhou, Feng Chu, Saïd Mammar

► To cite this version:

Naiqi Wu, Liping Bai, Mengchu Zhou, Feng Chu, Saïd Mammar. A novel approach to the optimization of refining Schedules for crude oil operations in refinery. IEEE Transactions on Systems, Man, and Cybernetics, Part C: Applications and Reviews, 2012, 42 (6), pp.1042-1053. 10.1109/TSMCC.2012.2185226. [hal-00735582](https://hal.science/hal-00735582)

HAL Id: hal-00735582

https://hal.science/hal-00735582

Submitted on 12 Jul 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# A Novel Approach to Optimization of Refining Schedules for Crude Oil Operations in Refinery

NaiQi Wu, *Senior Member, IEEE*, Liping Bai, MengChu Zhou, *Fellow, IEEE*, Feng Chu, *Senior Member, IEEE*, and Saïd Mammar, *Senior Member, IEEE*

***Abstract***—Short-term scheduling for crude oil operations is a combinatorial problem and involves extreme detail. Thus, it is very complicated and, up to now, there is no efficient technique and software tool for it. To search for efficient techniques, a two-layer hierarchical solution is proposed for it. At the upper level, one finds a realizable refining schedule to optimize some objectives. At the lower level, a detailed schedule is obtained to realize it. A methodology has been presented to solve the lower level problem from a control perspective by the authors of this paper. In this paper, the upper level problem for finding optimal refining schedules is addressed, and a novel method is proposed based on the results obtained at the lower level. This method solves a linear programming problem to determine the maximal production rate and a transportation problem to optimally assign crude oil types and volume to the distillers. This way, the method is computationally very efficient. An industrial case study is presented to show the application of the proposed method.

***Index Terms***—Crude oil operations, linear programming, short-term scheduling, transportation problem.

## I. INTRODUCTION

In recent years, aiming at profit increase, great attention has been paid to the development of effective techniques for the operations of refinery [16]. There are three levels in operating a plant of refinery: production planning, production scheduling, and process control. Up to now, at the process control level, advanced control systems have been installed for unit control to optimize some production objectives in most oil refineries, resulting in significant productivity gains in the unit level. However, the optimized production units do not imply the global economic optimization of a plant. At the planning level,

with the availability of linear-programming-based commercial software for refinery production planning, such as process industry modeling system [1], general production plans of a whole refinery can be found. As pointed out by Pelham and Pharris [17], the planning technology can be considered well developed and not much progress should be expected. Short-term scheduling is at the middle level and it lacks effective techniques and software tools. The three levels should work together to effectively operate a process plant [26]. Thus, with the well-developed techniques for planning and process control, it is crucial to develop effective techniques for short-term scheduling [3], [4].

To search for effective techniques for short-term scheduling, in recent years, effort has been made and mathematical programming models are developed for batch processes. For examples, models in [6], [7], [13], [14], and [18] are representative. These techniques are then modified to solve short-term scheduling problem in refinery. Depending on the time representation, there are mainly two categories of mathematical programming models: discrete- and continuous-time representation ones. The former divides the scheduling horizon into a number of time intervals with uniform time durations. An event, such as start and end of an operation, should happen at the boundary of a time interval. The mixed integer programming models [5], [8], [11], [15], [19], [21], [23], [24] are the representative ones. The main drawback is that the uniform time interval must be small enough so as to obtain acceptable accuracy, which leads to a huge number of binary variables and makes the problem very difficult to solve [2], [33]. Continuous-time models are adopted in [8]–[10], [25] to reduce the number of discrete variables. Although the number of discrete variables is significantly reduced, the drawback is that there are nonlinear constraints in it [19]. Furthermore, to build such a model, it needs to know the number of events to occur [2]. In fact, it is not known before the schedule is created. Moreover, to make the problem solvable, most of discrete-time and continuous-time mathematical programming models make special assumptions, which, unfortunately, make a low-quality or unrealistic solution for real-world cases [15].

For complex scheduling problems, application of heuristics and search algorithms, such as simulated annealing algorithms, genetic algorithms, and tabu algorithms [12], [20], [22], [34], is a good choice. These techniques are applicable only for problems where the jobs that are to be scheduled are deterministic at the beginning and solution feasibility is not a problem. However, to generate a short-term schedule for a refinery process, one needs to set the number of jobs, define the detailed activities for each job and the time needed for each activity, and determine their sequence. Meanwhile, there is no simple way to check the

N. Q. Wu and L. P. Bai are with the Department of Industrial Engineering, School of Mechatronics Engineering, Guangdong University of Technology, Guangzhou 510006, China (e-mail: nqwu@gdut.edu.cn; bailp@gdut.edu.cn).

M. C. Zhou is with the Key Laboratory of Embedded System and Service Computing, Ministry of Education, Tongji University, Shanghai 200092, China and also with the Department of Electrical and Computer Engineering, New Jersey Institute of Technology, Newark, NJ 07102-1982 USA (e-mail: zhou@njit.edu).

F. Chu and S. Mammar are with the Laboratoire Informatique, Biologie Intégrative et Systèmes Complexes, Université d'Evry Val d'Essonne, 91020 Evry Cédex, France (e-mail: feng.chu@ibisc.univ-evry.fr; said.mammar@inrets.fr).
<figure><img src="image_2.png" /><figcaption>Fig. 1. Architecture of short-term scheduling for crude oil operations.</figcaption></figure>

feasibility of a schedule. In other words, these techniques are not applicable to short-term scheduling of refinery. Thus, a new method should be developed to solve this problem.

Short-term scheduling for crude oil operations is one of the most difficult scheduling problems in operating an oil refinery plant. To solve this problem, the short-term scheduling for crude oil operations is divided into two subproblems in a hierarchical way in [28]. At the upper level, one needs to find a refining schedule by optimizing certain objectives, while, at the lower level, a detailed schedule is created for a given refining one. With this decomposition and a Petri net model [28]–[31], [35]–[40] a heuristic is proposed to check the realizability for a given refining schedule in [28]. If realizable, a detailed schedule is created. Nevertheless, by that method, if a detailed schedule is not found, it cannot answer whether the refining schedule is realizable or not. Furthermore, in [28], no method is presented for how a realizable refining schedule can be efficiently found.

A schedule should satisfy all the constraints. If so, it is a feasible schedule, and otherwise, it is infeasible one. The short-term scheduling problem for crude oil operations is studied in a control perspective in [29]–[33]. It is found that a short-term schedule is composed of a series of operation decisions (OD). The execution of an OD transfers the system from a state to another. A state is called safe, if starting with this state, there exists a feasible schedule, and otherwise, it is unsafe. Thus, for a feasible schedule, each OD should transfer the system from a safe state to another safe one. If a system is schedulable, initially, it must be at a safe state. To analyze the schedulability of crude oil operations, an architecture as shown in Fig. 1 is proposed. The crude oil operation process contains both discrete event and continuous variables; hence, it is a hybrid process. Based on the proposed architecture, hybrid Petri net models are developed to describe this process in [29]–[33]. With these models, schedulabilty analysis is made and schedulabilty conditions are presented for different situations. These conditions can be used to check the realizability of a given refining schedule. If schedulable, a detailed schedule can be easily found. These conditions can also be used as constraints to obtain a realizable and optimal refining schedule. However, no method is presented

for how to find such a refining schedule in [29]–[33]. If such a refining schedule can be found in an efficient way, the short-term scheduling problem for crude oil operations can be solved. Based on the schedulabilty conditions, this paper addresses the refining scheduling problem and presents an efficient approach to find a realizable and optimal refining schedule. It is a three-phase approach. In phase 1, a linear programming model is built and solved to maximize productivity; in phase 2, a transportation problem is solved to assign crude oil to distillers; and then, in phase 3, the parcels of different crude oil types are sequenced to minimize the number of switching times. This way, a realizable and optimal refining schedule can be easily obtained. By this approach, the following contributions are made: 1) the hybrid optimization problem is decomposed such that each subproblem has only continuous or discrete event variables; 2) in phases 1 and 2, the subproblems are linear programming and transportation problem, respectively, which can be solved very efficiently, and it shows that the problem in phase 3 can be solved by a polynomial algorithm. Thus, the approach is computationally efficient; and 3) multiple objectives are handled effectively.

The remainder of this paper is organized as follows. In Section II, the process of crude oil operations is briefly introduced and statement of a refining scheduling problem is made. Then, the scheduling approach is presented in Section III. Section IV uses an industrial case problem to show the application and efficiency of the proposed approach. Conclusions are given in Section V.

## II. CRUDE OIL OPERATIONS AND REFINING SCHEDULE

Before presenting our approach, this section briefly introduces crude oil operations in refinery and defines its refining scheduling problem.

### A. Process

A general refinery process is illustrated in Fig. 2. It can be divided into three phases: 1) crude oil operations; 2) production; and 3) final product delivery. Crude oil is carried to the port by crude oil tankers and then unloaded into storage tanks by the port. The crude oil in the storage tanks is transported to charging tanks in the refinery plant through a pipeline. From the charging tanks, oil is fed into distillers for distillation. This process forms the crude oil operations. The middle products from the distillers are then sent to other production units for fractionation and reaction, which is the second phase. The products after fractionation and reaction are blended to produce the final products. As for short-term scheduling in a refinery, the scheduling problem of crude oil operations is one of the most difficult parts.

There are various types of crude oil processed in a refinery. The components are different given different types of crude oil. Each distiller can process parts of the crude oil types, but not all. Although a type of crude oil may be processed by multiple ones, the effectiveness is different for different ones. One can rank their effectiveness to process a crude oil type.

Because different types of crude oil should be processed by different distiller, a tank (storage or charging tank) can hold one type of crude oil at a time. Thus, crude oil can be unloaded into
<figure><img src="image_3.png" /><figcaption>Fig. 2. Illustrative view of the refinery process.</figcaption></figure>

only an empty storage tank unless the same type of crude oil is in it. Similarly, crude oil in a storage tank can be transported via a pipeline into an empty charging tank or a charging tank with same type of oil in it. After filling a storage or charging tank, crude oil must stay in it for a certain amount of time before it can be discharged. This time delay is called oil residency time. Besides, a tank cannot receive and send oil at the same time for both storage and charging tanks.

Usually, a pipeline takes tens of kilometers long with the capacity of tens of thousand cubic meters. It is full of crude oil all the time and cannot be emptied. Because all types of crude oil are transported from storage tanks to charging tanks via a pipeline, there may be a number of segments of crude oil in the pipeline with different types of oil for different segments.

When crude oil in storage tanks is transported through a pipeline to charging tanks, different types of crude oil may be mixed to obtain suitable components for distillation with the oil transportation. However, we do not consider the mixing here for a mixture can be treated just as a type of crude oil. When a charging tank is feeding a volume $\xi$ of crude oil into a distiller in time interval $[\tau_1, \tau_2]$ this tank must be dedicated to the distiller and cannot be charged during the time interval. Crude oil can also be mixed when it is fed into distillers. However, by doing so, two or more charging tanks should be used to serve one distiller at the same time. This way, a large number of charging tanks are required for distiller feeding. Hence, such an operational way is not considered because of the limited number of charging tanks. Thus, only one tank is needed to feed one distiller at a time unless it switches from one charging tank to another tank for feeding a distiller.

In feeding a distiller, there is a charging-tank-switch-overlap constraint explained as follows. Assume that charging tank CTK₁ is feeding distiller DS₁ and the oil in CTK₁ will be used up at time $\tau$ if the distiller is fed by just CTK₁. However, the refining process requires that the successor tank CTK₂ ready to feed DS₁ should start working at time $\tau_1$, i.e., before $\tau$. Thus, in time interval $[\tau_1, \tau_2]$ with $\tau_1 < \tau < \tau_2$, both CTK₁ and CTK₂ are feeding distiller DS₁. During this time, the remaining oil in charging tank CTK₁ is used up, as well as a certain amount of crude oil in CTK₂ is fed into distiller DS₁. This is called charging-tank-switch-overlap constraint in distiller feeding.

In summary, the process includes the following resource and process constraints. The former include: 1) the limited number of storage and charging tanks and the capacity of each tank; 2) the limited flow rate of oil unloading and pipeline; and 3) the volume of various crude oil types available in storage and charging tanks, and in coming tankers. The latter include: 1) a distiller should be kept in working all the time uninterruptedly with upper and lower bounds of its production rate; 2) a type of crude oil should be processed by suitable distillers; 3) at least one charging tank should be dedicated to a distiller at any time for feeding it; 4) a tank cannot be charged and discharged simultaneously; 5) oil residency time constraint must be met; and 6) charging-tank-switch-overlap constraint.

## B. Refining Scheduling Problem

Let $\Gamma = [\tau_s, \tau_e]$ denote the scheduling horizon that often lasts for a week or ten days with $\tau_s$ and $\tau_e$ being the start and end time points. A short-term schedule for crude oil operations should provide all the activities in every detail. For general scheduling problems, there are a set of jobs and a number of servers. The jobs are well defined, or they are often assumed to consume deterministic processing time. The scheduling problem is to assign the jobs to servers and determine the processing sequence for each server. For refining scheduling, the servers are the set of distillers in a refinery plant. However, the jobs that are to be scheduled are not known before a schedule is obtained. All the information that we know is the scheduling horizon $\Gamma = [\tau_s, \tau_e]$ and the initial state of the process at $\tau_s$. The initial state is characterized by the following.

1) The production state. For a distiller $i$, it gives:

a) the type of crude oil being processed by distiller $i$;

b) the production rate with which crude oil is being processed by distiller $i$;

c) the charging tank that is feeding distiller $i$.

2) The state of tanks. A storage or charging tank must be in one of the four states: a) idle and empty; b) idle with oil in it; c) in charging; and d) in discharging:

i) for State b, one has the information of the crude oil type and amount in it;

ii) for State c, the crude oil type that is being charged, the charging rate, and amount of oil in the tank at the moment are given;
iii) for State d, the crude oil type and amount remained in the tank and the discharging rate are given.

3) The state of a pipeline. A pipeline must be in one of the states: a) idle; and b) transporting crude oil from storage tanks to charging tanks:

i) for both states a and b, one has the number of different segments of crude oil in the pipeline, the crude oil type and amount for each segment at the moment;

ii) for State b, one has the rate with which crude oil is being transported.

4) The information of tanker arrivals. It includes the number of ships that will arrive during the scheduling horizon, and for each ship, one has

a) arrival time;

b) the types of crude oil in the ship and the amount of oil for each type; and

c) the oil unloading rate.

With the initial state for a process, a refining schedule is to determine, at any time point for the entire scheduling horizon, the production rate and the type of crude oil to be processed for every distiller in the system. In a refinery, processing different types of crude oil produces different products. To meet the market demands, various types of crude oil should be processed. Thus, for a distiller, it needs to switch from processing one type of crude oil to another type. Thus, the main decision for a refining scheduling is when such switches take place and the types of crude oil for each switch. To describe a refining schedule, we define a feeding parcel of crude oil (FPCO).

**Definition 2.1:** FPCO = (COT, $\zeta$, [α, β]) is defined as an FPCO, where COT = crude oil type to be fed into a distiller; $\zeta$ = volume of crude oil to be fed into a distiller; and [α, β] is a time interval in which α and β are the start and end time points for feeding this parcel of crude oil.

The flow rate for feeding such a parcel of oil during [α, β] can vary. However, when it changes, the set point for the distillation process should change as well, which leads to some loss. Thus, in practice, the flow rate for an FPCO is set to be a constant and can be calculated by $f = \zeta/(\beta - \alpha)$. Thereafter, if the same type of crude oil is fed into a distiller with different flow rate, we can simply treat it as a different FPCO. Let FPCO$_{ij}$ = (COT$_{ij}$, $\zeta_{ij}$, [α$_{ij}$, β$_{ij}$]) denote the jth FPCO for feeding distiller i. Assume that it needs Q FPCOs for distiller i during the scheduling horizon. Then, its refining schedule for distiller i can be denoted as $RS_i = \{FPCO_{i1}, FPCO_{i2}, \dots, FPCO_{iQ}\}$. Furthermore, assume that there are K distillers in the system and let $DS = \{1, 2, \dots, K\}$ be the set of distillers and $f_{ij} = \zeta_{ij}/(\beta_{ij} - \alpha_{ij})$. Then, the refining scheduling problem is to find an ordered set of FPCOs $RS = \{RS_1, RS_2, \dots, RS_K\}$ such that the following conditions are satisfied:

$$ \tau_s = \alpha_{i1}, \beta_{i1} = \alpha_{i2}, \dots, \beta_{ij} = \alpha_{i(j+1)}, \dots, \\ \beta_{i(Q-1)} = \alpha_{iQ}, \text{ and } \beta_{iQ} = \tau_e \quad \forall i \in DS \quad (2.1) $$

$$ F_{i(\text{MIN})} \le f_{ij} \le F_{i(\text{MAX})} \quad \forall i \in DS \quad (2.2) $$

where $F_{i(\text{MIN})}$ and $F_{i(\text{MAX})}$ are the allowable minimal and maximal flow rate for feeding distiller i. An illustrative refining

<figure><img src="image_4.png" /><figcaption>Fig. 3. Illustrative refining schedule.</figcaption></figure>

schedule is shown in Fig. 3, where there are three distillers and two FPCOs for each distiller with a ten-day scheduling horizon.

Feasibility is essential for scheduling the crude oil operations. It requires that a refining schedule must be realizable by a detailed schedule. It should be pointed out that conditions (2.1) and (2.2) are not enough to guarantee the feasibility of a refining schedule RS. An oil refining process is a continuous process and it has an operation requirement as follows. If, at the initial state, charging tank A is feeding distiller $DS_1$ with a type of crude oil #k, a refining process starting from time $\tau_s$ should be scheduled such that distiller $DS_1$ should continue to refine crude oil #k in charging tank A until tank A is emptied. If a refining schedule can meet this requirement, it is said that such a refining schedule is compatible with the initial state. Hence, the feasibility of a refining schedule is defined as follows.

**Definition 2.2:** A refining schedule for crude oil operations in a refinery is said to be feasible if 1) it is compatible with the initial state and 2) there exists a detailed schedule that implements it such that all the constraints given in the previous section are satisfied. In [29]–[31], schedulability conditions are presented. With these conditions as constraints, a realizable refining schedule can be found, but it does not know how such a schedule can be found. Up to now, we have described the refining problem. Based on the problem statement, an efficient scheduling approach will be presented in the next section.

### III. SCHEDULING METHOD

With the description of refining scheduling in the previous section, this section presents an efficient scheduling approach.

#### A. Analysis of Refining Scheduling

Some objectives should be optimized when the crude oil operations are scheduled. Thus, we need to determine the objectives first. In the literature, the objectives include: 1) minimization of crude oil inventory cost, tanker waiting cost, and crude oil unloading cost [8], [9], [11]; 2) maximization of production and minimization of the number of tanks used [19]; 3) minimization of changeover cost [11]; and 4) minimization of heels [24]. Among them, the minimization of crude oil inventory and changeover costs, and the maximization of production are related to the refining scheduling, while the others should be pursued at the detailed scheduling level. Note that for refining scheduling, the amount of crude oil available at the beginning
of the scheduling horizon and the amount of crude oil that will arrive during the scheduling horizon are independent of the scheduling. Thus, with the initial crude oil inventory and oil arrival information, if the crude oil operations are scheduled such that the production rate is maximized, the crude oil inventory during the scheduling horizon must be minimized. Hence, maximizing the production rate minimizes the crude oil inventory cost at the same time. Besides maximization of production rate and minimization of crude oil inventory, the cost caused by assigning crude oil types to distillers should be minimized when crude oil operations are scheduled. As stated in the previous section, although a type of crude oil can be processed by a number of distillers, the effectiveness is different when it is processed by different distillers. Therefore, it needs to assign crude oil types to appropriate distillers for processing. In this paper, the goal is to find a refining schedule such that production is maximized, and changeover and crude oil type assignment costs are minimized.

As defined in *Definition 2.2*, to make a refining schedule realizable, schedulability conditions must be satisfied. Such conditions should be taken as constraints in finding a refining schedule. Thus, before developing the approach, we first present the schedulability conditions as follows. Let $\Psi$ denote the oil residency time, $f_{dsi}$ the feeding rate to distiller $i$, and $F_{pmax}$ the maximal flow rate of the pipeline. We have the following schedulability conditions without considering the charging-tank-switch-overlap constraint.

**Lemma 3.1 [31]:** Assume that: 1) the feeding rate for the $K$ distillers $DS_{1-K}$ is $f_{ds1} > f_{ds2} > \dots > f_{dsK}$, $\alpha_1 = \Psi \times f_{ds1}$, $\alpha_2 = \Psi \times f_{ds2}$, \dots, and $\alpha_K = \Psi \times f_{dsK}$; 2) there are $2K + 2$ charging tanks $CTK_{1-(2K+2)}$ with capacities $\xi_1 \ge K\alpha_1$, $\xi_2 \ge K\alpha_1$, $\xi_3 \ge K\alpha_1$, $\xi_4 \ge K\alpha_2$, $\xi_5 \ge K\alpha_2$, \dots, $\xi_{2i} \ge K\alpha_i$, $\xi_{2i+1} \ge K\alpha_i$, \dots, and $\xi_{2K} \ge K\alpha_K$, $\xi_{2K+1} \ge K\alpha_K$, $\xi_{2K+2} \ge K\alpha_K$; 3) $F_{pmax} = f_{ds1} + f_{ds2} + \dots + f_{dsK}$; 4) initially, the volume of oil type 1 in $CTK_1$ and $CTK_2$ is $\zeta_1 = \zeta_2 = K\alpha_1$, the volume of oil type 2 in $CTK_4$ is $\zeta_4 = K\alpha_2$, \dots, the volume of oil type $i$ in $CTK_{2i}$ is $\zeta_{2i} = K\alpha_i$, \dots, the volume of oil type $K$ in $CTK_{2K}$ is $\zeta_{2K} = K\alpha_K$, the other tanks are empty, and the oil in $CTK_1$, $CTK_4$, \dots, $CTK_{2i}$, \dots, and $CTK_{2K}$ is ready to feed; 5) the volume of crude oil of type $K$ remaining in storage tanks is $\beta < \alpha_K$, and after processing this amount of oil type $K$, distiller $DS_K$ should switch to process oil type $j$. Then, the system is schedulable and the volume $\beta$ of oil type $K$ can be used up without being mixed with other oil type.

**Lemma 3.1** states that for the entire scheduling horizon, if there are three charging tanks for each distiller and there is enough crude oil in the charging tanks at the beginning of the scheduling horizon, a feasible short-term schedule can be found. When the charging-tank-switch-overlap constraint is considered, we can show that if the conditions given in Lemma 3.1 are satisfied, the system is still schedulable. In the following discussion, we show how these conditions are included in the models as constraints such that a feasible refining schedule can be obtained.

It follows from the initial state information that some crude oil arrives at the port at time $t$ with $\tau_s < t < \tau_e$. This implies that only after time point $\tau > t$ can such crude oil be ready to

feed a distiller. With time point $t$, the oil unloading rate, the oil residency time, and the oil transportation rate from a storage tank to a charging tank known, $\tau$ can be calculated. Thus, when $Q$ tankers arrive during the scheduling horizon at times $t_1, t_2, \dots$, and $t_Q$, respectively, with $\tau_s < t_1 < t_2 < \dots < t_Q < \tau_e$, we can obtain $\tau_1, \tau_2, \dots$, and $\tau_Q$ with $\tau_s < \tau_1 < \tau_2 < \dots < \tau_Q < \tau_e$ such that the crude oil in the tanker that arrives at $t_i$ can be available for feeding after $\tau_i$. In this paper, we assume that $\tau_1, \tau_2, \dots$, and $\tau_Q$ are known. This way, the scheduling horizon is divided into $Q+1$ time buckets $[\tau_s, \tau_1], [\tau_1, \tau_2], \dots, [\tau_{Q-1}, \tau_Q]$, and $[\tau_Q, \tau_e]$. Alternatively, they can be called buckets 0, 1, \dots, and $Q$, respectively.

To describe the effectiveness to process a crude oil type by a distiller, a cost associated with a type of crude oil and a distiller can be set. If it is the best to process crude oil type $i$ by distiller $j$, small cost is set. We can order the crude oil types that can be processed by a distiller from the best to the worst and set the cost in an increasing way. If crude oil type $i$ cannot be processed by distiller $j$, the cost is set to be a very large number.

To develop the refining scheduling approach, we present the following notation.

$\Lambda$ Number of crude oil types (COT) to be processed during the scheduling horizon.

$COT = \{1, 2, \dots, \Lambda\}$ Set of crude oil types.

$\Pi$ Number of distillers in the plant

$DS = \{1, 2, \dots, \Pi\}$ Set of distillers.

$Q$ Number of tankers that will arrive during the scheduling horizon.

$BUK = \{0, 1, \dots, Q\}$ Set of buckets that begin at $\tau_s, \tau_1, \dots$, and $\tau_Q$, respectively.

$C_{ij}$ Cost if crude oil type $i$ is processed by distiller $j$, $i \in COT$ and $j \in DS$.

$V_p$ Capacity of the pipeline.

$V_{i-c}$ Volume of crude oil type $i$ in the charging tanks at time $\tau_s$, $i \in COT$.

$W_{ij}$ Remaining volume of crude oil type $i$ in the charging tank feeding distiller $j$ at time $\tau_s$, $i \in COT$ and $j \in DS$.

$V_{i-p}$ Volume of crude oil type $i$ in the pipeline at time $\tau_s$, $i \in COT$, with $\sum_{i \in COT} V_{i(pipe)} = V_p$.

$V_{i-s}$ Volume of crude oil type $i$ in the storage tanks at time $\tau_s$, $i \in COT$.

$V_{ik}$ Volume of crude oil type $i$ that is available for feeding after time $\tau_k$, $i \in COT$ and $k \in BUK$.

$F_{i(MAX)}$ Maximal feeding rate allowed for distiller $i \in DS$.

$F_{i(MIN)}$ Minimal feeding rate allowed for distiller $i \in DS$.

$F_{pmax}$ Maximal oil transportation rate via the pipeline.

$\Omega_i$ Set of crude oil types that can be processed by distiller $i$, $i \in DS$;

$f_{ij}$ Oil feeding rate to distiller $i$ during bucket $j$, $i \in DS$ and $j \in BUK$.
The proposed scheduling approach is a three-phase one. In phase 1, the production rate to maximize the production is determined. The amount of crude oil to be processed for each distiller during each bucket is, therefore, found. Then, in phase 2, the crude oil types and amount of crude oil are assigned to the distillers to minimize the crude oil type assignment cost. In phase 3, the result obtained in phase 2 is adjusted, and the crude oil parcels and their sequence are determined to minimize the changeover cost.

## B. Determination of Production Rate

In this section, a model is presented to solve the problem of phase 1 as follows. To maximize the production is to maximize the crude oil feeding rate for each distiller

$$ \text{Problem P1: Maximize } J = \sum_{j=0}^{Q} \sum_{i \in \text{DS}} f_{ij} \quad (3.1) $$

subject to

$$ F_{i(\text{MIN})} \le f_{ij} \le F_{i(\text{MAX})}, \quad i \in \text{DS} \text{ and } j \in \text{BUK} \quad (3.2) $$

$$ \sum_{i \in \text{DS}} f_{ij} \le F_{p \max}, \quad j \in \text{BUK} \quad (3.3) $$

$$ \sum_{i \in \Omega_j} V_{i-c} + \sum_{i \in \Omega_j} V_{i-p} + \sum_{i \in \Omega_j} V_{i-s} \ge (\tau_1 - \tau_s) f_{j0}, \quad j \in \text{DS} \quad (3.4) $$

$$ \sum_{i \in \text{COT}} V_{i-c} + \sum_{i \in \text{COT}} V_{i-p} + \sum_{i \in \text{COT}} V_{i-s} \ge (\tau_1 - \tau_s) \sum_{j \in \text{DS}} f_{j0} \quad (3.5) $$

$$ \sum_{i \in \Omega_j} V_{i-c} + \sum_{i \in \Omega_j} V_{i-p} + \sum_{i \in \Omega_j} V_{i-s} + \sum_{i \in \Omega_j} \sum_{k=1}^{n} V_{ik} \ge (\tau_1 - \tau_s) f_{j0} + \sum_{k=1}^{n} (\tau_{k+1} - \tau_k) f_{jk}, \quad j \in \text{DS} \text{ and } 1 \le n \le Q-1 \quad (3.6) $$

$$ \sum_{i \in \text{COT}} V_{i-c} + \sum_{i \in \text{COT}} V_{i-p} + \sum_{i \in \text{COT}} V_{i-s} + \sum_{i \in \text{COT}} \sum_{k=1}^{n} V_{ik} \\ \ge (\tau_1 - \tau_s) \sum_{j \in \text{DS}} f_{j0} + \sum_{j \in \text{DS}} \sum_{k=1}^{n} (\tau_{k+1} - \tau_k) f_{jk}, \\ 1 \le n \le Q-1 \quad (3.7) $$

$$ \sum_{i \in \Omega_j} V_{i-c} + \sum_{i \in \Omega_j} V_{i-p} + \sum_{i \in \Omega_j} V_{i-s} + \sum_{i \in \Omega_j} \sum_{k=1}^{Q} V_{ik} \\ \ge (\tau_1 - \tau_s) f_{j0} + \sum_{k=1}^{Q-1} (\tau_{k+1} - \tau_k) f_{jk} + (\tau_e - \tau_Q) f_{jQ}, \\ j \in \text{DS} \quad (3.8) $$

$$ \sum_{i \in \text{COT}} V_{i-c} + \sum_{i \in \text{COT}} V_{i-p} + \sum_{i \in \text{COT}} V_{i-s} + \sum_{i \in \text{COT}} \sum_{k=1}^{Q} V_{ik} - V_p \\ \ge (\tau_1 - \tau_s) \sum_{j \in \text{DS}} f_{j0} + \sum_{j \in \text{DS}} \sum_{k=1}^{Q-1} (\tau_{k+1} - \tau_k) f_{jk} \\ + \sum_{j \in \text{DS}} (\tau_e - \tau_Q) f_{jQ}. \quad (3.9) $$

Objective (3.1) maximizes the production, and meanwhile, minimizes crude oil inventory cost as well. Constraint (3.2) states that for every distiller the crude oil feeding rate should be in an allowable range. As indicated in Lemma 3.1, the total production rate for the system cannot be greater than the maximal flow rate of the pipeline. This is guaranteed by Constraint (3.3). In bucket 0, only the crude oil in charging tanks, pipeline, and storage tanks can be usable. Constraint (3.4) says that $f_{j0}$'s should be set such that there is enough crude oil to be processed at each distiller, which implicitly gives the constraint that there is enough crude oil in the charging tanks at the beginning of the scheduling horizon as required by Lemma 3.1. Because a type of crude oil can be processed by more than one distiller, the satisfaction of Constraint (3.4) cannot guarantee that there is enough crude oil to be processed for the entire system in bucket 0. Thus, Constraint (3.5) is introduced. Similarly, Constraints (3.6) and (3.7) are introduced to guarantee that there is enough crude oil to be processed for each distiller and the entire system in the buckets 0, 1, ..., $n$ with $1 \le n \le Q-1$. Constraints (3.8) and (3.9) mean that during the entire scheduling horizon, there is enough crude oil for each distiller and the whole system, respectively. Note that at the end of the scheduling horizon, the pipeline should be full of oil; thus, it subtracts $V_p$ from the left size in Constraint (3.9).

It can be seen that in the model, $f_{ij}$'s are the decision variables and they are continuous variables and there is no discrete event variable at all. Thus, Problem P1 is formulated as a linear programming and is easy to solve.

## C. Assignment of Crude Oil to Distillers

With the production rate obtained by solving Problem P1, the amount of crude oil to be processed by each distiller is known. Then, it needs to divide the amount of crude oil to be processed during the scheduling horizon into a number of parcels and assign these parcels into the distillers. This problem is called Problem P2. Moreover, the number of parcels of crude oil is not known and needs to be determined by the scheduler. Thus, it seems that such a problem is a combinatorial problem and is hard to solve. However, if we treat the types of crude oil as suppliers and the distillers as demanders, this problem can be formulated as a transportation problem. It is sure that by solving such a transportation problem, a number of parcels of crude oil with different types are assigned to each distiller. By merging the parcels of the same type of crude oil, a schedule can be formed for each distiller. This way, this problem can be solved easily.
<table><caption>TABLE I
TRANSPORTATION MODEL FOR PROBLEM P2</caption><thead><tr><th rowspan="2">Crude oil</th><th colspan="10">Distillers or pipeline</th><th rowspan="2">Supply</th></tr><tr><th>Θ<sub>ij</sub></th><th>...</th><th>Θ<sub>i10</sub></th><th>Θ<sub>i11</sub></th><th>...</th><th>Θ<sub>i11</sub></th><th>...</th><th>Θ<sub>i10</sub></th><th>...</th><th>Θ<sub>i11</sub></th><th>Pipeline</th><th>DM-DS</th></tr></thead><tbody><tr><td>Φ<sub>i<sub>c</sub></sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>iii</sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>iii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>iii</sub></td><td>M</td><td>M</td><td>V<sub>i<sub>c</sub></sub> - W<sub>ii</sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Φ<sub>i<sub>1-c</sub></sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>M</td><td>M</td><td>V<sub>i<sub>1-c</sub></sub></td></tr><tr><td>Φ<sub>i<sub>1-p</sub></sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>M</td><td>M</td><td>V<sub>i<sub>1-p</sub></sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Φ<sub>i<sub>2-c</sub></sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>M</td><td>M</td><td>V<sub>i<sub>2-c</sub></sub></td></tr><tr><td>Φ<sub>i<sub>2-p</sub></sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>2-p</sub></sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Φ<sub>i<sub>3-c</sub></sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>3-c</sub></sub></td></tr><tr><td>Φ<sub>i<sub>3-p</sub></sub></td><td>M</td><td>...</td><td>M</td><td>C<sub>ii</sub></td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>3-p</sub></sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Φ<sub>i<sub>4-c</sub></sub></td><td>M</td><td>...</td><td>M</td><td>C<sub>ii</sub></td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>4-c</sub></sub></td></tr><tr><td>Φ<sub>i<sub>4-p</sub></sub></td><td>M</td><td>...</td><td>M</td><td>M</td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>4-p</sub></sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Φ<sub>i<sub>5-c</sub></sub></td><td>M</td><td>...</td><td>M</td><td>M</td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>5-c</sub></sub></td></tr><tr><td>Φ<sub>i<sub>5-p</sub></sub></td><td>M</td><td>...</td><td>M</td><td>M</td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>5-p</sub></sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Φ<sub>i<sub>6-c</sub></sub></td><td>M</td><td>...</td><td>M</td><td>M</td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>6-c</sub></sub></td></tr><tr><td>Φ<sub>i<sub>6-p</sub></sub></td><td>M</td><td>...</td><td>M</td><td>M</td><td>...</td><td>M</td><td>...</td><td>C<sub>ii</sub></td><td>...</td><td>C<sub>ii</sub></td><td>0</td><td>0</td><td>V<sub>i<sub>6-p</sub></sub></td></tr><tr><td>...</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>...</td></tr><tr><td>Demand</td><td>(τ<sub>1</sub> - τ<sub>2</sub>)f<sub>i10</sub> - W<sub>ii</sub></td><td>...</td><td>(τ<sub>1</sub> - τ<sub>2</sub>)f<sub>i10</sub> - W<sub>iii</sub></td><td>(τ<sub>2</sub> - τ<sub>1</sub>)f<sub>i11</sub></td><td>...</td><td>(τ<sub>2</sub> - τ<sub>1</sub>)f<sub>i11</sub></td><td>...</td><td>(τ<sub>2</sub> - τ<sub>2</sub>)f<sub>i11</sub></td><td>...</td><td>(τ<sub>2</sub> - τ<sub>2</sub>)f<sub>i11</sub></td><td>V<sub>p</sub></td><td>Z</td><td></td></tr></tbody></table>

Let $\Theta_{ij}$, $i \in DS$ and $j \in BUK$, denote bucket $j$ of distiller $i$; $\Phi_{i-c}$, $i \in COT$, crude oil type $i$ in the charging tanks; $\Phi_{i-p}$, $i \in COT$, crude oil type $i$ in the pipeline; $\Phi_{i-s}$, $i \in COT$, crude oil type $i$ in the storage tanks; and $\Phi_{ij}$, $i \in COT$ and $j \in BUK$, crude oil type $i$ available after $\tau_j$. The transportation problem model for P2 is presented in Table I.

To make a refining schedule feasible, crude oil that is available after $\tau_j$ cannot be assigned to a distiller for processing in a bucket $k$ with $k < j$, or $\Phi_{ij}$ cannot be assigned to $\Theta_{hk}$ with $k < j$. Thus, big $M$ is set in the intersection of $\Phi_{ij}$ and $\Theta_{hk}$. In fact, this is why the scheduling horizon is divided into a number of buckets when the problem is modeled. It should also be pointed out that $C_{ij}$ may be equal to $M$, meaning that crude oil type $i$ cannot be processed by distiller $j$.

To make a refining schedule compatible with the initial state, if a charging tank with crude oil type $i$ in it is feeding distiller $j$ at the initial state, the remaining oil in that tank should be fed into distiller $j$ in the schedule. This implies that such crude oil should be assigned into distiller $j$ in the schedule. In a refinery plant, the number of distillers is less than the number of crude oil types. Hence, without loss of generality, we assume that the crude oil type being fed into distiller $j$ is $j$ at the initial state, and the remaining volume is $W_{jj}$. Further, assume that $(\tau_1 - \tau_s)f_{j0} \ge W_{jj}$. Thus, the demand of $\Theta_{j0}$ is $(\tau_1 - \tau_s)f_{j0} - W_{jj}$ as shown in the model. If $(\tau_1 - \tau_s)f_{j0} \ge W_{jj}$ is not satisfied, we can just set the demand of $\Theta_{j0}$ to be zero and the demand of $\Theta_{j1}$ to be $(\tau_2 - \tau_1)f_{j1} + (\tau_1 - \tau_s)f_{j0} - W_{jj}$. Correspondingly, the supply of $\Phi_{j-c}$ becomes $V_{j-c} - W_{jj}$ as shown in the model.

At the end of the scheduling horizon, the pipeline must be full of crude oil. Thus, there is a crude oil demand for filling the pipeline with amount $V_p$.

To guarantee the existence of a solution for a transportation problem, the total demand must be equal to the total supply. By Problem P1, the total supply is greater than or equal to the total

demand. Thus, a dummy distiller denoted by DM-DS is necessary and its demand is $Z = \sum_{i \in COT} V_{i-c} + \sum_{i \in COT} V_{i-p} + \sum_{i \in COT} V_{i-s} + \sum_{i \in COT} \sum_{k=1}^{Q} V_{ik} - V_p - (\tau_1 - \tau_s) \sum_{j \in DS} f_{j0} - \sum_{j \in DS} \sum_{k=1}^{Q-1} (\tau_{k+1} - \tau_k) f_{jk} - \sum_{j \in DS} (\tau_e - \tau_Q) f_{jQ}$.

As discussed previously, the conditions given in Lemma 3.1 should be satisfied to make a refining schedule feasible. According to Lemma 3.1, it needs at least three charging tanks for a distiller to make a refining schedule realizable, which is not included in P1 as a constraint. Hence, this constraint should be considered in P2. In a refinery plant, if all the charging tanks are usable, this condition can be easily satisfied. In general, in a refinery plant, $\sum_{i \in COT} V_{i-c} + \sum_{i \in COT} V_{i-p}$ is less than the total amount for processing during the scheduling horizon. Thus, to guarantee the condition that there are three charging tanks for a distiller to be satisfied, all the charging tanks with oil in it at $\tau_s$ should be usable during the scheduling horizon. This implies that all the crude oil in the charging tanks at $\tau_s$ cannot be assigned to the dummy distiller DM-DS, and such crude oil is impossible to assign to the pipeline. The crude oil in the pipeline at $\tau_s$ takes spaces of charging tanks and cannot be assigned to dummy distiller DM-DS either. Hence, the corresponding costs are set to be big $M$.

With the aforementioned analysis, by solving the transportation model given in Table I, a feasible refining schedule can be obtained. It is well known that a transportation problem is easier to be solved than a linear programming, and there are standard commercial software tools for this purpose. Thus, Problem P2 can be solved very efficiently. Note that the solution is composed of a number of crude oil parcels distinguished by oil types. It should be pointed out that the great challenge of scheduling crude oil operations results from the hybrid property of the process. Although Problem P2 is a continuous optimization problem, its solution is composed of a number of discrete crude oil parcels. Thus, P2 implicitly solves a hybrid optimization problem.
## D. Sequencing Parcels

To minimize the changeover cost, it is best to assign crude oil in a charging tank to a single distiller. However, by solving the transportation problem given in Table I, crude oil in a charging tank at $τ_s$ may be assigned to more than one distiller. For example, there is volume $V$ of crude oil in a charging tank at $τ_s$; it may assign $V_1$ to Distiller 1 and $V_2$ to Distiller 2 with $V_1 + V_2 = V$. For this case, if possible, it is better to adjust the assignment such that $V$ is assigned to distillers 1 or 2 only. It can be done as follows.

1. Assume that another crude oil type, say type 2, is assigned to distiller $DS_1$, and meanwhile, there is crude oil type that can be processed by distiller $DS_2$, say type 3, and is assigned to DM-DS with volume $V_3 \ge V_2$. Then, we can reassign the crude oil as follows: a) $V$ is assigned to $DS_1$; b) take $V_2$ of crude oil type 3 from DM-DS to $DS_2$; and c) take $V_2$ of crude oil type 2 from $DS_1$ to DM-DS.

2. Assume that another crude oil type, say type 2, is assigned to $DS_1$ and crude oil type 2 can be processed by $DS_2$ too. Then, we can reassign the crude oil as follows: a) $V$ is assigned to $DS_1$; and b) take $V_2$ of crude oil type 2 from $DS_1$ to $DS_2$.

The computational complexity of the aforementioned algorithm can be analyzed as follows. Assume that there are $N$ charging tanks in which there is crude oil at the initial state. By requirement, such crude oil should be processed during the next scheduling horizon. Further, assume that the crude oil type in different charging tank is different, and each type of crude oil can be assigned to at most $G$ distillers with $G$ equal to or less than $Π$, i.e., the number of distillers in the plant. For a charging tank, only $G-1$ adjustments are needed to complete the previous algorithm. Thus, there are no more than $N \times (G-1)$ adjustments, which are of polynomial complexity.

Note that, in solving the transportation problem given in Table I, the crude oil from the charging tanks, pipeline, storage tanks, and so on is treated as from different suppliers. However, two parcels of crude oil assigned to a distiller from different suppliers may be of the same type. These parcels should be merged if they can be processed one after another such that changeover cost is reduced. Because the number of crude oil types is limited, the parcel merging is very simple.

With crude oil reassigned and parcel merging, we need only to sequence the parcels of crude oil for each distiller according to the order of available time to obtain a feasible refining schedule.

Up to now, we have presented the approach for refining scheduling. By this three-phase approach, we successfully decompose a hybrid optimization problem into subproblems such that each subproblem contains only continuous or discrete event variables. In addition, multiple objectives are effectively handled in different phase. To solve the problem, it needs to solve a linear programming problem, a transportation problem, and adjusting and sequencing the parcels. This way, the subproblems in all the phases can be efficiently solved. Thus, the proposed approach for refining scheduling is computationally efficient and can be used for practical applications. Furthermore, by combining the approaches for a detailed schedule presented in [29]

<table><caption>TABLE II
COST ASSOCIATED WITH CRUDE OIL TYPES AND DISTILLERS</caption><thead><tr><th></th><th>Distiller 1</th><th>Distiller 2</th><th>Distiller 3</th></tr></thead><tbody><tr><th>Crude oil #1</th><td>1</td><td><i>M</i></td><td><i>M</i></td></tr><tr><th>Crude oil #2</th><td><i>M</i></td><td>1</td><td><i>M</i></td></tr><tr><th>Crude oil #3</th><td>4</td><td>10</td><td>6</td></tr><tr><th>Crude oil #4</th><td><i>M</i></td><td>8</td><td>3</td></tr><tr><th>Crude oil #5</th><td><i>M</i></td><td>5</td><td>10</td></tr><tr><th>Crude oil #6</th><td><i>M</i></td><td>8</td><td>5</td></tr></tbody></table>

<table><caption>TABLE III
INITIAL STATE OF THE CHARGING TANKS</caption><thead><tr><th>Tank</th><th>Capacity (Ton)</th><th>Type of oil filled</th><th>Volume (Ton)</th><th>Distiller feeding</th></tr></thead><tbody><tr><td>Tank #129</td><td>34,000</td><td>Crude oil #3</td><td>27,000</td><td>Distiller 1</td></tr><tr><td>Tank #128</td><td>34,000</td><td>Crude oil #2</td><td>30,000</td><td>Distiller 2</td></tr><tr><td>Tank #116</td><td>34,000</td><td>Crude oil #4</td><td>27,000</td><td>Distiller 3</td></tr><tr><td>Tank #117</td><td>34,000</td><td>Crude oil #5</td><td>30,000</td><td></td></tr><tr><td>Tank #115</td><td>34,000</td><td>Crude oil #5</td><td>25,000</td><td></td></tr><tr><td>Tank #127</td><td>34,000</td><td></td><td></td><td></td></tr><tr><td>Tank #182</td><td>20,000</td><td></td><td></td><td></td></tr><tr><td>Tank #180</td><td>20,000</td><td></td><td></td><td></td></tr><tr><td>Tank #181</td><td>20,000</td><td></td><td></td><td></td></tr></tbody></table>

<table><caption>TABLE IV
AMOUNT (TON) OF CRUDE OIL TO BE PROCESSED IN EACH BUCKET</caption><thead><tr><th>Bucket</th><th>Distiller 1</th><th>Distiller 2</th><th>Distiller 3</th></tr></thead><tbody><tr><td>[0, 96]</td><td>36,000</td><td>22,080</td><td>48,000</td></tr><tr><td>[96, 240]</td><td>54,000</td><td>33,120</td><td>72,000</td></tr></tbody></table>

<table><caption>TABLE V
MODIFIED AMOUNT (TON) OF CRUDE OIL TO BE PROCESSED IN EACH BUCKET</caption><thead><tr><th>Bucket</th><th>Distiller 1</th><th>Distiller 2</th><th>Distiller 3</th></tr></thead><tbody><tr><td>[0, 96]</td><td>9,000</td><td>0</td><td>21,000</td></tr><tr><td>[96, 240]</td><td>54,000</td><td>25,200</td><td>72,000</td></tr></tbody></table>

and [30], a short-term schedule for crude oil operations can be efficiently found. This is a significant advancement in this research field.

## IV. INDUSTRIAL CASE STUDY

This section presents a case study to show the application of the approach that is proposed in this paper. This case problem arises from a practical application scenario of a refinery in China. The refinery has three distillers 1, 2, and 3. Three times each month, a short-term schedule should be created for the next ten days. For the scheduling horizon in this paper, there are six types of crude oil to be processed. Crude oil type #1 can be processed by only Distiller 1 and Crude oil #2 by only Distiller 2. Crude oil #3 can be processed by all three distillers; however, it is best to be processed by Distiller 1, then by Distiller 3, and it is the worst if it is processed by Distiller 2. Crude oil types #4, #5, and #6 can be processed by both Distillers 2 and 3 with different cost. Such cost associated with crude oil types and distillers is
<table><caption>TABLE VI
TRANSPORTATION PROBLEM MODEL FOR PROBLEM P2</caption><thead><tr><th></th><th>Θ<sub>10</sub></th><th>Θ<sub>20</sub></th><th>Θ<sub>30</sub></th><th>Θ<sub>40</sub></th><th>Θ<sub>50</sub></th><th>Θ<sub>60</sub></th><th>Pipeline</th><th>DM-DS</th><th>Supply</th></tr></thead><tbody><tr><td>Φ<sub>5-5</sub></td><td>M</td><td>5</td><td>10</td><td>M</td><td>5</td><td>10</td><td>M</td><td>M</td><td>55,000</td></tr><tr><td>Φ<sub>5-6</sub></td><td>M</td><td>1</td><td>M</td><td>M</td><td>1</td><td>M</td><td>M</td><td>M</td><td>12,000</td></tr><tr><td>Φ<sub>7-4</sub></td><td>1</td><td>M</td><td>M</td><td>1</td><td>M</td><td>M</td><td>0</td><td>0</td><td>64,000</td></tr><tr><td>Φ<sub>7-5</sub></td><td>M</td><td>1</td><td>M</td><td>M</td><td>1</td><td>M</td><td>0</td><td>0</td><td>54,000</td></tr><tr><td>Φ<sub>9-4</sub></td><td>4</td><td>10</td><td>6</td><td>4</td><td>10</td><td>6</td><td>0</td><td>0</td><td>28,000</td></tr><tr><td>Φ<sub>9-5</sub></td><td>M</td><td>M</td><td>M</td><td>M</td><td>8</td><td>5</td><td>0</td><td>0</td><td>132,000</td></tr><tr><td>Demand</td><td>9,000</td><td>0</td><td>21,000</td><td>54,000</td><td>25,200</td><td>72,000</td><td>12,000</td><td>151,800</td><td></td></tr></tbody></table>

<figure><img src="image_5.png" /><figcaption>Fig. 4. Refining schedule for the case study.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 5. Detailed schedule of distiller feeding for the case study.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. Detailed schedule of charging tank filling.</figcaption></figure>

given in Table II, where “M” means that a type of oil cannot be processed by the corresponding distiller.

During the scheduling horizon, there are nine charging tanks available. Initially, there is crude oil in Charging Tanks #129, #128, #116, #117, and #115, and the others are empty. At this state, Tanks #129, #128, and #116 are feeding Distillers 1, 2, and 3, respectively. The initial state of the charging tanks is shown in Table III. The capacity of the pipeline is 12000 tons and the pipeline is full of crude oil type #2. There are 28000 tons of crude oil #3, 54000 tons of crude oil #2, and 64000

tons of crude oil #1 in the storage tanks. During the scheduling horizon, a tanker will arrive with 132000 tons of crude oil #6. Assume that $τ_s = 0$ h. Then we can obtain $τ_1 = 96$ h, or after time 96 h, the oil in the tanker can be used for distillation. Hence, the scheduling horizon is divided into two buckets [0, 96] and [96, 240].

The minimal production rates for the three distillers are 312.5, 205, and 458 tons/h, and maximal production rates are 375, 230, and 500 tons/h, respectively. The maximal flow rate of the pipeline is $f_{pmax} = 1250$ tons/h. Four hours are required for both
oil residency time for charging tanks and charging-tank-switch-overlap time.

With the initial state information, according to Lemma 3.1, there is enough crude oil in the charging tanks for obtaining a realizable refining schedule. In addition, if all the oil in the charging tanks is processed during the scheduling horizon, there are enough charging tanks for scheduling the system. Thus, the approach presented in the previous section can be used to find a realizable refining schedule.

By using the initial state information, it is easy to write down the linear programming model for problem P1 for this case. By solving P1, we obtain $f_{10} = f_{11} = 375$ tons/h, $f_{20} = f_{21} = 230$ tons/h, and $f_{30} = f_{31} = 500$ tons/h. This is the maximal production rate for the system and the crude oil inventory is also minimized. With the production rate for each distiller in each bucket, the amount of crude oil to be processed by each distiller in each bucket can be obtained as shown in Table IV.

At the initial state, Charging Tanks #129, #128, and #116 are feeding Distillers 1, 2, and 3, respectively. Thus, to make a refining schedule compatible with the initial state, 27 000 tons of type #3 oil, 30 000 tons of type #2 oil, and 27 000 tons of type #4 oil should be assigned to bucket 0 of Distillers 1, 2, and 3, respectively. With this assignment, the modified amount of crude oil to be processed by each distiller in each bucket is shown in Table V. Notice that 22 080 tons of crude oil to be processed by Distiller 2 in bucket 0 is less than the amount in Charging Tanks #128. Hence, the amount of oil to be processed by Distiller 2 in bucket [96, 240] is modified as 25 200 tons.

Then, we can build the transportation problem model for Problem P2 as shown in Table VI. The following result of crude oil assignment is obtained by solving P2.

1) *Distiller 1*: 27 000 tons of type #3 oil in Tank #129 (parcel $P_{11}$), 9000 tons of type #1 oil from storage tanks (parcel $P_{12}$), and 54 000 tons of type #1 oil from storage tanks (parcel $P_{13}$);

2) *Distiller 2*: 30 000 tons of type #2 oil in Tank #128 (parcel $P_{21}$), 13 200 tons of type #5 oil in Tanks #117 and #115 (parcel $P_{22}$), and 12 000 tons of type #2 oil in the pipeline (parcel $P_{23}$);

3) *Distiller 3*: 27 000 tons of type #4 oil in Tank #116 (parcel $P_{31}$), 21 000 and 20 800 tons of type #5 oil in Tanks #117 and #115 (parcels $P_{32}$ and $P_{33}$), and 51 200 tons of type #6 oil (parcel $P_{34}$).

After this assignment, 1000 tons of type #1 oil, 54 000 tons of type #2 oil, 28 000 tons of type #3 oil, and 80 800 tons of type #6 oil remain. By $P_{22}$, $P_{32}$, and $P_{33}$, it assigns the oil in Tanks #117 and #115 to more than one distiller such that the oil in one tank is divided into two parcels, leading to the changeover cost. Thus, according to the proposed method, this can be adjusted: 1) move $P_{22}$ from Distiller 2 to Distiller 3; 2) create $P_{24}$ with 13 200 tons of type #2 oil from the storage tanks; and 3) take 13 200 tons of oil from $P_{34}$. Then, we merge: 1) $P_{12}$ and $P_{13}$; 2) $P_{23}$ and $P_{24}$ with $P_{23}$ being processed before $P_{24}$; and 3) $P_{32}$, $P_{33}$, and $P_{22}$, for they are the same type of crude oil. This way, a realizable refining schedule is obtained as shown in Fig. 4. It can be seen that although it is the best for Distiller 2 to process crude oil type #5, it is assigned to Distiller 3; otherwise, there

would not be enough oil for Distiller 3 to process during bucket [0, 96) thereby an infeasible solution. In addition, 28 000 tons of oil type #3 is not used although it can be processed by all the distillers. It is meaningful to keep this type of crude oil for Distiller 1 to process for the next scheduling horizon; otherwise, there is no oil that can be processed by Distiller 1 during that time. Thus, the obtained refining schedule is a very good one.

By using the methods presented in [29] and [30], a detailed schedule to realize the refining schedule obtained is easily created. The detailed schedules of distiller feeding and charging tank filling are shown in Figs. 5 and 6, respectively. It can be seen that all the constraints, including crude oil residency time and charging-tank-switch-overlap constraints, are satisfied.

It should be pointed out that this case problem is from practical applications with all the constraints considered. It is extremely difficult for an existing mixed integer mathematical programming model to solve such large problems if it is not impossible. By combining the method presented in this paper and that in our previous work [29], [30], a short-term schedule can be easily found.

## V. CONCLUSION

Short-term scheduling for crude oil operations is a combinatorial problem and involves extreme detail. Thus, it is very complicated and, up to now, there are no efficient technique and software tool in practice. Thus, it is crucial to develop efficient methods to solve this problem. For this purpose, a two-level approach is presented and schedulability conditions are derived in [29] and [30]. Based on the schedulability conditions, given a realizable refining schedule, it is easy to find a detailed schedule at the lower level. With the schedulability conditions, this paper solves the upper level problem of finding the optimal and realizable refining schedule. It successfully decomposes a hybrid optimization problem into subproblems such that each subproblem contains continuous or discrete event variables only but not both. In addition, multiple objectives are effectively handled in different phases. Thus, the entire short-term scheduling problem of crude oil operations is solved. The approach proposed in this paper is very efficient, for it needs to solve a linear programming problem, a transportation problem, and adjustment problems. They all can be solved very efficiently.

As pointed out in [27], there are various objectives that are to be optimized in finding a detailed schedule at the lower level. Although detailed scheduling methods are presented in [29] and [30], the operations are not optimized. Optimization of detailed schedules at the lower level is one of our future studies. Developing methods for short-term scheduling of crude oil operations is not enough. One needs efficient software tools for practical use. It is also our future work to develop such software tools by using the proposed methods.

## REFERENCES

[1] PIMS (Process Industry Modeling System) User's manual, Version 6.0, Bechtel Corp., Houston, TX, 1993.
[2] C. A. Floudas and X. Lin, "Continuous-time versus discrete-time approaches for scheduling of chemical processes: A review," *Comput. Chem. Eng.*, vol. 28, pp. 2109-2129, 2004.

[3] H. A. Gabbar, "Formal representation of meta-operation of chemical plants," *IEEE Trans. Syst., Man, Cybern. C, Appl. Rev.*, vol. 37, no. 4, pp. 633-641, Jul. 2007.

[4] H. A. Gabbar, "Synthesis of parallel operation for enhanced chemical plant operation," *IEEE Trans. Syst., Man, Cybern. C, Appl. Rev.*, vol. 37, no. 4, pp. 703-711, Jul. 2007.

[5] K. Glismann and G. Gruhn, "Short-term scheduling and recipe optimization of blending processes," *Comput. Chem. Eng.*, vol. 25, pp. 627-634, 2001.

[6] M. G. Ierapetritou and C. A. Floudas, "Effective continuous-time formulation for short-term scheduling, I. Multipurpose batch processes," *Ind. Eng. Chem. Res.*, vol. 37, pp. 4341-4359, 1998.

[7] M. G. Ierapetritou and C. A. Floudas, "Effective continuous-time formulation for short-term scheduling, 2. continuous and semicontinuous processes," *Ind. Eng. Chem. Res.*, vol. 37, pp. 4360-4374, 1998.

[8] Z. Jia, M. Ierapetritou, and J. D. Kelly, "Refinery short-term scheduling using continuous time formation: Crude oil operations," *Ind. Eng. Chem. Res.*, vol. 42, pp. 3085-3097, 2003.

[9] Z. Jia and M. Ierapetritou, "Efficient short-term scheduling of refinery operations based on a continuous time formulation," *Comput. Chem. Eng.*, vol. 28, pp. 1001-1019, 2004.

[10] R. Karuppiah, K. C. Furmanb, and I. E. Grossmann, "Global optimization for scheduling refinery crude oil operations," *Comput. Chem. Eng.*, vol. 32, pp. 2745-2766, 2008.

[11] H. Lee, J. M. Pinto, I. E. Grossmann, and S. Park, "Mixed integer linear programming model for refinery short-term scheduling of crude oil unloading with inventory management," *Ind. Eng. Chem. Res.*, vol. 35, pp. 1630-1641, 1996.

[12] D. C. Mattfeld and C. Bierwirth, "An efficient genetic algorithm for job shop scheduling with tardiness objectives," *Eur. J. Oper. Res.*, vol. 155, no. 2, pp. 616-630, 2004.

[13] C. A. Mendez and J. Cerda, "An efficient MILP continuous time formulation for short-term scheduling of multiproduct continuous facilities," *Comput. Chem. Eng.*, vol. 26, pp. 687-695, 2002.

[14] C. A. Mendez and J. Cerda, "Dynamic scheduling in multiproduct batch plants," *Comput. Chem. Eng.*, vol. 27, pp. 1247-1259, 2003.

[15] C. A. Mendez, I. E. Grossmann, I. Harjunkoski, and P. Kabore, "A simultaneous optimization approach for off-line blending and scheduling of oil-refinery operations," *Comput. Chem. Eng.*, vol. 30, no. 4, pp. 614-634, 2006.

[16] L. F. L. Moro, "Process technology in the petroleum industry—Current situation and future trends," *Comput. Chem. Eng.*, vol. 27, pp. 1303-1305, 2003.

[17] R. Pelham and C. Pharris, "Refinery operation and control: A future vision," *Hydrocarbon Process.*, vol. 75, no. 7, pp. 89-94, 1996.

[18] J. M. Pinto and I. E. Grossmann, "A logic-based approach to scheduling problem with resource constraints," *Comput. Chem. Eng.*, vol. 21, pp. 801-818, 1997.

[19] J. M. Pinto, M. Joly, and L. F. L. Moro, "Planning and scheduling models for refinery operations," *Comput. Chem. Eng.*, vol. 24, pp. 2259-2276, 2000.

[20] S. G. Ponnambalam, N. Jawahar, and P. Aravindan, "A simulated annealing algorithm for job shop scheduling," *Prod. Planning Control*, vol. 10, no. 8, pp. 767-777, 1999.

[21] R. Rejowski and J. M. Pinto, "Scheduling of a multiproduct pipeline system," *Comput. Chem. Eng.*, vol. 27, no. 8-9, pp. 1229-1246, 2003.

[22] I. Sabuncuoğlu and M. Bayiz, "Job shop scheduling with beam search," *Eur. J. Oper. Res.*, vol. 118, no. 2, pp. 390-412, 1999.

[23] G. K. D. Saharidisa, M. Minouxb, and Y. Dallery, "Scheduling of loading and unloading of crude oil in a refinery using event-based discrete time formulation," *Comput. Chem. Eng.*, vol. 33, pp. 1413-1426, 2009.

[24] N. Shah, "Mathematical programming techniques for crude oil scheduling," *Comput. Chem. Eng.*, vol. 20, pp. S1227-S1232, 1996.

[25] N. Shah, G. K. D. Saharidis, Z. Jia, and M. G. Ierapetritou, "Centralized-decentralized optimization for refinery scheduling," *Comput. Chem. Eng.*, vol. 33, pp. 2091-2105, 2009.

[26] D. E. Shobrys and D. C. White, "Planning, scheduling and control systems: Why can they not work together," *Comput. Chem. Eng.*, vol. 24, pp. 63-173, 2000.

[27] N. Q. Wu, M. C. Zhou, and F. Chu, "Short-term scheduling for refinery process: Bridging the gap between theory and applications," *Int. J. Intell. Control Syst.*, vol. 10, no. 2, pp. 162-174, Jun. 2005.

[28] N. Q. Wu, M. C. Zhou, and F. Chu, "A Petri net based heuristic algorithm for realizability of target refining schedule for oil refinery," *IEEE Trans. Autom. Sci. Eng.*, vol. 5, no. 4, pp. 661-676, Oct. 2008.

[29] N. Q. Wu, F. Chu, C. B. Chu, and M. C. Zhou, "Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri net," *IEEE Trans. Syst., Man, Cybern. C, Appl. Rev.*, vol. 38, no. 6, pp. 765-778, Nov. 2008.

[30] N. Q. Wu, F. Chu, C. B. Chu, and M. C. Zhou, "Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint," *IEEE Trans. Syst., Man, Cybern. C, Appl. Rev.*, vol. 39, no. 1, pp. 1-16, Jan. 2009.

[31] N. Q. Wu, F. Chu, C. B. Chu, and M. C. Zhou, "Hybrid Petri net modeling and schedulability analysis of high fusion point oil transportation under tank grouping strategy for crude oil operations in refinery," *IEEE Trans. Syst., Man, Cybern. C, Appl. Rev.*, vol. 40, no. 2, pp. 159-175, Mar. 2010.

[32] N. Q. Wu, F. Chu, C. B. Chu, and M. C. Zhou, "Tank cycling and scheduling analysis of high fusion point oil transportation for crude oil operations in refinery," *Comput. Chem. Eng.*, vol. 34, no. 4, pp. 529-543, 2010.

[33] N. Q. Wu, C. B. Chu, F. Chu, and M. C. Zhou, "Schedulability analysis of short-term scheduling for crude oil operations in refinery with oil residency time and charging-tank-switch-overlap constraints," *IEEE Trans. Autom. Sci. Eng.*, vol. 8, no. 1, pp. 190-204, Jan. 2011.

[34] S. X. Yang and D. W. Wang, "A new adaptive neural network and heuristics hybrid approach for job-shop scheduling," *Comput. Oper. Res.*, vol. 28, no. 10, pp. 955-971, 2001.

[35] M. C. Zhou and M. P. Fanti (Ed.), *Deadlock Resolution in Computer-Integrated Systems*, New York: Marcel Dekker, Jan. 2005.

[36] M. C. Zhou and K. Venkatesh, *Modeling, Simulation and Control of Flexible Manufacturing Systems: A Petri Net Approach*. Singapore: World Scientific, 1998.

[37] M. C. Zhou (Ed.), *Petri Nets in Flexible and Agile Automation*. Boston/Dordrecht/London: Kluwer Academic Publishers, 1995.

[38] M. C. Zhou and F. DiCesare, *Petri Net Synthesis for Discrete Event Control of Manufacturing Systems*. London: Kluwer Academic Publishers, 1993.

[39] M. C. Zhou and M. D. Jeng, "Modeling, analysis, simulation, scheduling, and control of semiconductor manufacturing systems: A Petri net approach," *IEEE Trans. Semiconductor Manuf.*, vol. 11, no. 3, pp. 333-357, 1998.

[40] R. Zurawski and M. C. Zhou, "Petri nets and industrial applications: A Tutorial," *IEEE Trans. Ind. Electron.*, vol. 41, no. 6, pp. 567-583, Dec. 1994.