## 3 Stochastic MPC Approach for Coordinated Scheduling Optimization of MES
### Modelling of Electric Vehicles' Stochastic Availability  
It is assumed that the EV owners immediately connect their EVs to the charging/discharging station in the office or residential building in the morning when they arrive at work and in the evening when they arrive home. In office buildings or residential communities, EV characteristics, in terms of available charging/discharging energy, are quite unique and distinctive, closely depending on peoples' commuting behaviors. In addition, it is worthwhile to note that the availability  
Figure 4: Schematic overview of the stochastic model predictive control (MPC) approach for MES scheduling optimization. MILP: mixed-integer linear programming. Figure 3: Feasible operation region of CHP unit with variable heat-to-electricity ratio. of EV charging/discharging is quite uncertain, considering the stochastic individual arrival and departure time. According to the study which uses driving pattern data of a large number of customers from the National Household Travel Survey (NHTS) [25], the probability distribution of arrival time to the office or home and departure time from the office or home is developed. The arrival/departure time can be represented by a normal distribution and its probability density function (PDF) is described as  
\[f(t,\mu,\sigma)\ =\ \frac{1}{\sigma\sqrt{2\pi}}\exp[-\frac{(t-\mu)^{2}}{2\sigma^{ 2}}],0<t\leq 24, \tag{1}\]  
where \(f\) is the probability of arrival/departure time, and \(\mu\) and \(\sigma\) are its mean value and standard deviation, respectively. Take the office arrival time as an example to illustrate this. It is assumed that, in the researched office building, the number of EVs participating in scheduling management is \(NEV\). For all the EVs, their arrival times are uncertain variables. Usually, sampling is implemented to generate representative samples, aimed to reflect the distribution of each random variable. For an EV \(i\), the uncertainty of its office arrival time is represented by \(NS\) scenarios generated by a Latin Hypercube Sampling (LHS) method considering PDF described in Equation (1) [26]. It is assumed that the arrival events of EVs are independent from each other, i.e., the random variable \(f_{i}\) for EV \(i\) is independent from \(f_{j},j\
eq i\). In order to minimize the undesired correlations between the generated samples of different random variables, a permutation method is needed. Cholesky decomposition is a good permutation method, which is helpful for reducing the correlation among the samples of different random variables and can also further improve the performance of LHS. Then, \(NS\) scenarios of \(NEV\) random variables  
\[\left\{ \begin{array}{ccc}f_{1}^{1}&\cdots&f_{NEV}^{1}\\ \vdots&\ddots&\vdots\\ f_{1}^{NS}&\cdots&f_{NEV}^{NS}\end{array} \right\}\text{ are derived. For scenario }s\left\{f_{1}^{s},\cdots,f_{NEV}^{s}\right\}\text{, the available state }I_{j}^{s}(t)\text{ of EV }j\]  
at time \(t\) is defined as \(I_{j}^{s}(t)\ =\ 1,if\ t\geq round(f_{j}^{s});I_{j}^{s}(t)\ =\ 0,else\). The available EV number \(AN^{s}(t)\) at time \(t\) can be calculated by \(AN^{s}(t)\ =\ \sum\limits_{j}I_{j}^{s}(t)\). \(NS\) scenarios of random vector \(\{AN^{s}(1),\cdots,AN^{s}(T)\},s\ =\ 1,\cdots,NS\) can be generated using the aforementioned procedure. However, it is time consuming to solve the stochastic scheduling optimization using \(NS\) scenarios. The very large set of scenarios has to be approximated by a small number of scenarios using a scenario reduction technique. Here, the backward method is subsequently applied to make the reduced set of scenarios be as close as possible to the original stochastic process. The probability of each scenario in \(NS\) scenarios is \(p_{s}\ =\ 1/NS\), and \(\sum p_{s}\ =\ 1\). The scenarios set is \(\xi_{s}\ =\ \{AN^{s}(1),\cdots,AN^{s}(T)\},s\ =\ 1,\cdots,NS\). The set \(S\) and \(DS\) represents all scenarios before and after reduction, respectively. Calculating all the distances of a couple of scenarios \(DT_{s,s^{\prime}}\ =\ DT(\xi_{s},\xi_{s^{\prime}})\).