*2.1. The Proposed Methodology*

The purpose of V2G methods is to acquire energy at peak demand, while still meeting the target of net-zero GHG emissions. The V2G method presented in Figure 1 was designed and applied to an operational University campus. The method is determined by the tariff rate, which is determined by energy demand that depends on the time of day. While the energy demand is high, the tariff rate is high, and the energy can be taken from the EVs instead of buying at a higher price from the electricity grid. When the energy demand is low, the EVs can be charged, as the electricity can be bought from the grid. This method works under the proposition that the EVs will leave at 17:00, as the most common times of use is 09:00–17:00. The EV must be fully charged by 17:00, which is enabled by the above chart.

The English north-west university building used 2,666,560 kW in 2019, with a daily average of 7936.19 kW with the energy peaking at the university opening hours from 09:00 to 17:00. The university pays 12 p/kW off-peak and 15 p/kW on the peak. The average EV car battery size is 37.125 kW meaning each charger would provide 27.75 kW of battery storage for the campus. EV batteries can only be discharged to 25% to stop critical battery

*Sustainability* **2021**, *13*, x FOR PEER REVIEW 5 of 25

degradation [26]. This method uses the batteries from the EVs to supply the campus at peak times instead of buying at peak prices or having a large battery installed. storage for the campus. EV batteries can only be discharged to 25% to stop critical battery degradation [26]. This method uses the batteries from the EVs to supply the campus at peak times instead of buying at peak prices or having a large battery installed.

to 17:00. The university pays 12 p/kW off-peak and 15 p/kW on the peak. The average EV car battery size is 37.125 kW meaning each charger would provide 27.75 kW of battery

**Figure 1.** The methodological steps of the V2G implementation.

**Figure 1.** The methodological steps of the V2G implementation. To calculate the costs and savings of charger installation, the company 'PodPoint' To calculate the costs and savings of charger installation, the company 'PodPoint' [27] was used. This was a quote given for purchasing and installing the charger. Equation (1) shows the profit (*P*) calculated using money made (*M*) and installation cost (*I*).

$$P = \mathcal{M} - I \tag{1}$$

 = − (1) The period of return on investment (ROI) was calculated by plotting the 'Money made' through time until the profit is no longer a negative. Instead of buying electricity when the renewable harvesting is low, the electricity from the EV batteries can be used. This saves money as instead of buying expensive electricity from the grid at peak times, the EV The period of return on investment (ROI) was calculated by plotting the 'Money made' through time until the profit is no longer a negative. Instead of buying electricity when the renewable harvesting is low, the electricity from the EV batteries can be used. This saves money as instead of buying expensive electricity from the grid at peak times, the EV batteries can be discharged and then recharged at off-peak times. In addition, the cost of large-scale batteries will outweigh the purchase and installation costs of charging stations.

batteries can be discharged and then recharged at off-peak times. In addition, the cost of large-scale batteries will outweigh the purchase and installation costs of charging stations. The electricity usage of the investigated building (Business School Building—BSB) was 8256 kW. Where '*t*' is time, '*Ah*' is Amps per hour, '*w*' is Watts, '*Nb*' is the number of The electricity usage of the investigated building (Business School Building—BSB) was 8256 kW. Where '*t*' is time, '*Ah*' is Amps per hour, '*w*' is Watts, '*Nb*' is the number of batteries and '*C*' is battery capacity, the storage for this can be calculated through Equations (2) and (3).

$$\text{Ah} = \frac{w}{t} \tag{2}$$

$$Nb = \frac{Ah}{\mathbb{C}}\tag{3}$$

The cost and number of batteries can vary significantly depending on the required capacity. A battery of this size would be roughly £1823.86, which is too expensive to insure a good ROI. This would be costly for any ROI or to be beneficial to anyone involved, meaning

tions (2) and (3).

the V2G method is essential. Instead of using an on-site battery, the EVs plugged into the charging points can be used as they're probably going to be there during peak times. into the charging points can be used as they're probably going to be there during peak times. EV battery cost determines the net-profit of the car owner as the battery will need to

<sup>=</sup> ℎ

The cost and number of batteries can vary significantly depending on the required capacity. A battery of this size would be roughly £1823.86, which is too expensive to insure a good ROI. This would be costly for any ROI or to be beneficial to anyone involved, meaning the V2G method is essential. Instead of using an on-site battery, the EVs plugged

(3)

*Sustainability* **2021**, *13*, x FOR PEER REVIEW 6 of 25

EV battery cost determines the net-profit of the car owner as the battery will need to be replaced more often as it is being charged and discharged more frequently. A cost analysis of the university campus and EV users was carried out to determine if this was successful for both parties, which has been further elaborated in the results section. be replaced more often as it is being charged and discharged more frequently. A cost analysis of the university campus and EV users was carried out to determine if this was successful for both parties, which has been further elaborated in the results section. The proposed method is a novel algorithm that is capable of accurately predicting

The proposed method is a novel algorithm that is capable of accurately predicting the present, and future, financial and energy characteristics of the vehicle-to-grid system. The collected energy characteristic data from the building will train the algorithm and improve accuracy and usability. the present, and future, financial and energy characteristics of the vehicle-to-grid system. The collected energy characteristic data from the building will train the algorithm and improve accuracy and usability.

### *2.2. Machine Learning (ML) Algorithm 2.2. Machine Learning (ML) Algorithm*

For a large amount of data, machine learning (ML), including supervised and unsupervised techniques, are massively used, especially for classification problems [28]. Input and output data are required to build and train the supervised model, which will be used in predicting future outcome for relevant new data sets. On the contrary, only input data are enough in developing models using unsupervised learning [29,30]. Machine learning was used for predicting energy savings for a building in Reference [31]. The methods used multiple linear regression, support vector regression, and back-propagation neural network. ML was also used for the thermal response of buildings, e.g., comparisons between measured and predicted results. The thermal load of a building was predicted using machine learning. The ML approach proved useful, depending on whether it was predicting short-term or long-term, and the predicted data was most accurate when supplied with uncertain weather data. The approach was used to predict only the thermal load of a building [32]. The behaviour of residential buildings has been predicted using machine learning techniques in Reference [33]. The model required a small training set while predicting accurately. The method use was the holt-winters extreme learning machine. This proved to be accurate while only needing 50 days of input data. For a large amount of data, machine learning (ML), including supervised and unsupervised techniques, are massively used, especially for classification problems [28]. Input and output data are required to build and train the supervised model, which will be used in predicting future outcome for relevant new data sets. On the contrary, only input data are enough in developing models using unsupervised learning [29,30]. Machine learning was used for predicting energy savings for a building in Reference [31]. The methods used multiple linear regression, support vector regression, and back-propagation neural network. ML was also used for the thermal response of buildings, e.g., comparisons between measured and predicted results. The thermal load of a building was predicted using machine learning. The ML approach proved useful, depending on whether it was predicting short-term or long-term, and the predicted data was most accurate when supplied with uncertain weather data. The approach was used to predict only the thermal load of a building [32]. The behaviour of residential buildings has been predicted using machine learning techniques in Reference [33]. The model required a small training set while predicting accurately. The method use was the holt-winters extreme learning machine. This proved to be accurate while only needing 50 days of input data.

As shown in Figure 2, the neural networks (NN) based model starts with an input layer, through the weights, into the hidden layer, more weights, and into the output. The input is multiplied by the weights to reduce the error. Each hidden layer function is specialised to produce a defined output. As shown in Figure 2, the neural networks (NN) based model starts with an input layer, through the weights, into the hidden layer, more weights, and into the output. The input is multiplied by the weights to reduce the error. Each hidden layer function is specialised to produce a defined output.

**Figure 2.** NN model structure.

It is required to arrange input, output, and validation data for developing a NN model and making a prediction. After creating the model employing input data, validation data set are used for conducting prediction of the new data through the developed model [34]. In NN, the gradient descent method and the Gauss–Newton method are quite popular. Particularly for solving nonlinear problems, the algorithms use its standard technique [35]. Mean

squared error performs an evaluation of the training performance through simplifying the construction of a network by minimising the sum of the squared errors. through simplifying the construction of a network by minimising the sum of the squared errors. Hessian matrix approximates the sum of squares by H = *J <sup>T</sup> J*, where *J* is a Jacobian

It is required to arrange input, output, and validation data for developing a NN model and making a prediction. After creating the model employing input data, validation data set are used for conducting prediction of the new data through the developed model [34]. In NN, the gradient descent method and the Gauss–Newton method are quite popular. Particularly for solving nonlinear problems, the algorithms use its standard technique [35]. Mean squared error performs an evaluation of the training performance

*Sustainability* **2021**, *13*, x FOR PEER REVIEW 7 of 25

**Figure 2.** NN model structure.

Hessian matrix approximates the sum of squares by H = *J T J*, where *J* is a Jacobian matrix, gradient g = *J T e*. *e* is denoted as network error and Levenberg-Marquardt training algorithm can be presented by Equation (4). matrix, gradient g = *J Te*. e is denoted as network error and Levenberg-Marquardt training algorithm can be presented by Equation (4). Xk+1 = Xk ‒ [J<sup>T</sup> J + µI]‒1 JT e (4)

$$\mathbf{X}\_{k+1} = \mathbf{X}\_k \mathbf{-} \{ \mathbf{f}^T \mathbf{J} + \mu \mathbf{I} \}^{-1} \mathbf{J}^T \ e \tag{4}$$

Connection weight is called by '*X<sup>k</sup> '* at the '*k'* number of iterations. Scalar combination coefficient is denoted by '*µ',* which accomplishes transformation to either gradient descent or Gauss–Newton algorithm. The identity matrix is represented by '*I'*, where the training process of NN is performed through the descent gradient method as a learning rule. The error between the outcome of training and the targeted output is calculated through the error function. All the calculation is performed by determining the sum of the squared errors of input data and output patterns of the training set. The error function is calculated by Equation (5). coefficient is denoted by '*μ',* which accomplishes transformation to either gradient descent or Gauss–Newton algorithm. The identity matrix is represented by '*I'*, where the training process of NN is performed through the descent gradient method as a learning rule. The error between the outcome of training and the targeted output is calculated through the error function. All the calculation is performed by determining the sum of the squared errors of input data and output patterns of the training set. The error function is calculated by Equation (5). ε = ∑ t<sup>p</sup> ‒ f<sup>p</sup> (5)

$$
\varepsilon = \sum t\_p \cdot f\_p \tag{5}
$$

Where '*tp*' indicates targeted output and '*fp*' denotes actual output. The goal of using this learning rule is to search for suitable values of weights for minimising the error. Where '*tp*' indicates targeted output and '*fp*' denotes actual output. The goal of using this learning rule is to search for suitable values of weights for minimising the error.

A feed-forward neural network (FFNN) machine learning algorithm (MLA) was used to predict the future energy demand of the investigated building. The data taken from 2013–2017 was used as an input and built ML models where the years 2018 and 2019 were predicted, as depicted in Figure 3. A feed-forward neural network (FFNN) machine learning algorithm (MLA) was used to predict the future energy demand of the investigated building. The data taken from 2013–2017 was used as an input and built ML models where the years 2018 and 2019 were predicted, as depicted in Figure 3.

**Figure 3.** Architecture of neural network. **Figure 3.** Architecture of neural network.

The proposed approach allows the training of data for the aim of building models and future prediction. In our study, the energy demand of the building was predicted for the years 2018 and 2019. In addition, the V2G cost was calculated using the energy demand for 2013–2017, and the cost was predicted for 2018 and 2019, which have been presented in the results section. The proposed approach allows the training of data for the aim of building models and future prediction. In our study, the energy demand of the building was predicted for the years 2018 and 2019. In addition, the V2G cost was calculated using the energy demand for 2013–2017, and the cost was predicted for 2018 and 2019, which have been presented in the results section.

### **3. Results and Discussion 3. Results and Discussion**

### *3.1. On-Site Battery Storage 3.1. On-Site Battery Storage*

Excess electricity is stored in a battery where the size of the battery is dependent on how much electricity is required to store. From the simulation, variables, such as the type of vehicle, battery capacity, charging rate, number of charging stations, kW rating of charging station and price of electricity, has been calculated. The ROI and overall profit Excess electricity is stored in a battery where the size of the battery is dependent on how much electricity is required to store. From the simulation, variables, such as the type of vehicle, battery capacity, charging rate, number of charging stations, kW rating of charging station and price of electricity, has been calculated. The ROI and overall profit for both the consumer and for the stand-alone building can be determined. The 8256 kW comes from the demand for the building on a given day—see Equations (6) and (7).

$$Ah = \frac{8256 \, kW}{12} = 688 \, kA \tag{6}$$

$$Nb = \frac{688 \, kA}{4560 \, A/h} = 150.87 = 151\tag{7}$$

This can be converted to cover the capacity of 10 EVs connected to the campus in Equation (8).

$$\text{SC} = \text{Cr} \times \text{Nc} \times \text{Nh} = 6.66 \times 10 \times 12 = 799 \text{ kW/}d \tag{8}$$

*SC* is the charging station capacity, *Cr* is the charging rate of the station, *Nc* is the number of charging stations, *Nh* is the number of hours they will be needed for, and *Nb* is the number of batteries. The battery capacity for this can be calculated using Equations (9) and (10).

$$Ah = \frac{799.2 \, kW}{12} = 66.6 \, kA \tag{9}$$

$$Nb = \frac{66.6 \text{ k}A}{4560 \text{ Aph}} = 14.6 = 15 \text{ Batteries} \tag{10}$$

The price is estimated as £27,432.90 for 15 batteries, where the price of the battery can be affected by the factors, including capacity, size and the supplier.
