Agent-based modelling of electric vehicle behaviour in a university environment

: As the number of electric vehicles (EVs) increases, the strategic planning of charging infrastructure becomes a crucial matter. Vehicle parking time takes the longest at home and work. The residential is responsible for 75% of EV charging time, while the workplace is for 14%. The combination of EVs with intermittent energy sources has attracted considerable attention in recent years. It has several advantages, including significantly greening the entire EV usage cycle and attaining financial viability by lowering the direct peak demand on the grid. This study has described the agent-based infrastructure of the EV charging station model on university premises. It lets us obtain the best possible energy supply from solar PV, external batteries, and grid agents. Three charging scenarios (uncontrolled, vehicle-to-grid (V2G), and grid-to-vehicle (G2V)) are constructed and simulated with varying percentages of EV resemblance. Slow charging is included in the G2V scenario to improve the PV benefits in the EV charging model. The simulation result shows that slow charging in the workplace infrastructure increases the PV benefits of EV charging while reducing grid dependency.


INTRODUCTION
In addition to eco-friendly transportation, EVs also serve as energy storage, a solution to rising fuel prices, and a means of lowering air pollution. The transportation industry continues to be one of the largest producers of greenhouse gas (GHG) emissions. It accounts for approximately 23%, with car passenger transport accounting for 11% (Vijayashankar, 2017). EVs have the potential to reduce GHG emissions significantly. Charging massive EV fleets poses a problem to the electrical grid since both the total and instantaneous peak demand increase considerably. It causes severe loading at transformer stations. Understanding user behaviour and how it affects charging infrastructure could help the most efficient deployment of charging stations (Gunther & Fallahnejad, 2021). EV charging using renewable energy (RE) not only realizes its full potential as a green mode of transportation but also aids the large-scale integration of RE into the existing energy infrastructure (van der Kam et al., 2019).
The thesis report of Pallawala (2019) intended to examine the sectors and stakeholders involved in promoting EVs in Sri Lanka, as well as the opportunities and challenges that might arise Global trends in the EV industry, rising fossil fuel prices, availability of financing instruments, overall cheap cost of transportation, comparably minimal maintenance needs, and passionate early adopters are the primary potential for promoting EVs in Sri Lanka. In 2021, the President of Sri Lanka presented the country's sustainable energy development goals at the United Nations High-Level Dialogue on Energy (United Nations, 2021). According to the President, Sri Lanka has set an ambitious goal to obtain 70% of the country's energy needs from renewable sources by 2030. Sri Lanka aims to move away from fossil fuels, promote decarbonization, and achieve carbon neutrality by 2050.
The import of cars that run on fossil fuels will also be discouraged, and EV adoption will be promoted. These goals demonstrate the future of EVs in Sri Lanka. EV charging behaviour is influenced by many factors, such as charging time, parking duration, range anxiety, driver experience, etc. This complex system could be modelled using a relatively new modelling technique named agent based model (ABM). ABM is a technique for simulating the activities and interactions of several independent entities, or agents, across time. It allows systematic investigations of changes in social systems over extended periods, which would be expensive and impossible to test in real life. The ABM-charging infrastructure allows the EV charging demand to be determined, which considers several EV features, such as the number of EVs, the SOC of each EV at the time of arrival, and charging modes (uncontrolled, V2G, and G2V).
This research intends to create a PV-based EV charging platform on university premises to efficiently charge EVs, enhance integrated renewable sources -PV while charging, and show the impact of using energy storage devices on the charging station's performance.

RELATED WORKS
The multi-agent system (MAS) based simulation technology has been proposed to assess the impacts of EV charging on Singapore's energy infrastructure in (Ho et al., 2014). The developed EV charging algorithm allocated charging energy to individual vehicles based on their state of charge (Jiang et al., 2019). An intelligent and decentralized MAS was offered for controlling and managing EV charging in low-voltage (LV) distribution networks . It has been enhanced with active demand (AD) in .
A probabilistic ABM enabled the calculation of EV charging demand while considering various social and economic aspects (Afzaal et al., 2020). A charging station infrastructure for a large metropolis has been proposed in (Gunther & Fallahnejad, 2021). Various influencing parameters, including the number of users, charging time, charging frequency, charging station type, and billing models, were altered to achieve the optimal possible development and operation of public charging infrastructure. The ABM for EV charging infrastructure has been proposed in (Vijayashankar, 2017). That could be used on a neighbourhood scale until 2035. A new bottom-up physical method has been presented in (Plagowski et al., 2021), which combined the simulations of ABM traffic and grid energy flow. A Multi-Agent model of long-distance transportation in Sweden was proposed by (Marquez-Fernandez et al., 2019), allowing for the simulation of various scenarios and a complete analysis of the interaction between these vehicles and the charging infrastructure.
The ABM simulation determined whether an electric van fleet with various charging options could equal the performance of a diesel fleet (Utomo et al., 2019). The impacts of influencing variables such as driver behaviour, charging station location, and electricity pricing on EV charging demand were evaluated on EV charging demand using an ABM-simulation model in (Chaudhari, 2019). A multilevel agent-based model was proposed for buying, charging, and driving EVs (the ABCD model) (Hoekstra & Hogeveen, 2017).
The different charging infrastructure rollout strategies to facilitate large-scale adoption of EVs have been presented in (Wolbertus & van den Hoed, 2019). An ABM information system for recognizing trends in residential plug-in electric vehicle (PEV) ownership and driving behaviours were presented in (Sweda & Klabjan, 2014). A unique ABM simulation framework for urban electro-mobility was proposed in (Adenaw & Lienkamp, 2021), which could be used to analyse charging station usage and user behaviour.
Over the last few years, the combination of EVs with intermittent renewable energy sources has garnered considerable attention. An ABM was utilized to determine how well alternative charging patterns correspond to RE generation from photovoltaics and wind in (van der Kam et al., 2019). The impacts of driver behaviour, charging station location, and energy cost on EV charging demand were examined in (Chaudhari, 2019). Private and commercial EV charging demands place additional stress on the distribution grid. Photovoltaic (PV) systems might assist in easing this stress. Depending on the energy pricing band allocation, the algorithm switches between the deterministic and rule-based modes of operation.
Most EV load modelling systems use charge scheduling algorithms to forecast current load demand. When modelling the EV charging load, the literature lacks realistic considerations from the perspective of university and workplace EV charging stations. To minimize the effects on the distribution grid, studies on power system optimization maximize EV penetration by utilizing charge scheduling algorithms. Previous EV charging-related research papers have not included a realistic estimate of EV energy use, including longitudinal vehicle dynamics and the power train system. The EV load models and energy system models must be co-simulated to consider these considerations when modelling EV loads. The literature lacks co-simulation studies connecting isolated transportation and energy system studies.
The remaining portion of this paper is organized as follows. The work of agent modelling is discussed in the next section. L a t e r , t h e validation of the agent model is also presented, followed by the experimental and simulation findings.

TOPOLOGY AND MODELLING OF THE STUDIED SYSTEM
The studied system is based on ABM. It comprises multiple agents, such as solar PV, EVs, utility, weather, charging control, external battery storage, and charge pole agents, as illustrated in Figure 1. PV agent energy is primarily used to charge EVs. A battery agent is an additional energy source that can be used to energize EVs or to absorb excess energy generated by the PV agent. The Utility grid agent is used as a backup source. The control agent is utilized to manage charging scenarios based on the energy management strategy, which ensures the system's energy balance.

Agent Modelling
This research builds a platform to simulate the behaviour of EVs and the corresponding infrastructure. ABM is used to model different components in an EV charging infrastructure and their interactions. MESA agent-based simulation platform in Python models the agents and their behaviours.

Solar Agent Modelling
The solar PV agent accesses temperature and irradiance data from the weather agent. Test data has been acquired from the PV portal of the Faculty of Engineering, University S.K. Jaslin et al.
of Peradeniya, Sri Lanka. IBC Solar -PolySol 250 CS 40 kWp and 15 kWp solar panels are available on the faculty premises. The predicted energy output of the PV (P PV ) is calculated from equation (1), (Chandrasiri, 2017). (1) where, I PV : Sun Irradiance value at the current time (Wm −2 ),τ PV : Transmittance value of PV cell, η ref : PV electrical efficiency, A : Area of PV module, α P : Temperature coefficient of power (K −1 ), T : Temperature at the current time (K), and T STC : standard temperature (25 o C).

EV Agent Modelling
A similar behavioural pattern of actual EVs has been followed to develop EV agents. The EV agent comprises a vehicle power train system, transmission and battery model, regenerative braking system, and driver cycle. The speed trace from the database is applied to the vehicle drive cycle unit. Nissan leaf 2013 EV is simulated in this model.
Auxiliary devices are also included in the EV model. It increases the accuracy of the energy consumption prediction. The backwards-facing model is utilized to access the EV agent's total energy consumption (Miri et al., 2021); (Wawrzyniec & Maciej, 2018). Figure 2 shows the backward model of EV.
The novelty of this study is summarized from the above works of literature. It includes: • Calculation of auxiliary device energy usage (which is assumed to be 300W as per literature studies).
• Using efficiency maps, estimate the efficiency of an electric motor and inverter.
Nissan leaf 2013 has a 100% electrified powertrain system called e-POWER. It has significant characteristics such as rapid reaction, smooth acceleration and deceleration, and quietness. The traction electric motor and inverter have an optimal efficiency of approximately 96% (Yoshimoto & Hanyu, 2021). For this ABM, the optimal efficiency value (96%) is used.
The power consumption of motion accounted for a part of power demand, as calculated by the following equations (2) and (3), : Force required to increase of the rotational speed of the rotating components, δ: Rotary Inertia Coefficient, and a: Acceleration of EV.

External Battery Agent Modelling
An external Battery agent is additional storage to supply the EVs or to absorb excess energy produced by the solar agent. It primarily provides energy if the energy of the solar agent is insufficient. EV agent battery instances are used to develop this simulation model.
The battery model's two major energy storage systems are the lithium-ion battery pack and lead-acid battery. Lithiumion battery pack propels the vehicle and the low voltage (12V) lead-acid battery that provides energy to the auxiliary devices. The dynamic charging/discharging characteristics of the lithium-ion battery pack are simulated to estimate its operating voltage and SoC with a high level of precision (Miri et al., 2021), (Lamba, 2019), and (Mantravadi, 2011).
The battery current is calculated in equation (4) Every battery cell is assumed to be in the same state of health. As a result, the model is identical to a single cell. The SoC, battery temperature, and whether the battery is charging or discharging conditions determine the total resistance of the battery, R_Battery. Which can be calculated using singlecell resistance, R_cell and the number of cells in series and parallel. where,

No of cells in parallel.
P_Battery: Power requirements determine the voltage at the battery level. The V Battery is calculated from equation (7) since the power required at the battery level is known. Which is based on Thevenin's equivalent model (Figure 3). By applying equation (7) into (3), battery current is calculated. Which is in equation (8).
An equivalent electrical circuit-based model of Li-ion batteries is in Figure 3. At each agent step, the battery SoC updates by using the Coulomb counting method, as shown in equation (9). This approach cannot be used in a realworld application (due to measurement noise).
where, SOC%: battery state of charge in (%), SOC 0 : initial battery state of charge in (%) and C Battery : battery cell capacity in (Ah).
Other Agent modelling: Utility agent Charging control agent, External Battery agent, Weather agent and charge pole agent.
The EV charging agent model includes other agents such as the utility agent, charging control agent, external battery agent, weather agent, and charge pole agent.
• Utility Agent: In this agent model, the utility agent has no energy limit. It serves as a backup supply, allowing PV sources to sell excess energy and EVs to obtain energy, depending on the energy management strategy.
• Weather agent: It has a temperature and irradiance values database in faculty surroundings. From the faculty inverter portal, the weather agent accessed the data. The solar agent generates energy by using its data.
• Charge pole agent: Three charging modes are slow, average, and fast charging. The details are listed in Table 1.
• External Battery agent: Battery Storage agent is additional storage to supply the EVs or to absorb excess energy produced by the solar agent. It primarily provides energy if the energy of the solar agent is insufficient. EV agent battery instances are used to develop this ABM.    • Charging Control agent: Charging control, energy management, external battery, and EV battery's SOC control are the primary functions.
Charging control has been designed with uncontrolled charging, vehicle-to-grid (V2G), and grid-to-vehicle (G2V) situations, as summarized in Figure 4. This can be chosen from our simulation model interface.
The EV is charged using an energy management scenario, which allows the user to choose between solar, external batteries, or grid agents as an energy source. The solar agent is primarily used to charge EVs. An external battery agent is a storage device that energizes EVs or absorbs the surplus energy generated by the solar agent. The utility agent provides a backup supply and allows the solar agent to sell excess energy. This scenario updated the SOC of the external battery and the EV. Figure 5 shows the energy management statement.

Solar Agent Validation
The solar agent model has been validated using the Homer Pro 3.14. The results show the least amount of variation. Figure 6 shows the simulation output, and Table 2 concludes the results.  (Jessica, 2020). Table 3 shows the testing results. Vehicles run through a series of driving routines with the city (FTP), highway, high speed (US06), and air conditioning (SC03) in EPA tests.
The Federal Register of the Environmental Protection Agency has specified vehicle fuel economy labelling for EPA testing. They examined 615 latest car models to determine the percentage change in label values relative to the present labels. According to the new city and highway fuel economy labels, 90% of the cars would have new label values 8 to 15% and 5 to 15% lower than their current label values accordingly (Rachel Lee et al., 2020). The EPA testing simulation of the model has yielded findings within a permissible range, as shown in Table 4.

Battery Agent Validation
To evaluate the battery model of an EV, a concurrently operating Li-Ion battery from a Nissan leaf 2013 vehicle power profile has been used. The design and validation of a hardware-in-loop lithium-ion battery pack were gathered from Field for EPA testing (US06, HW, and USSD/FTP) (Lee et al., 2014). They used a two-time constant equivalent circuit battery cell model and lumped capacitance for a  The first order Thevenin's equivalent circuit has provided more accurate dynamic charge/discharge characteristics.
The AB-simulation model included a single-time constant equivalent circuit battery cell model (Eltoumi Fouad, 2020). As shown in Table 5, the simulated battery pack of the Nissan Leaf emulation has shown better agreement with the actual battery pack data under EPA testing. The absence of a battery thermal model in the agent model for regulating coolant flow rate and temperature changed the results slightly.

SIMULATION AND RESULTS
The proposed model is based on the MESA agent-based simulation. Each step takes up to 5 minutes. The simulation started with two EVs during parking time on the faculty premises. Then, the percentage of available cars was predicted as EVs, which was added to the database. Energy distribution pattern from the grid, solar, and batteries has been observed.

Case-1: Two EV cars
The patterns have been observed using the two accessible EVs under three charging scenarios: uncontrolled, V2G, and G2V. When the car arrives at the car park for uncontrolled charging, it immediately begins to charge the car until the SOC reaches 100% or until disconnection. It charges by average charging mode at a rate of 6.6kW as mentioned in Table 1. The observations are presented in Figure 7.
When the car's SOC falls below 80% during the V2G scenario, it begins charging until the SOC reaches 100% or disconnection. Otherwise, it acts as storage and supplies the energy to an external battery storage agent until it reaches 80% of SOC. During the charging, it intends to charge the car in average mode (6.6 kW) when the SOC of the EV is greater than 50%. It will be in fast charging mode (30 kW) if the SOC is less than 50%. The charging mode power values have mentioned in Table 1.
Since the available cars are near the faculty, only a significant fraction have less than 80% SOC when they arrive. At the same time, the simulation model focuses on charging at the workplace, ensuring that each day begins with 100% SOC. Figure 7 shows the results.
When an EV's SOC is less than 50% in the G2V scenario, it is under fast charging mode. Unless it is charged at average mode (6.6kW). First, the solar PV agent be-gins charging. The external storage agent charges the EV if the PV energy is inadequate to charge it fully. After that, the excess PV is fed into the grid. Which is presented in Figure 8.

Case-2: The Future of EV-Predicted Model
Various percentages of EV predictions in the university car park have been simulated under uncontrolled, V2G, and G2V charging scenarios. A complementary energy supply requires external battery storage and grid connections. PV can either charge EVs immediately or offer stationary storage during the day. The utility grid agent is with unlimited resources in this scenario. The external battery storage capacity and power limit are 40 kWh and 50 kW, respectively.
PV energy is inadequate to charge all the EVs' SOC to 100%. At this point, the stationary storage charge the EV until it runs with minimum SOC, and then energy is supplied by the utility grid. The findings show that PV energy generation does not entirely benefit EV charging and that reliance on the public grid increases as the percentage of EVs increases. It is depicted in Figure 9 for the G2V scenario as an example. S.K. Jaslin et al. Increased PV penetration for EV charging is a crucial challenge for PV-aided EV charging stations. This raises the question regarding the circumstances. What is the optimal size of the system? What additional features could be included in the existing charging infrastructure? Slow charging in the G2V mode with 2.3kW boosts the direct PV benefits. In the slow charging mode, the PV, grid, and stationary storage share the energy to charge the EVs.

Slow charging
Almost all cars in the database have working time span of more than 2-4 hours. Slow charging provides a higher PV benefit than the average charging G2V. A comparison of the two scenarios with varying EV predictions has been shown in Figure 10.
As EVs grow in the faculty, grid energy consumption also increases. At that point, solar energy is insufficient to compensate for EVs' demand fully. However, it provides significant PV benefits when charged slowly in a G2V scenario. It substantially doubles the PV influence and reduces grid reliance by a factor of two. The energy distribution percentage profile is depicted in Figure 11.
• 50% of EV resemblance: The solar benefits from 28.72% to 52.39% while eliminating grid dependency.
• 100% of EV resemblance: The solar energy contribution is increased from 14.07% to 29.82%.
(b) Slow and average charging for 75% of EV prediction.
(c) Slow and average charging for 50% of EV prediction.

DISCUSSION
With uncontrolled charging, it begins the charging process for the cars as soon as it enters the faculty. It continues until they achieve 100% SOC or are disconnected. It resulted in a substantial increase in energy demand.
V2G permits obtaining energy from energy resources and charging the vehicle when implementing controlled charging. When the SOC exceeds 50%, fast charging begins to preserve the battery's lifetime from the full depth of the discharge (Venkat, 2020). On the other hand, V2G charging is more effective than the two charging scenarios. When the SOC is above 80%, EVs can return significant energy to the grid. As a result, V2G has assisted in reducing the grid's need for additional energy generation and the demand for energy supply resources.
In the G2V scenario, the average charging mode is to charge the EVs. A slow charging condition is introduced to the system to improve the PV benefits. It has almost increased the system's PV benefit by a factor of 2.
The physical limitations and proper sizing must be analysed and adjusted to design a viable PV-based EV charging station. PV energy generation is also affected by weather, solar irradiation, and temperature. When there is a surplus of PV production, a proper storage system and utility connection should be in place to acquire it.

CONCLUSION
This research focused on modelling a solar-aided EV charging station at a university. It can be chosen between three charging modes (uncontrolled, V2G, and G2V). This SOC-based charging management monitors and ensures EV recharge. In the V2G situation, the PV benefits increase when the average mode is switched to slow charging. The two main concerns highlighted in the case studies are V2G charging and G2V-slow charging. It lowers the barrier to EV charging during the unanticipated energy demand and boosts the usefulness of PV-used charging. Future research will enforce a time-of-use (ToU) system with appropriate price charges for EV users. In addition, it needs to define the barriers and develop solutions for PV-based EV charging stations at the university premises.