The present work aims to illustrate the potential benefits of urban community microgrids, carrying out an optimal planning of hundreds of microgrids with reliability requirements. This work seeks to contribute to the solution of the problem in urban communities, related to guarantee a minimum period of energy autonomy in the event of contingencies in the power grid. For that purpose, the models developed integrate sizing, type and operation of DER, using deterministic and stochastic optimization approaches, which are summarized in
Figure 1. The models receive input parameters such as fault start time, fault duration, probability of each fault scenario (only for stochastic model), load and generation hourly profiles, and investment and operational costs. CREST Demand Model and Solar Explorer tools are used to get household and solar generation profiles. For the stochastic model, a clustering method is previously applied in order to reduce the number of scenarios. Then, microgrids capable of facing different main grid fault scenarios are determined. Finally, the results, such as size and type of microgrid assets, operation and total costs, are obtained for both deterministic and stochastic optimization approaches.
These models were solved for different groups of residential clients and also for different clients within the same group. The reason for solving the planning problem for different groups of clients is due to the fact that residential demands are diverse (e.g., different households are not consuming the same power at any given time); therefore, a microgrid designed for one particular client and/or group of clients will not necessarily be the same microgrid as for other residential households or groups of households. All the elements and the implementation of the models will be presented in the following sections.
2.1. Deterministic Planning Model
The deterministic approach to the planning problem seeks to determine the type and capacity of the assets of the microgrids that minimize investment and operating costs. Therefore, the formulation of planning models with reliability requirements is presented below.
Planning models with the incorporation of reliability requirements: Reliability requirements guarantee islanded operation of the microgrids, in the event of contingencies in the power grid. This aspect was achieved by the optimal combination of photovoltaic generators and energy storage systems. Regarding the PV inverters, two possible configurations for microgrids are considered:
Alternative 1: photovoltaic solar system with on-grid inverter technology, an inverter charger and batteries.
Alternative 2: photovoltaic solar system with hybrid inverter technology with or without batteries.
The microgrids can operate in islanded mode incorporating the necessary assets that guarantee their operation. For Alternative 1, an inverter charger must always be included, to which the batteries are connected, and which together with the photovoltaic generator guarantees power supply to the users.
The planning tool must decide on the most economical alternative, and this will depend mainly on the time period during which a fault occurs (morning, afternoon, night), on the stochastic behavior of energy consumption and on other factors that make it impossible to decide a priori on one of the two configuration alternatives as the optimal one.
The installed power of the PV system is determined by Equations (1) and (2):
Since the planning tool must decide whether to install solar panels with on-grid inverter technology (decision variable
), or panels with hybrid inverter technology (decision variable
), the binary variables
and
are used, which, along with Inequality (3), ensure that both have different values. These variables are applied as constraints to the panel’s installed power with on-grid and hybrid inverter technologies, using the
Big-M method [
37], as observed in Inequalities (1) and (2). In this case, the power that can be injected into the grid is presented in (4) and (5):
where
is the power generated by 1 kW of panels installed in the study region, which is given by the generation profile for each hour of the analysis horizon. Additionally, the power that can be injected into the grid is limited by solar generation, as presented in Inequality (6):
Additionally, the energy constraints of the battery storage system are determined by (7)–(9):
where
corresponds to the energy of the battery to be installed and represents another decision variable of the optimization problem that is included in the objective function of each model. Furthermore,
and
are the charging and discharging power of the battery;
and
are coefficients that determine the performance of the battery in charging and discharging, respectively.
t is the index associated with the study horizon, which takes values from 0 to 8759. Δ
t indicates the resolution of the data (1 h in this paper).
Inequalities (7) and (8) represent the technical limits of battery charge. Batteries should not be charged above 90% of their capacity, nor discharged below 20% [
38]. Equation (9) describes the operation of the battery as the energy of the battery at time
t, equal to the energy it had at a previous time, added to its charge energy minus the discharge energy (both the power and the energy of the battery are variables to be optimized in planning models). Battery power constraints are supplemented by minimum storage requirements:
Minimum battery size: 0 Wh, if a PV system with hybrid inverter technology is sized.
Minimum battery size: or the value determined from Equation (11), if a PV system is dimensioned with on-grid inverter technology.
The idea of having two alternatives for the minimum size to which the battery can be dimensioned is based on the following assumptions: (i) PV systems with hybrid inverter technology can work disconnected from the grid even without the incorporation of batteries (as long as generation is greater than demand). (ii) For the operation of PV systems with on-grid inverter technology disconnected from the main grid, an inverter battery charger is always required. The minimum size of the batteries is, therefore, 60 Wh (enough to turn on a bulb) times the interruption duration
(this is the duration of the fault in hours), or as proposed in [
39] from Equation (11), enough to smooth the power fluctuations at the output of the PV generator, implemented in this research as a guarantee of minimum battery storage.
The minimum storage requirement constraints are presented in Equations (10) and (11).
And
where
corresponds to a binary variable that is activated when the planning tool decides to install batteries,
is a variable that can take any value between zero and infinity,
is the parameter that limits the minimum value of battery energy
(decision variable), according to the minimum storage requirements described above. Additionally,
is the maximum ramp limit expressed in [%/min] according to [
39].
Regarding the battery charge and discharge limit constraints, these are determined from (12)–(18).
As the battery cannot be charged and discharged at the same time, the binary variables
and
are used, which with Inequality (18) ensure that both have different values. These variables are applied as constraints to the load (
) and discharge (
) powers, as observed in Inequalities (12) and (15). The charging and discharging powers are limited by the power of the inverter charger (
, decision variable) and by the installed power of the PV system with hybrid inverter technology (
, decision variable), as presented in Inequalities (13), (14), (16) and (17). The minimum power of the battery inverter charger is limited by half the installed power of the on-grid system (according to [
39]) or the maximum demand, for the duration of the episode of power fault (Equation (19)). This is to guarantee feasibility in the operation of microgrids, and to ensure that all the energy generated by the panels can be delivered to the users at the time of a fault.
Finally, the objective function that determines microgrid investment and operational costs, both in connected and islanded modes, under reliability requirements, is presented in Equation (20).
where
and
are the costs of buying and selling energy to the main electrical grid,
and
are the import and export powers to the power grid, and
,
,
and
are the annual investment costs of the photovoltaic system with on-grid inverter technology, hybrid inverter, battery storage system and inverter charger, respectively.
Constraints:
During fault hours:
,
Regarding the power balance constraints, in the non-fault condition (Equation (21)), the normal load profile is always supplied, while in the fault condition, Case 1 (Equation (22), ensuring supply of all energy demand) and Case 2 (Equation (23), ensuring supply of a critical demand) are evaluated. For both cases, some flexibility in the system is provisioned to be able to “pour” solar energy if necessary. This happens when the connection to the power grid is lost. Given that during this fault event the demand for normal or critical energy must be ensured from the batteries and the PV generator, the latter being unavailable makes the task of matching generation to demand quite complex. For this reason, in the case of fault it is necessary to include the inequality symbol in the power balance equations (i.e., the PV production can be reduced).
2.2. Two-Stage Stochastic Planning Model
Since the deterministic models described in the previous section do not consider the uncertainty represented by moments of the year in which a fault could occur (any hour of the analysis horizon), the stochastic dimension was included in order to optimally plan microgrids capable of facing different main grid fault scenarios. The literature describes stochastic programming as a two-stage problem [
40]: the first stage associates investment decisions on a project, whilst the second stage involves decisions on the operation and/or maintenance of project assets. In this sense, the variables of the models from the previous section were adjusted to include a random vector represented by scenarios (s) for the moments of the year in which a fault could occur, and as a consequence solve a planning problem with a stochastic approach.
Taking into account that the equations of the first stage are the same as those presented in the deterministic models of
Section 2.1, only the variables and constraints that affect the second stage of the stochastic planning problem are presented below:
Battery power constraints:
where
represents the operational scenarios of the microgrid, for hours of the year in which a fault occurs. For this work,
takes values of 1, 2 and 3 (three scenarios).
Power injected into the grid:
Battery charging and discharging power:
Minimum power requirement of the inverter charger:
Finally, the objective function of the stochastic planning problem, both in connected mode and in islanded mode, under reliability requirements, is presented in Equation (36).
where
p(s) is the probability for each scenario
.
Constraints:
During fault hours:
,
This way of representing the objective function of the stochastic problem (Equation (36)) is known as the “implicit form of the stochastic programming problem” because it describes in a general way the decision variables of the second stage for
scenarios to be evaluated [
40].
Identification of stochastic scenarios: In order to perform stochastic simulations of the models in Equation (36), it is necessary to identify the scenarios (fault start times in the power grid). In this sense, the strategy used in this research was to obtain the annual “Fault Energy Demand Duration Curve” (for each residential household and for each group of households). Each value of this curve corresponds to the total energy that would have been consumed during the next 8 h given a fault occurring in hour h; after that, these values are sorted from highest to lowest. The steps to identify the scenarios are as follows:
Establish the duration of the continuous fault (1, 2, …, d) where d is the maximum duration of the fault in hours.
Establish moving windows for the size of the fault duration and sum the demands within the established range. Then, move the window to the second hour and add the demands of the new range. It must start at until .
Obtain histograms with an annual distribution of energy demand during fault hours for the study horizon. Next, the fault energy demands (scenarios) must be organized in descending order, taking care to identify the time of year in which each one occurs.
Given that the number of scenarios is quite large, Ward’s hierarchical agglomeration method is applied to obtain the representative fault energy demands of each scenario to be modeled (according to the number of clusters to be formed). Ward’s method is presented in [
41]. This is a hierarchical procedure whose objective is to find, at each stage of the agglomeration process, two clusters or individuals whose union provides the smallest increase in the total sum of errors
. Ward’s method has the form presented in Equation (40):
where
is the sum of squares of the errors in cluster
, that is, the squared Euclidean distance, between each individual in cluster
at its centroid.
is the value of the
–
th variable on the
individual of the
–
th cluster, assuming that said cluster has
individuals.
means component
of centroid
of cluster
.
Finally, the sum of squares of the errors for all clusters, assuming there are
clusters, is determined as shown in Equation (41).
After the clusters are formed, the mean of each one is calculated and the individual or scenario (energy fault demand) that is closest to the adjustment of its cluster is chosen. Finally, this value is indexed to obtain each scenario to be modeled, i.e., for this research, the time energy fault demand is presented. Subsequently, the probability that this fault demand occurs is calculated as the relationship between the number of scenarios per cluster and the total number of scenarios for the entire population.