## 2 Refinery Process and Short-Term Scheduling
### The Scheduling Problem  
A crude oil operation process is composed of a series of operations. The short-term scheduling problem is to make decisions on what an operation should do and when and how it should be executed. To describe a short-term schedule, we first define an operation decision (\(OD\)).  
**Definition 1**: _An operation is defined as \(OD\) = (COT, \(\zeta\), S, D, INT), where COT = the crude oil type; \(\zeta\) = 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\) = the source from which the crude oil is to be delivered; \(D\) = the destination to which the crude oil is to be delivered; and INT = [a, b] a time interval, where a and b are the start and end time points of the operation, respectively._  
The flow rate in delivering crude oil in [_a, b_] may be variable. However, it is scheduled as a constant for a single operation in practice for the sake of stability and simplification. Thus, given volume \(\zeta\) and time interval [_a, b_] in an \(OD\), \(\zeta/(b-a)\) is its flow rate. Each \(OD\) is a control command that transfers the system from a state to another.  
There are three types of \(OD\)s: \(OD\) of crude oil unloading (\(ODU\)), \(OD\) of transportation (\(ODT\)), and \(OD\) of feeding to a distiller (\(ODF\)), and their time intervals are denoted as [\(\alpha\), \(\beta\)], [\(\lambda\), \(\mu\)], and [\(\omega\), \(\pi\)], respectively. For \(ODU\), \(S\) is a tanker and \(D\) is a storage tank. For \(ODT\), \(S\) is a storage tank and \(D\) is a charging tank, and the transportation is performed through a pipeline. For \(ODF\), \(S\) is a charging tank and \(D\) is a distiller. We use \(ODF_{ki}\) to denote the \(i\)th \(OD\) for feeding distiller \(k\) during the scheduling horizon. Let \(\Gamma\) = [\(\tau_{s}\), \(\tau_{e}\)] be the scheduling horizon that often lasts for a week or ten days and \(g=\zeta/(\beta-\alpha),f=\zeta/(\mu-\lambda)\), and \(h=\zeta/(\pi-\omega)\) denote flow rates for tanker unloading, pipeline transportation, and distiller feeding decided by \(OD\)s, respectively. Let \(K\) be the set of distillers. Given the initial state at \(\tau_{s}\), i.e., the inventory of crude oil and state of all devices, and information of tanker arrival, the short-term scheduling problem is to find a series of \(OD\)s described as follows:  
\[SCHD=\{ODU_{1},\,...,\,ODU_{W},\,ODT_{1},\,...,\,ODT_{Z},\,ODF_{1},\,...,\,ODF _{K}\}, \tag{1}\]  
subjected to  
\[\omega_{k1}=\tau_{s}\text{, }\pi_{k1}=\omega_{k2}\text{,..., }\pi_{k(i-1)}=\omega_{ki}\text{,..., and }\pi_{kn}=\tau_{e}\text{ for }\forall k\in K \tag{2}\]  
and the constraints given in Section 2.1.  
Constraint (2) requires that the schedule should cover the entire scheduling horizon and a distiller cannot be stopped. Also, different objectives can be selected to optimize. Essentially, in the view of control theory, an \(OD\) is a control command that transfers the system state from one to another. If a state is reached such that any constraint is violated, this state is said to be infeasible. If not infeasible, it must be feasible. There may be a state that is feasible itself, but no matter what \(OD\)s are applied thereafter the system would eventually enter an infeasible state; such a state is called an unsafe one, and otherwise it is safe. A safe state guarantees the existence of a feasible schedule.