2. Methodology
The research design includes simulations in MATLAB/Simulink with study cases on the unidirectional charging and bidirectional charging of EVs in Sweden. The cases modeled in the simulations are based on the ongoing electrification in Sweden, where the electricity prices were significantly volatile at the end of 2022, resulting in higher household electricity costs during the winter months in 2022. Also, there is a significant number of EVs in Sweden. The novelty and the contribution of the model include an investigation of V2G charging based on estimated electricity prices in Sweden for several different EV owner user profiles in comparison to EV charging without V2G capabilities. The aim of the model is to gain knowledge on charging and discharging several EVs to the grid, with a control based on estimated local electricity prices. The objective of the V2G model is to investigate how V2G could function for a system of different vehicles, to compare the potential of EVs with and without V2G compatibilities, and to potentially enhance the economic revenue from charging and discharging EVs with V2G due to price variations.
2.1. Modeling Charging and Discharging of Vehicles in MATLAB/Simulink
The electric grid is represented in MATLAB/Simulink as a three-phase AC grid. The EV can be modeled in MATLAB/Simulink as a battery system. Therefore, the AC from the grid needs to be converted to DC for the battery, utilizing a converter. Thus, the converter system needs to be bidirectional to ensure a power flow in both directions. Input data to the model includes, for example, available data on EVs from [
8]. To illustrate how EV chargers could operate dynamically by responding to an external control signal, the system is shown in
Figure 1, where an aggregator plans the charging and discharging.
A set of chargers was modeled with varying characteristics. The EV charging was simulated for 24 h. The flowchart in
Figure 2 presents the model with the different algorithms divided into different functions. An overview of the functionality of the proposed V2G model is also provided in
Table 1.
Function 1 describes the initial conditions, including, e.g., the initial SOC value of each EV, as well as the electricity price set-point for when to sell or buy electricity (meaning when to charge or discharge the EV). The estimated electricity price in Sweden during a day with large hourly fluctuations was chosen to show how the chargers would operate during significantly different conditions. A price set-point was chosen in this simulation as 3 SEK/kWh (in Function 1), according to which the chargers would evaluate their operation mode. If the estimated electricity price exceeded the set-point, the chargers promoted the V2G mode, and for low prices, the chargers promoted the charging mode, as shown in Function 1 in the flowchart in
Figure 2. Five of the vehicles in the simulation model could use the V2G mode (meaning that these vehicles could buy and sell electricity from or to the grid based on the estimated electricity price), and another five vehicles did not have this capability.
In Function 2, it is determined whether the EV is parked and connected to a charger or not. If the EV is connected to a charger, there is an opportunity to use it for V2G with a set value of nominal power for charging and discharging, provided that the overall conditions (e.g., limits on SOC value, estimated electricity price, etc.) are fulfilled. If the EV is not parked, i.e., not connected to a charged, during the hours: 08:00 to 21:00, it is assumed that the EV is being driven and that the SOC value is dropping based on a set value.
In Function 3, the results from Functions 1 and 2 are summed up to decide whether the vehicle can be used for V2G or not.
In Function 4, the SOC of the EV is analyzed to find out if it is below or above the lower or upper SOC limits, set to 20% and 80%, respectively. The decision on whether to charge or discharge the EV depends also on the results from the previous functions.
Finally, in Function 5, the SOC of the EV battery is calculated based on Equation (4). The overall decision making for the vehicles in the model depends on all five functions described in the flowchart.
2.2. Input Data to the Case Study
The first version of the MATLAB/Simulink model for charging and discharging includes ten EVs, each with different estimated and assumed values regarding their battery systems (note that these values could vary), namely, three Nissan Leaf cars with BESS capacities of 40 kWh and an assumed 10 kW rated power for charging and discharging; two Mitsubishi Outlander, plug-in hybrids, with battery capacities of 13.8 kWh and a 3.7 kW rated power for charging and discharging; three Volvo cars, with a battery capacity of 69 kWh and an assumed 11 kW rated power for charging; and two Tesla cars with batteries of 57.5 kWh and an assumed 11 kW rated power for charging. The modeled EVs can be changed in user profiles (if the EVs are at home or away), initial SOC, maximum and minimum SOC, rated power for the charging and discharging, and battery capacity, to name a few configuration possibilities. This enables the modeling of different user profiles and different types of EVs. There is a trade-off between utilizing the car for personal transportation needs and enhancing the economic revenue from charging and discharging when there is a significant fluctuation in the electricity price.
The simulation model is a charging and discharging model of EVs based on a design approach, using MATLAB/Simulink in the phasor simulation type in 50 Hz for 24 h. This includes four different types of EVs, two of them in the charging and discharging mode (V2G) and the other two types in only the charging mode (EV). Three different user profiles are distributed among the vehicles. The model takes the estimated electricity price and user profile as input and generates the command to the vehicle. The case study focuses on the Swedish energy system. The electricity price over one day estimated for Sweden is used as input data to the model, and the estimation is shown in
Figure 3. Electricity prices for different regions can be found on, e.g., Nord Pool [
34] and in publications. The electricity price is based on the demand for electricity during the different hours. Based on
Figure 3, the set-point of 3 SEK/kWh was chosen for this simulation (indicated by a dashed line). The high values of the estimated electricity price match a high national electricity demand, and the EVs could, at these moments, possibly contribute by selling additional electricity to the grid for support. Also, the opposite could occur, where the EV owner buys electricity from the grid when the estimated price is lower. The electricity price in Sweden varies with the days and seasons. The estimated price in
Figure 3 varies over different days, where generally the prices are higher in the winter than in the summer. The electricity prices relate to the electricity production, with a significant amount of variable RES such as hydropower, wind power, and solar power in Sweden [
35]. For a household with a PV system installed, the electricity purchased from the grid could be reduced in the summer, due to more sunlight and longer days, than in the winter.
The user profile of the EV owner decides when the EV is at home, where an available bidirectional charger is assumed, or when the EV is not at home. The typical charging profiles of EVs vary (for example, if it is a weekend or weekday, the season, and type of life of the EV owner). Three user profiles utilized in this model are shown in
Figure 4.
Considering the user profiles in
Figure 4, the profiles follow patterns according to the following description; Profile 1: the car is parked for charging/discharging either at home or at work during some hours, and in between, it is driven a certain distance between the two locations. Profile 2: the car is parked at home in the morning and the evening, but during the daytime, there is no charging possibility at work. Profile 3: this profile corresponds to persons who work night shifts, where the car is parked at home during the daytime and parked at work during the nighttime with no charging possibilities. The three profiles are distributed among the ten EVs as follows: Profile 1 is added to Users 1, 6, 8, and 10; Profile 2 is added to Users 3, 7, and 9; and Profile 3 is added to Users 2, 4, and 5. The initial SOC is set to 50% for all ten cars, and the maximum and minimum SOC limits are set to 80% and 20%, respectively.
3. Results and Discussion
The results from the simulations include, e.g., the SOC when using the EVs for bidirectional or unidirectional charging strategies, presented in
Figure 5 and
Figure 6. The SOC values estimated for the EVs of the types Nissan Leaf and Mitsubishi Outlander, for different user profiles, are modeled and shown in
Figure 5. These EVs are simulated to both charge from and discharge back to the grid, with V2G capabilities.
The SOC values estimated for the EVs of the types Volvo and Tesla are modeled and shown in
Figure 6. It is noted that these EVs are only charged from the grid, with no V2G capabilities.
The different time periods of
Figure 5 and
Figure 6 can be analyzed. According to
Figure 3, before 07:00, the electricity price is below 3 SEK/kWh, allowing the vehicles only to charge until reaching the upper limit of the SOC. If the vehicle is not charging during this period, this is because of the user profile, meaning a car that is not connected to the charging station. This is the case for User 2, User 4, and User 5 (Profile 3 in
Figure 4), presented in
Figure 5.
During the period 07:00 to 13:00, the vehicles only discharge as the electricity price is above 3 SEK/kWh, selling electricity to the grid until reaching the lower limit of SOC. However, it can be noticed that User 1, User 3, User 6, User 7, User 8, User 9, and User 10 in
Figure 5 and
Figure 6 are discharging, even though the vehicles are not at the charging station. This occurs due to the vehicles traveling and discharging at an assumed 10% of the nominal power.
During the period 13:00 to 16:00, the vehicles only charge as the electricity price is below 3 SEK/kWh, buying the electricity from the grid until reaching the upper limit of SOC. However, it can be noticed that User 3, User 7, and User 9 (Profile 2 in
Figure 4) are discharging because each vehicle is not connected to the charger and traveling, discharging at 10% of the nominal power.
From 16:00 to 21:00, the vehicles only discharge as the electricity price is above 3 SEK/kWh, selling the electricity to the grid until reaching the lower limit of SOC. From 21:00 to 07:00, the vehicles only charge as the electricity price is below 3 SEK/kWh, buying the electricity from the grid until reaching the upper limit of SOC. It can be noted that when the vehicle is not at the charging station, the SOC is constant, different from the other scenarios where the vehicles were traveling and discharging at 10% of the nominal power. This is due to the possibility of traveling during a certain period (from 08:00 to 21:00).
Aggregating the ten EVs to the grid, where half of the EVs provide V2G, the estimated cost of the charging or revenues from discharging and the power (kW) to and from the grid over one day are shown in
Figure 7a,b.
From hour 00:00 to 07:00, in
Figure 7a, the electricity price is below 3 SEK/kWh, and the EVs are charging (buying electricity from the grid). The negative signal represents that the grid is earning money from EV users. From hour 07:00 to 13:00, the electricity price is above 3 SEK/kWh, meaning that some of the EVs (i.e., the EVs with V2G capabilities parked at the charging station—User 1, 2, 3, 4, and 5) will sell electricity back to the grid, as can be indicated by the rise of the red curve in
Figure 7a. But, the curve is still negative due to an imbalance between the electricity being sold to and bought from the electric grid. This variation (i.e., imbalance) in buying and selling electricity from and to the grid with all the EVs in the model is also shown in the final hours 13:00 to 24:00 in
Figure 7a.
Figure 7b shows the power to and from the electric grid based on the rated power for each EV for charging and discharging, presented in
Section 2.2. The grid sells more electricity for charging the EVs than buys electricity from the EVs, which is reasonable since the grid buys only when the electricity price in this model is higher than 3 SEK/kWh, and only half of the EVs have V2G capabilities in the model. Charging and discharging based on the electricity price could be controlled by an aggregator to provide support to the electric grid. The charging and discharging of EVs will affect the power system. EV charging at high power levels, to provide a short charging time, can create power peaks in the electric grid. To use V2G on a large scale in society requires a robust electric grid, and V2G can also support the electric grid with balancing services and enhanced flexibility.
While the main objective of this study is to investigate the potential economic revenues from V2G based on estimated local electricity price variations, future research could include an in-depth investigation of how the large-scale adoption of V2G may impact the electric grid (including, e.g., the load profiles of the grid). The benefits from utilizing V2G may not only be the economic revenues for each EV owner. V2G could potentially also support the local electric grid with grid balancing services, contribute with additional electricity at remote locations, or support the self-sufficiency of the EV owner if charged and discharged to a household.
However, the EV battery could be affected by this new bidirectional charging strategy. The lifetime of the EV batteries is affected by several factors, such as the ambient temperature and charging/discharging power levels. It is complex to estimate the SOH of an EV battery. Thus, the potential economic revenue from different charging strategies such as V2G is hard to estimate and varies from different specific cases. From the Swedish perspective, winters often provide negative ambient temperatures, and the charging or discharging of EVs outdoors may degrade the batteries faster, especially if the charging or discharging is carried out at high power levels (i.e., fast charging).
It is a challenge to propose a suitable economic compensation to an EV owner utilizing V2G as it should include both economic compensation for the electricity sold to the grid and for the potential EV battery wear. The opportunity to use V2G may also affect the warranty time of the EV, as well as the price of the EV on the second-hand market. The opportunities and challenges with implementing V2G in Sweden require further research, including both modeling and experimental work, to provide a deeper understanding of V2G from technical and economic perspectives.
As described in
Section 2, the results presented are based on the charging and discharging of the ten vehicles during 24 h modeled in the MATLAB/Simulink simulation framework, with a phasor simulation type with 50 Hz. The model includes an algorithm for deciding when to charge or discharge the EV, including input data, e.g., SOC, estimated electricity price, EV type, and charging and discharging power levels. The simulation model is still at an early stage of development. In this first version of the model, all EVs have the same initial SOC, the analysis is only conducted for one day, the SOC lowered due to driving the EV is only roughly estimated, etc. This can be modified for in future versions, to simulate EVs driving a certain distance when it is not parked at home. Additional functionality can be included and added to the model to better simulate different types of EVs and V2G. Future simulations will be conducted with a real-time simulator, and so far, only first trials have been carried out to, for example, simulate transients. Choosing an appropriate control signal for V2G can sometimes result in a conflict of interest, e.g., if the estimated electricity price is low during local high-demand hours, which would suggest charging when the grid is already stressed. Therefore, it may be a good idea to prioritize the order of objectives if the chargers target both economic and technical objectives.
4. Conclusions
There are different charging and discharging strategies presented in the scientific literature, including smart charging strategies such as V2G, where the EV is not only charged from the electric grid but also discharged back to the grid. A simulation model of the charging and discharging of ten vehicles has been designed in MATLAB/Simulink. The model includes an algorithm for deciding when to charge or discharge the EV. The charging strategy for V2G capability in the model is related to the estimated electricity price, with the goal to charge the EV when the price is low and discharge when the price is high. The model also includes EVs with no V2G capabilities, meaning that these can only be charged from the grid. The results show how the SOC for different user profiles could vary over a day.
The maximum SOC value for using V2G was set to 80%, whereas the minimum value was 20%, and the starting value of each EV was 50%. The value 3 SEK/kWh was chosen as a set-point for when to charge (if the price was lower than 3 SEK/kWh) or when to discharge if V2G was an option (if the price was higher than 3 SEK/kWh). It was concluded that the model of V2G resulted in larger SOC differences (from 20% to 80% SOC) than if the V2G capability was not included. V2G can potentially support the power grid with grid balancing services.
The electricity price can vary with, e.g., different seasons and days due to the amount of RES connected to the electric grid. Therefore, the revenue from using the V2G will vary with different seasons and days. The electricity usage pattern may, however, be more or less similar for a workday in any season. If there are great variations in the electricity prices due to, for example, seasons with significant variations in electricity production from RES, the economic revenue from V2G will increase as the EV owner can buy electricity when the price is low and sell when the price is high. If the electricity price is more or less stable, which could be the case during some seasons, the financial incitements from using V2G will decrease. Generally, the electricity need in Sweden is greater in the winter than in the summer, and therefore, the V2G could be more important in the winter than in the summer.
While the estimated electricity price and variations over the day provide opportunities to create additional revenues, the battery system of the EV may be aged faster due to additional battery cycling. The results from the simulation show that the grid sells more electricity, due to EV charging, than buys electricity from the EVs due to V2G. There are limitations with this study, e.g., it is only based on MATLAB/Simulink simulations with no real experimental data from EV charging, and no experiments are included, and there are assumptions made on the type of EVs and the charging and discharging rates. Future research can include, e.g., improved estimations on discharging during driving, include a validation of simulated values in comparison to real-life data from EV charging, or include experiments on V2G in society. There are several barriers limiting the acceptance of V2G technologies, such as technical, economic, regulatory, social, political, and environmental challenges. Additionally, other important issues need to be addressed for the successful implementation of V2G, such as coordination among stakeholders, standardization, the deployment of charging stations, and the design of public policy incorporating EVs. This study investigates some of these aspects, bringing V2G technologies one step closer to more widespread implementation. This is the first step in modeling and understanding more about the opportunities and challenges with the charging and discharging of future EVs.