Optimal Dispatch Strategy of a Virtual Power Plant Containing Battery Switch Stations in a Unified Electricity Market

: A virtual power plant takes advantage of interactive communication and energy management systems to optimize and coordinate the dispatch of distributed generation, interruptible loads, energy storage systems and battery switch stations, so as to integrate them as an entity to exchange energy with the power market. This paper studies the optimal dispatch strategy of a virtual power plant, based on a unified electricity market combining day-ahead trading with real-time trading. The operation models of interruptible loads, energy storage systems and battery switch stations are specifically described in the paper. The virtual power plant applies an optimal dispatch strategy to earn the maximal expected profit under some fluctuating parameters, including market price, retail price and load demand. The presented model is a nonlinear mixed-integer programming with inter-temporal constraints and is solved by the fruit fly algorithm.


Introduction
With the graveness of environmental pollution and energy shortage, distributed generation (DG) has been a widely researched topic in energy system studies. Although DG has many merits, there are still OPEN ACCESS many problems in its application [1]. Microgrids can coordinate well technical contradictions between DG and the power grid, and also have some energy management functions. Power from DGs is used locally most of the time, so the application of DG is limited by its geographic area. It not possible to effectively use DG on a large-scale and in multiple areas and achieve the benefits of scale in the electricity market. The virtual power plant (VPP) provides new thinking and methods to solve these problems. Figure 1 shows the basic elements in VPP. With remote control and communication technology, VPP aggregates distributed energy resources (DERs) including DGs, interruptible loads (ILs), energy storage systems (ESSs) and electric vehicles (EVs), as an integrated entity [2]. It takes part in the electricity market in the form of a "single plant" and provides convenient service to the system operator, which improves the controllability and visibility of DERs. VPP forms an appropriate and flexible portfolio for DERs to maximize expected benefits [3]. VPP realizes optimal energy allocation by exchanging energy with the grid and dispatching energy among the elements inside the VPP. As a core energy management system (EMS) in VPPs, the optimal dispatch strategy (ODS) regulates and controls the power flow between DERs inside the VPP [4,5]. ODS is aimed at profit maximization and cost minimization of VPPs [6]. The operating characteristic of ODS make EMS have two-way information flow, as EMSs input real-time information from the DERs, and simultaneously output control signals to DERs. The internal operation state is that ESSs charge or discharge, ILs join or quit operation, DGs start up or shut down and EVs charge or discharge [7][8][9]. The external operation state of a VPP is that the ODS makes a bidding plan for the electricity market according to the electricity market price, electricity retail price [10], forecasted load and forecasted error [11]. These papers only consider the day-ahead market, and ignore the real-time market or separate the real-time market from the day-ahead market. Based on the separate electricity market, VPP will face the dilemma of less profit. The ODS model usually covers objective function [12] and constraint conditions, including energy balance constraints [13], battery storage constraints [14], DG operation constraints [15], IL operation constraints [16], power grid constraints [17] and the cost curve function of DERs [11,12]. Cost curves of ILs and DGs can be formulated as a quadratic polynomial of the output power. Conversely, the cost curve of an ESS is defined as a linear polynomial of the output power [13]. The energy flow loss between the VPP and the electricity market is a linear polynomial of the active power [14]. The objective function means maximum benefit and minimum cost, VPP sells electricity to earn the maximum benefit [15]. The cost contains start-up and shut-down costs of DGs, fuel costs of DGs, operation losses of ESSs, expenses of electricity purchase. The start-up cost of DGs is usually a constant [16], which does not conform to the actual operation situation, as it has a mathematical function relationship with the off time.
Reference [18] considers state of charge (SOC) to the ensure the operational safety of ESSs, but the service life of ESSs affect ageing cost, so some constraints must be considered to extend the service life of ESSs, but these constraints do not appear in the previous research [15,17]. In addition, batteries should be charged in a timely manner when they are approximately fully discharged, which is ignored in the references [11,18]. According to the dispatch strategy, ILs such as washing machines, air conditioners and water heaters, can be regulated to maintain energy balance [19]. The simplified model only limits the amount of interruption load, which cannot reflect the characteristics of ILs, so the interruption interval constraints and interruption time constraints in the IL model still need further research.
Electric vehicles are usually regarded as a battery to optimize the charge and discharge strategy [20], but the model cannot provide a visual interface for system operators. A VPP needs to obtain operation information of all EVs and make charge-discharge schedules for each EV, which increases the computational complexity and reduces ODS which is a dynamic programming project, so its solving speed and precision affect the dynamic response and economic benefit of the VPP. ODS has more constraints and numerical variables, so the solving process needs a great amount of calculations. The genetic algorithm [11], accelerated particle swarm optimization [21] and Bender's decomposition algorithm [22] have unsatisfactory solution speed, so it is necessary to choose a reasonable algorithm to improve timeliness and accuracy.
To overcome the drawbacks of existing power dispatch models, the paper proposes an optimal dispatch strategy of a VPP containing battery switch stations (BSSs) in a unified electricity market. Based on the unified electricity market, the model optimizes electricity trading in the day-ahead market to maximize the profits of selling electricity and minimize costs of purchasing electricity. DER constraints, power balance constraints, security constraints and network constraints are taken into consideration in the VPP operation. Compared to previous VPP models, the presented model expands and enriches the description of the elements in the VPP in which the state-switch of DGs, cycle life of ESSs, charging constraints of ESSs, and the interruption constraints of ILs and the described BSSs are introduced to recharge EVs and its operation details are illustrated in the paper. The model is applied to a test system to verify its validity, and the simulation results solved by the fruit fly algorithm show that VPPs provide the optimal portfolio of DERs and play a reasonable dual role in trading with the unified market, and the dispatch strategy reduces the difficulty of the power grid dispatching and improves the profitability of the VPP. This paper is organized as follows: in the next section, we present the trading model in a unified electricity market. The third section proposes the objective function and operational constraints for the optimal dispatch strategy. The next section illustrates the fruit fly algorithm. In the fifth section, the proposed model is evaluated with a VPP case, then simulation results are presented and analyzed. Finally the conclusions are drawn in the fifth section.

Trading Model in a Unified Electricity Market
At present, spot transactions in the electricity market mainly use two kinds of pricing method: the market clearing price (MCP) and pay-as-bid (PAB) [23]. The MCP, also known as system marginal pricing, is also adopted in this paper. The proposed power purchase trading model and algorithm have one thing in common: day-ahead trading purchases all electricity to meet the forecasted load demand of the next day, then the Independent System Operator (ISO) buys some electricity to make up the load balance between the forecasted load and the real time load in the real-time market, where the trading model is a separate independent sequential trading model. The total electricity purchase cost is the sum of a two-part purchase cost. The model separates day-ahead trading and real-time trading, and ignores the influence caused by the day-ahead market on the real-time market, so it misses the optimal power purchase deal. To get the optimal trading scheme, the day-ahead market and real-time market should be unified to make an electricity purchase scheme with minimum cost and an electricity selling scheme with maximum benefits. Therefore the new model should combine the day-ahead market with the real-time market, breaking the constraint that the VPP should purchase or sell electricity power according to the forecasted load in the day-ahead market. The trading power in the day-ahead market is optimized to achieve the greatest gains.
A large number of single loads make up the total load in a power grid, so a single load generally represents a small proportion in total load. On the basis of the central limit theorem the total load approximately follows a normal distribution. If some single loads have a larger proportion, one can use data analysis methods, such as histograms and empirical distributions, etc., to approximately describe the total load distribution, based on historical load data.

Power Purchases in a Unified Market
Some research defines the forecasted load and forecast error as a random variable and use a normal distribution to describe their uncertainty [10,[24][25][26][27][28]. The references [29,30] use a Gauss model to describe the load, in which it is assumed that the load at each hour follows a normal distribution with known mean and variance. In addition, some research shows how to transfer the load to a normal distribution [31][32][33][34], and the daily load can be divided into several segments to use normal distributions with different mean and variance. Douglas [34] thinks that it is a reasonable assumption to consider the load demand follows normal distributions because the system load is actually an aggregation of all end users connected to the grid. If each customer is considered a random variable, then their summed loads will approximate a normal distribution according to the central limit theorem. The paper supposes the actual load demand t L D follows a normal distribution and it can be expressed as: where t L S is the forecasted load; σ t is the variance of forecasted load, that reflects the fluctuation of the actual load demand. In a unified electricity market, the electricity purchased in the day-ahead market does not need to be equal to the forecasted load, moreover the DG and IL in the VPP are taken into consideration, then the electricity purchased in the real-time market follows a normal distribution and can be formulated as: . , , where i is the index of DG units, running from 1 to G ; j is the index of IL blocks, running from 1 to IL ; t is the index of time periods, running from 1 to T ; t DA B is the electricity purchased in the day-ahead market; t RT B is the electricity purchased in the real-time market; t IL S is the total load shedding of ILs; . j t IL S is the load shedding of IL j ; t DG P is the total output of DGs; , IL is a binary variable denoting the curtailment decision for a IL; , i t G u is a binary variable denoting the generation decision for a DG. According to the MCP, the total power purchase cost b C can be expressed as: where DA C is the cost of power purchasee in the day-ahead market; RT C is the cost of power purchases in the real-time market; ρ t d is the unified marginal price in the day-ahead market; ρ t r is the adjustment Differences between the forecasted load and actual load are inevitable. When t DA B cannot meet the load demand, VPP needs to purchase extra electricity in the real-time market at a price which is higher than ρ t d , meanwhile when t DA B is larger than the load demand, VPP will sell redundant electricity at a price which is lower than ρ t d . t r  can be expressed as: where ρ t rb is the purchasing price; ρ t rs is the selling price. According to Equations (4) and (5), RT C can be expressed as: Further RT C can be derived from Equations (6) and (7) and expressed as: is the distribution function of a normal distribution.

Power Selling in a Unified Market
The electricity sold in the real-time market follows the normal distribution and can be formulated as: where t DA S is the electricity sold in the day-ahead market; t RT S is the electricity sold in the real-time market; μ t s is the forecasted electricity sold in the real-time market. The total electricity sold benefits Es can be expressed as: where DA E is the benefits of electricity sold in the day-ahead market; RT E is the benefits of electricity sold in the real-time market;   t s RT f S is the density function of t RT S ;When the load demand exceeds its expectation, electricity is already inadequate after selling electricity in the day-ahead market, so the VPP must purchase electricity at the price level of ρ t rb , to meet the load demands. If electricity is also adequate after selling electricity in the day-ahead market, the VPP will continue to sell electricity at the price level ρ t rs . According to Equations (10)- (12), RT E can be expressed as:

Objective Function
where

Grid Security and Power Balance Constraints
where i P and j P , i Q and j Q , i V and j V are the active power, reactive power, voltage and phase angle of two terminals in a bus, respectively; θ ij is the angle of complex Y-bus matrix elements; i j Y is magnitude of admittance matrix elements; min V and max V are the minimum and maximum limits on the bus voltage respectively; ij S is the line capacity; max ij S is the line maximum capacity.

Operation Costs
The fuel cost of a DG can be formulated as a quadratic polynomial of the output power, and besides the start-up cost and shut-down cost are also covered in operation costs: where .t i DG SUC is the start-up cost of a DG; . γ i t DG is a binary variable denoting the start-up decision for DG i at time t . τ i DG is the time constant of the start-up cost for DG i .
where . i t DG SDC is the shut-down cost of a DG; .

i t DG
 is a binary variable denoting the shut-down decision for DG i at time t.

Operation Benefits and Costs
The benefits of selling electricity to consumers in the VPP can be expressed as: where λ t is the electricity retail price; t IL S is the total amount of load to be shed for all ILs.
VPP should pay outage compensation for an IL that gets cut off. , m a x * 0 where , The total interruption durations constraint is given by: where ,max i IL T is the longest duration for each interruption.

Operation Costs
Lead-acid and lithium-ion batteries will lose part of their available capacity after charging-discharging several times. When the available capacity drops below the capacity limit, the battery must be replaced. The battery aging/wear cost represents the operation cost of the ESS. The depth of discharge (DoD) contributes to the cycle life of an EV battery [35]. In this study, due to the lack of direct operational data on DoD, the state of charge (SOC) subtracted from 100% charge (1−SOC) is employed to represent the DoD of the BEV battery. The relationship between the cycle life and the DoD is an empirical formula: where rc is replacement cost for one ESS; , i t rc cl is the aging/wear cost for each discharge.

Operation Constraints
The SOC must be limited in a reasonable range to avoid overcharge or deep charge. The ESS only has one operating state between charge state and discharge state at the same time, the operating state constraint can be expressed as: The battery should be charged in a timely manner when it's approximately fully discharged SOCi ≤ 0.35, and the next discharge is not allowed before charging is completed.
where ,min i ESS T is the minimum time interval between the next charge and this full discharge; SOC i T is DoD after the normalization; τ SOC is a time constant for SOC.

BSS Model
EV is charged by charging posts in which slow charging only applies to cars parked for a longer periods of time, while quick charging has a negative effect on the lifespan of the battery. The two charging modes have a high requirement for charging time and charging spots. Battery swap mode removes battery packs that have been used in an EV [36], and installs full battery packs that have been charged in a battery switch station (BSS), so the process can be finished in a few minutes. The replacement battery packs are then charged slowly at low power grid load to ensure the battery lifespan. The battery packs in BSSs can restrain the power fluctuations caused by intermittent DGs and provide reserve capacity for the power grid [37].
As shown in Figure 2, a BSS consists of a charger controller and battery packs. The charger controller charges and discharges the battery packs under the unified control and management of the VPP. The battery packs, including empty packs and full packs, are controlled by a dispatching center. The dispatching center collects empty packs from service points, and transports them to a warehouse for recharging. Meanwhile the center dispatches full packs to service points, then rents them to EV consumers. When the power price is high, BSS may sell power to the grid by discharging, and it can charge the batteries at low price.
(1) Service points charge a battery rental fee from EV consumers, after deducting the battery depreciation cost caused by charge, so the BSS's net benefits can be expressed as: where α is the battery rental fee for one battery pack; β is the battery depreciation cost for one discharge; rc is the replacement cost for one battery pack; , (2) BSS earn profits by selling power to the grid at a high price and purchasing power from the grid at a lower price: , . , , 3 . .
is the number of charge-discharge cycles for a battery pack selling power to the grid in unit time; λ is the aging cost coefficient;

Operation Constraints
(1) Charger controller constraint: To expand the battery service life, the online battery must complete charging before its state changes to discharge from charge, and besides the online battery must complete discharge before its state changes to charge from discharge: where , i t BSS E is the power charged by charger i at time t.

Fruit Fly Optimization Algorithm
The fruit fly optimization algorithm (FOA) [38] is a new global optimization method based on the food finding behavior of the fruit fly. The fruit fly has a very keen sense of sight and smell [39], its food finding process is as follows: firstly, the fruit fly smells the food source by is osphresis organ, and flies toward that location [40]; when it gets close to the food location, its sensitive vision is also used for finding food and the company's flocking, and it flies toward that direction [41]. According to the food finding characteristics of fruit fly swarm, the FOA can be divided into six steps [38]: (1) Initialize the fruit fly swarm location   , x y , and set the maximum number of generations and population size; (2) Give the random direction and distance for foraging using osphresis by an individual fruit fly: where L is the fixed step size of a fruit fly using osphresis for foraging. The FOA needs few adaptable parameters and is easy to implement, it has higher optimizing precision and less calculation. In addition, the algorithm has stronger global optimization ability, and can effectively prevent premature convergence.

Test System
In this section, the test system used for evaluation of the proposed model is introduced. A VPP exchanges electricity with the grid in a unified trading market. The network configuration of the VPP is shown in Figure 3. The VPP contains four DGs at bus 2, 6, 7 and 11. The characteristics and constraints of the DGs such as generation limit, cost function coefficients, minimum up/down time limit and ramping capability for reserve are shown in Table 1. The four DGs do not contain intermittent DGs, such as wind generation and photovoltaic. If DGs contain intermittent DG, the VPP also dispatches other controllable DGs, such as micro turbines, diesel generators and fuel cells, based on the forecasted output of intermittent DGs, and the dispatch strategy focuses on the power generation scheme of DGs. Therefore the absence of intermittent DGs does not affects the research idea about the dispatch strategy of the VPP.
At bus 5 and 10, the interruptible loads can be curtailed up to 20 and 30 kW. The VPP should pay an outage compensation to consumers according to 2 2 0.01 1.5 . The rated capacity of the ESS located at bus 9 is 80 KW and of the BSS located at bus 10 is 100 KW. The forecasted load t L S of VPP is shown in Figure 2a and the variance of forecasted load σ t is shown in Table 2. In this case, the time cycle is 24 h.

Simulation Result and Discussion
The paper introduces FOA to solve the optimal dispatch problem in VPP. Figure 5 shows the results of the VPP optimal dispatch problem using FOA. As shown in Figure 5a, during hours 1-5, the prices in both the day-ahead and real-time market are lower than the operation costs of DG units. Therefore the VPP tends to buy electricity from the market rather than schedule the generation of DGs, then VPP sells electricity to the end consumers and charges the ESS and battery packs in the BSS. During hours 10-15 and 18-22, the prices in the day-ahead market are greater than the production costs of the DG units. According to load demand and storage needs, the VPP dispatches DGs to operate at full capacity to make a large gain. During hours 15-18, the market price is at a low point, so DGs tend to slash or suspend production. Due to the higher cost of star-up and shut-down and the lower limit of ramp-up and ramp-down, the DG1, DG2 and DG3 select to slash production and DG4 chooses shutdown to reduce spending. Figure 5b explains the curtailed load of the IL. During hours 15-17 and 21-24, the retail price is larger than the market price, so the VPP earns more benefits by selling electricity to all consumers. During that period, IL does need to be curtailed. Although the retail price is also at a higher level in the time period between hours 1 to 4, the VPP cuts off all the IL to charge the ESS and the empty battery packs in the BSS. The main reasons for giving a priority to BSS and ESS is the potential profit of the next period. In other times, the retail price is lower than the market price, so the VPP makes more profit by flexibly curtailing the loads. Figure 5c illustrates the SOC change of ESSs and BSSs, during hours 1-6 and 20-24, based on the less load demand lower market price, when the VPP purchases power from the market then stores electricity in ESSs, so the ESSs are charged to full capacity. During hours 14-17, the VPP does the same thing after selling electricity to its end consumers, ESS waits a reasonable time to discharge electricity. In other time periods, the VPP sells electricity to the market for more benefits by discharging ESS. During hours 8-11 and 16-22, EVs have more demands for battery replacement. According to the dispatch strategy, the BSS purchases low-price electricity to produce full battery packs before the load peaks. Because the battery rental price is larger than the retail price, the BSS does not sell any surplus electricity to the end consumers in the VPP rather than trade electricity with the market. In other times, the BSS develops a reasonable charge-discharge plan after meeting the battery demands of EVs, so the SOC curve has more fluctuation than the ESS. Figure 5d shows the electricity transactions of the VPP in a unified market. The positive values denote that the VPP sells power to the energy market as a producer, while the negative values denote that the VPP purchases power from the energy market as a consumer. The dispatch strategy optimizes the electricity trading in the day-ahead market, and purchases or sells electricity to meet the difference between the forecasted load and actual load. The VPP can make more benefits in a unified market than a separate market. Table 3 illustrates the profits of the VPP in a unified market and separate market. The total net benefits are 11,483.8 monetary units in the unified market and 9091.8 monetary units in a separate market, so the model proposed in this paper can help the VPP make more benefits.  The presented dispatch strategy is solved by using Matlab under FOA on a laptop computer with a 2.5 GHz core processor. The average time consumption of five cycles is 356 s. The obtained average execution times are acceptable for solving the dispatch strategy of the VPP. If we change the time step from 1 h to 15 min, VPP can improve the accuracy of the load prediction, and the variance of the forecasted load will be reduced at least 5.3%. The VPP can cope better with short-term price spikes and load fluctuations to enhance the economic benefits. The new net benefits are 11,647.6 monetary unit, which is less than 11,483.8, but the execution times is 1572 s. The result shows that a little time step can increase less the benefits.

Conclusions
The paper presents a trading model of a VPP in a unified market combining a day-ahead market with a real-time market. Based on the forecasted load, the volume of electricity trading in the day-ahead market is optimized to minimize the costs of purchasing power and maximize the benefits of power selling. Trading in a unified market can produce more benefits than a separate market. The load expectation in load forecasting is facile, so the paper adopts a statistical analysis method of historical data to achieve a normal distribution of the forecasted load. The trading model is based on MCP and it also can be applied to PAB.
The model proposed in the paper expands and enriches the description of elements in a VPP. Considering the start-up costs of a DG, the model is redefined to consider the influence of shut-down time. The duration constraint for an interruption, total interruption times, total interruption durations and the time intervals between two interruptions are covered in the IL model. The paper takes cycle life into consideration to emulate the aging cost of ESSs, and in addition, the minimum time interval between the next charge and full discharge is limited to protect the battery. The BSS is introduced to recharge EVs and its operation benefits and constraints are illustrated in the paper.
The proposed dispatch strategy is also tested with a VPP system including 11 buses, four DGs, two ILs as well as one ESS and one BSS. The simulation result achieved by the fruit fly algorithm shows that VPP can reasonably merge the various elements and flexibly dispatch power among elements based on a global benefits goal. VPP is a consumer or supplier of the unified market, and it switches roles according to the retail price and market price for increasing the potential profit. The proposed model can determine the optimal power dispatch strategy among elements in the VPP and a trading plan with the electricity market for the whole VPP.