Senior Member, IEEE Naiqi Q Wu
email: nqwu@gdut.edu.cn

Feng Chu
email: feng.chu@ibisc.univ-evry.fr

Chengbin Chu
email: chengbin.chu@ecp.fr

Fellow, IEEE Mengchu C Zhou
email: zhou@njit.edu

Hybrid Petri Net Modeling and Schedulability Analysis of High Fusion Point Oil Transportation Under Tank Grouping Strategy for Crude Oil Operations in Refinery

Keywords: Crude oil operations, discrete event systems, hybrid system, oil refinery, Petri net. I

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.

Hybrid Petri net modeling and schedulability analysis of high fusion point oil transportation under tank grouping strategy for crude oil operations in refinery

past years. With the installation of advanced control systems for process control and the planning technique well developed by using linear programming-based commercial software [START_REF] Bechtel | PIMS (Process Industry Modeling System) User's Manual[END_REF], [START_REF] Pelham | Refinery operation and control: a future vision[END_REF], there is a gap between the process control level and the planning level [START_REF] Honkomp | The curse of reality -why process scheduling optimization problems are difficult in practice[END_REF], [START_REF] Wu | Short-term scheduling for refinery process: bridging the gap between theory and applications[END_REF]. Therefore, to effectively operate an oil refinery plant, it is necessary to integrate process control and production planning by short-term scheduling. A short-term schedule for oil refinery should provide all the activities in every detail for the whole scheduling horizon, it is the detail that makes the short-term scheduling problem so difficult as pointed out by Honkomp et al. [START_REF] Honkomp | The curse of reality -why process scheduling optimization problems are difficult in practice[END_REF]. Besides, it is subject to various constraints, including physical and process constraints. If one of the constraints is violated, a short-term schedule becomes infeasible. However, up to now, it lacks effective techniques and software tools for short-term scheduling problem in oil refinery, because of its extreme complexity. In fact, this job is still done manually by a planner in oil refinery plants. Thus, it is meaningful to search for effective techniques and tools for short-term scheduling, and effort was made to do so in the recent years. The mathematical programming models that are applied to study the scheduling problem of batch processes are modified for shortterm scheduling of oil refinery processes and a variety of mathematical programming models are currently available. There are mainly two categories: discrete-time and continuous-time models. The work in [START_REF] Floudas | Continuous-time versus discrete-time approaches for scheduling of chemical processes: A review[END_REF], [START_REF] Glismann | Short-term scheduling and recipe optimization of blending processes[END_REF], [START_REF] Jia | Refinery short-term scheduling using continuous time formation: Crude oil operations[END_REF], [START_REF] Lee | Mixed integer linear programming model for refinery short-term scheduling of crude oil unloading with inventory management[END_REF], [START_REF] Mendez | A simultaneous optimization approach for off-line blending and scheduling of oil-refinery operations[END_REF], [START_REF] Pinto | Planning and scheduling models for refinery operations[END_REF], and [START_REF] Shah | Mathematical programming techniques for crude oil scheduling[END_REF] belongs to the former. The main drawback with such models is that there is a huge number of binary variables and makes the problem very difficult to solve.

To overcome the drawback in the discrete-time representation, continuous-time representation is adopted by some researchers [START_REF] Floudas | Continuous-time versus discrete-time approaches for scheduling of chemical processes: A review[END_REF], [START_REF] Jia | Refinery short-term scheduling using continuous time formation: Crude oil operations[END_REF], [START_REF] Jia | Efficient short-term scheduling of refinery operations based on a continuous time formulation[END_REF], and [START_REF] Mendez | A simultaneous optimization approach for off-line blending and scheduling of oil-refinery operations[END_REF]. Although, with these models, the number of discrete variables is reduced significantly, there are nonlinear constraints in it, which makes the problem difficult to solve. Moreover, because of the complexity for the requirement of providing detailed activity, to make the problem solvable, for most of models in both discrete-time and continuous-time models, special assumptions are made, which generally make the solution inefficient or unrealistic for real world cases. Meanwhile, in these models, often some constraints, such as the oil residency time and high fusion point crude oil transportation constraints are ignored. This leads their solutions to be infeasible. Thus, although there is significant progress in theory for the shortterm scheduling problem of oil refinery, there is a serious gap between theory and applications [START_REF] Wu | Short-term scheduling for refinery process: bridging the gap between theory and applications[END_REF]. It is crucial to search for effective techniques that work well in practical applications.

Short-term scheduling for crude oil operations is one of the most difficult scheduling problems in operating an oil refinery plant. To reduce the complexity, a new method is proposed in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF]- [START_REF] Wu | A Petri net based heuristic algorithm for realizability of target refining schedules in oil refinery[END_REF]. By this method, the problem of short-term scheduling for crude oil operations is decomposed into two subproblems in a hierarchical way. At the upper level, it finds the refining schedule to optimize the objectives, such as crude oil inventory and production rate. At the lower level, it provides the detailed schedule to realize a given refining schedule. In doing so, it gives rise to new problems: 1) how can we guarantee that the refining schedule found is realizable, because, at the upper level, it does not decide the detailed schedule; and 2) how can we guarantee that a detailed schedule can be found when a refining schedule is realizable. In [START_REF] Wu | A Petri net based heuristic algorithm for realizability of target refining schedules in oil refinery[END_REF], a Petri net (PN)-based heuristic is presented to check the realizability of a refining schedule, if realizable, a detailed schedule is found as well. However, if a detailed schedule is not found it cannot guarantee that the refining schedule is not realizable. Feasibility is essential to the short-term scheduling problem of crude oil operation in a refinery. If schedulability conditions are known, the upper level subproblem can be solved by taking these conditions as constraints. In this way, the realizability of the obtained refining schedule is guaranteed. Thus, if given a refining schedule, a detailed schedule can be efficiently obtained with the schedulabilty conditions, the issue of shortterm scheduling can be resolved. For this purpose, with the architecture as shown in Fig. 1, schedulability analysis is done in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] and [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF] and schedulability conditions are presented. These conditions can be used as constraints for finding realizable refining schedule. At the same time, with these conditions, it is easy to find detailed short-term schedule for a given refining schedule.

In viewing each operation decision in a short-term schedule as a control command to the system, its schedulability is analyzed in a control theory perspective in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] and [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF]. As shown in Fig. 1, the system is modeled by a hybrid PN. The execution of an operation decision transfers the system from one state to another. Thus, if a system is schedulable, the initial state must be safe and an operation decision should transfer the system from a safe state to another safe one. Then, a newly reached state can be seen as an initial state at the time point. This implies that all the reached states should be safe. Hence, safeness of the system is equivalent to schedulability [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF], [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF]. In this way, with safeness conditions known and the system state given, it is simple to find an operation decision such that its execution transfers the system from the given safe state to another safe one, and the detailed schedule can be obtained by creating operation decisions one by one given a refining schedule.

In scheduling crude oil operations, there are various constraints, including resource and process ones. Resource constraints 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. Process constraints include: 1) a distiller should be kept in working all the time uninterruptedly; 2) at least one charging tank should be dedicated to a distiller at any time for feeding the latter; 3) a tank cannot be charged and discharged at the same time; 4) after being charged, the crude oil should stay in the charged tank for a certain amount of time before it can be discharged. This is called oil residency time (RT) constraint; and 5) theoretically, crude oil can be kept in pipeline without flowing. However, when a type of crude oil with high fusion point is being transported via a pipeline, such crude oil must be kept flowing until it goes out of the pipeline; and otherwise the pipeline will be blocked. This requirement is called high fusion crude oil transportation constraint. Most of the existing methods ignore the fourth and fifth process constraints, and there is no model that deals with the fifth process constraint. This paper conducts schedulability analysis with all the constraints taken into account.

With high fusion point crude oil types to be processed, cost is an important issue and should be considered in scheduling the system. In crude oil operations, when a tank is discharged such that there is no oil in the tank can be discharged any more, this tank is said to be emptied. However, it cannot be really emptied. Instead there is some oil remaining (usually about 1/6 capacity). Thus, when a tank with oil type i in it is emptied, and is then recharged with oil type j with i = j, some volume of high quality oil is likely treated as low quality oil due to the oil mixture. This leads to a loss, called tank charging and discharging loss. Therefore, when a tank with oil type i in it is emptied and recharged, it is better to charge the same or similar type of oil that contains similar components.

Often, different distillers process different types of crude oil at a time. A distiller may process different crude oil type at different time. However, these crude oil types processed by the same distiller at different time are similar. Thus, to reduce charging and discharging loss, for a time, the charging tanks are grouped such that each group of charging tanks serve a distiller. Crude oil to be processed by distiller DS i is charged into the tanks in the tank group assigned to DS i . We call such strategy as charging tank grouping. In this paper, this strategy is applied in analyzing the schedulability so as to reduce scheduling cost as much as possible.

With the architecture given in Fig. 1, a model that describes the behavior of the system is necessary. For crude oil operations, the start and end of crude oil movement are discrete events and oil flows continuously. Thus, it is a typical hybrid system and should be described by a hybrid model. There are hybrid PN models [START_REF] Chen | Analysis of hybrid system based on hybrid net condition/event system model[END_REF], [START_REF] David | On hybrid Petri nets[END_REF], [START_REF] Ferrarini | Modular design and implementation of a logic control system for a batch process[END_REF], [START_REF] Silva | Petri nets and integrality relaxations: A view of continuous Petri net models[END_REF], [START_REF] Yamalidou | Modeling and optimal control of discrete-event chemical processes using Petri nets[END_REF]. However, they cannot be directly used here because they cannot describe the abovementioned constraints well. The hybrid PN model developed in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF], [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF] is modified to model such systems. With it, schedulability conditions are presented that describe the relationship among the number of charging tanks, number of distillers, capacity of charging tanks, production rates, and amount of high fusion point oil that can be transported by a single setup. These conditions provide the base for finding a refining schedule and checking the realizability of a given one. By using them, one can find a detailed schedule for a given realizable refining one.

The contribution of this paper includes: 1) it is the first time that high fusion point crude oil is considered in scheduling crude oil operations; 2) a hybrid PN model is developed to describe such a system; 3) schedulability conditions are presented; 4) with the schedulability conditions, one can derive how much high fusion point crude oil can be transported from storage tanks to charging tanks, which is important in scheduling such systems; and 5) with them, one can easily find a detailed feasible one given a realizable refining schedule.

Next, we briefly introduce the process of crude oil operations and its short-term scheduling problem. The hybrid PN model is developed in Section III. With the PN model, schedulability analysis for systems with one and two distillers is carried out in Section IV. Section V generalizes the results obtained in Section IV into general cases. In Section VI, an industrial case study is presented to show the power and applications of the results obtained. Finally, conclusions are given in Section VII.

II. PROCESS AND SHORT-TERM SCHEDULING

This section briefly introduces the process of crude oil operations and its short-term scheduling problem. The readers are referred as to [START_REF] Wu | Short-term scheduling for refinery process: bridging the gap between theory and applications[END_REF]- [START_REF] Wu | A Petri net based heuristic algorithm for realizability of target refining schedules in oil refinery[END_REF] for detail.

In a general refinery process, crude oil is carried to the port by crude oil tankers, where crude oil is 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. The middle products from the distillers are then sent to other production units for fractionation and reaction. The products after fractionation and reaction are blended to produce the final products that are ready for delivery. This paper addresses only short-term scheduling problem for crude oil operations from a tanker to distillers.

Often, in a refinery, various types of crude oil are processed. Some crude oil types have fusion point higher than 30 • C, and it is in a solid state under ordinary temperature. To prevent such crude oil from being frozen in the pipeline, the pipeline and the crude oil that is being transported must be kept hot enough. Notice that, generally, a pipeline has tens of kilometers long, it can be heated only by hot crude oil that is flowing through it. Thus, before high fusion point crude oil is to be transported from storage tanks to charging tanks through the pipeline, a certain amount of hot crude oil with low fusion point should be transported via the pipeline such that the pipeline can be heated first. After it is heated in this way, the heated high fusion point crude oil can be sent to charging tanks through it. After a parcel of such oil is sent to the pipeline, another parcel of crude oil with low fusion point must be sent to it such that the high fusion point crude oil can go out of the pipeline. This results in high set up cost for transporting high fusion point crude oil. Thus, in scheduling crude oil operations, when high fusion point crude oil is transported from storage tanks to charging one, it is desired that it can transport as much as possible, or at least an expected amount by a single setup. Often, in determining a refining schedule, a planner wants to know if a given amount of high fusion crude oil in the storage tanks can be transported to charging tanks for processing by a single setup.

It should be pointed out that when there is crude oil with high fusion point in the pipeline, the oil in it must be kept in flowing; and otherwise the pipeline and oil in it will cool down and the oil will be frozen. This implies that once crude oil with high fusion point is sent to the pipeline there must be enough space in charging tanks to hold the coming crude oil, otherwise, the oil in the pipeline cannot be kept in flowing. With the number of charging tanks limited and there are multiple distillers that process different types of crude oil concurrently, it is a great challenge to schedule the system.

A crude oil operation process is composed of a series of operations. For each operation to take place, a decision should be made. To describe a short-term schedule, we first define an operation decision. ) is defined as an operation decision, where COT is the crude oil type; ζ is the volume of crude oil to be unloaded from a tanker to a storage tank, or transported from a storage tank to a charging tank, or fed from a charging tank to a distiller; S is the source from which the crude oil is to be delivered; D is the destination to which the crude oil is to be delivered; and INT is a time interval in which a and b are the start and end time points of the operation.

The flow rate in delivering crude oil in [a, b] can be variable. However, in reality, it is kept as a constant for a single operation. Thus, given volume ζ and time interval [a, b]i na n OD, ζ/(b -a) is determined and used as its flow rate. Each OD is a command that transfers the system from a state to another.

There are three types of ODs: crude oil unloading, transportation, and feeding, denoted by ODU, ODT, and ODF, respectively, and their time interval is denoted as [α, β], [λ,µ], and [ω, π], respectively. For ODU, S is a tanker and D is a storage tank. For ODT, S is a storage tank, D is a charging tank, and the transportation must be conducted through a pipeline. For ODF, S is a charging tank and D is a distiller. We use ODF ki to denote the ith OD for feeding distiller k during the schedule horizon. Let Γ=[τ s ,τ e ] be the schedule horizon that often lasts for a week or 10 days and g = ζ/(β -α), f = ζ/(µλ), and h = ζ/(π -ω) denote flow rates for a tanker unloading, pipeline transportation, and distiller feeding decided by ODs, and K denote index set for the distillers. Given the system state at τ s , i.e., the inventory of crude oil and state of all the devices, and information of tanker arrival, the short-term scheduling problem is to find a series of ODs described as follows: SCHD = {ODU 1 ,...,ODU w , ODT 1 ,..., ODT z , ODF 1 ,...,ODF K }. the resource and process constraints given in Section I.

Constraint (2.2) requires that the schedule should cover the entire scheduling horizon and a distiller cannot be stopped.

A schedule for crude oil operations may not be feasible. Its feasibility is strongly related to the safeness of the system in a control theory perspective. The execution of an infeasible OD results in an unsafe state. On the other hand, a safe state guarantees the existence of a feasible schedule. This can be explained as follows. An operation decision OD in a schedule is a control that transfers the system from one state to another. If a state is reached such that one or more constraints are violated, this state is said to be an infeasible state. If a state is not infeasible, it must be feasible. Assume that, at time τ , after the action of OD 1 ,O D 2 , ..., and OD i , the system is transferred from state M 1 to M i , and M i itself is feasible. However, no matter what ODs are applied after time τ , the system will enter an infeasible state. Then, state M i is called an unsafe state. If a state is not unsafe, it must be safe. If a short-term schedule SCHD = (OD 1 , OD 2 , ...,OD n ) is obtained such that OD 1 transfer the system from M 1 to M 2 ,OD 2 from M 2 to M 3 , ..., and OD n from M n to M n +1 , and all the states M 1 , M 2 , ..., M n +1 are safe, the schedule is feasible. On the other hand, at any time, if the system is in a safe state, there must exist a short-term schedule such that the system is always in a safe state.

III. HYBRID PN MODELING

It follows from the short-term schedule defined in the last section that a hybrid model suitable for short-term scheduling is needed. A hybrid PN is developed for crude oil operations for schedulability analysis in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] and [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF], which consider only the situations without high point crude oil being processed. By modifying it, we present a new hybrid PN model here. We first present the models for devices, e.g., tanks and pipeline. Then, based on the models for devices, the model for the whole system is developed. A reader is referred to [START_REF] David | On hybrid Petri nets[END_REF], [START_REF] Wang | Timed Petri Nets: Theory and Application[END_REF], [START_REF] Zhou | Modeling, Simulation and Control of Flexible Manufacturing Systems: A Petri Net Approach[END_REF]- [START_REF] Zurawski | Petri nets and industrial applications: A tutorial[END_REF] for the basic knowledge of PN.

The PN model used here is a kind of colored-timed PN (CTPN) defined as CTPN =(P = P D ∪ P C ∪ P E ,T = T D ∪ T T ∪ T C ,I,O,Φ,M 0 ), where P D , P C , and P E are sets of discrete, continuous, and enforcing places; T D , T T , and T C are sets of discrete, timed, and continuous transitions; I and O are input and output functions; Φ(p) and Φ(t) represent the color sets of place p ∈ P and transition t ∈ T ; and M 0 is the initial marking. The icons are shown in Fig. 2.

A. Device Modeling

The devices include tanks (storage and charging tanks) and pipeline. A tank is modeled by a PN shown in Fig. 3. A token in a discrete place is a discrete token and acts just as that in ordinary PN. A token in a continuous place represents a type of materials with a real number of volume, called token volume for short. A discrete transition acts just as that in ordinary PN. When a timed transition fires, it delivers a token from a place to another with a constant time delay. When a continuous transition fires, some type of material represented by a token is delivered from a place to another with a known flow rate determined by an OD. Whether the token is completely removed from its input place is determined by its firing duration.

In Fig. 3, continuous places p s and p c that can hold at most one token at a time model the state of a tank. A token in either p s or p c or both represents that there is crude oil in the tank. However, a token in p s represents that the oil in the tank is not ready for discharging, and it is ready only if p c has a token and p s is empty. Continuous transitions t 1 and t 3 model the processes of filling to and discharging from a tank. The time delay in t 2 models the RT constraint. Thus, when charging oil to a tank stops, a token representing a type of crude oil must stay in p s for some time. After the time delay specified by t 2 , a token with a real number of volume moves from p s to p c , and is ready to be discharged from a tank. Because there is only one token in discrete place p 4 , only one of transitions t 1 and t 3 can fire at a time. This guarantees that a tank cannot be filled and discharged at the same time. The self-loop between p 4 and t 2 together with the inhibitor arc (p s , t 3 ) guarantees the RT requirement of the oil in the tank before it can be discharged. The volume associated with the token in continuous place p 3 models the capacity of the tank available at the current marking. Thus, the behavior of the charging and discharging of a tank is exactly described. Thereafter, by K i (p s ), K i (p c ), and K i (p s , p c )(orK i in short) we mean places p s , p c , and the model for tank i.

The PN model in Fig. 4 describes the behavior of a pipeline. It is modeled by a macro transition t pipeline in which there are continuous places, such as p 1 , p 2 , and p 3 , connected by discrete transitions in a serial way. A token in a continuous place in t pipeline represents a segment of crude oil in the pipeline. The tokens in different continuous places represent segments of different crude oil types. When a discrete transition in t pipeline , say t 1 , is enabled and fires, a token in p 2 is removed immediately, and when t 2 is enabled and fires, a token enters p 2 immediately. Thus, the behavior of a segment in the pipeline for holding one type of crude oil is described by the PN.

The PN model shown in Fig. 4 describes the behavior of the pipeline that can hold three different types of crude oil with continuous places p 1 , p 2 , and p 3 in t pipeline . Continuous transitions t I 1 to t Ik and t O 1 to t Ok in t pipeline a r eu s e dt o model the behavior that crude oil flows into and out of the pipeline with a given flow rate. Let T I = {t I 1 ,...,t Ik } and T O = {t O 1 ,...,t Ok }. It should be noticed that, at a time, only one type of crude oil can flow into (out of) the pipeline. This implies that only one transition in T I and one transition in T O can fire at a time. When one of transitions in T O is firing, the token volume in p 1 is continuously decreasing until p 1 is emptied. When p 1 is emptied, t 1 is enabled and fires, and the token in p 2 is moved into p 1 immediately. In this way, one transition in T O can fire continuously. When one transition in T I ,s a yt I 1 , fires, a token goes into p 3 immediately. With the continuous firing of t I 1 , the token volume in p 3 increases continuously until p 3 is full. The number of continuous places in the model means the number of segments of crude oil of different types in the pipeline. It can be set as the largest number of crude oil segments that may occur. Since the pipeline is modeled as a single macro transition t pipeline , a transition in T I and another in T O fire concurrently with the same flow rate. However, the crude oil type flowing into a pipeline may be different from that flowing out of it. There is also an enforcing place p 4 in t pipeline . Every time, a token enters p 3 by firing a transition in T I ,at o k e nw i t ht h e same color and volume goes into p 4 too. When there is a token representing a high fusion point crude oil type in p 4 , it enforces one of transition in T O to fire, which requires firing of one transition in T I too. When the token representing a high fusion point crude oil in a continuous place in t pipeline goes out of t pipeline by firing a transition in T O ,thetokeninp 4 is removed too. For the sake of simplicity, transition y as shown in Fig. 4 is used to represent this process pictorially. Then, a place p in y can be denoted as p(y). When y fires, it implies that one transition in T I and one transition in T O firewiththesamerate simultaneously, or crude oil is delivered from a storage tank to the pipeline (a place in y) by a transition in T I , and at the same time crude oil in p 1 (y) is being delivered into a charging tank by a transition in T O .

B. PN Model for the Whole System

The PN in Fig. 5 gives the illustration for the whole system with two storage and charging tanks, respectively. For the reason of simplicity, we omit the discrete place and its associated arcs, and the inhibitor arc in a tank PN model. Later, we also omit p i3 . Crude oil in a storage tank is discharged through the pipeline, and then transition y for the pipeline is the discharging transition for every storage tank. Similarly, y is the charging transition for every charging tank. Thus, {t 11 , t 12 , y, p 1s , p 1c , p 13 } and {t 21 , t 22 , y, p 2s , p 2c , p 23 } are for two storage tanks, respectively, and {y, t 31 , t 32 , p 3s , p 3c , p 33 } and {y, t 41 , t 42 , p 4s , p 4c , p 43 } for two charging tanks, respectively. Transition t 1 creates a token when a tanker arrives. If a tanker carries k types of crude oil, then k tokens are created with their respective volumes. However, a token can be moved into p 1 from t 1 only if p 1 is empty. Places p 3 and p 4 represent two distillers. From the definition of a shortterm schedule, we know that firing a continuous transition in the PN model must be triggered by an OD. Thus, the dynamics of crude oil flow in the PN model should be governed by the flow rate given in OD. This can be modeled by the transition enabling and firing rules that are defined below.

We use • t ( • p) to denote the set of input places of transition t (input transitions of place p) and t • (p • ) the set of output places of t (output transitions of p). Let V (M (p)) denote the volume of material in p at marking M . Definition 3.1: A discrete transition (including discrete ones in y) t is said to be enabled at marking

M ,i fM (p) ≥ 1, ∀p ∈ • t and M (p)=0, ∀p ∈ t • . When t fires, M is changed into M ′ with M ′ (p)=M (p) -1, ∀p ∈ • t and M ′ (p)=M (p)+ 1, ∀p ∈ t • .
Compared with the transition enabling and firing rules for ordinary PN, it requires that t's output places are empty, similarly to that for finite capacity PN. Notice that, in ordinary PN, tokens are discrete, but the tokens in the PN model here may be discrete or continuous. However, to fire a discrete transition, all tokens in the model are treated as discrete one. By Definition 3.1, when some part of oil in p 1 in Fig. 4 is discharged, there is still a token in p 1 and t 1 cannot fire, or a token in p 2 cannot go to p 1 . Only when all the oil in p 1 is discharged such that p 1 is empty, then t 1 can fire and a token in p 2 can go to p 1 .In this way, it guarantees that each continuous place in Fig. 4 can hold one type of crude oil at a time. A timed transition is used only in the PN for a tank to guarantee the RT before oil in a tank can be discharged. Assume that the time associated with a timed transition is Ψ. Its enabling and firing rules are defined as follows:

Definition 3.2: A timed transition t is said to be enabled at marking

M if M (p i ) ≥ 1, ∀p i ∈ • t. When t starts to fire at time τ , M is changed into M ′ such that: 1) at τ , M ′ (p i )=M (p i ) - 1,i fp i ∈ • t and p i ∈ P D and M ′ (p i )=M (p i ) if p i ∈ • t and p i ∈ P C ;2)atτ +Ψ, M ′ (p i )=M (p i ) -1 and V (M ′ (p i )) = 0, p i ∈ • t and p i ∈ P C ; and 3) at τ +Ψ, M ′ (p j )=1for ∀p j ∈ t • and V (M ′ (p j )) = V (M (p j )) + V (M (p i )),forp j ∈ t • and p j ∈ P C .
Notice that when a timed transition t fires, there may be a token in its output place p j . When the token in the input place p i moves into p j these two tokens merge into one with the volume being the sum. This definition is used to describe such a fact that when a tank is neither full nor empty, this tank can still be charged. When it is charged, the volume of oil should be added. Meanwhile, the time delay associated with the timed transition guarantees the RT constraint. In this way, the behavior of a tank is precisely modeled by the PN.

Because there are multiple types of crude oil, it is necessary to distinguish them. To do so, colors are introduced into the PN model. We use ϕ ∈ Φ to denote the color of crude oil and say that a token in place p representing crude oil of type i has color ϕ i and the number of tokens in p with color ϕ i at marking M is denoted by M (p, ϕ i ), and the volume for this token at M is denoted by V (M (p, ϕ i )). When V (M (p, ϕ i )) = 0, it implies that the number of tokens with color ϕ i in p is zero. If a continuous transition t is firing to move crude oil type i from a place to another, we say t is firing with color ϕ i . A continuous transition must fire with a color. As discussed above, the volume of a token in p 3 in Fig. 3 models the capacity of a tank available. Let Θ denote the color for such a token. In other words, p 3 in each tank's PN model has the same color as the token in p s and/or p c . Further, let Φ 1 ⊂ Φ be the set of colors for crude oil types with low fusion point and Φ 2 ⊂ Φ be the set of colors for crude oil types with high fusion point with

Φ 1 ∩ Φ 2 =Øand Φ 1 ∪ Φ 2 =Φ.
Definition 3.3: A continuous transition (including transitions in T I and T O in y) t is said to be enabled with color ϕ i at marking M , if the following conditions are satisfied:

1) M (p, ϕ i ) ≥ 1 or M (p, Θ) ≥ 1, ∀p ∈ • t; and 2) K j (p s ) ∈ t • for some j, then M (K j (p s ),ϕ i ) ≥ 1 or M (K j (p c ),ϕ i ) ≥ 1,orM (K j (p s )) = M (K j (p c
)) = 0. By condition 1), it says that, if p ∈ P C , there must be crude oil with a right color or the tank to be charged must not be full. If p ∈ P E , it implies that firing t will consume a token in p.By 2), it says that the oil in K j (p s ) has color ϕ i that is same as that in p ∈ • t. This implies that if there is crude oil in a tank, only the same type of crude oil can be filled into it. However, if a tank is empty, any type of crude oil can be filled into it. When a continuous transition t is enabled and triggered by an OD, it can then fire. This firing must be associated with a flow rate given in OD, i.e., the flow of crude oil is governed by a flow rate. The transition firing rules below describe this dynamics. We assume that t's firing with color ϕ i begins at time τ 1 , ends at time τ 2 , τ ∈ [τ 1 ,τ 2 ], and the flow rate is f . Then, the marking changes as follows. At τ 1 ,ifp ∈ • t and p is a discrete place

M ′ (p)=M (p) -1. (3.1) At τ 2 ,ifp ∈ t • and p is a discrete place M ′ (p)=M (p)+1. (3.2) At τ ∈ [τ 1 ,τ 2 ]
,ifp ∈ • t and p ∈ P C or p ∈ P E , and there is a token with color ϕ i in p

V (M ′ (p, ϕ i )) = V (M (p, ϕ i )) -(τ -τ 1 )f. (3.3)
If p ∈ • t and p ∈ P C , and there is a token with color Θ in p

V (M ′ (p, Θ)) = V (M (p, Θ)) -(τ -τ 1 )f. (3.4)
If p ∈ t • and p ∈ P C or p ∈ P E , and there is a token with color ϕ i in p

V (M ′ (p, ϕ i )) = V (M (p, ϕ i )) + (τ -τ 1 )f. (3.5)
If p ∈ t • and p ∈ P C or p ∈ P E , and there is no token with color ϕ i in p

M ′ (p, ϕ i )=1
and

V (M ′ (p, ϕ i )) = V (M (p, ϕ i )) + (τ -τ 1 )f. (3.6)
Because any firing of a continuous transition leads to a crude oil operation determined by an OD, expressions (3.1) through (3.6) describe the dynamics of crude oil flow in the PN model for the system. Notice that, with (3.5) and (3.6), when a transition t in T I in y fires with color ϕ i , a token with color ϕ i and volume that flows through t is moved into t's output enforcing place. From (3.3) By Definition 3.4, a nonlive state is an infeasible state resulting from an infeasible schedule. Thus, it is necessary to schedule crude oil operations such that the PN model is live. If a schedule can be found such that the PN is live, the system is schedulable. It should be pointed out that the conditions in Definition 3.4 are very easy to check. Thus, the PN model developed here is an effective tool for scheduling the system.

IV. SCHEDULABILITY WITH ONE AND TWO DISTILLERS

With the PN model developed in the last section, this section analyzes the schedulability and the amount of high fusion point oil that can be transported by a single setup based on charging tank grouping. It assumes that there is always enough crude oil in the storage tanks to be processed, or schedule feasibility is independent of the number of storage tanks and their capacity. Notice that the pipeline always holds some oil in it and we use C pipe to denote its capacity. Hence, when a volume V 1 > C pipe of oil is transported from storage tanks to charging tank CTK 1 , C pipe of it will remain in the pipeline if there is no other parcel of oil that is transported via the pipeline immediately after V 1 volume of oil is transported. Therefore, after transporting a parcel of oil with high fusion point, a parcel of oil with low fusion point and volume V 2 ≥ C pipe must be transported immediately. This implies that, after charging CTK 1 with V 1 of high fusion point oil, there must be a charging tank that can receive at least volume C pipe of oil. Without loss of generality, we assume that the capacity of any charging tanks is greater than C pipe .T o reduce charging and discharging cost, it is also desired that a tank is charged to capacity when it is charged. Thus, we use the number of tanks to discuss the volume of oil transported.

Definition 4.1: A system of crude oil operations with initial state S 0 is said to be schedulable if there exists a feasible shortterm schedule for a horizon Γ=[0, ∞).

Notice that the key here is the schedule horizon Γ=[0, ∞), because the operation of distillers cannot be interrupted. The existence of a feasible short-term schedule SCHD 1 = {OD 1 , OD 2 ,...,OD n } for a schedule horizon [0, a] does not guarantee that a feasible short-term schedule SCHD 2 = {OD 1 , OD 2 ,...,OD n , OD n +1 ,...,OD n + k } with SCHD 1 ⊂ SCHD 2 for schedule horizon [0,b], with b>a, can be found.

Definition 4.2: A state M of a system of crude oil operations is said to be safe if, with M as initial state, the system is schedulable.

Therefore, with Definitions 4.1 and 4.2, to analyze the schedulability of crude oil operations is to analyze the safeness of the system. In [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] and [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF], schedulability conditions are presented by considering oil residency time constraint only. Here, both oil residency time constraint and crude oil types with high fusion point are considered. Thus, the problem addressed here is much more complex than that in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] and [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF].

A. Case 1: System with One Distiller

Let f p max , f ds , and Ψ be the maximal crude oil transportation rate of the pipeline, the feeding rate to the single distiller, and the oil residency time, respectively. It is shown in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] that if there is only a single charging tank and Ψ > 0 the system is not schedulable even if f p max = ∞. Obviously, such a system is not schedulable for the situation considered in this paper. Nevertheless, it is shown in [START_REF] Wu | Short-term schedulability analysis of crude oil operations in refinery with oil residency time constraint using Petri nets[END_REF] that if there are two charging tanks and f p max is large enough the system is schedulable if only oil residency time is considered. However, the following theorem shows that it is not schedulable for the system considered in this paper. Let ξ =(Ψ× f p max × f ds )/(f p max -f ds ), CTK i denote charging tanks i, α = f ds × Ψ, and ϕ be the color of crude oil type being processed, respectively.

Theorem 4.1: Assume that: 1) there is a single distiller with feeding rate f ds ; 2) there are two charging tanks CTK 1 and CTK 2 with capacity greater than or equal to ξ; 3) the crude oil being processed is a type with high fusion point and its color is ϕ ∈ Φ 2 ;4)f p max >f ds ; and 5) initially there is crude oil ready for feeding with volume ζ ≥ (Ψ × f p max × f ds )/(f p max -f ds ) in tank CTK 1 and CTK 2 is empty. Then, the system is not schedulable.

Proof: This situation can be modeled by the PN shown in Fig. 6. At the beginning (time τ 0 ), we have M 0 (p 1c )= 1, M 0 (p 1s )=M 0 (p 2c )=M 0 (p 2s )=0, V (M 0 (p 1c ,ϕ)) = ζ, and M 0 (p 4 (y),ϕ)=1 as shown in Fig. 6(a). Then, t 12 can fire with rate f ds for feeding p 1 (the distiller) and y can fire with rate f p max to charge p 2s . At time [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF] can fire with rate f ds and the distiller can continue its operation without interruption. However, because M 1 (p 4 (y),ϕ)=1with ϕ ∈ Φ 2 , at τ 1 , y cannot stop firing. Thus, at τ 2 , it reaches M 3 such that M 3 (p 1c )=M 3 (p 2c )=0 as shown in Fig. 6(c). At this marking, both t 11 and t 22 cannot fire, or the PN is not live, or this is an infeasible state. Therefore, the system is not schedulable. Theorem 4.1 shows that with high fusion point types of crude oil to be processed more charging tanks are required.

τ 1 = τ 0 +(ζ/f p max ), M 1 is reached such that M 1 (p 2s )=M 1 (p 1c )=M 1 (p 4 (y), ϕ) = 1, V (M 1 (p 2s ,ϕ)) = ζ, and V (M 1 (p 1c ,ϕ)) = ζ -(τ 1 - τ 0 )f ds > 0 as shown in
τ 2 -τ 1 = ς f ds - ς f p max = f p max -f ds f p max × f ds × ς ≥ f p max -f ds f p max × f ds × Ψ × f p max × f ds f p max -f ds =Ψ or we have M 2 (p 2c )=1and V (M 2 (p 2c ,ϕ)) = ζ,ort
Theorem 4.2: Assume that: 1) there is a single distiller with feeding rate f ds ; 2) there are three charging tanks CTK 1-3 with capacity C j ≥ α, j ∈{1, 2, 3}; 3) the crude oil being processed is a type with high fusion point and its color is ϕ ∈ Φ 2 ; and 4) f p max ≥ f ds ; and 5) initially there is crude oil in CTK 1 and CTK 2 with amount ζ 1 and ζ 2 , respectively, where

ζ 1 = ζ 2 = ζ = min{C 1 ,C 2 ,C 3 }.
The oil in CTK 1 is ready for feeding and CTK 3 is empty. Then, the system is schedulable and any number of tanks of high fusion oil can be transported by a single setup.

Proof: The PN model is shown in Fig. 7. Initially (at time τ 0 , or at marking M 0 )w eh a v eM 0 (p 1c )=M 0 (p 2s )= M At this time, t 22 can fire with rate f ds to feed p 1 and y can fire with rate f ds to charge p 1s . In fact, marking M 1 is equivalent to M 0 , hence, the previous process can be repeated unlimitedly. By doing so, there is always a transition firing to feed p 1 and at the same time y keeps firing without interruption. Thus, the PN is live and it is schedulable. At the same time, y can fire with color ϕ ∈ Φ 2 unlimitedly, or any number of tanks of high fusion oil can be transported. This can be done by a single setup.

Obviously, if there are more than three charging tanks, the system is schedulable and any amount of crude oil with high fusion point can be transported by a single setup.

B. Case 2: System with Two Distillers

When there are multiple distillers in a refinery, often each distiller processes different type of crude oil with different crude oil feeding rate. Thus, we always assume that different distiller processes different type of crude oil at a time. Without loss of generality, we also assume that at any time there is no more than one type of high fusion point crude oil to be processed at a time. Let f ds1 and f ds2 denote the feeding rate to distiller #1 (DS 1 ) and distiller #2 (DS 2 ), and α 1 =Ψ× f ds1 and α 2 =Ψ× f ds2 , respectively.

In crude oil operations, when f p max = f ds1 + f ds2 the system reaches its maximal productivity, for f ds1 + f ds2 cannot be greater than f p max . In this paper, schedulability is discussed under the assumption that f p max = f ds1 + f ds2 . It is shown in [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF] that if there are four charging tanks for feeding two distillers and it requires f p max = f ds1 + f ds2 with f ds1 = f ds2 , the system is not schedulable. This conclusion must hold here too. We consider the situation that there are five charging tanks. Let Π be a real number with Π ≥ 1 and the following conditions are given.

1) Production condition: there are two distillers DS 1 and DS 2 with feeding rates being f ds1 and f ds2 , 4) are satisfied, the system is schedulable and one tank of crude oil of type 3 can be transported by a single setup.

f ds1 >f ds2 , α 1 = Ψ × f ds1 , α 2 =Ψ× f ds2 ,
Proof: With the PN model shown in Fig. 8, the system can be scheduled as follows. Initially, at marking M 0 (time τ 0 ), we have M 0 (p 1c )=M 0 (p 2s )=M 0 (p 4c )=1, V (M 0 (p 1c ,ϕ 1 )) = V (M 0 (p 2s ,ϕ 1 )) = 2Πα 1 , V (M 0 (p 4c ,ϕ 2 )) = 2Πα 2 , and other places are empty. At this marking, we fire t 12 and t 42 with colors ϕ 1 and ϕ 2 to feed p 1 and p 2 , respectively. At the same time, we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 during time interval [τ 0 ,τ 0 +2Πα 2 /(f ds1 + f ds2 )] to charge p 5s and fire y with color ϕ 1 and rate f ds1 + f ds2 during time interval [τ 0 +Πα 2 /(f ds1 + f ds2 ),τ 0 +2ΠΨ]to charge p 3s . In this way, at τ 1 = τ 0 +2Πα 2 /(f ds1 + f ds2 ),wehaveM (p 4 (y)) = 1,but with M (p 3s )=0, y can fire. It is a live state. Also, at τ 1 , t 51 can start to fire and at τ 0 +2ΠΨ, the firing of t 51 must have ended, because 2Πα 2 /(f ds1 + f ds2 ) < Π(α 1 + α 2 )/(f ds1 + f ds2 )= Π(f ds1 + f ds2 )Ψ/(f ds1 + f ds2 )=ΠΨ. Thus, after ΠΨ ≥ Ψ time units, at time τ 2 = τ 0 +2ΠΨ, marking M 1 is reached such that M 1 (p 2c )=M 1 (p 5c )=M 1 (p 3s )=1, V (M 1 (p 2c ,ϕ 1 )) = V (M 1 (p 3s ,ϕ 1 )) = 2Πα 1 , and V (M 1 (p 5c ,ϕ 3 )) = 2Πα 2 , and other places are empty. This marking is equivalent to the initial marking M 0 or the previous process can be repeated and y can be kept firing in all the time. In other words, the system is schedulable. In this process, one tank of high fusion point oil is transported by firing y uninterruptedly, or by a single setup.

Theorem 4.3's conditions require that f ds1 >f ds2 .T h i s condition guarantees that when M 1 is reached such that M 1 (p 4c )=0, M 1 (p 5s )=0 and V (M 1 (p 5s ,ϕ 2 )) = 2Πα 2 must hold, such that the oil residency time constraint can be met. If f ds2 >f ds1 , and when a marking M is reached such that V (M (p 4c ,ϕ 2 )) = α 2 and V (M (p 5s ,ϕ 2 )) = 2Πα 2 ,t h e oil residency time constraint must also be met. In this case, it requires that 2Πα 2 /(f ds1

+ f ds2 ) ≤ (2Π -1)α 2 /f ds2 ⇒ 2ΠΨ × f ds2 /(f ds1 + f ds2 ) ≤ (2Π -1)Ψ × f ds2 /f ds2 ⇒ Π≥ (f ds1 + f ds2 )/2f ds1 .
In general, Ψ is just several hour long and Π can be more than 2 for most charging tanks. Thus, if f ds2 ≤ 3f ds1 the condition can be met, or the theorem holds for f ds2 >f ds1 too. It follows from the proof of Theorem 4.3 that it is impossible to transport two tanks of high fusion point oil by a single setup. Thus, with five charging tanks for feeding two distillers, at most one tank of high fusion point oil can be transported by a single setup. Now we consider the situation with six charging tanks and the following conditions. 5) Production condition: there are two distillers DS 1 and DS 2 with f ds1 = f ds2 , α 1 =Ψ× f ds1 , α 2 =Ψ× f ds2 and f p max = f ds1 + f ds2 . 6) Tank capacity: there are six charging tanks CTK 5)-( 8) are satisfied, the system is schedulable and two tanks of crude oil of type 3 can be transported via the pipeline by a single setup.

Proof: The PN model for this case is shown in Fig. 9. We first show that when f ds1 >f ds2 the theorem holds. Initially, at marking M 0 (time τ 0 ), we have M 0 (p 1c )=M 0 (p 2s )=M 0 (p 4c )=1, V (M 0 (p 1c ,ϕ 1 )) = V (M 0 (p 2s ,ϕ 1 )) = Πα 1 , V (M 0 (p 4c ,ϕ 2 )) = Πα 2 , and other places are empty. At this marking, we fire t 12 with color ϕ 1 and rate f ds1 to feed p 1 , and t 42 with color ϕ 2 and rate f ds2 to feed p 2 , respectively. At the same time, we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 5s .A tt i m eτ 1 = τ 0 +Πα 2 /(f ds1 + f ds2 ), marking M 1 is reached such that M 1 (p 1c )=M 1 (p 2c )=M 1 (p 4c )= M 1 (p 5s )=M 1 (p 4 (y),ϕ 3 )=1 and V (M 1 (p 5s ,ϕ 3 )) = Πα 2 . At this marking, we can continue the firing of t 12 and t 42 to feed p 1 and p 2 , respectively. Meanwhile, M 1 (p 6s )= M 1 (p 6c )=0. Hence, we can fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 6s continuously. Because f ds1 > f ds2 , at time τ 2 = τ 0 +2Πα 2 /(f ds1 + f ds2 ), marking M 2 is reached such that V (M 2 (p 6s ,ϕ 3 )) = Πα 2 ,b u tM 2 (p 1c )= M 2 (p 4c )=M 1 (p 4 (y),ϕ 3 )=1 still holds. At this marking, with M 2 (p 3s )=M 1 (p 6c )=0, we can fire y with color ϕ 1 and rate f ds1 + f ds2 to charge p 3s , and at the same time continue the firing of t 12 and t 42 to feed p 1 and p 2 . At time τ 3 = τ 0 +ΠΨ, M 3 is reached such that M 3 (p 5c )=M 3 (p 2c )= 1, M 3 (p 4c )=M 3 (p 1c )=0, and V (M 3 (p 3s ,ϕ 1 )) = Π(α 1α 2 ). The question is if M 3 (p 4 (y),ϕ 3 )=1, which depends on whether Π(α 1 -α 2 ) ≥ C pipe or not. However, we can assume that M 3 (p 4 (y),ϕ 3 )=1. At this marking, we can fire t 22 with color ϕ 1 to feed p 1 , t 52 with color ϕ 3 to feed p 2 , and fire y with color ϕ 1 to charge p 3s and p 1s with volume Πα 2 and Πα 1 , respectively. Let

τ 4 = τ 0 +2ΠΨ,w e have τ 4 -Πα 2 /(f ds1 + f ds2 ) -τ 3 =ΠΨ-ΠΨ×f ds2 /(f ds1 + f ds2 ) ≥ Ψ((f ds1 +f ds2 )/f ds1 -f ds2 /f ds1 )=Ψ.
This implies that t 31 's firing has ended at τ 4 . Thus, at time τ 4 , marking M 4 is reached such that M 4 (p 6c )= M 4 (p 3c )=M 4 (p 1s )=1, M 4 (p 6s )=M 4 (p 3s )=M 4 (p 4 (y), ϕ 3 )=0, V (M 4 (p 3c ,ϕ 1 )) = V (M 4 (p 1s ,ϕ 1 )) = Πα 1 , and V (M 4 (p 6c ,ϕ 3 )) = Πα 2 . This marking is equivalent to M 0 ,the previous process can be repeated in a cycle way. Now we discuss the case with f ds2 >f ds1 .A tM 0 ,w efi r e t 12 with color ϕ 1 and rate f ds1 to feed p 1 , and t 42 with color ϕ 2 and rate f ds2 to feed p 2 , respectively. At the same time, we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 5s .A tt i m eτ 1 = τ 0 +Πα 2 /(f ds1 + f ds2 ), M 1 is reached such that M 1 (p 1c )=M 1 (p 2c )=M 1 (p 4c )=M 1 (p 5s )= M 1 (p 4 (y),ϕ 3 )=1 and V (M 1 (p 5s ,ϕ 3 )) = Πα 2 .A tt h i s marking, we can continue the firing of t 12 and t 42 to feed p 1 and p 2 , respectively. Meanwhile, M 1 (p 6s )=M 1 (p 6c )=0, the PN is in a live state. Hence we can fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 6s . Because f ds2 >f ds1 , at time τ 2 = τ 0 +ΠΨ, M 2 is reached such that V (M 2 (p 6s ,ϕ 3 )) = Πα 1 , and p 1c and p 4c are just emptied or M 2 (p 1c )=M 2 (p 4c )=0 and M 2 (p 4 (y),ϕ 3 )=1.A tt h i s marking, we have τ

2 -τ 1 =ΠΨ-Πα 2 /(f ds1 + f ds2 )= ΠΨ -ΠΨ × f ds2 /(f ds1 + f ds2 ) ≥ Ψ((f ds1 + f ds2 )/f ds1 - f ds2 /f ds1 )=Ψ.
This implies that, at τ 2 , t 51 's firing has ended or M 2 (p 5s )=0, M 2 (p 5c )=1, and V (M 2 (p 5s ,ϕ 3 )) = Πα 2 . Thus, at τ 2 , we can fire t 22 and t 52 to feed p 1 and p 2 , respectively, and at the same time fire y with color ϕ 3 and rate f ds1 + f ds2 to charge p 6s .Atτ 3 = τ 2 +Π(α 2 -α 1 )/(f ds1 + f ds2 ), M 3 is reached such that M 3 (p 2c )=M 3 (p 5c )=M 3 (p 4 (y), ϕ 3 )=1 and V (M 3 (p 6s ,ϕ 3 )) = Πα 2 . At this marking, with p 3s , p 3c , p 1s , and p 1c being empty, we can continue the firing of t 22 and t 52 to feed p 1 and p 2 , respectively, and at the same time fire y with color ϕ 1 and rate f ds1 + f ds2 to charge p 3s and then p 1s .A tτ 4 = τ 0 +2ΠΨ, M 4 is reached such that M 4 (p 2c )=M 4 (p 5c )=M 4 (p 4 (y), ϕ 3 )=0. Notice that the volume that is charged to p 6s and p 35 after

τ 2 is Π(α 2 - α 1 )+Πα 1 =Πα 2 . Thus, τ 4 -(τ 2 +Πα 2 /(f ds1 + f ds2 )) = ΠΨ -Πα 2 /(f ds1 + f ds2 )=ΠΨ-ΠΨ × f ds2 /(f ds1 + f ds2 ) ≥ Ψ((f ds1 + f ds2 )/f ds1 -f ds2 /f ds1 )=Ψ.
This implies that, at τ 4 , the firing of t 61 and t 31 has ended or M 4 (p 6s )= M 4 (p 3s )=0, M 4 (p 6c )=M 4 (p 3c )=M 4 (p 1s )=1, V (M 4 (p 3c ,ϕ 1 )) = V (M 4 (p 1s ,ϕ 1 )) = Πα 1 , and V (M 4 (p 6c ,ϕ 3 )) = Πα 2 . This marking is equivalent to M 0 , or the previous process can be repeated in a cycle way, or the system is schedulable. In both cases, two tanks of crude oil with high fusion point are transported via the pipeline without being interrupted. Thus, such a parcel of oil can be transported by a single setup.

By making Π as large as possible, the charging tanks can be charged as full as possible. It follows from Theorem 4.4 that two tanks of oil with high fusion point can be transported from storage tanks to charging tanks by a single setup. At the same time, maximal productivity can be reached. From the proof of Theorem 4.4, it is obvious that it is impossible to transport three tanks of oil with high fusion point if there are three charging tanks for each distiller. From the proof, it is known that CTK 3 and CTK 1 are charged interruptedly. This implies that two tanks of high fusion point crude oil can be transported by a single setup for any one of the two distillers.

From Theorem 4.2, we notice that when there are three charging tanks for feeding one distiller, unlimited amount of high fusion point oil can be transported by a single setup. However, only two tanks of high fusion point oil can be transported by a single setup when there are two distillers with each distiller having three charging tanks. This implies that, with more distillers in the system, it is more difficult to schedule it. Now we consider the situation with more charging tanks and the following conditions are given. 9) Tank capacity: there are eight charging tanks CTK 5), ( 9)-( 11) are satisfied the system is schedulable and three tanks of crude oil of type 3 can be transported via the pipeline by a single setup.

Proof: The PN model for this case is shown in Fig. 10. We first show that when f ds1 >f ds2 the theorem holds. Initially, at marking M 0 (time τ 0 ), we have M 0 (p 1c )=M 0 (p 2s )=M 0 (p 3s )=M 0 (p 5c )=1,V(M 0 (p 1c , ϕ 1 )) = V (M 0 (p 2s ,ϕ 1 )) = V (M 0 (p 3s ,ϕ 1 )) = Πα 1 , V (M 0 (p 5c , ϕ 2 )) = Πα 2 , and other places are empty. At this marking, we fire t 12 with color ϕ 1 and rate f ds1 to feed p 1 , and t 52 with color ϕ 2 and rate f ds2 to feed p 2 , respectively. For y's firing, there are three cases: 1) f ds1 < 2f ds2 ;2 )f ds1 =2f ds2 , and 3) f ds1 > 2f ds2 . For Case 1), we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 6s with volume Πα 2 , then charge p 7s with volume Πα 2 , and then charge p 8s with volume Π(α 1 -α 2 ). For Case 2), we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 6s , then p 7s , and then p 8s , all with volume Πα 2 . For Case (3), we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 6s , then p 7s , and then p 8s , all with volume Πα 2 , and then continue to fire y with color ϕ 1 to charge p 4s with volume

Π(α 1 -2α 2 ).A tτ 1 = τ 0 +ΠΨ, M 1 is reached such that M 1 (p 1c )=M 1 (p 5c )=0, M 1 (p 2c )=M 1 (p 3c )=M 1 (p 6c )=M 1 (p 4 (y),ϕ 3 )=1for all the three cases; V (M 1 (p 6c ,ϕ 3 )) = V (M 1 (p 7s ,ϕ 3 )) = Πα 2 , and V (M 1 (p 8s ,ϕ 3 )) = Π(α 1 -α 2 ) for Case (1); V (M 1 (p 6c ,ϕ 3 )) = V (M 1 (p 7s ,ϕ 3 )) = V (M 1 (p 8s ,ϕ 3 )) = Πα 2 for Case (2); and V (M 1 (p 6c ,ϕ 3 )) = V (M 1 (p 7s ,ϕ 3 )) = V (M 1 (p 8s ,ϕ 3 )) = Πα 2 , V (M 1 (p 4s ,ϕ 1 )) = Π(α 1 -2α 2 )
for Case [START_REF] David | On hybrid Petri nets[END_REF]. At this marking, we can fire t 22 with color ϕ 1 and rate f ds1 to feed p 1 , and t 62 with color ϕ 3 and rate f ds2 to feed p 2 , respectively. Meanwhile, there is enough space in p 4s and p 1s , the PN is in a live marking. We fire y with color ϕ 3 ∈ Φ 2 to charge p 8s with volume Π(2α 2 -α 1 ), then with ϕ 1 to charge p 4s with volume Πα 1 , and then with ϕ 1 to charge p 1s with volume Π(α 1 -α 2 ) for Case (1); fire y with ϕ 1 to charge p 4s with volume Πα 1 , and then with ϕ 1 to charge p 1s with volume Π(α 1 -α 2 ) for Case (2); and fire y with ϕ 1 to charge p 4s with volume 2Πα 2 , and then with ϕ 1 to charge p 1s with volume Π(α 1 -α 2 ) for Case [START_REF] David | On hybrid Petri nets[END_REF]

. At τ 2 = τ 0 +2ΠΨ, M 2 is reached such that M 2 (p 2c )=M 2 (p 6c )=M 2 (p 4 (y),ϕ 3 )=0, M 2 (p 3c )=M 2 (p 7c )=M 2 (p 8s )=M 2 (p 4s )=M 2 (p 1s )=1, V (M 2 (p 7c ,ϕ 3 )) = V (M 2 (p 8s ,ϕ 3 )) = Πα 2 , V (M 2 (p 4s ,ϕ 1 )) = Πα 1 , and V (M 2 (p 1s ,ϕ 1 )) = Π(α 1 -α 2 )
. At this marking, we fire t 32 with color ϕ 1 and rate f ds1 to feed p 1 , and t 72 with color ϕ 3 and rate f ds2 to and p 2 , respectively. At the same time, we continue to fire y with color ϕ 1 to charge p 1s with volume Πα 2 and then charge p 2s with volume Πα 1 . Thus, at

τ 3 = τ 0 +3ΠΨ, M 3 is reached such that M 3 (p 3c )=M 3 (p 7c )=M 3 (p 4 (y), ϕ 3 )=0, M 3 (p 4c )=M 3 (p 8c )=M 3 (p 1s )=M 3 (p 2s )=1, V (M 3 (p 1s ,ϕ 1 )) = V (M 3 (p 2s ,ϕ 1 )) = V (M 3 (p 4c ,ϕ 1 )) = Πα 1
, and V (M 3 (p 8c ,ϕ 3 )) = Πα 2 . This marking is equivalent to M 0 , or the previous process can be repeated in a cycle way. Now we discuss the case with f ds2 >f ds1 . There are also three cases: 1) f ds2 < 2f ds1 ;2 )f ds2 =2f ds1 ; and 3) f ds2 > 2f ds1 .A tM 0 ,w efi r et 12 with color ϕ 1 and rate f ds1 to feed p 1 , and t 52 with color ϕ 2 and rate f ds2 to feed p 2 , respectively. At the same time, we fire y with color ϕ 3 ∈ Φ 2 and rate f ds1 + f ds2 to charge p 6s with volume Πα 2 and then to charge p 7s with volume Πα 1 .L e tτ 1 = τ 0 +ΠΨ,w eh a v e

τ 1 -Πα 2 /(f ds1 + f ds2 ) -τ 0 =ΠΨ-ΠΨ × (f ds2 /(f ds1 + f ds2 )) ≥ Ψ((f ds1 + f ds2 )/f ds1 -f ds2 /f ds1 )=Ψ.T h i si m - plies that t 61 's firing has ended at τ 1 . Thus, at time τ 1 , M 1 is reached such that M 1 (p 1c )=M 1 (p 5c )=0, M 1 (p 2c )= M 1 (p 6c )=M 1 (p 7s )=M 1 (p 4 (y)) = 1, V (M 1 (p 6c ,ϕ 3 )) = Πα 2 , and V (M 1 (p 7s , ϕ 3 )) =Π α 1 .
At this marking, we fire t 22 with color ϕ 1 and rate f ds1 to feed p 1 , and t 62 with color ϕ 3 and rate f ds2 to feed p 2 , respectively. At the same time, we fire y with color ϕ 3 ∈ Φ 2 to charge p 7s with volume Π(α 2 -α 1 ), then with color ϕ 3 to charge p 8s with volume Πα 2 , and then with color ϕ 1 to charge p 4s with volume Π(2α 1 -α 2 ) for Case 1); with color ϕ 3 ∈ Φ 2 to charge p 7s with volume Π(α 2 -α 1 ), then with color ϕ 3 ∈ Φ 2 to charge p 8s with volume Πα 2 for Case 2); and with color ϕ 3 ∈ Φ 2 to charge p 7s with volume Π(α 2 -α 1 ), then with color ϕ 3 ∈ Φ 2 to charge p 8s with volume 2Πα 1 for Case 3). At [START_REF] Chen | Analysis of hybrid system based on hybrid net condition/event system model[END_REF]; and V (M 2 (p 7c ,ϕ 3 )) = Πα 2 and V (M 2 (p 8s ,ϕ 3 )) = 2Πα 1 for Case [START_REF] David | On hybrid Petri nets[END_REF]. At this marking, we fire t 32 with color ϕ 1 and t 72 with color ϕ 3 to feed p 1 and p 2 , respectively. At the same time, there is space in p 4s , p 1s , and p 2s ,w efi r ey with color ϕ 1 to charge p 4s with volume Π(α 2 -α 1 ), then to charge p 1s with volume Πα 1 , and then to charge p 2s with volume Πα 1 for Case (1); fire y with color ϕ 1 to charge p 4s , p 1s , and p 2s , sequentially, all with volume Πα 1 for Case (2); and fire y with color ϕ 3 ∈ Φ 2 to charge p 8s with volume Π(α 2 -2α 1 ), then with color ϕ 1 to charge p 4s , p 1s , and p 2s , sequentially, all with volume Πα 1 for Case [START_REF] David | On hybrid Petri nets[END_REF]. At

τ 2 = τ 0 +2ΠΨ,M 2 is reached such that M 2 (p 2c )= M 2 (p 6c )=0 and M 2 (p 3c )=M 2 (p 7c )=M 2 (p 4 (y),ϕ 3 )=1 for all the three cases; V (M 2 (p 7c ,ϕ 3 )) = V (M 2 (p 8s ,ϕ 3 )) = Πα 2 , and V (M 2 (p 4s ,ϕ 1 )) = Π(2α 1 -α 2 ) for Case (1); V (M 2 (p 7c ,ϕ 3 )) = V (M 2 (p 8s ,ϕ 3 )) = Πα 2 for Case
τ 3 = τ 0 +3ΠΨ,M 3 is reached such that M 3 (p 3c )=M 3 (p 7c )= M 3 (p 4 (y),ϕ 3 )=0 ,M 3 (p 4c )=M 3 (p 8c )=M 3 (p 1s )=M 3 (p 2s )=1,V(M 3 (p 1c ,ϕ 1 )) = V (M 3 (p 2s ,ϕ 1 )) = V (M 3 (p 4c , ϕ 1
)) = Πα 1 , and V (M 3 (p 8c ,ϕ 3 )) = Πα 2 . This marking is equivalent to M 0 , or the previous process can be repeated in a cycle way.

In both cases, three tanks of high fusion point crude oil are transported via the pipeline without being interrupted. Thus, such a parcel of oil can be transported by a single setup.

From Theorems 4.4 and 4.5, it seems that, with one more charging tank adding to each distiller, one more tank of high fusion point crude oil can be transported via the pipeline by a single setup for a distiller to process. It should be noticed that, for Case (2), after charging CTK 6 and CTK 7 to Πα 2 by firing y, CTK 5 has been emptied. Thus, while p 1 and p 2 are being fed by CTK 2 and CTK 6 , CTK 8 and CTK 5 can be charged by firing y. Then, while p 1 and p 2 are being fed by CTK 3 and CTK 7 , CTK 4 and CTK 1 can be charged by firing y. In this way, the PN is live. This implies, in some case, that four tanks of high fusion oil can be transported by a single setup.

V. S CHEDULABILITY FOR SYSTEMS WITH MULTIPLE DISTILLERS

This section discusses schedulability for systems with more than two distillers and generalizes the results obtained in the last section. We assume that there are K ≥ 3 distillers for the system discussed and the following conditions are given. 12) Production condition: there are K distillers DS 1-K with feeding rates f dsi >f ds(i+1) , i =1,...,K -1,α i =Ψ× f dsi ,i =1,...,K, and

f p max = f ds1 + f ds2 + •••+ f dsK . 13) Tank capacity: there are 2K +1 charging tanks CTK 1-(2K +1) with capacity C 1 ≥ Kα 1 , C 2 ≥ Kα 1 , C 3 ≥ Kα 1 ; C 4 ≥ Kα 2 , C 5 ≥ Kα 2 ; ...,C 2i ≥ Kα i , C 2i+1 ≥ Kα i ; ...; C 2K ≥ Kα K ,C 2K +1 ≥ Kα K . CTK 1-3 serve DS 1 while CTK 2i - CTK 2i+1 serve DS i , 2 ≤ i ≤ K. 14) Initial condition: the volume of oil type 1 in CTK 1 and CTK 2 is ζ 1 = ζ 2 = Kα 1 , the volume of type 2 in CTK 4 is ζ 4 = Kα 2 , ..., the volume of type i in CTK 2 i is ζ 2i = Kα i ,..., the volume of type K in CTK 2K is ζ 2K = Kα K
, the other tanks are empty, and the oil in CTK 1 , and CTK 2i , 2 ≤ i ≤ K is ready for feeding. 15) Crude oil type switching: after finishing the oil of type K in CTK 2K , distiller K should process another type of crude oil (type K +1) that has high fusion point. Theorem 5.1: If conditions ( 12)-( 15) are satisfied the system is schedulable and one tank of crude oil of type K +1can be transported via the pipeline by a single setup.

Proof: Let a charging tank CTK i be modeled by {p is , p ic , t i1 , t i2 } with t i1 and t i2 being the timed and discharging transitions, respectively, and distiller DS i be modeled by p i in the PN model. Then, this system can be scheduled as follows. Initially, at M 0 (time τ 0 ), M 0 (p 1c )=M 0 (p 2s )=1,M 0 (p (2i)c )= 1,i=2 , 3,...,K,V(M 0 (p 1c ,ϕ 1 )) = V (M 0 (p 2s ,ϕ 1 )) = Kα 1 ,V(M 0 (p (2i)c ,ϕ i )) = Kα i ,i =2, 3,...,K, and the other places are empty. At this marking, we fire t 12 with color ϕ 1 to feed p 1 , and t (2i)2 with color ϕ i to feed p i ,i =2, 3,...,K, respectively. Meanwhile, we fire y in the following order: with color ϕ K +1 ∈ Φ 2 to charge p (2K +1)s with volume Kα K → with color ϕ K -1 to charge p (2K -1)s with volume Kα K -1 → ••• →with color ϕ i to charge p (2i+1)s with volume Kα i → ••• →with color ϕ 2 to charge p 5s with volume Kα 2 → with color ϕ 1 to charge p 3s with volume Kα 1 .I t should be pointed out that after firing y for charging p (2K +1)s , we have M (p 4 (y),ϕ K +1 )=1. However, at that marking, there are K -1 empty places: p (2K -1)s ,...,p (2i+1)s ,...,p 5s , and p 3s . Thus, y can continue to fire and after some time M (p 4 (y),ϕ K +1 )=0 must hold. Notice also that

Kα 1 f p max = K ×f ds1 ×Ψ f ds1 + •••+ f dsK ≥ (f ds1 + •••+ f dsK )×Ψ f ds1 + •••+ f dsK
=Ψ. This implies that charging p 5s stops before time τ 0 +(K -1)Ψ. Hence, the firing of t 51 can start before τ 0 +(K -1)Ψ and must end before τ 1 = τ 0 + KΨ,o ro i l residency time constraint is met. Thus, at τ 1 , marking M 1 is reached such that M 1 (p 2c )=M 1 (p 3s )=1,M 1 (p (2i+1)c )= 1,i =2, 3,...,K,V(M 1 (p 2c ,ϕ 1 ))=V (M 1 (p 3s ,ϕ 1 ))=Kα 1 , V (M 1 (p (2i+1)c ,ϕ i )) = Kα i ,i =2, 3,...,K, and the other places are empty. This marking is equivalent to M 0 . Hence, the process can be repeated in a cyclic way and a feasible schedule can be obtained. It can be seen that, in this process, a tank of oil type K +1is transported by a single setup.

Theorem 5.1's conditions require that the capacity of a charging tank and the volume of crude oil in a charging tank are greater or equal to Kα i . It seems that it is difficult to be satisfied. However, in practice, it is not a serious restriction. In practice, in general, there are no more than four distillers in most refineries. Similarly, feeding rate for a distiller is no more than 650 t/h. Generally, Ψ is from 4-6 h. Thus, we have 4 × 650 × 6 = 15 500 t that is less than the capacity of a general charging tank. In the theorem, it states that a tank of a high fusion oil type can be transported for DS K . It follows from the proof of the theorem that one tank of high fusion crude oil can be transported for any distiller if the conditions in the theorem are satisfied. However, the cost may be very high if only one tank of high fusion crude oil is transported with one setup, unless the capacity of tank is very large. Now we consider more charging tank situations with the following conditions. 16) Production condition: there are K distillers DS 1-K with feeding rates f dsi = f dsj ,i = j, α i =Ψ× f dsi , i = 1,...,K, and f p max = f ds1 + f ds2 16) to [START_REF] Wu | Modeling and conflict detection of crude-oil operations for refinery process based on controlled-coloredtimed Petri net[END_REF] given above are satisfied, then the system is schedulable and two tanks of uninterruptedly. Hence, the previous process is feasible.

Let τ 1 = τ 0 +ΠΨ,w eh a v eτ 1 -Πα K /(f ds1 + •••+ f dsK ) -τ 0 =Π Ψ-ΠΨf dsK /(f ds1 + •••+ f dsK )=ΠΨ (1 -f dsK /(f ds1 + •••+ f dsK )) ≥ Ψ. This implies that t (3K -1)1 's firing has ended at τ 1 . Thus, at τ 1 , M 1 is reached such that M 1 (p 4 (y),ϕ K +1 )=0,M 1 (p 2c )=1, M 1 (p (3i+2)c )=M 1 (p (3i+3)s )=1 , 1 ≤ i ≤ K -1,V (M 1 (p 2c ,ϕ 1 )) = Πα 1 ,V(M 1 (p (3i+2)c ,ϕ i+1 )) = V (M 1 (p (3i+3)s , ϕ i+1 )) = Πα i+1 , 2 ≤ i ≤ K -2,V(M 1 (p 5c ,ϕ 2 )) = Πα 2 , V (M 1 (p 6s ,ϕ 2 )) = Π(α 1 + α 2 -α K ),V(M 1 (p (3K -1)c , ϕ K +1 )) = V (M 1 (p (3K )s ,ϕ K +1 )) = Πα K ,
and other places are empty. At this marking, we fire t 22 with color ϕ 1 to feed p 1 , t (3i-1)2 with color ϕ i to feed p i , 2 ≤ i ≤ K -1, and t (3K -1)2 with color ϕ K +1 to feed p K . At the same time, we fire y with the following order: with color ϕ 2 and rate f p max to charge p 6s with volume Π(α K -α 1 ) → with color ϕ 1 and rate f p max to charge p 3s with volume Πα 1 → with color ϕ 1 and rate f p max to charge p 1s with volume Πα 1 → ••• → with color ϕ i+1 to charge p (3i+1)s with volume Πα i+1 , 1 ≤ i ≤ K -2. Notice that, between τ 1 and the time point when it stops charging p 3s ,t h e total volume of oil charged by firing y is Πα K . Hence, let

τ 2 = τ 0 +2ΠΨ,w eh a v e(τ 2 -Πα K )/(f ds1 + •••+ f dsK ) -τ 1 = ΠΨ -ΠΨf dsK /(f ds1 + ••• + f dsK )=Π Ψ ( 1-f dsK / (f ds1 + •••+ f dsK )) ≥ Ψ. This implies that t 31 's firing has ended at τ 2 . Thus, at τ 2 , M 2 is reached such that M 2 (p 3c )= M 2 (p 1s )=1 ,M 2 (p (3i)c )=M 2 (p (3i-2)s )=1, 2 ≤ i ≤ K - 1,M 2 (p (3K )c )=1 ,V(M 2 (p 3c ,ϕ 1 )) = V (M 2 (p 1s ,ϕ 1 )) = Πα 1 ,V(M 2 (p (3i)c ,ϕ i )) = V (M 2 (p (3i-2)s ,ϕ i )) = Πα i , 2 ≤ i ≤ K -1,V(M 2 (p (3K )c ,ϕ K +1 )) = Πα K ,
and other places are empty. This marking is equivalent to M 0 , and thus the process can be repeated in a cyclic way.

In both cases, a feasible schedule can be obtained and two tanks of crude oil of high fusion point type by firing y continuously. This implies that this amount of oil can be transported by just a single setup.

In the proof of the theorem, we assume that α 1 + α 2 -α K > 0. It seems a constraint, in fact it is not. If α 1 + α 2 -α K ≤ 0, we need only to leave p 6s empty and charge p 9s with volume Π(α 1 + α 2 + α 3 -α K ) during the time interval [τ 0 , τ 1 ], then the result is unchanged. It follows from the proof of the theorem that only two tanks of high fusion point oil can be transported by a single setup. For Case [START_REF] Bechtel | PIMS (Process Industry Modeling System) User's Manual[END_REF], when CTK 3K -1 and CTK 3K are charged to Πα K , CTK 3K -2 has not been emptied yet. To charge CTK 3K -2 after charging CTK 3K , y should stop firing for some time. This violates the liveness conditions given in Definition 3.4. For Case (2), when CTK 3K -1 and CTK 3K are charged to Πα K , CTK 3K -2 has been emptied. However, by charging CTK 3K -2 immediately after charging CTK 3K , oil residency time constraint will be violated. Theorem 5.2 shows that if each distiller has three charging tanks, two tanks of high fusion point oil can be transported for a distiller by a single setup. The following theorem shows that with one more charging tank adding to each distiller, one more tank of high fusion point crude oil can be transported via the pipeline by a single setup. Let H> 3 be an integer and the following conditions are given. 16) and ( 20)- [START_REF] Wu | Short-term schedulability analysis of multiple distiller crude oil operations in refinery with oil residency time constraint[END_REF] given above are satisfied, then the system is schedulable and H -1 tanks of crude oil of type K +1can be transported via the pipeline by a single setup.

Proof:

It depends on (H -1)α K /(α 1 + •••+ α K ). We have 0 < (H -1)α K /(α 1 + •••+ α K ) <H-1.
We first show that the theorem holds when 0 <

(H -1)α K /(α 1 + •••+ α K ) < 1. Initially, at M 0 (time τ 0 ), we have M 0 (p (i1)c )=1 and M 0 (p (ij)s )=1, 1 ≤ i ≤ K -1 and 2 ≤ j ≤ H -1,M 0 (p (K 1)c )=1; and V (M 0 (p (i1)c ,ϕ i )) = V (M 0 (p (ij)s ,ϕ i )) = Πα i , 1 ≤ i ≤ K -1 and 2 ≤ j ≤ H -1,V(M 0 (p (K 1)c ,ϕ K )) = Πα K ,
and other places are empty. At this marking, the total capacity in p (Kj)s , 2 ≤ j ≤ H, and p

(iH )s , 1 ≤ i ≤ K -1,is Π(α 1 + •••+ α K -1 +(H -1)α K ),
or there is enough capacity to fire y. Hence, at this marking, we fire t (i1)2 with color ϕ i to feed p i , 1 ≤ i ≤ K, respectively. At the same time, we fire y with the following order: with color ϕ K +1 ∈ Φ 2 and rate f p max to charge p (K 2)s with volume Πα K → ••• → with color ϕ K +1 ∈ Φ 2 and rate f p max to charge p (KH)s with volume Πα K → with color ϕ i and rate f p max to charge p (iH )s with volume Πα i ,K -1 ≥ i>A and 0

≤ α 1 + •••+ α A -(H -1)α K ≤ α A → with color ϕ A to charge p (AH)s with volume Π((H -1)α K -(α 1 + •••+ α A -1 )
). It should be pointed out that, after charging p (KH)s with volume Πα K ,w eh a v eM (p 4 (y),ϕ K +1 )=1. However, with p (iH )s , 1 ≤ i ≤ K -1, being empty, y can fire uninterruptedly. Hence, the previous process is feasible

. Let τ 1 = τ 0 +ΠΨ,w eh a v eτ 1 -Πα K /(f ds1 + •••+ f dsK ) -τ 0 =Π Ψ-(ΠΨ × f dsK )/(f ds1 + •••+ f dsK )= ΠΨ(1 -f dsK /(f ds1 + •••+ f dsK )) ≥ Ψ. This implies that t (K 2)1 's firing has ended at τ 1 . Thus, at τ 1 , M 1 is reached such that M 1 (p 4 (y),ϕ K +1 )=0,M 1 (p (i2)c )=1, 1 ≤ i ≤ K, V (M 1 (p (i2)c ,ϕ i )) = Πα i , 1 ≤ i ≤ K -1,V(M 1 (p (iH )s ,ϕ i )) = Πα i ,A+1≤ i ≤ K -1,V(M 1 (p (AH)s ,ϕ A )) =Π((H -1)α K -(α 1 + •••+ α A -1 )),V(M 1 (p (K 2)c ,ϕ K +1 )) = V (M 1 (p (Kj)s ,ϕ K +1 )) = Πα K , 3 ≤ j ≤ H,
and other places are empty. At this marking, we fire t (i2)2 with color ϕ i to feed p i , 1 ≤ i ≤ K -1, and t (K 2)2 with color ϕ K +1 ∈ Φ 2 to feed p K , respectively. At the same time, we fire y with the following order: with color ϕ A and rate f p max to charge p (AH)s with volume Π(α 1 + •••+ α A -(H -1)α K ) → with color ϕ i and rate f p max to charge p (iH )s with volume Πα i ,A-1 ≥ i ≥ 1 → with color ϕ i and rate f p max to charge p (i1)s with volume Πα i ,K -1 ≥ i>B and

0 ≤ α 1 + •••+ α B -(H -2)α K ≤ α B → with color ϕ B to charge p (B 1)s with volume Π((H -2)α K -(α 1 + •••+ α B -1 )). Then, at τ 2 = τ 0 +2ΠΨ, M 2 is reached such that M 2 (p 4 (y),ϕ K +1 )=0,M 2 (p (i3)c )=1, 1 ≤ i ≤ K, V (M 2 (p (i3)c ,ϕ i )) = V (M 2 (p (iH )s ,ϕ i )) = Πα i , 1 ≤ i ≤ K -1,V(M 1 (p (K 3)c ,ϕ K +1 )) = Πα K , the remaining ca- pacity in p (i1)s , 1 ≤ i ≤ B,i sΠ(H -2)α K . By doing so, at τ F = τ 0 + F ΠΨ, 2 <F <H-1,M F is reached such that M F (p 4 (y),ϕ K +1 )=0 ,M F (p (i(F +1))c )=1 , 1 ≤ i ≤ K, V (M F (p (i(F +1))c ,ϕ i )) = Πα i , 1 ≤ i ≤ K -1,V(M F (p (K (F +1))c ,ϕ K +1 )) = Πα K , and ∃G such that 0 ≤ α 1 + •••+ α G -(H -F )α K ≤ α G and the remain- ing capacity in p (i(F -1))s , 1 ≤ i ≤ G,i sΠ(H -F )α K . Finally, at τ H -1 = τ 0 +(H -1)ΠΨ,M H -1 is reached such that M H -1 (p (iH )c )=1 and M H -1 (p (ij)s )=1, 1 ≤ i ≤ K -1 and 2 ≤ j ≤ H -2,M H -1 (p (KH)c )=1; and V (M H -1 (p (iH )c ,ϕ i )) = V (M H -1 (p (ij)s ,ϕ i )) = Πα i , 1 ≤ i ≤ K -1 and 2 ≤ j ≤ H -2,V(M H -1 (p (KH)c ,ϕ K +1 )) =
Πα K , and other places are empty. This marking is equivalent to M 0 and the previous process can be repeated in a cycle way. In this way, a feasible schedule is created and, by such schedule, H -1 tanks of high fusion point crude oil are transported for feeding DS K . Because y can fire uninterruptedly whenever M (p 4 (y),ϕ K +1 )=1, or the transportation of the H -1 tanks of high fusion point crude oil can be completed by just a single setup.

When (H -1)α K /(α 1 + •••+ α K ) ≥ 1 it can be shown in the similar way and it is omitted.

Notice that when there are two distillers and four charging tanks, for each distiller four tanks of high fusion crude oil can be transported by just a single setup. In that case, we have H -1 >K. From the proof of Theorems 5.2 and 5.3, it is easy to show that when H -1 ≤ K only H -1 tanks of high fusion crude oil can be transported by just a single setup. In the above theorems, it is required that Π

≥ (f ds1 + •••+ f dsK )/(f ds1 + •••+ f ds(K -1)
). This requirement is to guarantee the satisfaction of oil residency time constraint. In practice, if Π is large enough, a charging tank can be charged with volume more than Πα i , possibly as full as possible.

In the proof of Theorem 5.3, a streamlined procedure with all the parameters analytically given is presented to obtain a feasible detailed schedule such that H -1 tanks of high fusion crude oil can be transported from storage tanks to charging tanks by a single setup. Thus, to do so, almost no computation is necessary. In practice, often Π is large enough and a charging tank CTK j can be charged with volume more than Πα i . Thus, we need to determine the volume of oil to be charged into CTK j such that oil residency time constraint can be satisfied. To do so, it needs to calculate the time when the oil for feeding DS i is used up. With the state of the system and the feeding rate to DS i known, this calculation is very simple. In other words, by using the proposed method, no complex computation is required.

VI. INDUSTRIAL CASE STUDY

This section presents a case study to show the application and power of the results obtained in this paper. This case problem arises from a practical application scenario. The refinery has three distillers DS 1 ,D S 2 , and DS 3 with nine charging tanks available. Three times each month, a short-term schedule should be created for the next 10 days. The initial state for nine charging tanks is shown in Table I. The maximal flow rate of the pipeline is f p max = 1250 t/h. There is 62 000 t of crude oil of type #2, a type of high fusion point oil, in the storage tanks. Such crude oil is to be processed by distiller DS 3 . A refining schedule is given as shown in Fig. 11 for the next 10 days with refining rates for distillers DS 1 ,DS 2 , and DS 3 being 333.3, 291.7, and 625.0 t/h, respectively, where #i denotes crude oil type # i, i =1, 2,...,7. The oil residency time for charging tanks Ψ is 6 h and the capacity of pipeline is C pipe = 12 000 t. The question is if the refining schedule is realizable and 62 000 t crude oil of type #2 can be transported to charging tanks by a single setup.

According to the schedulability analysis presented above, examine the refining schedule and the initial state of the charging tanks, we find that: 1) DS 1 processes 38 000 t of oil type #1 held in charging tanks CT122 and CT129 first and then switches to process crude oil type #5. This implies that charging tanks CT122, CT129, and CT180 can be assigned to DS 1 ;2 )D S 2 first processes the crude oil held in tanks CT181 and CT124, then switches to process crude oil type #7, or charging tanks CT124 and CT181 are usable for DS 2 ;3 )D S 3 process the oil held in tank CT115 first and then switches to process oil type #2 and then #4, or charging tanks CT115 is usable for DS 3 ; 4) charging tanks CT116, CT127, and CT125, they are free to be used; and 5) the total production rate is equal to the maximal transportation rate of the pipeline. Because f ds3 > f ds2 , we assign CT116 and CT127 to DS 3 , and CT125 to DS 2 . Thus, each of the three distillers has three charging tanks with two tanks being empty for DS 3 , and one for DS 2 . With C CT125 = 2000 t>C pipe = 12 000 t. This implies that two tanks of #2 oil can be transported for DS 3 by a single setup. Furthermore, we have C CT116 + C CT127 = 68 000 t > 62000 t. Thus, from the results obtained in this paper, it concludes that the refining schedule is realizable and 62 000 t of #2 oil can be transported for DS 3 by a single setup.

With the above observation and following the scheduling idea presented in this paper, we find the detailed schedule for this case study as shown in Figs. 12 and13, where #1 stands for crude oil type #1 and 122 for charging tanks CT122. This is consistent to the analysis given in the last section.

Notice that, in Fig. 13, we only present the charging tank filling schedule up to time point 200H. To this time point, the amount of crude oil of all types filled into the charging tanks is enough for completing the refining schedule. Then, different types of oil may need to fill to the charging tanks for the next scheduling horizon. It is extremely difficult, if not impossible, for any existing mathematical programming methods to obtain a short-term schedule for this presented industrial case.

VII. CONCLUSION

A short-term schedule for oil refinery should provide all the activities in every detail for the whole scheduling horizon. It is the detail that makes the short-term scheduling problem extremely difficult [START_REF] Honkomp | The curse of reality -why process scheduling optimization problems are difficult in practice[END_REF]. There are various constraints including resource and process ones. Some of them are very difficult to model by mathematical programming models. Thus, it is hard to find a feasible schedule that is essential to the short-term scheduling problem for crude oil operations. Moreover, a good schedule should make operational cost as low as possible, such as minimizing oil inventory cost. Among various costs, high setup cost for high fusion point crude oil transportation via pipeline and the cost resulting from mixing different types of oil in a tank play an important role. Because of the complexity, there is no model in the literature that can be used to reduce such kinds of costs. In viewing an operation decision, which forms a short-term schedule, as a control, we propose to study the short-term scheduling problem for crude oil operations in a control theory perspective. In this way, the short-term scheduling problem can be solved in a hierarchical way. At the upper level, it determines a refining schedule by minimizing oil inventory cost and maximizing productivity, while, at the lower level, a detailed schedule is found to realize it and reduce oil transportation cost and tank charging and discharging cost.

To solve the lower level problem, this paper studies the detailed scheduling problem by taking the setup cost of high fusion point oil transportation and tank charging and discharging cost into consideration. The system is modeled by a hybrid Petri net model. The liveness of the model, which is easy to check, describes the feasibility of a short-term schedule for the system. To reduce the tank charging and discharging cost, a control strategy is used. By this control strategy, the charging tanks are grouped such that a group of them serve a distiller. With the PN model and control strategy, this paper conducts schedulability analysis and schedulability conditions are presented. These conditions reveal the relationship among the number of charging tanks, number of distillers, capacity of charging tanks, flow rate of the pipeline, productivity, and volume of high fusion point crude oil able to be transported by a single setup. They are necessary for determining a refining schedule at the upper level and can be used to check its realizability. They are presented in a structural way, and can be easily used to create its corresponding detailed schedule with setup cost of high fusion point oil transportation and tank charging and discharging cost being minimized.

It should be noticed that the volume of high fusion point crude oil that is able to be transported by a single setup is obtained under the special control strategy. It is ideal that a required volume of such oil can be transported by a single setup under this strategy. However, if not, a control policy and its corresponding scheduling analysis are necessary because of the high setup cost for high fusion crude oil transportation. This is our future work.

  Wu, Feng Chu, Mengchu Zhou To cite this version: Naiqi Wu, Feng Chu, Mengchu 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 Transactions on Systems, Man, and Cybernetics, Part C: Applications and Reviews, 2010, 40 (2), pp.159-175. 10.1109/TSMCC.2009.2032661. hal-00645147

Fig. 1 .

 1 Fig. 1. Architecture of short-term scheduling for refinery.

Definition 2 . 1 :

 21 OD =(COT,ζ,S,D,INT =[a, b]

1 =

 1 τ s ,π k 1 = ω k 2 ,...,π k (i-1) = ω ki , ..., and π kn = τ e , for ∀k ∈ K (2.2)

Fig. 2 .

 2 Fig. 2. Icons in the model.

Fig. 3 .

 3 Fig. 3. Petri net for a tank.

Fig. 4 .

 4 Fig. 4. PN model for pipeline.

Fig. 5 .

 5 Fig. 5. PN model for the whole system.

Fig. 6 .

 6 Fig. 6. PN model for the proof of Theorem 4.1.

Fig. 6 (

 6 b). At τ 1 ,ify stops firing, then at timeτ 2 = τ 0 +(ζ/f ds ), M 2 is reached such that M 2 (p 1c )=0and V (M 2 (p 1c )) = 0. This time, we have

Fig. 7 .

 7 Fig. 7. PN model for a system with three charging tanks and one distiller.

  1 (p 4 (y), ϕ)=1 with ϕ ∈ Φ 2 and M 0 (p 1s )=M 0 (p 2c )= M 0 (p 3s )=M 0 (p 3c )=0, V (M 0 (p 1c ,ϕ)) = V (M 0 (p 2s ,ϕ)) = ζ, and V (M 0 (p 1s )) = V (M 0 (p 2c )) = V (M 0 (p 3s )) = V (M 0 (p 3c )) =0.Thistimewefiret 12 with rate f ds to feed p 1 , meanwhile y can fire with rate f ds to charge p 3s ,f o rf p max ≥ f ds . At time τ 1 = τ 0 +(ζ/f ds ) ≥ τ 0 +Ψ, M 1 is reached such that M 1 (p 1c )=M 1 (p 2s )=0, M 1 (p 2c )=M 1 (p 3s )= M 1 (p 4 (y),ϕ)=1, and V (M 1 (p 2c ,ϕ)) = V (M 1 (p 3s ,ϕ)) = ζ.

Fig. 8 .

 8 Fig. 8. PN model with five charging tanks for feeding two distillers.

2 )

 2 and f p max = f ds1 + f ds2 . Tank capacity: there are five charging tanks CTK 1-5 with capacity C 1 ≥ 2Πα 1 , C 2 ≥ 2Πα 1 , C 3 ≥ 2Πα 1 , C 4 ≥ 2Πα 2 , and C 5 ≥ 2Πα 2 , and CTK 1 , CTK 2 , and CTK 3 are for DS 1 , CTK 4 and CTK 5 for DS 2 . 3) Initial Condition: the volume of oil type 1 (color ϕ 1 )i n CTK 1 and CTK 2 is ζ 1 = ζ 2 =2Πα 1 , and the volume of oil type 2 (color ϕ 2 ) in CTK 4 is ζ 4 =2Πα 2 , CTK 3 and CTK 5 are empty, and the oil in CTK 1 and CTK 4 is ready for feeding. 4) Crude oil type switching: after processing oil in CTK 4 by DS 2 , it should process a high fusion point oil type (type #3). Theorem 4.3: If conditions (1)-(

Fig. 9 .

 9 Fig. 9. PN model with six charging tanks for feeding two distillers.

Fig. 10 .

 10 Fig. 10. PN model with eight charging tanks for feeding two distillers.

Fig. 11 .

 11 Fig. 11. Refining schedule for the case study.

Fig. 12 .

 12 Fig. 12. Detailed charging tank schedule for feeding distillers.

Fig. 13 .

 13 Fig. 13. Detailed schedule for filling the charging tanks.

  , such a token can be removed by firing transitions in T O .Definition 3.4: The PN model for the crude oil operations is live if and only if the following conditions are satisfied.

1) Let P dsl denote the set of places representing the distillers and |P dsl | = h. Then, at any time t (or at any marking M ) for any p i ∈ P dsl , there exists a t i ∈ • p i such that t i is in firing or enabled and t 1 ∩ t 2 ∩ ...∩ t h =Ø.

2) If M (p 4 (y),ϕ i ) > 0,ϕ i ∈ Φ 2 , and p 4 (y) ∈ P E ,atmarking M , there exists at least a transition t ∈ p 4 (y) • is in firing or enabled.

  1-6 with capacity C 1 ≥ Πα 1 , C 2 ≥ Πα 1 , C 3 ≥ Πα 1 , C 4 ≥ Πα 2 , C 5 ≥ Πα 2 , and C 6 ≥ Πα 2 , and Π ≥ (f ds1 + f ds2 )/f ds1 ; CTK 1 , CTK 2 , and CTK 3 are for DS 1 ; and CTK 4 , CTK 5 , and CTK 5 for DS 2 . 7) Initial condition: the volume of oil type 1 (color ϕ 1 )i n CTK 1 and CTK 2 is ζ 1 = ζ 2 =Πα 1 , the volume of oil type 2 (color ϕ 2 ) in CTK 4 is ζ 4 =Πα 2 , CTK 3 , CTK 5 , and CTK 6 are empty, and the oil in CTK 1 and CTK 4 is ready for feeding. 8) Crude oil type switching: after finishing the oil of type 2 in CTK 4 ,D S 2 should process oil type 3 (color ϕ 3 ) with high fusion point. Theorem 4.4: If conditions (

  + •••+ f dsK . 17) Tank capacity: there are 3K charging tanks CTK 1-3K with capacity C 3i-2 ≥ Πα i , C 3i-1 ≥ Πα i , and C 3i ≥ Πα i ,i =1,...,K, and Π ≥ (f ds1 + ...+ f dsK )/(f ds1 + ...+ f ds(K -1) ), and CTK 3(i-1)+1 , CTK 3(i-1)+2 , and CTK 3(i-1)+3 are for DS i , 1 ≤ i ≤ K. 18) Initial condition: the volume of oil type 1 in CTK 1 and CTK 2 is ζ 1 = ζ 2 =Πα 1 ,..., the volume of oil type i in CTK 3i+1 and CTK 3i+2 is ζ 3i+1= ζ 3i+2 =Πα i+1 , 1 < i ≤ K -2, the volume of oil type K in CTK 3(K -1)+1 is ζ 3(K -1)+1 =Πα K ,the other tanks are empty, and the oil in CTK 1 , CTK 3i+1 , 1 <i≤ K -1, is ready for feeding; 19) Crude oil type switching: after finishing the oil of type K in CTK 3(K -1)+1 , distiller K should process another type of crude oil (type K +1) that has high fusion point. Theorem 5.2: Assume that conditions (

  with CTK (i-1)H +1 , CTK (i-1)H +2 ,....,CTK iH for DS i , the capacities of CTK (i-1)H +1 , CTK (i-1)H +2 ,...., CTK iH , 1 ≤ i ≤ K, are all greater than or equal to Πα i , andΠ ≥ (f ds1 + •••+ f dsK )/(f ds1 + •••+ f ds(K -1) ). 21) Initial condition: the volume of oil type i in CTK (i-1)H +1 , CTK (i-1)H +2 , ... .,CTK (i-1)H +(H -1) , 1 ≤ i ≤ K -1,i sΠα i ,the volume of oil type K in CTK (K -1)H +1 is Πα k , the other tanks are empty, and the oil in CTK (i-1)H +1 , 1 <i≤ K, is ready for feeding. 22) Crude oil type switching: after finishing the oil of type K in CTK (K -1)H +1 , distiller K should process another type of crude oil (type K +1) that has high fusion point. Theorem 5.3: Assume that conditions (

[START_REF] Wu | Short-term scheduling for refinery process: bridging the gap between theory and applications[END_REF]

Tank capacity: there are HK charging tanks numbered

CTK (i-1)H +1 , CTK (i-1)H +2 ,....,CTK iH , 1 ≤ i ≤ K,

TABLE I INITIAL

 I STATE FOR THE CHARGING TANKS

crude oil of type K +1can be transported via the pipeline by a single setup.

Proof: There are two cases: 1) f ds1 > f dsK ; and 2) f ds1 <f dsK . We first show that the theorem holds for Case [START_REF] Bechtel | PIMS (Process Industry Modeling System) User's Manual[END_REF]. Initially, at M 0 (time τ 0 ), we have M 0 (p 1c )= M 0 (p 2s )=1 ,M 0 (p (3i+1)c) = M 0 (p (3i+2)s )=1 ,

and other places are empty. At this marking, we fire t (3i-2)2 with color ϕ i to feed p i , 1 ≤ i ≤ K. At the same time, we fire y with the following order: with color ϕ K +1 ∈ Φ 2 and rate f p max to charge p (3K -1)s with volume Πα K → with color ϕ K +1 ∈ Φ 2 and rate f p max to charge p (3K )s with volume

It should be pointed out that, after charging p (3K )s with volume Πα K ,weha veM (p 4 (y),ϕ K +1 )=1. However, with p (3i)s , 1 ≤ i ≤ K -1, being empty, y can fire uninterruptedly. Hence, the PN is in a live marking and the previous process is feasible. Then, at

, and other places are empty. At this marking, we fire t 22 with color ϕ 1 to feed p 1 , t (3i-1)2 with color ϕ i to feed p i , 2 ≤ i ≤ K -1, and t (3K -1)2 with color ϕ K +1 to feed p K .At the same time, we fire y with the following order: with color ϕ 1 and rate f p max to charge p 3s with volume Πα K → with color ϕ 1 and rate f p max to charge p 1s with volume Πα 1 → ••• → with color ϕ i+1 to charge p (3i+1)s with volume Πα i+1 ,

and other places are empty. This marking is equivalent to M 0 , and thus the process can be repeated in a cyclic way. Now we show that the theorem still holds for Case [START_REF] Chen | Analysis of hybrid system based on hybrid net condition/event system model[END_REF]. Without loss of generality, we assume that α 1 + α 2 -α K > 0. At M 0 ,w efi r et 12 with color ϕ 1 to feed p 1 , t (3i-2)2 with color ϕ i to feed p i , 2 ≤ i ≤ K. At the same time, we fire y with the following order: with color ϕ K +1 ∈ Φ 2 and rate f p max to charge p (3K -1)s with volume Πα K → with color ϕ K +1 ∈ Φ 2 and rate f p max to charge p (3K )s with volume Πα K → with color ϕ K -1 and rate f p max to charge p (3K -3)s with volume Πα K -1 ••• → with color ϕ i to charge p (3i)s with volume Πα i , 3 ≤ i ≤ K -2, → ••• → with color ϕ 2 to charge p 6s with volume Π(α 1 + α 2 -α K ). It should be pointed out that, after charging p (3K )s with volume Πα K ,w eh a v eM (p 4 (y),ϕ K +1 )=1.H o wever, with p (3i)s , 1 ≤ i ≤ K -1, being empty, y can fire