1 Introduction

With recent concerns about environmental protection and energy conservation, the development of electric vehicle (EV) technology has been accelerated to fulfill these needs [13]. Chinese government has released a series of policies and incentives to promote the development of plug-in hybrid electric vehicles (PHEVs). The national plan of “ten cities & thousands units” was initiated in 2009. This plan mainly promotes the application of PHEVs in public buses, taxies, official cars and vehicles for public services. So far, there are 25 cities included in this plan. PHEV can be utilized as an electricity consumer or electricity supplier [4, 5]. One of the promising integration mechanisms is the implementation of interaction between renewable energy sources and EVs (including PHEVs). In [6], three-way interaction between PV, PHEVs and the grid ensures optimal usage of available power, charging time and grid stability. In [7], the impacts of integrating PV power into future electricity system with electric vehicles under smart control strategies are evaluated. The electric Tuk-tuk battery charging station is powered by renewable energy source such as wind or photovoltaic (PV) used as stand alone or in hybrid configuration with battery storage system in [8]. In [9], a probabilistic constrained load flow problem is formulated and electric vehicle charging/ discharging state is modeled using queuing theory. The effects of different EV charging strategies on the balance between wind power production and consumption in a future Danish power system are investigated in [10]. In [11], the impact of plug-in hybrid electric vehicles on power systems with demand response and wind power is evaluated. A short review of economic dispatch in presence of PHEVs is given in [12]. In [13], employed as decentralized storage, batteries of EVs can be used for a microgrid’s power supply and provide ancillary services. A seductive solution to implement a centralized stabilization system in the dc microgrid is introduced in [14]. In [15], three coordinated wind-PEV energy dispatching approaches in vehicle-to-grid (V2G) context are exploited, aiming to promote the user demand response through optimizing the utilization efficiency of wind power generation as well as meeting the dynamic power demands. In [16], an electricity and heat generation scheduling method coordinated with PEV charging in an IMG considering photovoltaic (PV) generation systems coupled with PV storages is presented. In [17], the possibility of smoothing out the load variance in a household microgrid by regulating the charging patterns of family PHEVs is investigated. In [18], the charging of plug-in hybrid electric vehicles (PHEVs) in an existing office building microgrid equipped with a photovoltaic (PV) system and a combined heat and power (CHP) unit is discussed. In [19], an optimization model is proposed to manage a residential microgrid including a charging spot with a vehicle-to-grid system and renewable energy sources. In [20], the regional energy management and optimized operating strategies of electric vehicles (EVs) and battery swapping station (BSS) are proposed based on smart microgrid according to the effects of the utility grid caused by uncoordinated charging of EVs and BSS. Most of the existing works have not taken into account the friendly two-way interaction between plug-in hybrid electric vehicles and microgrid (MG). The general aim of this research is to gain an in-depth understanding of the impact of different charging and discharging modes on microgrid economic operation. In the microgrid, PHEV charging facilities will have multiple energy sources including distributed generation (DG) and energy storage system (ESS). An optimized interface that links these energy sources and loads is consequently needed. The tasks of this interface are to optimize the energy flow between different sources and loads, and to minimize the total energy consumption of the microgrid.

This paper analyzes the integration of plug-in electric vehicle battery packs into smart energy management system (SEMS) of an office building. It aims to be a first step towards understanding the combined economic value of the friendly two-way interaction for the vehicle owner and an office building microgrid. This paper is organized as follows. Section 2 describes the various factors that should be considered when analyzing the allocation and operation of the PHEVs in MGs. Section 3 describes the microgrid economic scheduling model with electric vehicle integration. In order to evaluate the economic performance of PHEV in MGs, some cost parameters are given such as capital cost, operation and maintenance costs, fuel costs, startup costs, and energy purchase costs, including the objective function and constraints. Section 4 gives the characteristics of the genetic algorithm for microgrid economic scheduling. In Section 5, Results and discussion are given for a low-voltage DC microgrid with PHEVs integration. Conclusions are given in Section 6.

2 Charge and discharge characteristics of PHEVs

The modeling of PHEV charging and discharging characteristics is the basis of the PHEV’s energy management as well as charge and discharge control. The main factors involved in electric vehicle charging and discharging characteristics modeling include: 1) the battery characteristics of electric vehicles; 2) the operation characteristics of electric vehicles; 3) electric vehicle charging and discharging modes.

2.1 Battery characteristics of PHEVs

Many factors contribute to the cycle life of a PHEV battery. These include depth of discharge, discharge rate, ambient temperature, charging regime, battery maintenance procedures, etc. Lithium-ion seems an ideal material for a battery [21]. All time stages used here are set to be one hour. Energy stored in the PHEV is expressed as follows.

$$\left\{ \begin{gathered} \frac{{P_{{k,t}}^{{{\text{PHEV}}}} \Delta t}}{{\eta _{{Dk}} }} \le E_{{Dk}}^{{{\text{PHEV}}}} {\text{ }}\quad P_{{k,t}}^{{{\text{PHEV}}}} \ge 0 \hfill \\ \eta _{{Ck}} \left| {P_{{k,t}}^{{{\text{PHEV}}}} } \right|\Delta t \le E_{{Ck}}^{{{\text{PHEV}}}} {\text{ }}\quad P_{{k,t}}^{{{\text{PHEV}}}} < 0 \hfill \\ \end{gathered} \right.$$
(1)

where \( E_{Ck}^{\text{PHEV}} \) is the maximum charge energy for PHEV k in one hour; \( E_{Dk}^{\text{PHEV}} \) is the maximum discharge energy for PHEV k in one hour; \( P_{k,t}^{\text{PHEV}} \) is the power production of PHEV k at hour t; \( \eta_{Ck} \) is the charging efficiency for PHEV k; \( \eta_{Dk} \) is the discharging efficiency for PHEV k.

2.2 Operation characteristics of PHEVs

The development of PHEVs in China will mainly focus on electric buses, taxies, official cars and private cars [22]. This paper focuses on smart management of electric vehicles in the office areas with renewable energy resources, thus the involved electric vehicles include official vehicles and private cars.

In general, the official electric vehicles are requested to park in the working places during the night time. Hence, the charging/discharging time is assumed to start after work from 18:00 to 7:00. For the uncertainty of the battery state of charge (SOC), Monte Carlo simulation is used to obtain an initial value of SOC of PHEV battery. The SOC of PHEV battery is considered as follows.

$$ S_{k,t}^{\text{PHEV}} = u_{k,t}^{\text{PHEV}} + \lambda_{k,t}^{\text{PHEV}} \sigma_{k,t}^{\text{PHEV}} $$
(2)

where \( S_{k,t}^{\text{PHEV}} \) is the SOC of PHEV battery; \( u_{k,t}^{\text{PHEV}} \) and \( \sigma_{k,t}^{\text{PHEV}} \) are the forecasted value of SOC at hour t and its standard deviation for PHEV k, respectively; \( \lambda_{k,t}^{\text{PHEV}} \) is a normal probability density function with a mean of zero and a standard deviation of 1.

Correspondingly, the charging/discharging time slots the private PHEVs are assumed at 8:00–17:00.

2.3 PHEV charging and discharging modes

The three charging modes are expressed as follows.

  1. 1)

    Uncontrolled charging mode. In this mode, the PHEV begins charging as soon as it arrives at the parking lot, and stops when the battery of the PHEV is fully charged.

  2. 2)

    Delayed charging mode. In this mode, the low-cost off-peak energy is used to PHEV charging by delaying initiation of PHEV charging. Different from the uncontrolled charging mode, this mode takes into account the time-of-use (TOU) price difference.

  3. 3)

    Smart charging and discharging mode. For the charging and discharging of the PHEV, the smart energy management system (SEMS) is used. As the output energy of renewable energy sources is intermittent and unpredictable [23], a neural network (NN) is incorporated to forecast the power output of a photovoltaic (PV) system in SEMS. The output of neural network is used to define the minimum/maximum power limits of PV system in the scheduling. The SEMS of the microgrid cooperates with the grid, to control the charging and discharging pattern of the PHEVs. The renewable energy is used as the primary energy supply to meet the load demands. The PHEV system serves as a generation/storage device for providing both energy and capacity to the microgrid to enhance the power supply sufficiency.

3 Microgrid economic operation model

3.1 System description

Figure 1 shows the configuration of the microgrid with PHEV integration in this paper.

Fig. 1
figure 1

Overall configuration of microgrid with PHEV integration

A microgrid can operate in stand-alone mode or in grid-connected mode [24, 25]. In the former mode, the microgrid is separated from the upstream distribution grid and the microgrid aims to serve the total demands by using its local production. In the later mode, the microgrid participates in the open market, probably via an aggregator or similar energy service provider.

In this paper, it is assumed that the system works in grid-connected mode. In order to get rational simulation results, a set of assumptions about microgrid and PHEV system are given as follows.

  1. 1)

    The microgrid is an office block and the plug-in hybrid vehicles in the parking lot are available.

  2. 2)

    All the PHEVs have the same batteries and the energy losses in the batteries are ignored. The charging and discharging power of the PHEV is controllable in smart charging and discharging mode.

  3. 3)

    PHEV owners are independent of any other PHEV owners, and the charging/discharging time meets the owners’ habits.

3.2 Objective function

It was found that a conflict of interest exists regarding the optimal state of charge curve during the day. On the one hand, consumers do not want optimal charging to interfere with their daily driving profile. It is therefore in their interest to charge the vehicle as fast as possible. On the other hand, consumers also want to maximize their profits by purchasing energy at the lowest possible price and selling the maximal amount of regulation services. Both objectives should be weighted and considered in a control algorithm. It is the purpose of this paper to suggest possible system architecture for smart charging and discharging, and to formulate the objective of the microgrid economic scheduling model with electric vehicle integration. The objective function of economic scheduling model is dependent on a number of factors. The bids of the DG and ESS units are described as follows.

$$ B_{i,t}^{\text{DG}} = C_{{{\text{cap}}i}}^{\text{DG}} + C_{{{\text{om}}i}}^{\text{DG}} + C_{Fi,t}^{\text{DG}} $$
(3)
$$ B_{j}^{\text{ESS}} = C_{Pj}^{\text{ESS}} + C_{Ej}^{\text{ESS}} + C_{{{\text{om}}j}}^{\text{ESS}} $$
(4)

where \( B_{i,t}^{\text{DG}} \) is bid of DG unit i at hour t; \( B_{j}^{\text{ESS}} \) is bid of the ESS unit; \( C_{{{\text{cap}}i}}^{\text{DG}} \) is the capital cost of DG unit i; \( C_{{{\text{om}}i}}^{\text{DG}} \) is the operation and maintenance cost of DG unit i; \( C_{Fi,t}^{DG} \) is the fuel price of DG unit i at hour t; \( C_{Pj}^{\text{ESS}} \)is the capital cost for power capacity of ESS unit j; \( C_{{{\text{om}}j}}^{\text{ESS}} \) is the operation and maintenance cost of ESS unit j; \( C_{Ej}^{\text{ESS}} \)is the capital cost for energy capacity of ESS unit j.

Similar to the SOC of the battery, the bid of the grid is considered as follows.

$$ B_{t}^{\text{Grid}} = C_{{{\text{f}},t}}^{\text{Grid}} + \lambda_{t}^{\text{Grid}} \sigma_{t}^{\text{Grid}} $$
(5)

where \( B_{t}^{\text{Grid}} \) is the bid of the grid at hour t; \( C_{{{\text{f}},t}}^{\text{Grid}} \) and \( \sigma_{t}^{\text{Grid}} \) are the forecasted energy price of the grid at hour t and its standard deviation, respectively; \( \lambda_{t}^{\text{Grid}} \) is a random variable generated for energy price.

The total costs of a microgrid without PHEV integration within a period of one day is expressed as

$$ C_{Dc0}^{M} = \sum\limits_{i = 1}^{L} {\sum\limits_{t = 1}^{24} {B_{i,t}^{\text{DG}} P_{i,t}^{\text{DG}} } } + \sum\limits_{j = 1}^{M} {\sum\limits_{t = 1}^{24} {B_{j}^{\text{ESS}} P_{j,t}^{\text{ESS}} } } + C_{Ds}^{\text{DG}} - C_{De}^{\text{Grid}} $$
(6)
$$ C_{Ds}^{\text{DG}} = \sum\limits_{i = 1}^{L} {C_{si}^{\text{DG}} N_{i}^{\text{DG}} } $$
(7)
$$C_{{De}}^{{{\text{Grid}}}} = \left\{ \begin{gathered} \sum\limits_{{t = 1}}^{{24}} {B_{t}^{{{\text{Grid}}}} P_{t}^{{{\text{Grid}}}} \quad \quad \quad \quad \,\,\,\,\,\sum\limits_{{t = 1}}^{{24}} {B_{t}^{{{\text{Grid}}}} P_{t}^{{{\text{Grid}}}} < 0} } \hfill \\ (1 - S_{{{\text{tax}}}} )\sum\limits_{{t = 1}}^{{24}} {B_{t}^{{{\text{Grid}}}} P_{t}^{{{\text{Grid}}}} \quad {\text{ }}\sum\limits_{{t = 1}}^{{24}} {B_{t}^{{{\text{Grid}}}} P_{t}^{{{\text{Grid}}}} \ge 0} } \hfill \\ \end{gathered} \right.$$
(8)

where \( C_{Dci}^{M} \) is the daily total cost of the microgrid in the i th mode; \( C_{Ds}^{\text{DG}} \) is the daily total startup cost of the DG units; \( C_{De}^{\text{Grid}} \) is the daily benefit of energy exchanged with the grid; \( C_{si}^{\text{DG}} \) is the startup cost of i th DG; L is the number of DG units; M is the number of ESS units; \( N_{i}^{\text{DG}} \) is the number of startup for i th DG over the specific study period; \( P_{i,t}^{\text{DG}} \) is power production of the i th DG unit at hour t; \( P_{j,t}^{\text{ESS}} \) is power production of the j th ESS unit at hour t; \( P_{t}^{\text{Grid}} \) is power bought or sold from/to the utility at hour t; \( S_{\text{tax}} \) is the tax rate and is assumed to 10%.

According to the first mode, consumers do not want optimal charging to interfere with their daily driving profile. It is assumed that the PHEVs are charged via utility purchases according to the bid of the grid, and all the PHEVs are charged when they are at parking lot. The sum of microgrid total costs and PHEVs charging cost in the first mode is expressed as

$$ C_{Dc1}^{M} = C_{Dc0}^{M} + \sum\limits_{k = 1}^{S} {\sum\limits_{t = 1}^{24} {P_{1k,t}^{\text{PHEV}} } } B_{t}^{\text{Grid}} $$
(9)

where \( P_{1k,t}^{\text{PHEV}} \) is charging power of k th PHEV at hour t in the first mode; S is the number of PHEVs.

When the power generation in the microgrid is optimized considering PHEV integration, the charging demand of PHEV is treated as an additional load for the microgrid. And the sum of microgrid total costs and PHEVs charging cost in the first mode is expressed as

$$ C_{Dc1*}^{M} = \sum\limits_{i = 1}^{L} {\sum\limits_{t = 1}^{24} {B_{i,t}^{\text{DG}} P_{i,t}^{\text{DG1*}} } } + \sum\limits_{j = 1}^{M} {\sum\limits_{t = 1}^{24} {B_{j}^{\text{ESS}} P_{j,t}^{\text{ESS1*}} } } + C_{Ds1*}^{\text{DG}} - C_{De1*}^{\text{Grid}} $$
(10)
$$ C_{Ds1*}^{\text{DG}} = \sum\limits_{i = 1}^{L} {C_{si}^{\text{DG}} N_{i}^{\text{DG1*}} } $$
(11)
$$C_{De1*}^{\text{Grid}} = \left\{ \begin{array} {ll} \sum\limits_{t = 1}^{24} {B_{t}^{\text{Grid}} P_{t}^{\text{Grid1*}} \quad \quad \quad \quad \,\,\,\,\,\,\,\,\sum\limits_{t = 1}^{24} {B_{t}^{\text{Grid}} P_{t}^{\text{Grid1*}} < 0} } \hfill \\ (1 - S_{\text{tax}} )\sum\limits_{t = 1}^{24} {B_{t}^{\text{Grid}} P_{t}^{\text{Grid1*}} \quad \sum\limits_{t = 1}^{24} {B_{t}^{\text{Grid}} P_{t}^{\text{Grid1*}} \ge 0} } \hfill \\ \end{array} \right.$$
(12)

where \( C_{Dc1*}^{M} \), \( C_{Ds1*}^{\text{DG}} \), \( C_{De1*}^{\text{Grid}} \), \( P_{i,t}^{\text{DG1*}} \), \( P_{j,t}^{\text{ESS1*}} \), \( P_{i,t}^{\text{Grid1*}} \) and \( N_{i}^{\text{DG1*}} \) are the adjusted values considering PHEVs integration in Mode 1.

In the second mode, all the PHEVs are charged during off-peak hours. When the PHEVs are charged via utility purchases according to the bid of the grid, the sum of microgrid total costs and PHEVs charging cost in the second mode is expressed as

$$ C_{Dc2}^{M} = C_{Dc0}^{M} + \sum\limits_{k = 1}^{S} {\sum\limits_{t = 1}^{24} {P_{2k,t}^{\text{PHEV}} } } B_{t}^{\text{Grid}} $$
(13)

where \( P_{2k,t}^{\text{PHEV}} \) is charging power of k th PHEV at hour t in Mode 2.

When the power generation of the energy suppliers in the microgrid is optimized considering PHEV integration, the charging demand of PHEV is also treated as an additional load for the microgrid. Unlike the first mode, the charging demand of PHEV is added to the load of the microgrid during off-peak hours. The sum of microgrid total costs and PHEVs charging cost in the second mode is expressed as

$$ C_{Dc2*}^{M} = \sum\limits_{i = 1}^{L} {\sum\limits_{t = 1}^{24} {B_{i,t}^{\text{DG}} P_{i,t}^{\text{DG2*}} } } + \sum\limits_{j = 1}^{M} {\sum\limits_{t = 1}^{24} {B_{j}^{\text{ESS}} P_{j,t}^{\text{ESS2*}} } } + C_{Ds2*}^{\text{DG}} - C_{De2*}^{\text{Grid}} $$
(14)

where \( C_{Dc2*}^{M} \), \( C_{Ds2*}^{\text{DG}} \), \( C_{De2*}^{\text{Grid}} \), \( P_{i,t}^{\text{DG2*}} \) and \( P_{j,t}^{\text{ESS2*}} \) are the adjusted values considering PHEVs integration in Mode 1.

Contrary to the previous two modes, the battery of PHEV in the third mode can be controlled as an energy storage system to reduce the daily total costs by storing low-price energy during light-load periods and then delivering it during peak-load ones. Therefore, the power generation of the energy supplier of the microgrid and the battery of PHEV will be economically optimized, and the sum of microgrid total costs and PHEVs charging cost within a period of one day is expressed as

$$ C_{Dc3}^{M} = \sum\limits_{i = 1}^{L} {\sum\limits_{t = 1}^{24} {B_{i,t}^{\text{DG}} P_{i,t}^{\text{DG3}} } } + \sum\limits_{j = 1}^{M} {\sum\limits_{t = 1}^{24} {B_{j}^{\text{ESS}} P_{j,t}^{\text{ESS3}} } } + C_{Ds3}^{\text{DG}} - C_{De3}^{\text{Grid}} + C_{\text{cycle}}^{\text{PHEV}} $$
(15)

where \( C_{Dc3}^{M} \), \( C_{Ds3}^{\text{DG}} \), \( C_{De3}^{\text{Grid}} \), \( P_{i,t}^{\text{DG3}} \) and \( P_{j,t}^{\text{ESS3}} \) are the adjusted values considering PHEVs integration in the third mode; \( C_{\text{cycle}}^{\text{PHEV}} \) is penalty cost for additional charge and discharge cycles.

Since the number of charge and discharge cycles the battery affects battery life, Eqs. (16)–(19) are used to define the violation value of charge and discharge cycles for PHEVs.

$$ C_{\text{cycle}}^{\text{PHEV}} = \sum\limits_{k = 1}^{S} {N_{k}^{\text{PHEV}} } C_{Pk}^{\text{PHEV}} $$
(16)
$$\left\{ {\begin{array}{*{20}l} {u_{{k,t}}^{{{\text{PHEV}}}} {{ = 1}}} \hfill & \quad{{\text{E}}_{{k,t}}^{{{\text{PHEV}}}} > 0} \hfill \\ {u_{{k,t}}^{{{\text{PHEV}}}} {{ = 0}}} \hfill & \quad{{\text{E}}_{{k,t}}^{{{\text{PHEV}}}} = 0} \hfill \\ {u_{{k,t}}^{{{\text{PHEV}}}} {{ = -1}}} \hfill & \quad{{\text{E}}_{{k,t}}^{{{\text{PHEV}}}} < 0} \hfill \\ \end{array} } \right.$$
(17)
$$\left\{ \begin{aligned} E_{k,t}^{\text{PHEV}} = P_{k,t}^{\text{PHEV}} \Delta t/\eta_{Dk} \quad \quad P_{k,t}^{\text{PHEV}} \ge 0 \hfill \\ E_{k,t}^{\text{PHEV}} = \eta_{Ck} P_{k,t}^{\text{PHEV}} \Delta t \quad \quad P_{k,t}^{\text{PHEV}} < 0 \hfill \\ \end{aligned} \right.$$
(18)
$$ N_{k}^{\text{PHEV}} = f(u_{k,1}^{\text{PHEV}} ,u_{k,1}^{\text{PHEV}} ,\cdot\cdot\cdot,u_{{k,t_{\text{end}} - 1}}^{\text{PHEV}} ,u_{{k,t_{\text{end}} }}^{\text{PHEV}} ) $$
(19)

where \( C_{Pk}^{\text{PHEV}} \) is penalty cost for an additional cycle of k th PHEV; \( N_{k}^{\text{PHEV}} \) is the number of battery cycles for k th PHEV during the optimization period; \( E_{k,t}^{\text{PHEV}} \) is charging energy of k th PHEV at hour t; \( u_{k,t}^{\text{PHEV}} \) are binary variables expressing the charging status of k th PHEV.

3.3 Constraints

The constraints imposed on the optimizations are

$$\sum\limits_{i = 1}^{L} {P_{i,t}^{\text{DG}} + \sum\limits_{j = 1}^{M} {P_{j,t}^{\text{ESS}} } + \sum\limits_{k = 1}^{S} {P_{k,t}^{\text{PHEV}} } + P_{t}^{\text{Grid}} }\,=\, D_{t}^{\text{Load}}$$
(20)
$$ P_{i}^{\hbox{min} } \le P_{i,t} \le P_{i}^{\hbox{max} } $$
(21)

where \( D_{t}^{\text{Load}} \) is load demand at hour; \( P_{i,t} \) is power production of the i th unit, including the DG units, the ESS units, the PHEV units and the grid; \( P_{i}^{\hbox{min} } \) is the minimum power of unit t; \( P_{i}^{\hbox{max} } \) is the maximum power of unit t.

For the k th PHEV, the minimum/maximum power limits should satisfy

$$ \left\{ \begin{aligned} P_{k,t,\hbox{max} }^{\text{PHEV}} \le \eta_{Dk} E_{Dk}^{\text{PHEV}} /\Delta t \quad P_{k,t}^{\text{PHEV}} \ge 0 \hfill \\ P_{k,t,\hbox{min} }^{\text{PHEV}} \ge {-E}_{Ck}^{\text{PHEV}} /(\eta_{Ck} \Delta t) \quad P_{k,t}^{\text{PHEV}} < 0 \hfill \\ \end{aligned} \right. $$
(22)
$$ \left\{ \begin{aligned} Q_{k,t + 1}^{\text{PHEV}} = Q_{k,t}^{\text{PHEV}} - E_{k,t}^{\text{PHEV}} \hfill \\ Q_{k,\hbox{min} }^{\text{PHEV}} \le Q_{k,t}^{\text{PHEV}} \le Q_{k,\hbox{max} }^{\text{PHEV}} \hfill \\ Q_{{k,{\text{final}}}}^{\text{PHEV}} \le Q_{{i,t_{\text{final}} }}^{\text{PHEV}} \le Q_{k,\hbox{max} }^{\text{PHEV}} \hfill \\ \end{aligned} \right. $$
(23)

where \( P_{k,t,\hbox{max} }^{\text{PHEV}} \) is the maximum power of k th PHEV at hour t; \( P_{k,t,\hbox{min} }^{\text{PHEV}} \) is the minimum power of k th PHEV at hour t; \( Q_{k,t}^{\text{PHEV}} \) is aggregated capacity of j th ESS unit at hour t; \( Q_{k,\hbox{min} }^{\text{PHEV}} \) is the minimum capacity of j th ESS unit; \( Q_{{k,{ \hbox{max} }}}^{\text{PHEV}} \) is energy capacity of j th ESS unit; \( Q_{{k , {\text{final}}}}^{\text{PHEV}} \) is the final capacity of j th ESS unit at the ending time.

Therefore, the minimum/maximum power limits should also satisfy

$$ \left\{ \begin{array} {ll} P_{k,t,\hbox{max} }^{\text{PHEV}} \le \eta_{Dk} (Q_{k,t}^{\text{PHEV}} - Q_{k,\hbox{min} }^{\text{PHEV}} )/\Delta t \quad P_{k,t}^{\text{PHEV}} \ge 0 \hfill \\ P_{k,t,\hbox{min} }^{\text{PHEV}} \ge (Q_{k,\hbox{max} }^{\text{PHEV}} - Q_{k,t}^{\text{PHEV}} )/(\eta_{Ck} \Delta t) \quad P_{k,t}^{\text{PHEV}} < 0 \hfill \\ \end{array} \right. $$
(24)

Assume \( P_{{k,t_{\text{final}} }}^{\text{PHEV}} \) is the power output of the k th PHEV in the final hour,

$$\left\{ \begin{array} {ll} P_{{k,t_{\text{final}} ,\hbox{max} }}^{\text{PHEV}} \le \eta_{Dk} (Q_{{k,t_{\text{final}} }}^{\text{PHEV}} - Q_{{k,{\text{final}}}}^{\text{PHEV}} )/\Delta t \quad P_{{k,t_{\text{final}} }}^{\text{PHEV}} \ge 0 \hfill \\ P_{{k,t_{\text{final}} ,\hbox{min} }}^{\text{PHEV}} \ge (Q_{{k,t_{\text{final}} }}^{\text{PHEV}} - Q_{k,\hbox{max} }^{\text{PHEV}} )/(\eta_{Ck} \Delta t) \quad P_{{k,t_{\text{final}} }}^{\text{PHEV}} < 0 \hfill \\ \end{array} \right.$$
(25)

Especially, the minimum/maximum power limits should satisfy (22), (24) and (25) simultaneously.

4 Implementation of microgrid economic operation

Genetic algorithm (GA) is applied to implement microgrid economic scheduling with PHEVs integration.

4.1 Coding

The solution of economic scheduling in the microgrid is represented by a real number matrix.

$$ G_{k} = \left[ {\begin{array}{*{20}c} {P_{1,1} } & {P_{1,2} } & \cdots & {P_{1,t} } & \cdots & {P_{1,T} } \\ {P_{2,1} } & {P_{2,2} } & \cdots & {P_{2,t} } & \cdots & {P_{2,T} } \\ \vdots & \vdots & \cdots & \vdots & \cdots & \vdots \\ {P_{i,1} } & {P_{i,2} } & \cdots & {P_{i,t} } & \cdots & {P_{i,T} } \\ \vdots & \vdots & \cdots & \vdots & \cdots & \vdots \\ {P_{N,1} } & {P_{N,2} } & \cdots & {P_{N,t} } & \cdots & {P_{N,T} } \\ \end{array} } \right] = \;\left[ {\begin{array}{*{20}c} {P_{1,1}^{\text{DG}} } & {P_{1,2}^{\text{DG}} } & \cdots & {P_{1,t}^{\text{DG}} } & \cdots & {P_{1,T}^{\text{DG}} } \\ \vdots & \vdots & \cdots & \vdots & \cdots & \vdots \\ {P_{L,1}^{\text{DG}} } & {P_{L,2}^{\text{DG}} } & \cdots & {P_{L,t}^{\text{DG}} } & \cdots & {P_{L,T}^{\text{DG}} } \\ {P_{1,1}^{\text{ESS}} } & {P_{1,2}^{\text{ESS}} } & \cdots & {P_{1,t}^{\text{ESS}} } & \cdots & {P_{1,T}^{\text{ESS}} } \\ \vdots & \vdots & \cdots & \vdots & \cdots & \vdots \\ {P_{M,1}^{\text{ESS}} } & {P_{M,2}^{\text{ESS}} } & \cdots & {P_{M,t}^{\text{ESS}} } & \cdots & {P_{M,T}^{\text{ESS}} } \\ {P_{1,1}^{\text{PHEV}} } & {P_{1,2}^{\text{PHEV}} } & \cdots & {P_{1,t}^{\text{PHEV}} } & \cdots & {P_{1,T}^{\text{PHEV}} } \\ \vdots & \vdots & \cdots & \vdots & \cdots & \vdots \\ {P_{S,1}^{\text{PHEV}} } & {P_{S,2}^{\text{PHEV}} } & \cdots & {P_{S,t}^{\text{PHEV}} } & \cdots & {P_{S,T}^{\text{PHEV}} } \\ {P_{1}^{\text{Grid}} } & {P_{2}^{\text{Grid}} } & \cdots & {P_{t}^{\text{Grid}} } & \cdots & {P_{T}^{\text{Grid}} } \\ \end{array} } \right] $$
(26)

where \( N = L + M + S + 1 \); \( G_{k} \) is the k th individual of genetic populations; N is the number of total units.

In order to satisfy system power balance constraint, the initial group is generated according to [26].

4.2 Individual adjustment

(1) In order to satisfy unit generation output limits, \( P_{i,t}^{\text{DG}} \) is adjusted as follows.

$$ P_{{i,t}}^{{{\text{DG*}}}} = \left\{ \begin{array}{ll} P_{i}^{{\max }} & P_{{i,t}}^{{{\text{DG}}}} > P_{i}^{{\max }} \hfill \\ P_{{i,t}}^{{{\text{DG}}}} & P_{i}^{{\min }} < P_{{i,t}}^{{{\text{DG}}}} < P_{i}^{{\max }} \hfill \\ P_{i}^{{\min }} & \lambda P_{i}^{{\min }} < P_{{i,t}}^{{{\text{DG}}}} < P_{i}^{{\min }} \hfill \\ 0 & {\text{else}} \hfill \\ \end{array} \right. $$
(27)

where \( P_{i,t}^{\text{DG*}} \) is the adjusted value; λ is taken to 0.6 in this paper.

(2) In order to satisfy minimum/maximum power limits, \( P_{k,t}^{\text{PHEV}} \) is adjusted as follows.

$$ P_{k,t}^{\text{PHEV*}} = \left\{ \begin{array}{ll} P_{k,t,\hbox{max} }^{\text{PHEV}} & P_{k,t}^{\text{PHEV}} > P_{k,t,\hbox{max} }^{\text{PHEV}} \hfill \\ P_{k,t}^{\text{PHEV}} & P_{k,t,\hbox{min} }^{\text{PHEV}} < P_{k,t}^{\text{PHEV}} < P_{k,t,\hbox{max} }^{\text{PHEV}} \hfill \\ P_{k,t,\hbox{min} }^{\text{PHEV}} & P_{k,t}^{\text{PHEV}} < P_{k,t,\hbox{min} }^{\text{PHEV}} \hfill \\ \end{array} \right. $$
(28)

where \( P_{k,t}^{\text{PHEV*}} \) is the adjusted value.

(3) In order to satisfy minimum/maximum power limits, \( P_{t}^{\text{Grid}} \) is adjusted as follows.

$$ P_{t}^{\text{Grid*}} = \left\{ \begin{array}{ll} P_{\hbox{max} }^{\text{Grid}} & P_{t}^{\text{Grid}} > P_{\hbox{max} }^{\text{Grid}} \hfill \\ P_{t}^{\text{Grid}} & P_{\hbox{min} }^{\text{Grid}} < P_{t}^{\text{Grid}} < P_{\hbox{max} }^{\text{Grid}} \hfill \\ P_{\hbox{min} }^{\text{Grid}} & P_{t}^{\text{Grid}} < P_{\hbox{min} }^{\text{Grid}} \hfill \\ \end{array} \right. $$
(29)

where \( P_{t}^{\text{Grid*}} \) is the adjusted value; \( P_{\hbox{min} }^{\text{Grid}} \) is the minimum power bought or sold from/to the utility at hour t; \( P_{\hbox{max} }^{\text{Grid}} \) is the maximum power bought or sold from/to the utility at hour t.

(4) In order to satisfy system power balance, power output of the ESS will be adjusted as follows.

$$ P_{M,t}^{\text{ESS*}} = D_{t}^{\text{Load}} - \sum\limits_{i = 1}^{L} {P_{i,t}^{\text{DG}} - \sum\limits_{k = 1}^{S} {P_{k,t}^{\text{PHEV}} } - P_{t}^{\text{Grid}} - } \sum\limits_{j = 1}^{M - 1} {P_{j,t}^{\text{ESS}} } $$
(30)

where \( P_{M,t}^{\text{ESS*}} \) is the adjusted value.

The violation value of the minimum/maximum power constraints of the M th ESS is calculated as follows.

$$ P_{{PM,t}}^{{{\text{ESS}}}} = \left\{ {\begin{array}{ll} {P_{{M,t}}^{{{\text{ESS*}}}} - P_{{M,t,{\text{max}}}}^{{{\text{ESS}}}} } & {P_{{M,t}}^{{{\text{ESS*}}}} > P_{{M,t,{\text{max}}}}^{{{\text{ESS}}}} } \\ 0 & {P_{{M,t,{\text{min}}}}^{{{\text{ESS}}}} \le P_{{M,t}}^{{{\text{ESS*}}}} \le P_{{M,t,{\text{max}}}}^{{{\text{ESS}}}} } \\ {P_{{M,t}}^{{{\text{ESS*}}}} - P_{{M,t,{\text{min}}}}^{{{\text{ESS}}}} } & {P_{{M,t}}^{{{\text{ESS*}}}} < P_{{M,t,{\text{min}}}}^{{{\text{ESS}}}} } \\ \end{array} } \right. $$
(31)

where \( P_{M,t,\hbox{min} }^{\text{ESS}} \) is the maximum power of M th ESS at hour t; \( P_{M,t,\hbox{max} }^{\text{ESS}} \) is the maximum power of M th ESS at hour t.

The violation value of the minimum/maximum power constraints of j th \( (j = 1,2, \ldots ,M - 1) \) ESS is calculated as follows.

$$ P_{Pj,t}^{\text{ESS}} = \left\{ \begin{array} {ll} P_{j,t}^{\text{ESS}} - P_{j,t,\hbox{max} }^{\text{ESS}} \quad \;\;P_{j,t}^{\text{ESS}} > P_{j,t,\hbox{max} }^{\text{ESS}} \hfill \\ 0 \quad \, \;P_{j,t,\hbox{min} }^{\text{ESS}} \le P_{j,t}^{\text{ESS}} \le P_{j,t,\hbox{max} }^{\text{ESS}} \hfill \\ P_{j,t}^{\text{ESS}} - P_{j,t,\hbox{min} }^{\text{ESS}} \quad \, \;\;P_{j,t}^{\text{ESS}} < P_{j,t,\hbox{min} }^{\text{ESS}} \hfill \\ \end{array} \right. $$
(32)

where \( P_{Pj,t}^{\text{ESS}} \) is the violation value of the minimum/maximum power constraints of j th ESS at hour t; \( P_{j,t,\hbox{min} }^{\text{ESS}} \) is the maximum power of j th ESS at hour t; \( P_{j,t,\hbox{max} }^{\text{ESS}} \) is the maximum power of j th ESS at hour t.

The calculation method of \( P_{j,t,\hbox{max} }^{\text{ESS}} \) and \( P_{j,t,\hbox{min} }^{\text{ESS}} \) can refer to \( P_{j,t,\hbox{max} }^{\text{PHEV}} \) and \( P_{j,t,\hbox{min} }^{\text{PHEV}} \).

4.3 Fitness function

The fitness function is defined as the following form.

$$ f_{\text{fit}} = A/(C_{Dci}^{M} + \sum\limits_{j = 1}^{M} {\sum\limits_{t = 1}^{T} {P_{Pj,t}^{\text{ESS}} } \delta_{PFj} } ) $$
(33)

where A is positive constant; \( \delta_{PFi} \) is penalty factor for the violation value; \( C_{Dci}^{M} \) is the objective function and represents different functions in different modes, such as \( C_{Dc1}^{M} ,C_{Dc1*}^{M} ,C_{Dc2}^{M} ,C_{Dc2*}^{M} \), and \( C_{Dc3}^{M} \).

The flowchart in Fig. 2 illustrates the implementation of this iterative technique.

Fig. 2
figure 2

Implementation of iterative technique

5 Results and discussion

A variety of DG units, such as a PV array, two fuel cells (FCs), a microturbine (MT), are installed in the microgrid. Table 1 provides the minimum and the maximum operating limits of the DG sources. The energy capacity of the ESS is 300 kWh and the power capacity is 30 kW.

Table 1 Installed DG units

Table 2 summarizes the cost coefficients of the DG sources. The forecasted energy price of the grid refers to [27]. The load curve of the microgrid refers to [28]. The characteristics of selected PHEVs and their batteries refer to [29]. It is assumed that the microgrid is an office block and the parked electric vehicles include 5 official vehicles (18:00–7:00) and 10 private cars (8:00-17:00). In order to meet the needs of the owners, the PHEV are assumed to be filled when they leave.

Table 2 Costs of DG units

Figure 3 shows the operation results of SEMS without PHEV integration.

Fig. 3
figure 3

Typical operation results of SEMS without PHEV integration

In Fig. 3 the various curves in the graphs indicate the power output of different sources. When the curve of the ESS is underneath the x-axis, ESS is charging; when the curve of the ESS is above the x-axis, the ESS is discharging. When the curve of the grid is underneath the x-axis, the excess power of the microgrid is sold to the grid, whereas the power is purchased from the grid. SEMS optimizes the operation based on DG sources and load bids, and sends dispatch signals to the controllers of DG sources and load. SEMS sells energy to the consumers of the microgrid and also the excess production from DG sources and ESS, if any, to the upstream network at the market price. If the power produced by DG sources is not enough or too expensive to cover the local load, power is bought from the upstream network and sold to the consumers. For example, the energy price of grid is low at 1 o’clock, FC2 is allowed to export a small amount of energy to satisfy the load, but the energy of FC1 has not been purchased because of high bid. The total costs of the icrogrid without PHEV integration within a period of one day is $80.5 according to (6).

5.1 Uncontrolled charging mode

Figure 4a presents the charging power curves of the PHEVs in uncontrolled charging mode. The charging costs are $50.36 when the PHEVs are charged via utility purchases. As shown in Fig. 4b, the charging power of the PHEVs is provided from the microgrid and the SEMS aims to serve the local load demand and the PHEVs’ load, using its local generation. The SEMS sums up the DG sources bids in ascending order and the demand-side bids in descending order in order to decide which DG sources will operate for the next hour. The sum of microgrid total costs and PHEVs charging cost in the first mode is $118.11.

Fig. 4
figure 4

Computational results in Mode 1

5.2 Delayed charging mode

Figure 5a presents the charging power curves of the PHEVs in delayed charging mode. The charging costs are $35.14 when the PHEVs are charged via utility purchases. As shown in Fig. 5b, the charging power of the PHEVs is provided from the microgrid and the SEMS aims to serve the local load demand and the PHEVs’ load, using its local production. The sum of microgrid total costs and PHEVs charging cost in delayed charging mode is $103.21.

Fig. 5
figure 5

Computational results in Mode 2

5.3 Smart charging and discharging mode

Figure 6a presents the charging and discharging power curves of the PHEVs in smart charging and discharging mode. As a result of smart charging and discharging and large price differences of electricity throughout the day, the PHEV’s demand will always be highest when the price is lowest. As shown in Fig. 6b, the PHEVs participate in the energy management of the microgrid and the SEMS optimizes the energy flow among the PHEVs, local load, distributed generation units, ESS and the upstream network.

Fig. 6
figure 6

Computational results in Mode 3

In this case, the SOC of PHEV batteries will vary with the charging/discharging power according to the control signal of the SEMS. Fig. 7 presents the SOC of a private PHEV and an official PHEV in smart charging and discharging mode. The sum of microgrid total costs and PHEV charging costs in smart charging and discharging mode is $96.82. In Table 3, a summary of the total costs of the microgrid for the various computational simulations is presented. It is also shown that, the SEMS is beneficial to reduce energy costs for the consumers and microgrid.

Fig. 7
figure 7

SOC of charge in PHEVs

Table 3 Economic savings using SEMS

As we know, ESS integration includes capital cost for power capacity and energy capacity. Compared with ESS integration, PHEV’s integration doesn’t have these costs. The PHEVs can be supposed as a mobile generation/ storage device, what we need to do is to decide what time to charge and discharge to optimize energy exchange between microgrid and PHEVs. Because of large price differences of energy between the peaks and valleys, PHEVs in the third mode serves as an energy storage system to reduce the daily total costs by storing low-price energy during light-load periods and then delivering it during peak-load ones. Therefore, the power generation of the energy supplier in microgrids and the batteries of PHEVs will be economically optimized through price leverage. However, too much PHEV integration will affect the energy balance of microgrid since the capacity of microgrid is limited.

6 Conclusions

The microgrid owns both the DG units and energy storage systems, and is required to serve a load that has significant PHEV integration. An economic scheduling model based on genetic algorithm optimization is developed to optimize the scheduling of the microgrid and PHEV system, which also provides the flexibility to the PHEV owners for specifying their preferences. The objective is to minimize the daily electricity costs of the microgrid with the PHEVs integration considering open market and uncertainties. Simulation results show that coordinating PHEV integration with economic scheduling of the microgrid has several merits. For the PHEV owners, it can reduce the charging costs while optimizing the charging/discharging power and time of the PHEVs. For the microgrid, it results in an additional electricity consumer and electricity supplier and helps the microgrid trade more tactically. Further, as the energy stored in the PHEVs is mobile, the PHEV can be charged in residential areas at low energy price and discharged in commercial buildings at high energy price. In addition, the influence of different charging and discharging modes on microgrid economic operation is discussed. It can be seen that the friendly integration of a proper amount of PHEVs into the microgrid can result in enhanced power supply diversification as well as improved energy efficiency and economic benefit.