2.1 Microgrid energy management optimization model
The objective problem and constraint functions of the optimization model for energy management in the microgrid considering the two possible operation modes are formulated in this section. In the isolated mode, the microgrid objective is formulated to minimize the energy production cost (fuel cost), and the operation and maintenance costs within the microgrid. While operating in grid-connected mode, the microgrid can either send (sell) power to the main grid or receive (buy) from the main grid. During the periods receiving power from the main grid, the microgrid is expected to minimize the energy production cost, operation and maintenance cost and the expense of buying power from the main grid; while sending power to the main grid, the objective is to maximize the profit which is the energy selling revenue minus the energy production cost, and operation and maintenance cost.
This objective function is subjected to six decision variables: the charging/discharging power of the VRB, state of charge (SOC) of the VRB, charging/discharging power of the Li-Ion battery, SOC of the Li-Ion battery, the diesel generator power output, and the quantity of power exchange with the main grid.
2.2 Formulation of objective functions
The following are some of the information that should be specified in advance for a day-ahead energy management in microgrids [16, 17]:
-
24-h-ahead hourly load demand forecast
-
24-h-ahead hourly wind power forecast
-
24-h-ahead hourly PV power forecast
-
Grid price forecast, or pre-specified grid price
The objective functions are formulated independently by considering three operational cases based on the microgrid operating mode and the power flow directions between the microgrid and the main grid. In case I, the objective function for the isolated mode of operation is considered. In case II, the microgrid is in grid-connected mode and it receives (buys) power from the main grid. While in case III, the microgrid is also in grid-connected mode but it sends (sells) power to the main grid.
2.2.1 Case I – isolated mode
In case I, the objective targets to minimize the energy production cost (fuel cost), and the operation and maintenance costs within the microgrid.
The objective function is given by:
$$ M i n{\displaystyle \sum_{t=1}^n\left\{\begin{array}{l}{\displaystyle \sum_{i=1}^m\left({F}_i\left({P}_i(t)\right).{\tau}_i(t)+ S{C}_i(t)\right)}+\\ {}{\displaystyle \sum_{i=1}^m{C}_{OM, i}(t){P}_i(t)}+{C}_{OM wind}(t){P}_{wind}(t)+\\ {}{C}_{OM pv}(t) Ppv(t)+{\displaystyle \sum_{j=1}^q{C}_{OM es, j}(t){P}_{es, j}(t)}\end{array}\right\}}\kern1.1em (1) $$
Where, n is the number of time steps for a scheduling day; m indicates the number of all types of dispatchable DGs; q is the number of all types of energy storage units within the microgrid; P
i
(t) is the power output of the ith dispatchable DG at time t and F
i
(P
i
(t)) is the corresponding fuel cost function, and for a diesel generator it is defined as:
$$ {F}_i\left({P}_i(t)\right)={a}_i.{P}_i{(t)}^2+{b}_i.{P}_i(t)+ c $$
(2)
Where, ai, bi and ci are the cost function parameters.
τ
i
(t) = 1, if the ith dispatchable DG is in operation;
τ
i
(t) = 0, if the ith dispatchable DG is OFF at time t;
SC
i
(t) is the start up cost function of each dispatchable DG and is given by:
$$ S{C}_i(t)= s{c}_i, if{\tau}_i(t) - {\tau}_i\left( t-1\right) = 1 $$
otherwise
Where, sc
i
is the start up cost of dispatchable DG i.
c
OM,i
(t) is the operation and maintenance cost of the ith dispatchable DG at time t; c
OMwind
(t) is the operation and maintenance cost of the wind power generation system at time t; P
wind
(t) is the forecasted wind generation at time t; c
OMpv
(t) is the operation and maintenance cost of the PV system at time t; P
pv
(t) is the forecasted PV generation at time t; C
OMes,j
(t) is the operation and maintenance cost of the jth energy storage unit at time t; P
es,j
(t) is the jth energy storage charging/discharging power at time t.
2.2.2 Case II – Non-isolated mode - buying power from main grid
In this case, the objective aims in minimizing the energy production cost, the operation and maintenance costs and the expenses of energy purchasing from the main grid.
The objective function is:
$$ M i n{\displaystyle \sum_{t=1}^n\left\{\begin{array}{l}{c}_{grid buy}(t){P}_{grid}(t)+{\displaystyle \sum_{i=1}^m\left({F}_i\left({P}_i(t)\right).{\tau}_i(t)+ S{C}_i(t)\right)}+\\ {}{\displaystyle \sum_{i=1}^m{C}_{OM, i}(t){P}_i(t)}+{C}_{OM wind}(t){P}_{wind}(t)+\\ {}{C}_{OM pv}(t) Ppv(t)+{\displaystyle \sum_{j=1}^q{C}_{OM es, j}(t){P}_{es, j}(t)}\end{array}\right\}}\kern1.1em (3) $$
Where, c
gridbuy
(t) is the electricity buying price from the main grid at time t; P
grid
(t) is the power purchased from the main grid at time t, P
grid
(t) > 0.
2.2.3 Case III - Non-isolated mode - selling power to main grid
Here, the objective aims in maximizing the profit which is the energy selling revenue minus the energy production cost and the operation and maintenance costs within the microgrid.
The objective function becomes
$$ M a x{\displaystyle \sum_{t=1}^n\left\{\begin{array}{l}-{c}_{grid sell}(t){P}_{grid}(t)-\\ {}\left\{\begin{array}{l}{\displaystyle \sum_{i=1}^m\left({F}_i\left({P}_i(t)\right).{\tau}_i(t)+ S{C}_i(t)\right)}+{\displaystyle \sum_{i=1}^m{C}_{OM, i}(t){P}_i(t)}+\\ {}{C}_{OM wind}(t){P}_{wind}(t)+{C}_{OM pv}(t) Ppv(t)+\\ {}{\displaystyle \sum_{j=1}^q{C}_{OM es, j}(t){P}_{es, j}(t)}\end{array}\right\}\end{array}\right\}}\kern0.1em (4) $$
Where, c
gridsell
(t) is the electricity selling price to the main grid at time t; P
grid
(t) is the power sold to the main grid at time t, P
grid
(t) < 0.
2.3 Formulation of constraint functions
The objective functions formulated above are subjected to the following constraints; comprising ESS units’ capacity and operational limits, dispatchable DGs’ power limit, grid power transfer limits, and all other technical requirements in the microgrid:
2.3.1 Power output of the ith dispatchable DG at time t
$$ {P}_i^{\min }(t)\le {P}_i(t)\le {P}_i^{\max }(t) $$
(5)
2.3.2 Grid power exchange limits
$$ {P}_{grid}^{\min }(t)\le {P}_{grid}(t)\le {P}_{grid}^{\max }(t) $$
(6)
The grid power exchange minimum (\( {P}_{grid}^{\min }(t) \)) and maximum (\( {P}_{grid}^{\max }(t) \)) limits can be set as a large amount or the capacity of the transformer linking the microgrid and the main grid.
2.3.3 Demand-supply balance
$$ \begin{array}{l}{\displaystyle \sum_{i=1}^m{P}_i}(t)+{\displaystyle \sum_{i= j}^q{P}_{es, j}}(t)=\\ {}{P}_{load}(t)-{P}_{wind}(t)-{P}_{pv}(t)-{P}_{grid}(t)\end{array} $$
(7)
where P
load
(t) denotes the forecasted load demands at time t.
2.3.4 ESS units charging/discharging power limits
$$ {P}_{es, j}^{\min }(t)\le {P}_{es, j}(t)\le {P}_{es, j}^{\max }(t) $$
(8)
P
es,j
(t) > 0, the ith energy storage is discharging;
P
es,j
(t) < 0, the ith energy storage is charging;
P
es,j
(t) = 0, the ith energy storage is inactive.
2.3.5 ESS units dynamic operation performance
$$ SO{C}_{es, j}\left( t+1\right)= SO{C}_{es, j}(t)-\frac{\eta_{es, j}(t){P}_{es, j}(t)}{C_{es, j}} $$
(9)
$$ SO{C}_{es, j}^{\min}\le SO{C}_{es, j}\left( t+1\right)\le SO{C}_{es, j}^{\max } $$
Where, η
es,j
(t) is the ith energy storage unit charging or discharging efficiency at time t; C
es,j
denotes the rated storage capacity of jth energy storage unit.
Thus, the decision variables that need to be determined are the ESUs’ charging/discharging power P
es,j
(t) and their state of charges SOC
es,j
(t) (for i =1, 2, …, q); the power output of dispatchable DGs P
i
(t),and the quantity of power exchange with the main grid P
grid
(t) at time t.