# Hierarchical Agent-Based Integrated Modelling Approach for Microgrids with Adoption of EVs and HRES

Authors: Peng Han; Jinkuan Wang; Yan Li; Yinghua Han
Journal: Journal of Applied Mathematics
 (2014)

---

## Abstract

The large adoption of electric vehicles (EVs), hybrid renewable energy systems (HRESs), and the increasing of the loads shall bring significant challenges to the microgrid. The methodology to model microgrid with high EVs and HRESs penetrations is the key to EVs adoption assessment and optimized HRESs deployment. However, considering the complex interactions of the microgrid containing massive EVs and HRESs, any previous single modelling approaches are insufficient. Therefore in this paper, the methodology named Hierarchical Agent-based Integrated Modelling Approach (HAIMA) is proposed. With the effective integration of the agent-based modelling with other advanced modelling approaches, the proposed approach theoretically contributes to a new microgrid model hierarchically constituted by microgrid management layer, component layer, and event layer. Then the HAIMA further links the key parameters and interconnects them to achieve the interactions of the whole model. Furthermore, HAIMA practically contributes to a comprehensive microgrid operation system, through which the assessment of the proposed model and the impact of the EVs adoption are achieved. Simulations show that the proposed HAIMA methodology will be beneficial for the microgrid study and EV’s operation assessment and shall be further utilized for the energy management, electricity consumption prediction, the EV scheduling control, and HRES deployment optimization.


---

## Body

## 1. Introduction

The worldwide constructions of the smart grid technology bring significant development to microgrids, HRES, and EV technology. The microgrid is an integrated energy system consisting of interconnected loads, energy resources, and storages that can operate in parallel with the grid or in the island mode. Due to the needs of distributed generation, such microgrids have been popular over the years of development of the smart grid. And with the integration of HRESs including photovoltaic, wind, and biomass generators, the microgrids can deliver many advantages including reduced cost, increased reliability and security, renewable power generation, and power system optimization, bringing significant benefits to the grid enterprises and the public [1, 2]. However, the variety of renewable energy does not precisely match the time distribution of the electricity demand of the microgrid load, and the considerable oversized deployment of the HRESs for power generation reliability in turn makes the design costly. Moreover, the EVs’ increasing adoption also brings potential challenges to the operations of the microgrid, and, considering the large adoption of EVs in residential areas in the near future, the massive and random recharging activities shall cause severe voltage fluctuations to the microgrid [3, 4]. Besides, the additional power generation for EVs might be idle for most of the time, which further degrades the microgrid efficiency and infrastructure utilization [5, 6].Therefore, considering the complex operations and interactions of EVs and HRESs in the microgrid, the proper HRESs deployment assessment and EV-recharging prediction are the keys for minimizing the microgrid operation cost and maximizing the utilization of the HRES power volatility. And the modelling methodology for the microgrid with high penetrations of HRES and EVs is fundamental and critical to enable those abilities [7]. In recent years, various mathematical modelling techniques have been developed by many researchers, and the performance of the microgrid component is either modelled by deterministic or probabilistic approaches. Bazan and German [8] proposed a hybrid simulation approach for the analysis of the domestic homes equipped with different microgenerations and storage devices, but the study lacks the analysis on the microgrid operations. Petermann et al. [9] and Weniun et al. [10] proposed a multiagent control model for microgrid and a two-layer control system of microgrid is built; however, the EVs’ impact is not considered.Considering the model of microgrid power system with HRES and loads from EVs and from original consumers, this paper develops the methodology named Hierarchical Agent-based Integrated Modelling Approach (HAIMA). HAIMA also constitutes a flexible simulation system to further investigate the operation and interactions of the microgrid and EVs.


## 2. Microgrid Analysis with EVs and HRES

The analysis of the microgrid architecture is critical for the development of its model. The microgrid consists of multiple components of HRESs and power load. The HRESs of the microgrid include photovoltaic, wind energy, biomass, and battery storage systems. Meanwhile the multiple load of the microgrid includes the original load, that is, the operation of industrial, commercial electric equipment and residents’ home appliances, and the load of EV-recharging consumptions. All the components are connected together through a grid network and under the monitor of the microgrid management center.Without loss of generality, the schematic figure of the proposed system under study is shown in Figure1. Besides the mentioned HRES devices and load, the system consists of many power converters operating over a wide range of areas and interconnected with feeders and bus. The microgrid connects the distribution network through a single point of common coupling (PCC) and operates as a single unit. Two main types of EV energy supplement measures, that is, recharging and battery changing, are included in the system. Idle EVs can be recharged by the recharging electric vehicle supply equipment (EVSE) in the parking area or EV-recharging stations, and EVs with commute tasks and with depleted batteries can get a fast refuel service through battery-changing services, while the replaced depleted batteries shall be uniformly charged by the battery-recharging station through the logistics transportation by battery transport vehicles.Figure 1
Typical HRES structure.The structure in HAIMA is hierarchically divided into three layers: management layer, component layer, and event layer. The management layer consists of the control center and the sensors in the microgrid. It is responsible for communication with the smart grid control center and monitors and controls the flows on the microgrid bus with multiple energy inflows and outflows from the component layer. The component layer is formed by major power generation and consumption components of the microgrid including HRES devices, original electricity consumers, EVs, and service stations. And the event layer mainly focuses on equipment operation and processes in the EV service stations, that is, recharging and battery-changing stations.


## 3. Modelling Methodologies and Rationales

The proposed modelling methodologies of HAIMA are based on the ABM. As a computational approach to study multiagent systems (MASs), ABM has been a rapidly growing area for analyzing the electricity market in the past decade. The theoretical foundation of ABM mainly lies in complex system modelling (CSM), artificial life (AL), and swarm intelligence (SI). The fundamental approach of ABM is to simulate real-world systems with a group of interacting autonomous agents modelled as computer programs, and the agents shall interact with each other in the MAS [11]. As the objects with intelligence, the agents shall form the MAS with unique activity and interactions. And HAIMA adopts this character in modelling microgrid components including HRES devices, EV-recharging stations, and battery-changing stations. The other advantage of ABM is that it could efficiently model the complex behavior of massive system participants [12], which is particularly suitable for modelling massive consumption units such as EVs, enterprises, and residents with distinct characters and behaviors. Those electricity consumption units of the microgrid form up the electricity consumption in the microgrid and constitute an MAS which is well suited for agent-based modelling.To further enhance the effectiveness of the proposed agents, in the modelling approach the statechart is adopted to specify their states and behaviors. The statechart is a state machine that consists of states containing corresponding actions and transitions that can be triggered by events. Statecharts in HAIMA usually graphically capture the operations and conditions of certain agents and enable fast and convenient structuring of the microgrid model.The DEM and SDM are also adopted in HAIMA. As a modelling approach based on entities, resources, and block charts, DEM is capable of describing the entity flow and resource sharing. Such process-centric modelling is a medium-low abstraction level modelling approach and is well suited for exactly describing the EV refuel activities in both EV-recharging stations and battery-changing stations because refuel services in those stations can naturally be described as a sequence of operations. SDM is a rigorous modelling method that enables the building of complex systems simulations and the design of more effective policies and organizations [13]. SDM is typically used in long-term, strategic models and has been widely used in energy industries for demand forecasting [14] and energy flow modelling [8]. General system dynamics models consist of stocks and flows connected through auxiliaries depicting a system. And in HAIMA, the SDM is adopted for the management layer to generate energy consumptions and generations in the microgrid.


## 4. Hierarchical Agent-Based Model of Microgrid

### 4.1. System Dynamic Modelling for the Management Layer

In the management layer, SDM is adopted in the study of the energy supply in the microgrid. In this model, the stock of the microgrid energy comprises inflows and outflows indicating energy generation and consumptions, and those flows are generated by the corresponding components in the component layer while being under the control of the microgrid management center. Figure2 shows the logical setup of the proposed HAIMA management layer model, where the E
WD, E
PV, and E
BM denote the energy generated by wind, photovoltaic, biomass generators in the HRES; E
C
&
D is the energy flow in or out of the battery storage system depending on its charging or discharging operation; E
RES, E
IND, E
COM, and E
EV denote the residential, industrial, commercial, and EV energy consumptions; and E
DSCD is the discarded energy of the HRES. To guarantee the energy balance of the microgrid, the energy demand from the main grid can be calculated from the following equation:
(1)
E
GRID
=
E
WD
+
E
PV
+
E
BM
+
E
C
&
D
-
E
RES
-
E
IND
-
E
COM
-
E
EV
-
E
DSCD
,
and E
GRID is zero when the microgrid is working on islanding mode.Figure 2
Logical setup of the management layer.


### 4.2. Agent-Based Modelling for the Component Layer

The agent modelling in HAIMA can be divided into two types, where HRES components are modelled as single, complete, static agents operating under the control of the management layer, and the load from residential, commercial, and industrial consumers as well as EVs is modelled as separated autonomous dynamic agents with unique statechart, electricity usage distribution, and so forth in order to utilize the advantages of ABM to generate a bottom-to-top electricity consumption phenomenon.


#### 4.2.1. Modelling of HRES Generation Components

Wind Power System. Wind power is one of the most popular renewable energy sources in the microgrid whose power output at a specific site mainly depends on wind speed turbine characteristics. Typical hourly power output from a wind turbine can be calculated as
(2)
P
WD
(
t
)
=
{
0
,
V
(
t
)
≤
V
min
⁡
A
V
(
t
)
3
-
B
P
r
,
V
min
⁡
<
V
(
t
)
≤
V
r
P
r
,
V
r
<
V
(
t
)
≤
V
max
⁡
0
,
V
(
t
)
>
V
max
⁡
,
where P
r is the rated power, while V
min
⁡, V
max
⁡, and V
r are, respectively, the cut-in, cut-out, and rate speed of the wind turbine, V
t is the hourly average wind speed, and the factors A and B can be calculated as
(3)
A
=
P
r
V
r
3
-
V
max
⁡
3
,
B
=
V
min
⁡
V
r
3
-
V
min
⁡
3
.
Therefore the actual total power output from a wind energy system can be calculated by
(4)
P
WE
(
t
)
=
P
WD
(
t
)
A
WD
η
WD
,
where A
WD is the total turbine swept area of the wind energy system and the η
WD is the efficiency of the wind turbine generators and converters.Photovoltaic System. The hourly power output from the photovoltaic system with an area A
PV can be calculated by
(5)
P
PV
(
t
)
=
I
r
(
t
)
η
PV
A
PV
,
P
PV
(
t
)
≤
P
PV
max
⁡
,
where I
r
(
t
) is the total input solar radiation on unit area of the PV surface within an hour, and η
PV is the photovoltaic system efficiency.Biomass Power System. Biopower or biomass power utilizes biomass to generate electricity. With the development of biomass power technologies including direct-firing, cofiring, and gasification, biomass has provided a new option of renewable system for the microgrid. The power generated from direct-firing biomass power station can be calculated using
(6)
P
BM
(
t
)
=
η
BM
P
BM
r
(
t
)
,
P
BM
(
t
)
≤
P
BM
max
⁡
,
where P
BM
r
(
t
) is the rate power at time t and η
BM the biomass power generation efficiency.HRES Generation Statechart. The statechart of the proposed HRES generation devices can be illustrated in Figure 3. It contains four states that describes the main conditions of a renewable generator:(1)
power generating: the generator is generating power to the microgrid;
(2)
power discarding: the generated power is discarded;
(3)
shut down: the generator is stopped for regular maintenance;
(4)
failed: the generator is temporarily out of work and needs repairs.Figure 3
Statechart of the HRES generation devices.


#### 4.2.2. Modelling of HRES Storage Components

Battery Storage System. In the HRES, battery storage is fundamental to alleviate the fluctuation of the renewable generations. And it is therefore sized to meet the load demand during the nonavailability period of the renewable energy source while absorbing the exceeded power generations in HRES. The state of charge (SOC) of the battery storage system can be calculated by
(7)
SOC
BS
(
t
)
=
E
BS
(
t
)
E
BS
r
×
100
%
,
where E
BS
r is the rated battery energy storage and the current stored energy E
BS
(
t
) can be derived from the following equation:
(8)
E
BS
(
t
)
=
E
BS
(
t
-
Δ
t
)
(
1
-
σ
BS
)
+
E
C
&
D
(
Δ
t
)
,
where σ
BS is the hourly self-discharge rate and E
C
&
D
(
Δ
t
) is the charged or discharged energy in time period Δ
t and can be calculated by
(9)
E
C
&
D
(
Δ
t
)
=
{
(
E
GE
(
Δ
t
)
-
E
L
(
Δ
t
)
)
η
Bc
,
E
GE
(
Δ
t
)
>
E
L
(
Δ
t
)
,
E
BS
(
Δ
t
)
≤
E
BS
r
×
u
BS
max
⁡
(
E
GE
(
Δ
t
)
-
E
L
(
Δ
t
)
)
η
Bd
,
E
GE
(
Δ
t
)
≤
E
L
(
Δ
t
)
,
E
BS
(
Δ
t
)
≥
E
BS
r
×
u
BS
min
⁡
0
,
else
,
where E
GE
(
Δ
t
) and E
L
(
Δ
t
) are the total generation and load of the microgrid system, while η
Bc and η
Bd are the recharging and discharging efficiency of the battery. E
C
&
D
(
Δ
t
) is subject to the battery maximum recharging and discharging constraints:
(10)
E
C
&
D
min
⁡
≤
E
C
&
D
(
Δ
t
)
≤
E
C
&
D
max
⁡
.The six states of the energy storage system are as follows, while the corresponding statecharts are illustrated in Figures4 and 5:(1)
recharging: the battery storage system is being recharged by the microgrid;
(2)
discharging: the battery storage system is discharging energy to the microgrid;
(3)
fully recharged: the maximum SOC of the battery storage system has been reached;
(4)
depleted: the minimum SOC of the battery storage system has been reached;
(5)
shut down: the battery storage system is stopped for regular maintenance;
(6)
failed: the battery storage system is temporarily out of work and needs repairs.Figure 4
Statechart of the HRES energy storage system.Figure 5
Distribution of the trip length.


#### 4.2.3. Modelling of EVs in the Microgrid

As an active agent, the EV modelling in the microgrid should consider both the temporal and spatial aspects and the EVs’ behaviors. The main parameters impacting the EV energy requirement can be classified into three aspects: environment characters, driver characters, and EV characters. Environment characters include time, weather, climate, distribution of the EV-recharging and battery-changing station, and transportation conditions; driver characters include distributions of driving time and trip length; and EV characters include EV types, rated battery storage, recharging/discharging power, and efficiency. Given those characters, the SOC of the EV agent can be derived in the following equation:(11)
SOC
EV
(
t
)
=
E
EV
(
t
)
E
EV
r
×
100
%
=
E
EV
(
t
-
Δ
t
)
(
1
-
σ
EV
)
+
E
Charge
(
Δ
t
)
-
E
Discharge
(
Δ
t
)
E
EV
r
×
100
%
,
where the recharged energy E
Charge
(
Δ
t
) within time period Δ
t can be, respectively, calculated by the recharging power P
Charge
(
t
) in the following equation:
(12)
E
Charge
(
Δ
t
)
=
∫
0
Δ
t
κ
P
Charge
(
t
)
η
Charge
d
t
,
000
P
Charge
min
⁡
≤
P
Charge
(
t
)
≤
P
Charge
max
⁡
,
where variable κ is zero when EV is not plugged for recharging and is 1 when being recharged. And the total recharging load is
(13)
P
EV
(
t
)
=
∑
i
=
1
N
κ
P
Charge
i
(
t
)
,
P
Charge
i
min
⁡
≤
P
Charge
i
(
t
)
≤
P
Charge
i
max
⁡
.
When EVs are driving on the trips, the discharged energy from the battery within time period Δ
t
E
Discharge
(
Δ
t
) can be calculated with
(14)
E
Discharge
(
Δ
t
)
=
∫
0
Δ
t
ε
P
Discharge
(
v
(
t
)
)
d
t
,
00000000
0
≤
v
(
t
)
≤
v
max
⁡
,
where v
(
t
) is the EV velocity and variable ε is zero when EV is parked and is 1 when being driven for a trip. Besides, assuming the transition from ordinary internal-combustion engine vehicle to the electric vehicle will not apparently change the resident driving behaviors, the distribution of the trip length l in this model is derived from the latest National Household Travel Survey report (NHTS 2009) in the United States, as is shown in Figure 5.With the proposed key agent parameters, the EV agents’ behavior can be derived through a series of functions. And the main behavior influencing the microgrid is the EV refuelling decision between EV recharging and battery changing. And with plenty of EVSEs available at parking lots of office buildings as well as a residential area, an ideal decision process for EV drivers is shown in Figure6. The EVs finished tripping shall find whether there are available EVSEs to get a temporary refuelling, and when there are no available EVSEs while the EV battery is close to depleted, EVs shall go for the nearest ERS to get recharged and then wait for the next trip. Trip-unfinished EVs with nearly depleted batteries shall go to the nearest BCS and go on trips after the batteries have been changed.Figure 6
Decision process for EV driver.Based on the proposed agent's behavior, the EV agents’ states in the model can be described in the statechart as shown in Figure7:(1)
go tripping: the EV starts one trip of a day;
(2)
trip ending: the EV ends one trip of a day;
(3)
heading for BCS: the EV goes to the battery-changing station for refuelling;
(4)
heading for RS: the EV goes to the EV-recharging station for refuelling;
(5)
battery changing: the EV is under the service of battery changing;
(6)
recharging: the EV is under the recharging service;
(7)
standby: the EV ends all series of trips of a day;
(8)
failed: the EV encounters a breakdown and needs repairs.Figure 7
Statechart of the EV agent.


#### 4.2.4. Modelling of the Original Microgrid Load

The original load of the microgrid is mainly formed by residential, commercial, and industrial load and is mainly influenced by characters including population, electrical appliance types, and energy consumption per capita. In HAIMA, with the preset population and proportion of the microgrid, static agents have been adopted to represent the residential houses, commercial and industrial buildings, and other electrical appliances. Apart from the recharging load from EVs, the massive introduction of HRES and EVs does not apparently impact the load distribution and power consumption of a certain area, and the original load curves from residential, commercial, and industrial load can be adopted to generate the original load agent.


### 4.3. Discrete-Event Modelling for the Event Layer

DEM is proposed to model the inner operation in EV-recharging stations as well as battery-changing stations to capture the detailed refuel event of EVs. The service ability, congestion situation, can therefore be observed and further improved to raise EV customer service satisfaction. In HAIMA, EVs and their batteries are all passive entities that travel in the stations through a series of blocks representing processes of the recharging/battery-changing service sequence, as illustrated in Figure8, where the basic processes of the two sequences are waiting for service, applying for resources, being serviced, and departures. The service during time can be calculated, respectively, in
(15)
T
ERS
=
T
Wait
+
T
Charge
+
T
ExERS
,
(16)
T
BCS
=
T
Wait
+
T
Change
+
T
ExBCS
,
where the waiting time T
Wait is affected by the congestion conditions in the stations; the service time T
Charge is, respectively, affected by the EV SOC and recharging power; T
Change is due to battery-changing efficiency; and T
ExERS, T
ExBCS are the extra auxiliary services provided by the stations.Figure 8
Process of the EV agent in ERS and BCS.


### 4.4. Interactions between Layers

The interconnections and interactions are critical to the integrated operation of HAIMA. The communications between management layer and component layers are established in the model to transmit the data and control messages; therefore in component layer the component agents’ behaviors can be controlled and their key parameters can then feedback to update the flow variables in the SDM of the management layers, which enables HAIMA to simulate the monitoring of the grid bus and the real-time control of the HRES. The EV agent in the component layer also serves as triggers to the event layers. With the EV agent states changing, relative blocks of the DEM will trigger the corresponding process in response, and the entities process of the DEM shall in turn trigger the transitions of the relevant EV agent statechart. The synchronization is also important for the model and should be guaranteed through time triggers.


## 4.1. System Dynamic Modelling for the Management Layer

In the management layer, SDM is adopted in the study of the energy supply in the microgrid. In this model, the stock of the microgrid energy comprises inflows and outflows indicating energy generation and consumptions, and those flows are generated by the corresponding components in the component layer while being under the control of the microgrid management center. Figure2 shows the logical setup of the proposed HAIMA management layer model, where the E
WD, E
PV, and E
BM denote the energy generated by wind, photovoltaic, biomass generators in the HRES; E
C
&
D is the energy flow in or out of the battery storage system depending on its charging or discharging operation; E
RES, E
IND, E
COM, and E
EV denote the residential, industrial, commercial, and EV energy consumptions; and E
DSCD is the discarded energy of the HRES. To guarantee the energy balance of the microgrid, the energy demand from the main grid can be calculated from the following equation:
(1)
E
GRID
=
E
WD
+
E
PV
+
E
BM
+
E
C
&
D
-
E
RES
-
E
IND
-
E
COM
-
E
EV
-
E
DSCD
,
and E
GRID is zero when the microgrid is working on islanding mode.Figure 2
Logical setup of the management layer.


## 4.2. Agent-Based Modelling for the Component Layer

The agent modelling in HAIMA can be divided into two types, where HRES components are modelled as single, complete, static agents operating under the control of the management layer, and the load from residential, commercial, and industrial consumers as well as EVs is modelled as separated autonomous dynamic agents with unique statechart, electricity usage distribution, and so forth in order to utilize the advantages of ABM to generate a bottom-to-top electricity consumption phenomenon.


### 4.2.1. Modelling of HRES Generation Components

Wind Power System. Wind power is one of the most popular renewable energy sources in the microgrid whose power output at a specific site mainly depends on wind speed turbine characteristics. Typical hourly power output from a wind turbine can be calculated as
(2)
P
WD
(
t
)
=
{
0
,
V
(
t
)
≤
V
min
⁡
A
V
(
t
)
3
-
B
P
r
,
V
min
⁡
<
V
(
t
)
≤
V
r
P
r
,
V
r
<
V
(
t
)
≤
V
max
⁡
0
,
V
(
t
)
>
V
max
⁡
,
where P
r is the rated power, while V
min
⁡, V
max
⁡, and V
r are, respectively, the cut-in, cut-out, and rate speed of the wind turbine, V
t is the hourly average wind speed, and the factors A and B can be calculated as
(3)
A
=
P
r
V
r
3
-
V
max
⁡
3
,
B
=
V
min
⁡
V
r
3
-
V
min
⁡
3
.
Therefore the actual total power output from a wind energy system can be calculated by
(4)
P
WE
(
t
)
=
P
WD
(
t
)
A
WD
η
WD
,
where A
WD is the total turbine swept area of the wind energy system and the η
WD is the efficiency of the wind turbine generators and converters.Photovoltaic System. The hourly power output from the photovoltaic system with an area A
PV can be calculated by
(5)
P
PV
(
t
)
=
I
r
(
t
)
η
PV
A
PV
,
P
PV
(
t
)
≤
P
PV
max
⁡
,
where I
r
(
t
) is the total input solar radiation on unit area of the PV surface within an hour, and η
PV is the photovoltaic system efficiency.Biomass Power System. Biopower or biomass power utilizes biomass to generate electricity. With the development of biomass power technologies including direct-firing, cofiring, and gasification, biomass has provided a new option of renewable system for the microgrid. The power generated from direct-firing biomass power station can be calculated using
(6)
P
BM
(
t
)
=
η
BM
P
BM
r
(
t
)
,
P
BM
(
t
)
≤
P
BM
max
⁡
,
where P
BM
r
(
t
) is the rate power at time t and η
BM the biomass power generation efficiency.HRES Generation Statechart. The statechart of the proposed HRES generation devices can be illustrated in Figure 3. It contains four states that describes the main conditions of a renewable generator:(1)
power generating: the generator is generating power to the microgrid;
(2)
power discarding: the generated power is discarded;
(3)
shut down: the generator is stopped for regular maintenance;
(4)
failed: the generator is temporarily out of work and needs repairs.Figure 3
Statechart of the HRES generation devices.


### 4.2.2. Modelling of HRES Storage Components

Battery Storage System. In the HRES, battery storage is fundamental to alleviate the fluctuation of the renewable generations. And it is therefore sized to meet the load demand during the nonavailability period of the renewable energy source while absorbing the exceeded power generations in HRES. The state of charge (SOC) of the battery storage system can be calculated by
(7)
SOC
BS
(
t
)
=
E
BS
(
t
)
E
BS
r
×
100
%
,
where E
BS
r is the rated battery energy storage and the current stored energy E
BS
(
t
) can be derived from the following equation:
(8)
E
BS
(
t
)
=
E
BS
(
t
-
Δ
t
)
(
1
-
σ
BS
)
+
E
C
&
D
(
Δ
t
)
,
where σ
BS is the hourly self-discharge rate and E
C
&
D
(
Δ
t
) is the charged or discharged energy in time period Δ
t and can be calculated by
(9)
E
C
&
D
(
Δ
t
)
=
{
(
E
GE
(
Δ
t
)
-
E
L
(
Δ
t
)
)
η
Bc
,
E
GE
(
Δ
t
)
>
E
L
(
Δ
t
)
,
E
BS
(
Δ
t
)
≤
E
BS
r
×
u
BS
max
⁡
(
E
GE
(
Δ
t
)
-
E
L
(
Δ
t
)
)
η
Bd
,
E
GE
(
Δ
t
)
≤
E
L
(
Δ
t
)
,
E
BS
(
Δ
t
)
≥
E
BS
r
×
u
BS
min
⁡
0
,
else
,
where E
GE
(
Δ
t
) and E
L
(
Δ
t
) are the total generation and load of the microgrid system, while η
Bc and η
Bd are the recharging and discharging efficiency of the battery. E
C
&
D
(
Δ
t
) is subject to the battery maximum recharging and discharging constraints:
(10)
E
C
&
D
min
⁡
≤
E
C
&
D
(
Δ
t
)
≤
E
C
&
D
max
⁡
.The six states of the energy storage system are as follows, while the corresponding statecharts are illustrated in Figures4 and 5:(1)
recharging: the battery storage system is being recharged by the microgrid;
(2)
discharging: the battery storage system is discharging energy to the microgrid;
(3)
fully recharged: the maximum SOC of the battery storage system has been reached;
(4)
depleted: the minimum SOC of the battery storage system has been reached;
(5)
shut down: the battery storage system is stopped for regular maintenance;
(6)
failed: the battery storage system is temporarily out of work and needs repairs.Figure 4
Statechart of the HRES energy storage system.Figure 5
Distribution of the trip length.


### 4.2.3. Modelling of EVs in the Microgrid

As an active agent, the EV modelling in the microgrid should consider both the temporal and spatial aspects and the EVs’ behaviors. The main parameters impacting the EV energy requirement can be classified into three aspects: environment characters, driver characters, and EV characters. Environment characters include time, weather, climate, distribution of the EV-recharging and battery-changing station, and transportation conditions; driver characters include distributions of driving time and trip length; and EV characters include EV types, rated battery storage, recharging/discharging power, and efficiency. Given those characters, the SOC of the EV agent can be derived in the following equation:(11)
SOC
EV
(
t
)
=
E
EV
(
t
)
E
EV
r
×
100
%
=
E
EV
(
t
-
Δ
t
)
(
1
-
σ
EV
)
+
E
Charge
(
Δ
t
)
-
E
Discharge
(
Δ
t
)
E
EV
r
×
100
%
,
where the recharged energy E
Charge
(
Δ
t
) within time period Δ
t can be, respectively, calculated by the recharging power P
Charge
(
t
) in the following equation:
(12)
E
Charge
(
Δ
t
)
=
∫
0
Δ
t
κ
P
Charge
(
t
)
η
Charge
d
t
,
000
P
Charge
min
⁡
≤
P
Charge
(
t
)
≤
P
Charge
max
⁡
,
where variable κ is zero when EV is not plugged for recharging and is 1 when being recharged. And the total recharging load is
(13)
P
EV
(
t
)
=
∑
i
=
1
N
κ
P
Charge
i
(
t
)
,
P
Charge
i
min
⁡
≤
P
Charge
i
(
t
)
≤
P
Charge
i
max
⁡
.
When EVs are driving on the trips, the discharged energy from the battery within time period Δ
t
E
Discharge
(
Δ
t
) can be calculated with
(14)
E
Discharge
(
Δ
t
)
=
∫
0
Δ
t
ε
P
Discharge
(
v
(
t
)
)
d
t
,
00000000
0
≤
v
(
t
)
≤
v
max
⁡
,
where v
(
t
) is the EV velocity and variable ε is zero when EV is parked and is 1 when being driven for a trip. Besides, assuming the transition from ordinary internal-combustion engine vehicle to the electric vehicle will not apparently change the resident driving behaviors, the distribution of the trip length l in this model is derived from the latest National Household Travel Survey report (NHTS 2009) in the United States, as is shown in Figure 5.With the proposed key agent parameters, the EV agents’ behavior can be derived through a series of functions. And the main behavior influencing the microgrid is the EV refuelling decision between EV recharging and battery changing. And with plenty of EVSEs available at parking lots of office buildings as well as a residential area, an ideal decision process for EV drivers is shown in Figure6. The EVs finished tripping shall find whether there are available EVSEs to get a temporary refuelling, and when there are no available EVSEs while the EV battery is close to depleted, EVs shall go for the nearest ERS to get recharged and then wait for the next trip. Trip-unfinished EVs with nearly depleted batteries shall go to the nearest BCS and go on trips after the batteries have been changed.Figure 6
Decision process for EV driver.Based on the proposed agent's behavior, the EV agents’ states in the model can be described in the statechart as shown in Figure7:(1)
go tripping: the EV starts one trip of a day;
(2)
trip ending: the EV ends one trip of a day;
(3)
heading for BCS: the EV goes to the battery-changing station for refuelling;
(4)
heading for RS: the EV goes to the EV-recharging station for refuelling;
(5)
battery changing: the EV is under the service of battery changing;
(6)
recharging: the EV is under the recharging service;
(7)
standby: the EV ends all series of trips of a day;
(8)
failed: the EV encounters a breakdown and needs repairs.Figure 7
Statechart of the EV agent.


### 4.2.4. Modelling of the Original Microgrid Load

The original load of the microgrid is mainly formed by residential, commercial, and industrial load and is mainly influenced by characters including population, electrical appliance types, and energy consumption per capita. In HAIMA, with the preset population and proportion of the microgrid, static agents have been adopted to represent the residential houses, commercial and industrial buildings, and other electrical appliances. Apart from the recharging load from EVs, the massive introduction of HRES and EVs does not apparently impact the load distribution and power consumption of a certain area, and the original load curves from residential, commercial, and industrial load can be adopted to generate the original load agent.


## 4.2.1. Modelling of HRES Generation Components

Wind Power System. Wind power is one of the most popular renewable energy sources in the microgrid whose power output at a specific site mainly depends on wind speed turbine characteristics. Typical hourly power output from a wind turbine can be calculated as
(2)
P
WD
(
t
)
=
{
0
,
V
(
t
)
≤
V
min
⁡
A
V
(
t
)
3
-
B
P
r
,
V
min
⁡
<
V
(
t
)
≤
V
r
P
r
,
V
r
<
V
(
t
)
≤
V
max
⁡
0
,
V
(
t
)
>
V
max
⁡
,
where P
r is the rated power, while V
min
⁡, V
max
⁡, and V
r are, respectively, the cut-in, cut-out, and rate speed of the wind turbine, V
t is the hourly average wind speed, and the factors A and B can be calculated as
(3)
A
=
P
r
V
r
3
-
V
max
⁡
3
,
B
=
V
min
⁡
V
r
3
-
V
min
⁡
3
.
Therefore the actual total power output from a wind energy system can be calculated by
(4)
P
WE
(
t
)
=
P
WD
(
t
)
A
WD
η
WD
,
where A
WD is the total turbine swept area of the wind energy system and the η
WD is the efficiency of the wind turbine generators and converters.Photovoltaic System. The hourly power output from the photovoltaic system with an area A
PV can be calculated by
(5)
P
PV
(
t
)
=
I
r
(
t
)
η
PV
A
PV
,
P
PV
(
t
)
≤
P
PV
max
⁡
,
where I
r
(
t
) is the total input solar radiation on unit area of the PV surface within an hour, and η
PV is the photovoltaic system efficiency.Biomass Power System. Biopower or biomass power utilizes biomass to generate electricity. With the development of biomass power technologies including direct-firing, cofiring, and gasification, biomass has provided a new option of renewable system for the microgrid. The power generated from direct-firing biomass power station can be calculated using
(6)
P
BM
(
t
)
=
η
BM
P
BM
r
(
t
)
,
P
BM
(
t
)
≤
P
BM
max
⁡
,
where P
BM
r
(
t
) is the rate power at time t and η
BM the biomass power generation efficiency.HRES Generation Statechart. The statechart of the proposed HRES generation devices can be illustrated in Figure 3. It contains four states that describes the main conditions of a renewable generator:(1)
power generating: the generator is generating power to the microgrid;
(2)
power discarding: the generated power is discarded;
(3)
shut down: the generator is stopped for regular maintenance;
(4)
failed: the generator is temporarily out of work and needs repairs.Figure 3
Statechart of the HRES generation devices.


## 4.2.2. Modelling of HRES Storage Components

Battery Storage System. In the HRES, battery storage is fundamental to alleviate the fluctuation of the renewable generations. And it is therefore sized to meet the load demand during the nonavailability period of the renewable energy source while absorbing the exceeded power generations in HRES. The state of charge (SOC) of the battery storage system can be calculated by
(7)
SOC
BS
(
t
)
=
E
BS
(
t
)
E
BS
r
×
100
%
,
where E
BS
r is the rated battery energy storage and the current stored energy E
BS
(
t
) can be derived from the following equation:
(8)
E
BS
(
t
)
=
E
BS
(
t
-
Δ
t
)
(
1
-
σ
BS
)
+
E
C
&
D
(
Δ
t
)
,
where σ
BS is the hourly self-discharge rate and E
C
&
D
(
Δ
t
) is the charged or discharged energy in time period Δ
t and can be calculated by
(9)
E
C
&
D
(
Δ
t
)
=
{
(
E
GE
(
Δ
t
)
-
E
L
(
Δ
t
)
)
η
Bc
,
E
GE
(
Δ
t
)
>
E
L
(
Δ
t
)
,
E
BS
(
Δ
t
)
≤
E
BS
r
×
u
BS
max
⁡
(
E
GE
(
Δ
t
)
-
E
L
(
Δ
t
)
)
η
Bd
,
E
GE
(
Δ
t
)
≤
E
L
(
Δ
t
)
,
E
BS
(
Δ
t
)
≥
E
BS
r
×
u
BS
min
⁡
0
,
else
,
where E
GE
(
Δ
t
) and E
L
(
Δ
t
) are the total generation and load of the microgrid system, while η
Bc and η
Bd are the recharging and discharging efficiency of the battery. E
C
&
D
(
Δ
t
) is subject to the battery maximum recharging and discharging constraints:
(10)
E
C
&
D
min
⁡
≤
E
C
&
D
(
Δ
t
)
≤
E
C
&
D
max
⁡
.The six states of the energy storage system are as follows, while the corresponding statecharts are illustrated in Figures4 and 5:(1)
recharging: the battery storage system is being recharged by the microgrid;
(2)
discharging: the battery storage system is discharging energy to the microgrid;
(3)
fully recharged: the maximum SOC of the battery storage system has been reached;
(4)
depleted: the minimum SOC of the battery storage system has been reached;
(5)
shut down: the battery storage system is stopped for regular maintenance;
(6)
failed: the battery storage system is temporarily out of work and needs repairs.Figure 4
Statechart of the HRES energy storage system.Figure 5
Distribution of the trip length.


## 4.2.3. Modelling of EVs in the Microgrid

As an active agent, the EV modelling in the microgrid should consider both the temporal and spatial aspects and the EVs’ behaviors. The main parameters impacting the EV energy requirement can be classified into three aspects: environment characters, driver characters, and EV characters. Environment characters include time, weather, climate, distribution of the EV-recharging and battery-changing station, and transportation conditions; driver characters include distributions of driving time and trip length; and EV characters include EV types, rated battery storage, recharging/discharging power, and efficiency. Given those characters, the SOC of the EV agent can be derived in the following equation:(11)
SOC
EV
(
t
)
=
E
EV
(
t
)
E
EV
r
×
100
%
=
E
EV
(
t
-
Δ
t
)
(
1
-
σ
EV
)
+
E
Charge
(
Δ
t
)
-
E
Discharge
(
Δ
t
)
E
EV
r
×
100
%
,
where the recharged energy E
Charge
(
Δ
t
) within time period Δ
t can be, respectively, calculated by the recharging power P
Charge
(
t
) in the following equation:
(12)
E
Charge
(
Δ
t
)
=
∫
0
Δ
t
κ
P
Charge
(
t
)
η
Charge
d
t
,
000
P
Charge
min
⁡
≤
P
Charge
(
t
)
≤
P
Charge
max
⁡
,
where variable κ is zero when EV is not plugged for recharging and is 1 when being recharged. And the total recharging load is
(13)
P
EV
(
t
)
=
∑
i
=
1
N
κ
P
Charge
i
(
t
)
,
P
Charge
i
min
⁡
≤
P
Charge
i
(
t
)
≤
P
Charge
i
max
⁡
.
When EVs are driving on the trips, the discharged energy from the battery within time period Δ
t
E
Discharge
(
Δ
t
) can be calculated with
(14)
E
Discharge
(
Δ
t
)
=
∫
0
Δ
t
ε
P
Discharge
(
v
(
t
)
)
d
t
,
00000000
0
≤
v
(
t
)
≤
v
max
⁡
,
where v
(
t
) is the EV velocity and variable ε is zero when EV is parked and is 1 when being driven for a trip. Besides, assuming the transition from ordinary internal-combustion engine vehicle to the electric vehicle will not apparently change the resident driving behaviors, the distribution of the trip length l in this model is derived from the latest National Household Travel Survey report (NHTS 2009) in the United States, as is shown in Figure 5.With the proposed key agent parameters, the EV agents’ behavior can be derived through a series of functions. And the main behavior influencing the microgrid is the EV refuelling decision between EV recharging and battery changing. And with plenty of EVSEs available at parking lots of office buildings as well as a residential area, an ideal decision process for EV drivers is shown in Figure6. The EVs finished tripping shall find whether there are available EVSEs to get a temporary refuelling, and when there are no available EVSEs while the EV battery is close to depleted, EVs shall go for the nearest ERS to get recharged and then wait for the next trip. Trip-unfinished EVs with nearly depleted batteries shall go to the nearest BCS and go on trips after the batteries have been changed.Figure 6
Decision process for EV driver.Based on the proposed agent's behavior, the EV agents’ states in the model can be described in the statechart as shown in Figure7:(1)
go tripping: the EV starts one trip of a day;
(2)
trip ending: the EV ends one trip of a day;
(3)
heading for BCS: the EV goes to the battery-changing station for refuelling;
(4)
heading for RS: the EV goes to the EV-recharging station for refuelling;
(5)
battery changing: the EV is under the service of battery changing;
(6)
recharging: the EV is under the recharging service;
(7)
standby: the EV ends all series of trips of a day;
(8)
failed: the EV encounters a breakdown and needs repairs.Figure 7
Statechart of the EV agent.


## 4.2.4. Modelling of the Original Microgrid Load

The original load of the microgrid is mainly formed by residential, commercial, and industrial load and is mainly influenced by characters including population, electrical appliance types, and energy consumption per capita. In HAIMA, with the preset population and proportion of the microgrid, static agents have been adopted to represent the residential houses, commercial and industrial buildings, and other electrical appliances. Apart from the recharging load from EVs, the massive introduction of HRES and EVs does not apparently impact the load distribution and power consumption of a certain area, and the original load curves from residential, commercial, and industrial load can be adopted to generate the original load agent.


## 4.3. Discrete-Event Modelling for the Event Layer

DEM is proposed to model the inner operation in EV-recharging stations as well as battery-changing stations to capture the detailed refuel event of EVs. The service ability, congestion situation, can therefore be observed and further improved to raise EV customer service satisfaction. In HAIMA, EVs and their batteries are all passive entities that travel in the stations through a series of blocks representing processes of the recharging/battery-changing service sequence, as illustrated in Figure8, where the basic processes of the two sequences are waiting for service, applying for resources, being serviced, and departures. The service during time can be calculated, respectively, in
(15)
T
ERS
=
T
Wait
+
T
Charge
+
T
ExERS
,
(16)
T
BCS
=
T
Wait
+
T
Change
+
T
ExBCS
,
where the waiting time T
Wait is affected by the congestion conditions in the stations; the service time T
Charge is, respectively, affected by the EV SOC and recharging power; T
Change is due to battery-changing efficiency; and T
ExERS, T
ExBCS are the extra auxiliary services provided by the stations.Figure 8
Process of the EV agent in ERS and BCS.


## 4.4. Interactions between Layers

The interconnections and interactions are critical to the integrated operation of HAIMA. The communications between management layer and component layers are established in the model to transmit the data and control messages; therefore in component layer the component agents’ behaviors can be controlled and their key parameters can then feedback to update the flow variables in the SDM of the management layers, which enables HAIMA to simulate the monitoring of the grid bus and the real-time control of the HRES. The EV agent in the component layer also serves as triggers to the event layers. With the EV agent states changing, relative blocks of the DEM will trigger the corresponding process in response, and the entities process of the DEM shall in turn trigger the transitions of the relevant EV agent statechart. The synchronization is also important for the model and should be guaranteed through time triggers.


## 5. Comprehensive Simulation System for the Microgrid

In order to support systematically in-depth exploration of the microgrid operation and energy consumers’ behavior, the comprehensive simulation system is built which enables microgrid components to operate and interact with arbitrary virtual environments, enabling broader experimentation for the study of the HRESs and EVs in the microgrid.The main interface of the simulation system in HAIMA is implemented by the AnyLogic software. As the only simulation tools that support DEM, ABM, and SDM, AnyLogic’s object-oriented model design paradigm provides for modular, hierarchical, and incremental construction of large models [15]. In the simulation system of HAIMA, management layer is modelled with the SDM approach in AnyLogic, while agents of the component layer are implemented as JAVA objects, and the proposed agent behaviors, parameters, and statecharts can also be well constructed with AnyLogic provided functions, parameter widget, and the statechart pallet. Moreover, EVs agents in the simulation system are modelled dynamically on the microgrid traffic environment, which can help visualizing EV-caused emerging phenomenon such as traffic congestions in EV-recharging stations and battery-changing stations. To ensure the flexibility of the model, each component agent of the microgrid model is encapsulated to be independent active class object, and message ports as well as communication rules are also embedded on those objects to enable their interactions and communications among different agents and between different layers. The event layer is implemented by the AnyLogic Enterprise Library. The main process of the battery-changing station is shown in Figure 9, where upper blocks marked in italic notes denote the sequence of the translation vehicle for the depleted batteries and recharged new batteries, while the roman notes marked blocks below are the sequence of the EVs with depleted batteries.Figure 9
Main process of the battery-changing station.To make the system visual and interactive, many charts and graphics are adopted in the model. Animations including elementary graphical shapes as well as various types of indicators and graphs are developed to enable real-time illustration of the operation data in HAIMA. The user interaction is also considered in the simulation system. Interactive elements such as sliders, buttons, and text inputs are used to control the model's execution at run time, while the control panel and user interfaces of them are well designed. Moreover, the simulation system also prepares the open architecture and sockets for the database connection. This enables the real-time data exchange to the other software, databases, and microgrid utilities. With the advantages of AnyLogic to incorporate spatial data, GIS maps are used in HAIMA simulation system to generate the location of recharging stations and battery-changing stations.With the reusable active objects, visual interactive elements, and function to import database and GIS data, the constructed simulation system is visual, flexible, and extensible, and besides HAIMA model, the component-based design of the system allows it for the efficient creation of new case studies including centralized/decentralized control design, microgrid islanding mode, and dynamic power flow computing.


## 6. Computer Simulation and Analysis

The Monte Carlo simulation is carried out to verify the effectiveness of the proposed microgrid model and simulation system. The electricity grid load consults are from the real load of the Electric Reliability Council of Texas (ERCOT) [16]. ERCOT is an isolated electrical system that manages the flow of electric power to 23 million customers in Texas [17], while the latest residential electricity consumption is 37.6% [18]. Considering the large-scale EV data is not presently available, the paper reasonably assumes a microgrid with one-thirty-thousandth Texas population, that is, 2300 residents in Austin and TX, and with several industrial and commercial loads. The main information of HRES component and EV parameters used in the simulation is given in Table 1. The environment characters of Austin are acquired from the system advisor model (SAM) provided by the National Renewable Energy Laboratory (NREL), and the EV users' behavior is derived from the NHTS 2009.Table 1
HRES components and EV parameters in the microgrid.
HRES component
Type
Total number
Rate power
Wind turbine
Endurance E3120
10
50 kW
Photovoltaic panel
Sharp ND-62RU1
1000
1.1 kW
Battery storage
Hoppeche 600
1000
0.2 kW
Biomass generator
Grate stoker furnace
1
700 kW
Electric vehicle
Nissan LEAF
500
3.3 kWConsidering the reduction of the carbon emission, wind turbines and photovoltaic panels are firstly enabled to feed the energy consumptions, and extra generations can be absorbed by the unfulfilled battery storage system. The biomass generator is enabled only when the energy requirement of the load exceeds the outflow of the wind, photovoltaic, and battery storage systems. And the main grid shall supply insufficient energy when the total required energy goes beyond all the HRES generations in the microgrid.Firstly, assume the EVSEs have been fully adopted in the proposed microgrid, and EVs shall immediately be recharged once parked. Therefore the simulation of microgrid energy supply and consumption is shown in Figures10 and 11 based on the proposed parameters. Figure 10 indicates that wind and photovoltaic systems provide the most of the energy, the battery storage system, after recharged by the photovoltaic system at noon, and can supply the evening and night load with biomass systems, and the main grid only provides the exceeding energy at night peak. The energy consumption constitution in Figure 11 indicates that the recharging load conducts a severe grid fluctuation to the original load due to the convenient recharging facilities. The energy requirement caused by mass uncoordinated recharging activity significantly reshapes the original grid load power profile and enlarges the peak time as well as the peak value. And due to the battery storage system volume and power limitation, some generated energy by photovoltaic is discarded.Figure 10
HRES energy supply with 100% EVSE penetration.Figure 11
HRES energy consumption with 100% EVSE penetration.Then reduced the EVSE penetration ratio to be 60% and the corresponding simulation results are shown in Figures12 and 13. It can be comparably concluded that electricity grid with fewer EVSEs enjoys a relatively stable recharging load in peak hours, and fewer main grid energy supply is required. However the photovoltaic generated energy at noon is largely discarded, which indicates that the HRES battery storage system is insufficient and the photovoltaic generated energy exceeds the peak need of the microgrid. Further configuration optimization is in need with the simulation result of HAIMA.Figure 12
HRES energy supply with 60% EVSE penetration.Figure 13
HRES energy supply with 60% EVSE penetration.Besides, the recharging and battery-changing times in continuous 48 hours are shown in Table2. The large penetration of the EVSE shall reduce the need for battery-changing service but in turn significantly improves the recharging times and the energy consumption from the microgrid, causing enlarged PARs and reducing the independence of the microgrid. However, fewer EVSE penetration shall lead to the need of more battery-changing station, and a proper configuration of HRES is also in need.Table 2
Statistics of PEV traveling in the microgrid.
EVSE penetration
Total EVs
Simulation time
Recharging times
Battery-changing times
100%
1700
48 h
4820
10
60%
1700
48 h
1950
110


## 7. Conclusion

Multiple modelling approaches have been developed in the research of the microgrid with EVs and HRESs, and by integrating them this paper proposes the hybrid agent-based integrated modelling methodology while developing a comprehensive simulation system. A hierarchical microgrid structure is proposed and with the integration of ABM, DEM, and SDM, the modelling methodology for each layer is proposed. Furthermore, based on the integrated modelling methodology, a visual, flexible, and extensible microgrid simulation system is designed to verify its effectiveness. The simulation examples indicate that the proposed model can well reflect the energy generation and consumptions in the microgrid, and HRES configuration defects, EV facility utilization, and the impact of EVs recharging load in a different time and penetrations can be reflected in detail. With the establishment of the proposed HAIMA and combining with the actual grid data and latest travel information, the impact of various parameters imported by the energy policy, scheduling management, weather and climate, population, and personal behaviors can be tested in risk-free space at a very low cost, which will help to strategize the microgrid management, HRES optimized configuration, and EVs optimized scheduling as well as refuel facility construction.



---

*Source: 808549-2014-04-09.xml*