**1. Introduction**

Many small-scale DERs and loads form a Micro Grid, a local power grid that can be operated independently or by tying with the existing power grid [1]. The operator of such grid takes charge of energy supply and consumption for these resources and loads existing within the Micro Grid, whereas the system operator of the grid considers the entire Micro Grid system to be a single load or a generator and assigns the responsibility of its internal managemen<sup>t</sup> to the operator [2–4].

The energy resources in the Micro Grid are largely divided into passive resources that cannot be controlled by the grid operator and active resources controllable by him/her [5]. These resources are also classified as production, consumption or storage resources in terms of their applications [6]. Typical examples of a passive resource include new and renewable energy resources such as solar rays, wind, etc. The power production using these passive resources can be largely a ffected by external environmental conditions like weather situations rather than the operator-controlled production process.

Although it would be possible to interrupt power production by disconnecting with the Micro Grid's internal power grid, implementing some kind of control to increase power production arbitrarily is almost impossible as it depends on the external environmental conditions. Even though passive resources have a disadvantage in terms of inability to control, they also have an advantage of being able to achieve eco-friendly power generation without much extra cost after the initial installation cost in majority of the cases. For this reason, these resources are being used as a major power supply resource of a Micro Grid. Their issue of inability to control raises a problem in the balance between power demand and supply, causing sharp fluctuations in it such that an ancillary active resource is often required to solve the problem. One of the most popular passive resources, photovoltaic power generation, has a problem of production variability or excessive production due to its characteristic of insolation-based production. Thus, this study conducted simulations for cases wherein none of the

four kinds of conditional equations (i.e., conditional equations for peak control, power use flattening, power demand response and operation of net zero Energy or one of them had been applied to compare them and evaluate the e ffectiveness of each equation. The result showed that the conditional equations were e ffective when attempting to optimize the Micro Grids e fficiently.

#### **2. Related Research**

Typical examples of passive consumption resources of Micro Grid include loads such as household appliances used by the residents on the Micro Grid. Although there are some controllable loads, most of them are used to meet the requirements of residents and beyond the control of Micro Grid operators [7,8].

The active production resources of Micro Grid include fuel cells, combined heat and power generation and most of the other generating facilities that are able to produce power according to the operator's control. Although these resources require some additional costs (fuel expenses) when generating power, they are indispensable in the operation of a Micro Grid wherein power supply and demand or quality issues should be considered as their power output level can be controlled arbitrarily [9–11].

On the other hand, the active consumption resources of Micro Grid include some operator-controllable loads such as lighting fixtures, air-conditioning equipment, etc. Control can be implemented in a way that will not make the residents uncomfortable when attempting to reduce excessive power use in the Micro Grid. Moreover, the active storage resources are useful in keeping the balance between power supply and demand or securing power quality or economy by storing or releasing surplus power. These active storage resources can store or release the desired amount of power in any desired time zone. Likewise, as many of them have rapid responsiveness, it is possible to deal with the variability in power production. Typical examples of these resources include energy storage systems such as batteries, flywheels, combined air energy storage, etc. [12,13].

Meanwhile, Micro Grids are divided into system-connected type or independent type depending on whether they are operating with an external system (power grid) [14]. The grid-connected Micro Grid is operated in a state of establishing a connection with another power system and is able to exchange surplus power to supplement each other. The independent-type Micro Grid (a.k.a. island grid) is operated in a state of separating itself with another power grid and managing the quality (i.e., supply and demand or voltage/current, etc.) by itself. The former can sell the surplus or purchase the power amount lacking by connecting with an external system and some of the typical examples are small-scale building, home and campus Micro Grids. If it is impossible to meet the demand from a consumption resource, these Micro Grids buy the system's surplus power or sell their own surplus to the system when their production is more than enough.

In addition, an external power rates provision system (e.g., KEPCO or Korea Power Exchange) is necessary to settle the power bills incurred from these transactions, further requiring a metering device connected with an outside system along with the external system or market that will be able to pass on the signals in case of blackout or demand response (DR) [15].

The independent Micro Grid manages the power supply and demand balance or power quality within the grid by itself. One of the most typical examples of such grid is one that is being operated in an island, disconnecting itself from a large-scale inland power system and managing its power through its own power production, storage and consumption resources within the Micro Grid to supply power on demand.

There have been a quite number of studies for the optimization of Micro Grids and energy managemen<sup>t</sup> systems and planning an optimal operating schedule is one of the essential parts of the management: J. Li et al. [16] dealt with the design and implementation of Green Home Service for energy managemen<sup>t</sup> whereas A. R. Al-Ali et al. [17] focused on the design, implementation and test operation of a smart home using an energy storage system. Y. Zhang et al. [18] presented an optimization algorithm that can be used for a home energy managemen<sup>t</sup> system in a smart grid whereas

D. I. H Rodriguez et al. [19] and A.C. Luna et al. [20] dealt with the Micro Grid operating system using an optimization algorithm or vice versa and the energy managemen<sup>t</sup> system for the Micro Grid having its own power generation facility and connected to the existing power grid, respectively. Also, H. Li et al. [21] discussed energy managemen<sup>t</sup> for the industrial Micro Grid being connected to the existing power grid or operated independently. Further, D. Arcos-Aviles et al. [5] and C. Ju et al. [22] introduced a design of a fuzzy logic-based energy managemen<sup>t</sup> system for the Micro Grid having new and renewable energy resources and its own energy storage while being connected to the existing power grid and a 2-tier prediction energy managemen<sup>t</sup> system, respectively.

Meanwhile, for the deduction of schedule [22], H. Kim et al. [8] discussed the minimization of operating costs based on a basic model. F. A. Mohamed et al., [23] and F. A. Mohamed [24] focused on a Micro Grid system model having battery storage and its online management, aiming to minimize the costs while satisfying the demands in a respective system where wind/diesel/ PV generator or fuel cell or battery storage existed. A. Parisio [25] presented a Micro Grid managemen<sup>t</sup> method based on a model-based predictive control which was to improve calculation results or reduce calculation load by applying mixed-integer linear programming. P. Malysz et al. [26] dealt with the minimization of operating costs of energy storage connected to a grid, predicting future power usage and energy production by using mixed-integer linear programming.

On the other hand, H. Hori et al. [13] and W. Shi et al. [27] proposed a method of using an additional control to deal with the expected errors and the managemen<sup>t</sup> of distributed energy, respectively. Y. Zhang et al. [15] discussed the model-based predictive control and the operation considering uncertainties.

K. Hoffmann et al. [28] and S. Zhai et al. [29] dealt with the requirements of energy managemen<sup>t</sup> system information and the flexibility of home appliances used in a household energy managemen<sup>t</sup> system using smart plugs, respectively. M. M. Eissa et al. [30] discussed the demand-response based on a commercial energy managemen<sup>t</sup> system. Chee Lim Nge et al. [31] described their real-time energy managemen<sup>t</sup> system for a PV facility having battery storage. Amin Shokri Gazafroudi et al. [32] introduced their bidding strategy for the automatic housing energy managemen<sup>t</sup> system. Feras Alasali et al. [33] described their energy managemen<sup>t</sup> algorithm for the energy storage and crane network. Spyridon Chapaloglou et al. [34] and J. M. G Lopez [35] presented an energy managemen<sup>t</sup> algorithm for load flattening and peak-reduction and a simulator for the household energy managemen<sup>t</sup> system loads, respectively.

Yujie Wang et al. [36] presented their rule-based energy managemen<sup>t</sup> strategy based on the power prediction of a lithium-ion battery and a supercapacitor. Farid Farmani et al. [37] proposed a conceptual model for the residential building energy managemen<sup>t</sup> system having CCHP. F. Wang, Lidong Zhou et al. [38] introduced their building energy managemen<sup>t</sup> system considering the unit-price demand-response and other factors such as energy resources, load or storage that change according to time zones.

Meanwhile, Dimitrios et al. [39] proposed an energy managemen<sup>t</sup> system for the smart building connected to a power system considering the uncertainties of PV generation and the operation schedule of electric vehicles. D. van der Meer et al. [40] described his energy managemen<sup>t</sup> system that predicts PV generations for charging electric vehicles by detailing the PV generation system. And, H. S. V. S. K Nunna et al. [41] present their energy managemen<sup>t</sup> strategy when electric vehicles and/or power system are being connected for use. A. Azizvahed et al. [42] dealt with a multi-purpose energy managemen<sup>t</sup> system that operates a distributed network when there were distributed resources along with energy storage. V. Indragandhi et al. [43] discussed multi-purpose energy managemen<sup>t</sup> for a new and renewable energy resource-based AC/DC microgrid. V. Pilloni et al. [44] proposed an energy managemen<sup>t</sup> system for the operation or operating time of home appliances considering the aspect of not only energy cost-saving but also enhancement of user experience quality. I. Ali and S. M Suhail Hussain et al. [45] presented their communication system design for the automated energy managemen<sup>t</sup> of the Micro Grid involving various types of distributed energy sources. Lastly, W. Ma

and J. Wong et al. [46] dealt with the distributed energy managemen<sup>t</sup> for a networked Micro Grid having uncertainties due to distributed energy resources.

The system operator of a Micro Grid system regards the entire grid as a single load or generator and delegates its internal managemen<sup>t</sup> responsibility to the grid operator. The power generations based on a passive production resource can be largely a ffected by the external environmental condition such as weather. Thus, a series of simulations were conducted in this study for evaluation to optimize the e fficiency of the Micro Grid. Each one of the four conditional expressions (i.e., peak-zero, power-use flattening, demand-response and net zero operation) was applied to the simulations to compare with the case where any of these expressions were applied. Each performance was evaluated, and the validity of the expressions was determined through MATLAB simulations.

#### **3. Micro Grid Optimization Theory**

A Micro Grid consists of new and renewable energy, load and energy storage system. Although there are a number of new and renewable energy resources now available, only photovoltaic power generation was indicated as a representative system for convenience. The power generated by the photovoltaic (PV) system will be consumed by the load or stored in energy storage system (ESS). Their data are saved in the data storage for the estimation of their future values [47–49].

The power grids supply electricity to the ESS or load, whereas the unit cost of power is provided at the power exchange. The event server assumes the role of notifying the situation wherein DR or net zero operation is required. There will be no information about the external operating conditions from the event server in a scenario that does not include any special conditions; otherwise, the constraints and objective function will be changed after receiving external operating condition information.

This section focuses on the operating schedule calculation and prediction functions of ESS in the EMS. The constants used for the calculation of an ESS operating schedule include the PV/load data obtained through prediction, unit price data set by the power exchange, capacity of ESS, maximum/minimum charging/discharging power, etc. The constraints are then set based on these data and charging/discharging schedule, SoC limitations, etc. Lastly, appropriate individual objective functions are set to output an ESS operating (charging/discharging) schedule that minimizes each objective function by using an optimization technique. The resulting schedule presents a method with which the ESS charging/discharging power level in the Micro Grid can be determined in each time zone.

The system flow diagram is shown in Figure 1, where the red arrows show the directions of power to be supplied and the blue arrows represent the movement of each data (information). The system consists of Micro Grid, power grid, power exchange and event server; originally, however, EMS and data storage are also included in such system.

The red arrow in the system diagram (Figure 1) indicates the supply of power whereas the blue arrow is showing the flow of information. The system largely consists of a Micro Grid, power grid, power exchange and event-generating server. The variables used to explain the supply of power in the diagram are as follows: It is assumed that all kinds of powers in each time zone are constant and the time interval is one hour. Although both energy managemen<sup>t</sup> system (EMS) and data storage belong to the Micro Grid, the Micro Grid, in this case, is one that consists of new and renewable energy sources, loads and energy storage. There are a number of new and renewable energy sources such as photovoltaic (PV) and wind turbine (WT) but only PV was indicated for convenience. The power produced by PV will be stored in the ESS or consumed by the load. Also, PV/Load data are used to predict the future PV/load value after being stored in data storage.

**Figure 1.** System diagram (red arrow: supply of power; blue arrow: flow of information).

The target Micro Grid consists of new and renewable energy, load and energy storage system. Although there are a number of new and renewable energy resources now available, only photovoltaic power generation was indicated as a representative system for convenience. The power generated by the PV system will be consumed by the load or stored in ESS. Their data are saved in the data storage for the estimation of their future values.

Table 1 below describes the variables to be used to explain (definition) individual cases of supplying power, assuming that all kinds of power in each time zone (one hour) are constant.



The relationship between individual variables can be expressed by Equations (1)–(7):

$$P\_{PV}[k] = P\_{PV, \text{ESS}}[k] + P\_{PV, \text{Load}}[k] \tag{1}$$

Equation (1) indicates that the power generated by PV will be "charged to ESS" or "consumed by load."

$$P\_{ESS}^{\rm dis}[k] = P\_{ESS,Load}^{\rm dis}[k] + P\_{ESS, \rm g}^{\rm dis}[k] \tag{2}$$

Equation (2) indicates that the power discharged from ESS will be "consumed by load" or "sold to the power grid."

$$P\_{ESS}^{chg}[k] = P\_{\%,ESS}[k] + P\_{PV,ESS}[k] \tag{3}$$

Equation (3) indicates that the power used to charge ESS had been "received (bought) from the power grid" or "generated by PV."

$$P\_{\mathbb{X}^1}[k] = P\_{\mathbb{X}, \text{ESS}}[k] + P\_{\mathbb{X}, \text{Load}}[k] \tag{4}$$

Equation (4) indicates that the power received (bought) from the power grid will be "charged to ESS" or "consumed by load."

$$P\_{\lhd\mathcal{Z}}[k] = P\_{ESS\_{\lhd\mathcal{Z}}}^{\text{dis}}[k] \tag{5}$$

Equation (5) indicates that the power transmitted (sold) to the power grid had been discharged from ESS.

$$P\_{\rm load}[k] = P\_{PV,\rm load}[k] + P\_{ESS,\rm load}^{dis}[k] + P\_{\rm g,L,and}[k] \tag{6}$$

Equation (6) shows the balance between demand (right side) and supply (left side) and that the power consumed by load had been supplied from PV, ESS or power grid.

$$E\_{ESS}[k+1] = E\_{ESS}[k] + P\_{ESS}^{chg}[k] \cdot \mathbf{1}h - P\_{ESS}^{dis}[k] \cdot \mathbf{1}h \tag{7}$$

Equation (7) explains that the amount of power stored in ESS is determined by adding the charged power to the current power and subtracting the discharged power amount from it.

The variables that will be used to explain (definition) the movement of information in Table 2 are as follows:


**Table 2.** Definitions of Variables (2).

The relationship between individual variables can be expressed as:

$$\begin{aligned} \vert D\_{PV}[k] \cup \vert d\_{PV}[k] \rangle &= \vert d\_{PV}[1], d\_{PV}[2], \dots, d\_{PV}[k-1] \rangle \cup \vert d\_{PV}[k] \rangle \\ &= \vert d\_{PV}[1], d\_{PV}[2], \dots, d\_{PV}[k-1], d\_{PV}[k] \rangle \\ &= DpV[k+1] \end{aligned} \tag{8}$$

Equation (8) indicates that the data set in time zone 1–k will be generated by adding Kth PV data to the PV data set in time zone 1–(k-1).

$$\begin{array}{rcl}D\_{\text{Load}}[k] \cup [d\_{\text{Load}}[k]] &=& [d\_{\text{Load}}[1], d\_{\text{Load}}[2], \dots, d\_{\text{Load}}[k-1]] \cup \{d\_{\text{Load}}[k]\} \\ &=& [d\_{\text{Load}}[1], d\_{\text{Load}}[2], \dots, d\_{\text{Load}}[k-1], d\_{\text{Load}}[k]] \\ &=& D\_{\text{Load}}[k+1] \end{array} \tag{9}$$

Similar to Equation (8) load data set 1–k can be obtained when Kth load data are added to the PV load data set in time zone 1–(k-1).

$$\begin{aligned} D\left[k\right] \cup \left( \left( \left[ d\_{PV} \left[ k \right] \right] \cup \left[ d\_{Load} \left[ k \right] \right] \right) \right) &= \left( D\_{PV} \left[ k \right] \cup D\_{Load} \left[ k \right] \right) \cup \left( \left[ d\_{PV} \left[ k \right] \right] \cup \left[ d\_{Load} \left[ k \right] \right] \right) \\ &= \left( D\_{PV} \left[ k \right] \cup \left[ d\_{PV} \left[ k \right] \right] \right) \cup \left( D\_{Load} \left[ k \right] \cup \left[ d\_{Load} \left[ k \right] \right] \right) \\ &= \left( D\_{PV} \left[ k + 1 \right] \cup D\_{Load} \left[ k + 1 \right] \right) \\ &= D\left[ k + 1 \right] \end{aligned} \tag{10}$$

Equation (10), which can be obtained by using both Equations (8) and (9), indicates that data storage k+1 can be created by adding both PV and load data generated in the same time zone to the data storage in time zone k.

$$\begin{array}{rcl} \{f\_{\text{prd},\text{PV}}(D\_{\text{PV}}[k]) &=& \{PV\_{\text{prd}}[k],PV\_{\text{prd}}[k+1],\dots,PV\_{\text{prd}}[k+n-1] \} \\ &=& PV\_{\text{prd}}(k,n) \end{array} \tag{11}$$

Equation (11) shows that the PV data collected so far can be used to predict the future PV in n time zone.

$$\begin{array}{rcl} f\_{\text{prd}, \text{Load}}(D\_{\text{Load}}[k]) &=& \langle \text{Load}\_{\text{prd}}[k], \text{Load}\_{\text{prd}}[k+1], \dots, \text{Load}\_{\text{prd}}[k+n-1] \rangle \\ &=& \text{Load}\_{\text{prd}}(k,n) \end{array} \tag{12}$$

Similar to Equation (11), Equation (12) indicates that the load data collected so far can be used to predict future load in n time zone.

$$C = PV\_{prd}(k, n) \cup L \alpha \text{ad}\_{pnd}(k, n) \cup I\_{\text{cost}} \cup I\_{\text{ext}} \cup I\_{\text{spec}} \cup I\_{\text{etc}} \tag{13}$$

Equation (13) shows that the union of future PV data, load data, power unit price, external operating conditions, ESS performance information and other constant sets becomes a set of constants.

$$\mathbf{x} = f\_o(M(\mathbb{C}), f(\mathbb{C})) \tag{14}$$

Equation (14) shows that an ESS operating schedule can be established by entering the constraints and objective function (coefficient vector) in the optimization function. Nonetheless, it is important to understand that the constraints and objective function are determined by the set of coefficients.

Figure 2 is a diagram that shows how system power usage (blue line) and ESS charging/discharging power (red line) change depending on the external conditions applied. The picture on the upper left is a basic setting and the rest of the pictures in order of bottom left, bottom center, upper left and bottom right show the change when peak control, net zero operation, flattening and demand response have been applied, respectively. A detailed explanation for each diagram will be provided later.

**Figure 2.** Diagram showing the changes in system power usages, ESS charging/discharging according to the external operating conditions.

Meanwhile, performance evaluations were conducted by comparing a simulation wherein none of the four conditions above had been applied with the simulations to which each of those conditions was applied. For the simulations, MATLAB R2015a was used; the constraints resulting from individual constants and objective functions were used as inputs for the mixed-integer linear programming of MATLAB to show the resultant system power usage, ESS charging/discharging power and total demand with the graphs using a plot function.

The basic setting that does not have any special conditions is as follows: the ranges of ESS charging/discharging and state of charge (SoC) were set at 3–19.5kW and 0.05–0.95, respectively, whereas the ESS capacity was set at 40 kW. The conditions are shown in Table 3.


**Table 3.** Basic setting for the simulation.

The virtual data in Tables 4–6 is used as load prediction, PV (generation) prediction and power unit cost data. (n)–(n+1) are the time zones for integer (n), ranging from 0 to 23. For example, 1–2 indicates the time zone of 1 o'clock to 2 o'clock. In Table 4, the time zones having low power unit cost and high-power unit cost are denoted in red and blue, respectively. It was also assumed that the power was constant in each time zone (24 time zones/day). In this case, no external conditions were applied.


**Table 4.** Forecast prices of power demand schedule (virtual data) (kW).


**Table 5.** Forecast prices of power supply schedule (virtual data) (kW).

**Table 6.** Power unit price schedule (virtual data) (Korean won/kWh).


The simulation result from the basic setting is shown in Figure 3, where grid (blue line), ESS (red line) and net demand (yellow line) indicate the system power usage, ESS charging/discharging power and total demand, respectively. Since power demand and supply have to be balanced, the condition net demand-ESS-Grid = 0 must be satisfied. When the grid sign is (+), power is purchased from the system; if the sign is (-), it means that power is sold to the system.

**Figure 3.** Simulation result when there were no special conditional equations included.

At the same time, the (+) and (−) signs of ESS indicate charging and discharging, respectively. As shown in Figure 4, (n)-(n+1) on the horizontal axis is the time zone for integer n (0–23).

**Figure 4.** Simulation result when the conditional equation for peak control was included.

Since the value of ESS in time zones 0–1, 1–2, 2–3 and 3–4 was 0, it can be assumed that there was no charging or discharging in these time zones. Moreover, the overlapping yellow and blue lines satisfy the condition net demand = grid, indicating balanced demand and supply. As the sign of the ESS in time zone 4–5 was (−), it can be assumed that charging was required and that power was bought from the system having a (+) grid sign. There was no ESS charging/discharging in time zones 5–6, 6–7 and 7–8 and power demand and supply were balanced out as the condition net demand = grid was satisfied. The same balance was achieved in time zones 9–10 and 10–11 as the individual grid and ESS signs were (+) and (−), respectively, satisfying the conditions net demand = grid and net demand = ESS, respectively. For the latter time zone, it can be understood that power was discharged from ESS as the sign was (+). The ESS sign in time zone 11–12 was also (+), but the grid sign was (−); this means that power was sold to the system. Meanwhile, there was no ESS charging or discharging in time zones 12–13, 13–14, 14–15, 15–16, 16–17, 17–18, 18–19, 19–20, 20–21, 21–22 and 22–23, indicating that power demand and supply have been balanced; thus satisfying the condition net demand = grid. Lastly, the ESS sign in time zone 23–24 was (−), whereas the grid sign was (+), meaning power was purchased from the system.

Figure 3, where no additional conditions have been applied, shows that the ESS was charged in the time zones having the lowest power unit cost of 66.1 (time zones 4–5, 8–9 and 23–24) but discharged in time zones (10–11 and 11–12) having the highest power unit cost of 111.3.

#### **4. Conditional Equation**

#### *4.1. Conditional Equation for Peak Control*

The following equation should be added to the objective function when the conditional equation is included: 

$$\sum\_{i \in PC\_{\mathcal{G}, \text{hyy}}} \left[ -c\_{\text{PC,1}}^{\mathcal{S}\_{\text{hyy}}} \{ 1 + \left( c\_{\text{PC,2}}^{\mathcal{S}\_{\text{hyy}}} \right)^{i} \} dt \cdot \delta\_{\text{PC}}^{\mathcal{S}\_{\text{hyy}}} \left( i \right) + c\_{\text{PC,3}}^{\mathcal{S}\_{\text{hyy}}} dt \cdot p\_{\text{PC}}^{\mathcal{S}\_{\text{hyy}}} \left( i \right) \right] \tag{15}$$

where *cgbuy PC,*1*, cgbuy PC,*2*, cgbuy PC,*3 are the penalty constants for peak control. The possibility of success of peak control will be reflected to the objective function by adding this equation. Likewise, *<sup>i</sup>*∈*Pg,buy* means that time zone i will be included in the time zones performing peak control. Since the condition δ*gbuy PC* (*i*)=**<sup>1</sup>** can be satisfied when peak control is successful, the value of objective function will be decreased (−*cgbuy PC,*1{1+(*cgbuy PC,*2)*<sup>i</sup>*}*dt*·**1**). In such case, the possibility of success of peak control will be largely reflected when the value of *cgbuy PC,*1 is large (*cgbuy PC,*3*dt*·*pgbuy PC* (*i*)=**<sup>0</sup>** as **0** ≤ *pgbuy PC* (*i*)≤**0**). In contrast, the value of the objective function will not be decreased when peak control fails (−*cgbuy PC***,**<sup>1</sup>{1+(*cgbuy PC***,**<sup>2</sup>)**<sup>i</sup>**}*dt*·0=<sup>0</sup> as

δ*gbuy PC* (*i*)=0). This indicates that the value will be increased by *cgbuy PC,*3*dt*·*pgbuy PC* (*i*) as **<sup>0</sup>**≤*pgbuy PC* (*i*). Moreover, thepossibilityofsuccessofpeakcontrolwillbehighlyreflectedwhenthevalueof*cgbuy* islarge.

*PC,*3 Figure 4 shows the result of the simulation to which an external operating condition limiting system power usage to 15 kW in time zone 17–20 has been added to the basic setting (Table 7). The conditional equation for peak control seems to be valid as the system power usages in time zone *c gbuy PC,*3 were the same or below 15 kW compared to time zones 17–18, 18–19 and 19–20, where the usages were the same or above 15 kW (note that the blue line indicating system power usage and the yellow line representing total demand are overlapping).



In Figure 4, there was no charging/discharging in time zones 0–1 and 1–2 as the ESS values were 0. In addition, power demand and supply were balanced as net demand = grid was achieved (i.e., overlapping blue and yellow lines). It can be deduced that ESS has been charged as the sign was (−) in time zone 2–3. In this case, the (+) grid sign means that power was purchased from the system. Power demand and supply were balanced (net demand = grid) in time zones 3–4, 4–5, 5–6, 6–7 and 7–8 where there was no charging/discharging activity. The (+) grid sign and (−) ESS sign in time zone 8–9 indicate that power was purchased from the system to charge ESS. Next, no ESS charging/discharging was performed in time zones 9–10, 10–11, 11–12, 12–13, 13–14, 14–15, 15–16 and 16–17 and power demand and supply were balanced, thus satisfying net demand = grid. The same can be said for time zones 20–21, 21–22 and 22–23, but ESS was charged in time zone 23–24 as its sign was (−), buying power from the system.

In Figure 4, where a condition for peak control was included, it can be deduced that ESS was charged in time zones 2–3 and 8–9 due to their low power unit cost (66.1) and discharged in time zones 17–18, 18–19 and 19–20 where the condition was applied to satisfy it.

#### *4.2. Conditional Equation for Power Usage Flattening*

The maximum power demand, as well as power charges, can be reduced by improving the quality of power through power usage flattening, the efficiency of new and renewable energy-based generation and the use of off-peak electricity for the peak time hours during the day.

The following equation should be added to the objective function when the conditional equation is included

$$c\_{\mathcal{S}}^{flat} \left( p\_{\mathcal{S}}^{max} - p\_{\mathcal{S}}^{min} \right) T \tag{16}$$

where *cflat g* is a penalty constant for flattening. When this equation is added, the difference between the maximum and minimum system powers *pmax g* −*pmin g* will be reflected to the objective function. The value of *pmax g* −*pmin g* is reduced to minimize the value of the objective function and system power usage will be flattened. The flattening effect will be largely reflected when the value of *cflat g*becomes larger.

 The result of a simulation wherein a flattening condition has been added to the present setting is shown in Figure 5. When comparing it with the simulation result that does not include any conditional equation, as the difference between the maximum and minimum system power usages was reduced from 38.68[ = 28 − (−10.68)] kW to 9.8( = 14.6–4.8) kW, the conditional equation for power flattening can be considered to be valid. The differences were calculated based on the maximum (minimum) values of 28 (−10.68) and 14.6 obtained from time zones 23–24 (11–12) and 8–9, 16–17, 17–18 and 18–19 (9–10), respectively, in Figures 3 and 5.

**Figure 5.** Simulation result when the conditional equation for system power flattening (power use) was included.

In Figure 5, the ESS value in time zones 0–1, 1–2, 2–3 and 3–4 was 0, so there was no ESS charging/discharging at all. Moreover, in these zones, power demand and supply were balanced as the condition net demand = grid was satisfied. The ESS signs in time zones 4–5 and 5–6 were (−), so the ESS was charged. At this time, it can be deduced that power had been purchased from the system as the grid sign was (+). There was no ESS charging/discharging in time zone 6–7, so power demand and supply were well-balanced, thus satisfying the same condition. In addition, the (+) sign of the grid and the (−) sign of the ESS in time zones 7–8 and 8–9 showed that power was purchased from the system to charge the ESS. Power demand and supply were balanced in time zones 9–10 and 10–11 so there was no ESS charging/discharging, but demand and supply were balanced as the condition was satisfied. In time zone 11–12, the sign was (+) for both ESS and grid, so power was purchased from the system for charging. There was no ESS charging/discharging in time zone 12–13 and power demand and supply were balanced as the condition was satisfied. Accordingly, the power transactions for charging/discharging activities in each time zone can be grasped by checking the signs or finding out whether the condition has been satisfied or not.

As such, the flattening operations described in Figure 5 showed that the ESS was charged in time zones 4–5, 5–6, 7–8 and 8–9 when the power unit cost was low (66.1) and discharged in time zones 11–12, 17–18, 18–19 and 19–20 when the cost was high (111.3) to consider cost reduction.

#### *4.3. Conditional Equation for Demand Response Power*

Demand response is an activity by the electricity users to control their energy usages by shifting themselves from a passive power-user system to an active one, changing their normal power consumption patterns in response to the incentive(s) obtainable by saving power or the differentiated power rates depending on time zones.

The following equation should be added to the objective function when the conditional equation is included:

$$(-\mathbf{c}\_{DR,1} \langle 1 \star (\mathbf{c}\_{DR,2})^\dagger \rangle \cdot \delta\_{DR} \star \mathbf{c}\_{DR,3} \cdot \mathbf{P}\_{DR} \tag{17}$$

*cDR,*1, *cDR,*2, *cDR,*3 are the penalty constants of demand response. The possibility of success of demand response will be reflected to the objective function by adding this equation. When it becomes successful, the value of the objective function will be decreased based on the calculation <sup>−</sup>*cDR,*1{1+(*cDR,*2)*<sup>i</sup>*}*dt*·1*,* δ*DR*<sup>=</sup>1.

The possibility of success largely depends on the *cDR,*1: *cDR,*3·*PDR*=0 to be established when *cDR,*1: *cDR,*3·*PDR*=0. The value will not decrease when demand response fails (−*cDR,*1{1+(*cDR,*2)*<sup>i</sup>*}*dt*·0=0*,* δ*DR*<sup>=</sup>0) but will increase instead by *cDR,*3·*PDR* (0≤*PDR*). This suggests that the possibility of failure largely depends on the scale of *cDR,*3.

The result of a simulation wherein the external operating condition listed in Table 8 has been added to time zone 17–20 where 10 kW power is to be discharged is shown in Figure 6. By comparing it with the result obtained from the same time zones in Figure 3 where no conditional equations have been included, this conditional equation for demand response can be considered to be valid as the ESS discharging power in time zone 19–20 was 10 kWh (10 kW\*1 h).

**Table 8.** Demand response operating condition.

**Figure 6.** Simulation result when the conditional equation for demand response (power usage) was included.

In Figure 6, there was no ESS charging/discharging in time zones 0–1 and 1–2 as the ESS value was 0. In addition, power demand and supply were balanced as the yellow and blue lines were overlapping (net demand = grid). The (−) ESS sign in time zone 2–3 shows that the ESS had been charged by purchasing power from the system [(+) grid]. Power demand and supply in time zones 3–4, 4–5, 5–6, 6–7 and 7–8 were balanced (net demand = grid) and there was no ESS charging/discharging. Similar to all the other conditions mentioned above, the (+) and (−) signs of either the ESS or the grid explain the power transactions, power balance or ESS charging/discharging events that had taken place.

Added with a demand response condition, Figure 6 also shows that the ESS was charged in time zones 2–3, 8–9 and 23–24 when the power unit cost was low (66.1) and discharged in time zones 10–11 and 19–20 when the cost was high (111.3) to consider cost reduction.

#### *4.4. Conditional Equation for Net Zero Operation*

Although achieving net zero energy by utilizing now available new and renewable energy resources or energy-saving equipment is a desirable direction in energy management, establishing a system to realize it can be quite costly.

The following equation should be added to the objective function when the conditional equation is included: 

$$\sum\_{i \in \mathcal{IO}\_{\mathcal{S}}} \left[ -c\_{IO,1}^{\mathcal{S}} \{ 1 + \left( c\_{IO,2}^{\mathcal{S}} \right)^{i} \} dt \cdot \delta\_{IO}^{\mathcal{S}}(i) + c\_{IO,3}^{\mathcal{S}} dt \cdot p\_{IO}^{\mathcal{S}}(i) \right] \tag{18}$$

where *cgIO,*1*, cgIO,*2*, cgIO,*3 are the penalty constants for peak control. The possibility of success of net zero operation will be reflected to the objective function by adding this equation. In addition, *<sup>i</sup>*∈*IOg means* that time zone i will be included in the time zones performing the operation. Since the condition <sup>δ</sup>*gIO*(*i*)=<sup>1</sup> can be satisfied when the operation is successful, the value of the objective function will

be decreased (−*cgIO,*1{1+(*cgIO,*2)*<sup>i</sup>*}*dt*·1). In such case, the possibility of success of the operation will be largely reflected when the value of *cgIO,*1 is large. In contrast, the value of the objective function will not be decreased when the operation fails (−*cgIO,*1{1+(*cgIO,*2)*<sup>i</sup>*}*dt*·0=0*,* <sup>δ</sup>*gIO*(*i*)=0). This indicates that the value will be increased by *cgIO,*3*dt*·*<sup>p</sup>gIO*(*i*) as <sup>0</sup>≤*pgIO*(*i*). Moreover, the possibility of success of the operation will be highly reflected when the value of *cgIO,*3becomes larger.

The result of a simulation wherein the external operating condition listed in Table 9 has been added to time zone 3–5 for a net zero operation is shown in Figure 7. By comparing it with the result obtained from the same time zones in Figure 3 where system power usage was larger than 0, this conditional equation for the net zero operation can be considered to be valid as the system power usages in time zones 3–4 and 4–5 were 0.

**Table 9.** Net Zero operating condition.

**Figure 7.** Simulation result when the conditional equation for net zero operation was included.

#### **5. Performance Evaluation**

Performance evaluations were conducted by comparing a simulation wherein none of the four conditions above had been applied with the simulations to which each of those conditions was applied. For the simulations, MATLAB R2015a was used; the constraints resulting from individual constants and objective functions were used as inputs for the mixed-integer linear programming of MATLAB to show the resultant system power usage, ESS charging/discharging power and total demand with the graphs using a plot function. Thus, for the optimization of microgrid, four environmental conditions have been put to simulations to find the actual conditions that actually have an impact on improving the optimization performance.

Figure 7 shows all power transactions and operations according to the (+) and (−) signs of both the ESS and grid, whereas the overlapping yellow and blue lines indicate successful establishment of the condition net demand = grid. It is possible to understand what had happened in each time zone.

As such, Figure 7 also shows that the ESS was charged in time zones 0–1, 8–9 and 23–24 when the power unit cost was low (66.1) and discharged in time zone 10–11 when the cost was high (111.3) to achieve net zero operation. The system power usages obtained from a simulation conducted by changing the capacity of ESS from 40 to 120 kW (+10 kW per simulation) are shown in Figures 8–10 and their discharging powers, in Figures 11–13.

**Figure 8.** System power usage by ESS capacity (1).

**Figure 9.** System power usage by ESS capacity (2).

**Figure 10.** System power usage by ESS capacity (3).

**Figure 11.** Discharging power by ESS capacity (1).

**Figure 12.** Discharging power by ESS capacity (2).

**Figure 13.** Discharging power by ESS capacity (3).

Figures 9, 10, 12 and 13 are the pictures of Figures 8 and 11, respectively, when viewed from other angles. The vertical axis in Figures 8–10 indicates the system power usages (Grid), whereas the same axis in Figures 11–13 is the ESS charging(-)/discharging(-) power. A long axis, "Time Slot," shows the time zones, with "ESS Capacity" indicating the capacity of the ESS. The bar3 function of MATLAB R2015a was used for graphing.

Observing time zones 4–5 and 8–9 in Figures 8–10, it is possible to recognize the tendency of increasing system power usages in proportion to the ESS capacity. This would mean that the grid is pursuing an economic gain by charging its ESS when the power unit cost is low and selling or reducing its purchase during the time zones when the cost is high.

The time zones where power unit cost is at the lowest or highest level are 9–10 and 12–17. Observing these time zones in Figures 11–13, there were no charging/discharging operations. This also proves that the grid is considering gaining profit by discharging its ESS when the power unit cost is highest and vice versa.

Being a local power grid, a Micro Grid consists of a series of DERs along with loads and is self-sustainable or runs with the existing power grid. In such a power grid, the system operator/administrator managing the entire supply and consumption of these resources assigns some of his/her sublevel tasks to individual operators under him/her. The passive production resources are often affected by the natural environments beyond the control of operators such as weather. A series of simulations were conducted in this study for evaluation to optimize the efficiency of the Micro Grid. Each one of the four conditional expressions (i.e., peak-zero, power-use flattening, demand-response and net zero operation) was applied to the simulations to compare with the case where none of these expressions were applied. Each performance was evaluated, and the validity of the expressions was determined through simulations which proved their effectiveness for the optimization of Micro Grids as a result.
