# Electric-Vehicle Routing Planning Based on the Law of Electric Energy Consumption
## 4 The Electric Vehicle Routing Problem with Time Windows Based on Driving Cycles (EVRPTW-DC)
### Formulation of EVRPTW-DC
\begin{table}
\begin{tabular}{l l} \hline \hline \(M\) & Number of available EVs at the distribution center \\ \hline \(W\) & The maximum load of an EV, in kg \\ \hline \(\lambda_{1}\) & Unit cost of a vehicle arriving before the time window, in Yuan/h \\ \hline \(\lambda_{2}\) & Unit cost of a vehicle arriving after the time window, in Yuan/h \\ \hline \(v_{ai}\) & The speed of an EV in driving cycle A, \(i=1,2,3,\text{ in m/s}\) \\ \hline \(a_{ai}\) & The acceleration of an EV in driving cycle A, \(i=1,2,3,4,\text{ in m/s}^{2}\) \\ \hline \(v_{bi}\) & The speed of an EV in driving cycle B, \(i=1,2,3,4,\text{ in m/s}\) \\ \hline \(a_{bi}\) & The acceleration of an EV in driving cycle B, \(i=1,2,\text{ in m/s}^{2}\) \\ \hline \(c_{1}\) & Unit cost of traveled distance, in Yuan/km \\ \hline \(c_{2}\) & Fixed cost for recharging \\ \hline \(q_{i}\) & The demand of node \(i,\text{ }i\in N_{C}\) \\ \hline \(\mu_{i}\) & Earliest start of service at node \(i,\text{ }i\in N_{C}\) \\ \hline \(l_{i}\) & Latest start of service at node \(i,\text{ }i\in N_{C}\) \\ \hline \(d_{ij}\) & Distance between node \(i\) and \(j,\text{ }i,j\in N\) \\ \hline \(t_{ijk}\) & Travel time of vehicle \(k\) between node \(i\) and \(j,\text{ }i,j\in N,\text{ }k\in K\) \\ \hline \(E_{ijk}\) & Battery energy consumption of vehicle \(k\) between node \(i\) and \(j,\text{ }i,j\in N,\text{ }k\in K\); and is calculated by Equations (21) and (31) depending on driving cycle \\ \hline \multicolumn{2}{l}{**Variables**} \\ \hline \(t_{ik}^{a}\) & Time of arrival of vehicle \(k\) at node \(i,\text{ }i\in N,\text{ }k\in K\) \\ \hline \(t_{ik}^{a}\) & Time of arrival of vehicle \(k\) at node \(i,\text{ },\text{ }i\in N,\text{ }k\in K\) \\ \hline \(t_{ik}^{s}\) & The service time or recharging time of vehicle \(k\) at node \(i,\text{ }i\in N,\text{ }k\in K\) \\ \hline \(t_{ik}^{av}\) & The waiting time of vehicle \(k\) at node \(i,\text{ }i\in N,\text{ }k\in K\) \\ \hline \(p_{ik}^{a}\) & Battery level of vehicle \(k\) when arriving node \(,\text{ }i\in N,\text{ }k\in K\) \\ \hline \(p_{ik}^{l}\) & Battery level of vehicle \(k\) when leaving node \(i,\text{ }i\in N,\text{ }k\in K\) \\ \hline \(w_{ik}\) & Load of vehicle \(k\) when arriving node \(i,\text{ }i\in N,\text{ }k\in K\) \\ \hline \(E_{ijk}\) & Battery energy consumption of vehicle \(k\) between node \(i\) and \(j,\text{ }i,j\in N,\text{ }k\in K\); and is calculated by Equations (21) and (31) depending on driving cycle \\ \hline \(x_{ijk}\) & Binary decision variable indicating if vehicle \(k\) travels from node \(i\) to node \(j,\text{ }i,j\in N,\text{ }k\in K\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._Let \(y_{ijk}=p_{jk}^{a}x_{ijk}\), and, with the below constraints:  
\[y_{ijk}\leq Qx_{ijk} \tag{34}\]  
\[y_{ijk}\leq p_{jk}^{a} \tag{35}\]  
\[y_{ijk}\geq p_{jk}^{a}-Q(1-x_{ijk}) \tag{36}\]  
Equation (33) can be transformed into a linear formation as:  
\[C_{r}=c_{2}\sum_{i\in N}\sum_{j\in N_{k}}\sum_{k\in K}x_{ijk}+\phi Q\sum_{i\in N }\sum_{j\in N_{k}}\sum_{k\in K}x_{ijk}-\phi\sum_{i\in N}\sum_{j\in N_{k}}\sum_{ k\in K}y_{ijk} \tag{37}\]
3. Cost of time window punishment \(C_{t}\): \[C_{t}=\sum_{i\in N_{C}}\sum_{k\in K}f(t_{ik}^{a})\] (38) with: \[f(t_{ik}^{a})= \begin{cases}\lambda_{1}\big{(}u_{i}-t_{ik}^{a}\big{)}&t_{ik}^{ a}<u_{i}\\ 0&u_{i}\leq t_{ik}^{a}\leq l_{i},\ \forall i\in N_{C},k\in K\\ \lambda_{2}\big{(}t_{ik}^{a}-l_{i}\big{)}&l_{i}<t_{ik}^{a}\end{cases}