In order to verify the proposed scenarios, a small residential building with an electricity consumption of 26 kWh/day, a commercial unit with an electricity consumption of 70 kWh/day and 5 EVs having a battery storage capacity of 24 kWh per EV has been utilized for simulation on battery degradation and electricity bill estimation. The results are obtained using Matlab/Simulink and can be applicable to any larger buildings with a fleet of EVs by multiplication and additional detailed adjustment. In this simulation work, it is assumed that a data centre or commercial building has 70 kWh power consumption with 10 kW peak power between 7:00 and 18:00 in a day.

The volatility of renewable energy poses uncontrollable fluctuations to the power generation in the electric grid; therefore, it is required to find and connect resources for providing ancillary services such as frequency and voltage regulations. A fleet of electric vehicles in the parking lot of a building during working hours can be connected to the electric grid for ancillary services. This simulation utilizes 5 EVs with different levels of SoC usage for the combination of frequency regulation and peak shaving as V2B/V2G application between 11:30 and 12:30 in a day.

#### 3.1. EV Owner and Household Bill

For each EV user, a fixed driving profile over a period of 10+ years is hypothesized. The MBESS of the nth user can be used for household load, building load, and driving purposes.

Figure 2 shows the Simulink schema.

Figure 3 shows the daily profile simulation of EV

_{1}, EV

_{2}, EV

_{3}, EV

_{4}, and EV

_{5}, respectively. As shown in

Figure 3, every day from 11:30 to 12:30, all the EVs have the same depth of discharge (DoD) with 20% for selling the same amount of energy to the building owner (V2B) for ancillary services on the grid side. The rest of the day, EV discharging and charging profiles are different and correspond to the EV owner’s driving and charging patterns.

In each profile, at the first current spike, the daily battery cycling starts with a discharge current of 25 A (driving to work), at ambient temperature of 25 degrees C. The initial SoC (SoC_{max} = 90%) is same for each EV and its battery pack is discharged until the SoC reaches 65% (DoD of 35%), 70% (DoD of 30%), 75% (DoD of 25%), 80% (DoD of 20%), 85% (DoD of 15%), for EV_{1}, EV_{2}, EV_{3}, EV_{4}, and EV_{5}, respectively.

The second current spike is related to the V2B application after each EV arrives at work and is connected to the DC fast charger of the parking lot of the building for ancillary services. For this period, the discharge current is 25 A and the SoC decreases down to 45% (DoD of 55%), 50% (DoD of 50%), 55% (DoD of 45%), 60% (DoD of 40%), 65% (DoD of 35%), for EV_{1}, EV_{2}, EV_{3}, EV_{4}, and EV_{5}, respectively.

The third current spike is related to driving back home. The discharge current is 25A and the SoC decreases down to 20% (DoD of 80%), 30% (DoD of 70%), 40% (DoD of 60%), 50% (DoD of 50%), 60% (DoD of 40%), for EV_{1}, EV_{2}, EV_{3}, EV_{4}, and EV_{5}, respectively.

The fourth current spike describes the V2H application after each EV arrives at home and is connected to the EV charger of the house for V2H applications. For this period, the discharge current is 25 A and the SoC decreases down to minimum SoC_{min} for each EV. That is: 10% (DoD of 90%), 20% (DoD of 80%), 30% (DoD of 70%), 40% (DoD of 60%), 50% (DoD of 50%), for EV_{1}, EV_{2}, EV_{3}, EV_{4}, and EV_{5}, respectively.

Afterwards, the EV battery pack is charged back overnight to 90% SoC with a charge current of 15 A. As this cycle is repeated every day up to 12 years (12 × 365 = 4380 days), the battery age increases whereas its capacity decreases. Simulation of the battery degradation on ancillary services and driving over this period is shown in

Figure 4. The deeper the depth of battery discharge is used, the more the battery degradation is pronounced. Short commute driving habit, EV

_{5} with SoC within [50–90%] shows the lowest battery degradation.

Figure 5 shows the comparison of the original bill normalized to 1 with simulated bills after frequency regulation only, peak shaving only and combined peak shaving and frequency regulation, for each of the

SoC operation range considered above.

Bill corresponds to the original bill normalized to 1. That is the home owner’s bill without ancillary services. Frequency regulation, peak shaving, and joint correspond to normalized bill when participating in frequency regulation, peak shaving, and both services respectively.