Next Article in Journal
The Financing of Renewable Energy Sources and the Level of Sustainable Development of Poland’s Provinces in the Area of Environmental Order
Next Article in Special Issue
Individual vs. Community: Economic Assessment of Energy Management Systems under Different Regulatory Frameworks
Previous Article in Journal
Adaptive Control of Fuel Cell and Supercapacitor Based Hybrid Electric Vehicles
Previous Article in Special Issue
Dynamic Modeling of Multiple Microgrid Clusters Using Regional Demand Response Programs
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Comprehensive Model for the Design of a Microgrid under Regulatory Constraints Using Synthetical Data Generation and Stochastic Optimization

1
Electric Engineering Department, Escola d’Enginyeria de Barcelona Est, Polytechnic University of Catalonia, 08019 Barcelona, Spain
2
km0.Energy, Carrer de Lepant, 43, 08223 Terrassa, Barcelona, Spain
*
Author to whom correspondence should be addressed.
Energies 2020, 13(21), 5590; https://doi.org/10.3390/en13215590
Submission received: 31 August 2020 / Revised: 18 October 2020 / Accepted: 19 October 2020 / Published: 26 October 2020

Abstract

:
As renewable energy installation costs decrease and environmentally-friendly policies are progressively applied in many countries, distributed generation has emerged as the new archetype of energy generation and distribution. The design and economic feasibility of distributed generation systems is constrained by the operation of the microgrid, which has to consider the uncertainty of renewable energy sources, consumption habits and electricity market prices. In this paper, a mathematical model intended to optimize the design and economic feasibility of a microgrid is proposed. After a search in the state-of-the-art, weaknesses and strengths of existing models have been identified and taken into account for building the present model. The present model should be seen as a basis on which other models can be built upon, hence a complete definition of the different sub-models is stated: uncertainty modelling, optimization technique, physical constraints and regulatory framework. One of the main features presented is the generation of synthetic data in uncertainty modelling, employed to enhance the reliability of the model by taking into account a longer time horizon and a shorter time step. Results show significant details about energy management and prove the suitability of using a stochastic approach rather than deterministic or intuitive ones to perform the optimization.

1. Introduction

1.1. Context and Definitions

Motivated by the 2030 climate targets, the installation of distributed generation facilities is starting to proliferate in the European Union (EU) [1]. The distributed generation paradigm aims that energy would be produced locally by an aggregation of at most a few hundreds of prosumers. This aggregation, called an energy community (EC) [2], makes use of the resources in their immediate environment to produce the energy that will satisfy their own needs. These resources are eminently renewable, simply because they are the most widespread geographically and the ones that a small group of people is capable of exploiting. The structure that integrates all the elements of production, distribution and consumption in an EC is called a microgrid.
In this study, a grid-connected microgrid is assumed. This structure allows the aggregation of the prosumers while guaranteeing the access to the electricity grid supply in case of not having enough in situ produced energy. Regarding the isolated operation of a microgrid belonging to an EC, it has not been considered here the contingency of islanding mode as it occurs in the eventuality of a grid failure, which is not the general case approached in this study.
When addressing the design of a microgrid for an EC, in which the elements of generation are strictly renewable, a problem arises due to the idiosyncrasy of the renewable sources: their large variability, both spatial and temporal. This variability is caused by the strong dependence of some sources, such as solar or wind power, on the weather conditions, meaning that if the weather conditions change from one place to another and between different points in time, the generation output will vary too. In addition, the consumption of electrical energy at a small scale is also very volatile, because it is difficult to forecast the exact moment when an appliance is switched on or off. Moreover, it is of utmost importance that the supply of electricity is uninterrupted, to ensure that the consumers have a high level of comfort. In consequence, the design of the microgrid must include an accurate forecast of the generation potential and the habits of the consumers.
Currently, it is possible to forecast the aforementioned key variables for a short time period with little error [3]. However, in order to evaluate the feasibility of a microgrid in an EC, this forecast alone is insufficient; it is strongly recommended to perform a long-term analysis [4], with a time horizon of months or even years. This kind of long-term analysis allows capturing the irregularities in the patterns of weather conditions, habits of consumption, and other key variables, a thing that cannot be achieved by forecasting in the short-term. Recently, several statistical techniques have been employed to address this issue, one of the most prominent ones being stochastic programming [5]. Stochastic programming takes into account a variety of scenarios, characterized by a distribution of probability. In consequence, this approach is able to take into account different future situations, making the outcome of the analysis more reliable.

1.2. Review of the State of the Art, Justification and Objectives of the Paper

Several studies have been of paramount importance in the optimization of the design and management of microgrids under uncertainties. Farsangi et al. present in [6] a two-stage stochastic program aimed to minimize the operational cost in a microgrid with electrical and thermal loads. The uncertainties covered are renewable generation, load and electricity price, and scenarios are generated based on theoretical probability distributions such as Normal or Beta. Li et al. [7] use a combination of mixed integer linear programming and a metaheuristic algorithm to optimize both sizing and operation of a microgrid. A sensitivity analysis is used to account for uncertainties. In [8], Shin et al. elaborate a day-ahead energy management with a detailed model of wind uncertainty using a Markov decision process. Thomas et al. [9] integrate the electric vehicle as a source of uncertainty, alongside photovoltaic (PV) generation. PV measurements are clustered, while synthetical driving profiles are generated to account for randomness in the electric vehicle availability. A different approach is employed by Fazlalipour et al. [10] who investigate the optimal participation of a renewable microgrid in the market, with a non-linear program. A lognormal probability distribution is assumed to model price uncertainties. Nikmehr et al. [11] consider different demand response programs and employ a PSO algorithm to optimize the operation of a microgrid. Normal and Weibull distributions are used for the scenario generation of renewable generation and load. Risk measures originated in economics are applied in the field of energy planning by Narayan and Ponnambalam [12] in a two-stage stochastic program which take into account generation and load variabilities. Correa-Florez et al. [13] present a day-ahead operation of a local energy management system taking into account the battery life cycle and also uncertainties in load and PV generation. This results in a nonlinear program which is decomposed with a metaheuristic algorithm. Wang et al. [14] consider also market price uncertainty by means of a time series. The two stages of the program are devoted to the energy management, being the granularity in the second stage higher than in the first. Lastly, in [15], Mavromatidis et al. identify uncertainties in distributed energy systems and elaborate a sensitivity analysis with the most relevant ones. The design is optimized from a deterministic point of view and then uncertainties are added.
Considering the undertaken search on the state of the art of mathematical programming in microgrids under uncertainty, the present paper is justified because of the following reasons:
  • Most of the works analyzed consider the effects of uncertainty on renewable generation, some others on the load, but there are few works which take into account the effects of the three principal sources of uncertainty at the same time: generation, load and market price.
  • Some of the works show the virtues of an innovative metaheuristic algorithm, but more than often this algorithm is complex, leading to a non-reproducible work.
  • Most of the models deal with random variables with a simple model based on theoretical probability distributions, such as the normal distribution. This characterization does not reflect accurately the behavior of these random variables.
  • Most of the results lose accuracy when considering a time horizon of a few days or a daily time step, instead of an hourly one.
  • Generally, when modelling an EC, an aggregated formulation is employed, meaning that the renewable generation and load of all the prosumers of the community is considered as one. A disaggregated formulation allows going into detail on how the energy management between different prosumers is done.
  • In general, the models addressed to characterize the EC ignore the regulatory restrictions and its effects on the energy management and economic results.
In order to cover the identified gaps present in the scientific literature, the contributions of the study are aimed to provide:
  • A mathematical model which allows analyzing the viability of the investment in a microgrid for an energy community. This model embeds the regulatory constraints of the EC microgrid. The microgrid is supplied by solar and wind power. This model, besides optimizing the design of the microgrid, allows analyzing how the energy management is done. For this purpose, a disaggregated formulation is applied, the time horizon is set to one year and the time step to one hour.
  • Two-stage stochastic programming (SP) has been employed to take into account the randomness of the sources of uncertainty, these being: renewable generation, electrical consumption and electricity market price. The first stage corresponds to the design stage, while the second stage corresponds to the energy management during the time horizon. Each source of uncertainty has been characterized with models present in scientific literature, and to train these models, the information contained in databases is used as far as possible.
  • The model allows for reproducibility, modification, and expansion. The mathematical model is in fact a core where different submodels for forecasting the renewable generation, loads and market prices can be coupled to. Besides, the formulation of the model can change to include different types of energy storage, different configurations of the energy community, and the presence or not of incentives and taxes.
Figure 1 summarizes the different possibilities in which a microgrid model can be expanded to include different submodels of uncertainty analysis, mathematical formulation, and physical and economic conditions.

2. Mathematical Model

2.1. Microgrid Topology

The configuration of the microgrid is schematized in Figure 2. The EC consists of a number D of dwellings which are constituted as prosumers. Each dwelling comprises a series of loads, which are described by their energy consumption ( C d , h , s ), and a PV facility, which is described by its generated energy ( EG d , h , s PV ) and peak power ( P peak PV d ). Each dwelling has an available area to install solar panels Smax d .
The microgrid on this study is considered to be 3-phase AC. Therefore, PV inverters are required to transform direct current produced by solar panels to alternating current. Each of the dwellings is assumed to have also a 3-phase main breaker, even though the loads can be both single-phase and 3-phase. Besides, a centralized generation facility is considered. Centralized generation takes the form of a small-scale wind power plant which consists of a number N _ WT of wind turbines. This power plant supplies energy equal to EG h , s WT in form of alternating current. The electricity produced by wind turbines goes through a rectifier, whose output is connected to a centralized battery bank, of capacity Bcap . The battery bank main function is to resolve the intermittency of wind-produced electricity. Additionally, it can be used as a backup in case of a blackout in the main grid. When the battery is full, the excess energy of the wind power plant is dumped to the grid.
The EC considered in this article is created from an existent residential area. In consequence, the connection with the electrical grid is maintained. In order to maintain voltage and frequency within the desired values, PV inverters act as regulators for the solar energy, whereas for the energy that comes from the wind power plant and the battery bank, another regulator is used.
Each line is sized in order to admit a maximum current of I max . It is supposed that regulators act in order to maintain a constant voltage through all the coupling points of the microgrid. In addition, reactive loads are considered negligible compared to active loads. Therefore, the current limitation can be translated to an active power limitation PLineMax .
According to Figure 2, different nodes by which the electricity flow goes through can be identified. These nodes are: PV generation, wind power generation, storage, consumption, and main grid. The energy flows and their denomination in the mathematical program are depicted in Figure 3.

2.2. Model Formulation

As already mentioned in Section 1.2, the merits of the presented model rely on embedding the regulatory constraints into the making decision as well as a comprehensive treatment of the uncertainty.

2.2.1. Physical Constraints

The physical model and energy flow of the microgrid is depicted according to the following equations and Table 1, Table 2, Table 3, Table 4 and Table 5. Firstly, all energy balances must be satisfied according to what is shown in Figure 3.
EG d , h , s   PV =   PV . to . C d , h , s   +   PV . to . G d , h , s   +   PV . to . B d , h , s     d , h , s
EG h , s WT   =   WT . to . G h , s   +   WT . to . B h , s   +   WT . to . C d , h , s     h , s
C d , h , s   =   G . to . C d , h , s   +   PV . to . C d , h , s   +   B . to . C d , h , s   +   WT . to . C d , h , s   d , h , s
The variables that figure in the energy balances must be bounded appropriately:
EG _ ma   x   d , h , s PV   =   I h , s   ×   Δ t   ×   S d × η panels η inverter   d , h , s
EG _ max h , s WT   =   P h , s WT   ×   N _ WT           h , s
EG d , h , s PV     EG _ max d , h , s PV         d , h , s
EG h , s WT     EG _ max h , s WT         h , s
The design variables are constrained to a maximum value:
S d     Smax d     d
N _ WT     N _ WTmax
An informative variable is created in order to express the results in terms of peak installed power instead of occupied area.
P peak PV d = RPS × S d     d
The flows that go through a line cannot surpass the maximum capacity of that line:
d D ( PV . to . G d , h , s ) + WT . to . G h , s PLineMax     h , s
d D ( B . to . C d , h , s   +   G . to . C d , h , s + WT . to . C d , h , s ) PLineMax       h , s
d D ( PV . to . G d , h , s + PV . to . B d , h , s ) PLineMax     h , s
The constraints related to the energy storage ensure that the total installed capacity and the charge and discharge power are below a certain limit:
BCap     Bmax
EB _ C h , s   =   WT . to . B h , s   + d PV . to . B d , h , s   h , s
EB _ D h , s   = d B . to . C d , h , s   h , s
EB _ C h , s     PBat _ max   ×   Δ t     h , s
EB _ D h , s   PBat _ max × Δ t     h , s
It is also ensured that the energy inside the batteries is updated in each time period while not surpassing the installed capacity. An initial charge is set in order for the updating constraint to be consistent for all time periods:
SoC min × BCap     B h , s SoC max × BCap     h , s
B h , s   =   B h - 1 , s + ( EB _ C h , s × η bat ) ( EB _ D h , s / η bat )   h , s
B 0 , s = SoC _ 0   × BCap     s

2.2.2. Regulatory and Economic Constraints

The electrical bill without microgrid is described by Equations (22)–(24), and is based on the Spanish billing structure. The energy cost of each dwelling ( CE d , s SA ) covers the costs of energy production plus a percentage of losses, while the access cost ( PA d , s SA ) covers the costs of the electrical grid and the renewable energy premiums. Grid charges ( Te h and Tp ) change depending on the electricity contract, but in this case, it is considered that all housings possess the same contract, with a constant price throughout the day. The total cost ( FSE d , s SA ) considers, as well, the taxes (the electricity tax and the VAT, of 5.1% and 21%, respectively):
CE d , s   SA = h = 1 8760 C d , h , s × MarketPrice h , s   d , s
PA d , s   SA = h = 1 8760 C d , h , s × Te h + Pcon d × Tp   d , s
FSE d , s SA = ( ( CE d , s SA + PA d , s SA ) × ( 1 + ETax ) ) × ( 1 + VAT ) d , s
The electrical bill, in the case of using a microgrid under the self-consumption scheme, is described by Equations (25)–(27):
CE d , s = h = 1 8760 G . to . C d , h , s × MarketPrice d , s   d , s
PA d , s = h = 1 8760 G . to . C d , h , s × Te h + Pcon d × Tp   d , s
FSE d , s = ( ( CE d , s + PA d , s ) × ( 1   +   ETax ) ) × ( 1 + VAT )   d , s
The incomes and taxes related to the excess of energy injected into the grid, and the economic cost of using the microgrid, are described by Equations (28)–(30):
ING d , s = h = 1 8760 PV . to . G d , h , s × SellingPrice h , s + WT . to . G d , h , s D × SellingPrice h , s   d , s
TAX d , s   = FTax × ING d , s + VTax × h = 1 8760 PV . to . C d , h , s +   WT . to . G h , s   d , s
COpm d = COpm PV × P peak PV d + COpm WT × NWT × PWT m à x + COpm Bat ×   BCap D   d
Regarding the operation and maintenance (O&M) costs, these are eminently flat (€/kW·year) and in the case of the generation elements, are extracted from [16]. Regarding the batteries, the costs are extracted from [17]. The costs are heavily influenced by the operational regime of the batteries: number of cycles and depth of discharge (DoD). These costs are assumed for an operational regime of 1 cycle/day and 80% of DoD.
The new rated power for each dwelling is reduced depending on the average storage installed capacity:
Pcon df =   Pcon d     BCap F × D   d
where F is a dimensionless parameter which allows modifying the trade-off between battery capacity and reduction of power. It also constrains the installation of a very high battery capacity. In Equation (31), the standardization of the rated power is dismissed for the sake of simplification.
In Table 6, Table 7, Table 8, Table 9, Table 10 and Table 11 the values and definition of each economic parameter can be consulted.

2.2.3. Description of 2-Stage Stochastic Programming

In order to account for the variability of different future scenarios, 2-stage stochastic programming has been employed. The two stages of the program are divided by the moment of realization of the random variables. The first stage, or design stage takes place before knowing the realization while the second or management stage takes place after that. Defining by x the set of first-stage decisions, by y the set of second-stage decisions and by ξ the set of uncertain parameters, the 2-stage stochastic program can be written as [18]:
minc T x +   Ε [ Q ( y , ξ ) ] s . t .       Ax   =   b x     0
where:
Q ( y , ξ )   =   minq T y s . t .       T ( ξ ) x   +   W ( ξ ) y   =   h ( ξ ) y     0
where c and q are the first and second stage costs respectively, and the set of second-stage constraints is characterized by T ( ξ ) x   +   W ( ξ ) y   =   h ( ξ ) . Assuming that ξ is continuous, its expected value is calculated as:
Q ( y )   =   Ε [ Q ( y , ξ ) ]   =   Dom f ( ξ ) Q ( y , ξ ) · f ( ξ ) d ξ
However, computing this integral is practically impossible in most of the cases. This is why the equivalent deterministic form is used. Every uncertain parameter ξ i is discretized as a finite set of scenarios. Each scenario represents a plausible realization of the random variables that occurs with a certain probability. The stochastic program is then reformulated into a set of deterministic programs where:
Ε [ Q ( y , ξ ) ]   = s S Prob s · Q ( y , ω s )
where ω s is a scenario or realization of the random variables. To generate the scenarios, the models described in Section 2 are employed, and it is assumed that each source of uncertainty is independent of each other. Solving the problem with this formulation leads to the optimal solution (x*, y * ( ω s ) ).

2.2.4. Objective Function

The main goal of the program is to ensure that the microgrid is economically feasible by deciding which combination of elements has to be installed and performing the most cost-effective operation for all the energy community. The microgrid would be less likely to be installed in case that its operation was more expensive than in the standard case, meaning purchasing all the electricity from the grid. Therefore, the operation costs of the standard case and the self-consumption case must be compared. These operation costs are given in their majority by the electricity bill that the power company handles to the customer. Installing a renewable energy facility might reduce the energy dependence on the grid, if it is appropriately designed, and in consequence, the price of the bill. Besides, generating energy allows the community to act as a producer and perceive earnings from the sale of electricity. The main drawback is that the maintenance of the facility is severally assumed by the energy community, and not by the system operator. The maintenance costs are here assumed to be a linear function of the installed capacity.
It is thus considered that the facility is economically viable if the investment costs are recovered in less than the lifetime of the facility. This time is called the payback time. The shorter the payback time, the higher the viability of the microgrid. Therefore, the deterministic objective function can be written as:
Obj . f :   minz det   =   CInv LSpan + d D ( COpm d ( FSE d SA FSE d ) ( ING d TAX d ) )
where CInv is the total investment cost, LSpan the lifespan of the facility in years so the ratio of CInv to Lspan represents an undiscounted annualized investment cost. The term inside the sum represents the energy management cost during a year of operation. It consists of the operation and maintenance costs, the savings in the energy purchase respect to the case without self-consumption, and the net income for the sale of electricity. Note that by dividing CInv LSpan it is implied that the time horizon is of one year. Likewise, the effects of inflation and depreciation through the years are neglected.
Considering now the two-stage stochastic formulation, it is clear that the first-stage cost corresponds to the investment cost. The investment is made while the values of solar irradiance, wind speed, electrical consumption and market price remain unknown. In other words, CInv is independent of the scenario s. On the other hand, the energy management, meaning the flux of energy that goes through the different elements of the facility (generators, batteries, loads and grid) changes depending on the values of the aforementioned sources of uncertainty; hence it depends on s. The stochastic objective function can be written as:
Obj . f :   minz   =   CInv LSpan + s S Prob s d D ( COpm d , s     ( FSE d , s   SA -   FSE d ) ( ING d , s   -   TAX d , s ) )
where s S Prob s = 1 and CInv is defined as following, taking into account that the battery lifespan LBat is lower than the one of the facility:
CInv = d D CInv PV × P peak PV d + CInv WT × N _ WT   ×   PWT m à x + CInv Bat × BCap · LSpan LBat

3. Uncertainty Analysis

In this section, the characterization of the sources of uncertainty is described. The sources of uncertainty under consideration are, as mentioned before, renewable generation (solar and wind power), load and electricity market price. The methodology to implement this characterization is the same for all four sources: models present in scientific literature have been sought, one of them has been chosen on the basis of the good relation effectiveness - simplicity, and subsequently it has been adapted for their use as synthetic data generators.

3.1. Solar Generation

Solar irradiance under clear-sky conditions can be modelled deterministically [19]. Nevertheless, it is because of the presence of clouds and other particles that reflect and refract the solar radiation that the irradiance can be considered a random variable [20]. There exists a variety of methods to model solar irradiance under real conditions but there is still no consensus about which models fit better: deterministic [21,22] or stochastic [23,24,25,26,27,28,29,30,31].
The model that has been chosen in this article to model solar irradiance is a seasonal ARIMA or SARIMA [32]. The SARIMA model is chosen because it tackles the seasonality caused by the rotation movement of the earth. Solar radiation data has been extracted from the Helioclim database [33], and is modelled indirectly, using a Clear-Sky-Index [19]:
k = I I clear [ 0 , 1 ]
where the Clear-Sky Index k is a parameter between 0 and 1 that indicates the proportion of irradiance that reaches the ground level respect the irradiance that would reach if the sky was completely clear Therefore, values of k do not depend on the season of the year.

3.2. Wind Power

In order to forecast the wind resource, a wide range of methods have been employed, both deterministic [34,35] and stochastic [36,37].
For the purpose of this article, it is necessary to use a model that is able to generate plausible scenarios from a microscopic (correlation between two consecutive values of wind speed) and a macroscopic (monthly generated energy) point of view. The method that is used is adapted from [38]. The main advantage of this model is that it allows working on daily mean values and having as a result a time series of hourly values. To this end, the following equation is employed:
v h = v d ( 1 + cos ( π 12 ( h   -   h p ) ) )
where v h is the wind speed at hour h, v d is the daily mean speed and h p is the hour when maximum speed has been recorded. To the resulting values, an autoregressive model of first order is applied:
v h = a · v h - 1 + ε h
where a is the autocorrelation coefficient. The series has now consistency from an hourly point of view but it does not lead to the expected monthly generated energy. That is because the resulting series follows a Normal distribution, while wind speed is better approximated by a Weibull distribution. In consequence, a mapping has to be done to let the data of the time series follow a Weibull distribution. The mapping is done by matching the cumulative distribution functions of both Normal and Weibull, which result in the following equation:
v Wei = λ ( ln ( 1 2     1 2 erf ( v Norm - μ 2 σ ) ) ) 1 k
For this project, daily mean and maximum wind speed data have been extracted from AEMET database [39]. The parameters c and k of Weibull distribution are chosen depending on the location, by consulting wind atlas such as DTU Global Wind Atlas, NASA MERRA-2 or CNER Spanish Atlas [40,41,42]. In practice it is useful to consider different Weibull distributions for each season and obtaining the parameters using this relation:
v ¯ = λ Γ ( 1 k + 1 )
where v ¯ is the quarterly mean wind speed and Γ is the gamma function.
Wind power as a function of wind speed is essentially given by the power curve of the wind turbine. This curve can be divided in three zones: A first zone where the wind speed is below the cut-in value and the wind turbine is not working. Then, a second zone where the power follows the following theoretical law:
P WTh = C p · 1 2 ρ v h 3
where Cp is the coefficient of power of the wind turbine and ρ is the density of the wind. In practice, a polynomial regression is employed to extrapolate the power from the wind turbine power curve. Finally, there is a third zone where the output reaches the rated power value and the power is limited disregarding the speed of the wind. The turbine is stopped when the speed surpasses a cut-out value for safety reasons.

3.3. Load

Aggregated demand shows some regular features, and it can be forecasted accurately if factors like season, day of the week and weather conditions are taken into account. It is, nevertheless, the other way around when analyzing individual demands, especially if the analysis is performed on the residential sector. Besides physical and economic conditions, in a dwelling, factors such as the number of appliances, work schedule, holidays and the financial capacity of the dwellers must be taken into account.
There are some works which try to model load in a disaggregated way [43,44,45,46,47]. The approach employed in this paper instead is to generate synthetical data from aggregated values. To do this, the load profiles are created from the probability of use of different electrical appliances. The method is adapted from [48] and the demand profiles are obtained from [49]. For each house and device, a random uniform number R 1 d , e between 0 and 1 is generated:
R 1 d , e ~ U ( 0 , 1 )
where d represents the set of dwellings and e the set of appliances. For each appliance it has been defined a set of probabilities which indicate the rate of possession p e and the rate of multiple possession Mp e x so:
  • If R 1 d , e   <   1 p e the dwelling d do not possess the appliance e.
  • If R 1 d , e   <   Mp e x the dwelling d possess x appliances of type e.
Once the devices of each housing have been defined, the demand profiles can be created. A second random number R 2 d , e , t is generated, this time for each dwelling, appliance, and time step:
R 2 d , e , t ~ U ( 0 , 1 )
where e’ is the set of appliances taking into account the rate of possession (different in each dwelling) and t is the hour. u e , t is the probability that the appliance e is turned on at time t.
If R 2 d , e , t   >   u e , t the appliance is on stand-by. Otherwise, the appliance is switched on and remains on during Le time steps. During this time, the device consumes an energy equal to E d , e , t . Additionally, when a device is on, it cannot be switched on again and after it is switched off, the probability that it is turned on again becomes lowered by a factor β .
R 2 d , e , t   <   u t E d , e , t .. t + L e = P e · F e · R e · Δ T   ;   u t .. t + L e = 0   u t + L e .. T = u t β
where P is the nominal power, F is the ratio between nominal power and mean power, R is the ratio between the real time that the device is on and the number of defined time steps Le and Δ T is the length of the time step.
Finally, the consumption of a household is equal to the sum of the consumption of all its appliances:
C d , h = e E d , e , h

3.4. Market Price

The electricity market price fits into the field of financial time series, and for that reason, many forecasting methods can be applied to it [50,51,52,53]. The particular model employed in this paper is based on [54]. It takes into account the strong relation between the price of energy and the demand, and allows to capture the typical features that are present in this financial series such as seasonality, price spikes, and rapid reversion to the mean. The equation of the model, simplified from the aforementioned article, is the following:
MarketPrice h = exp ( f ( h , L h v h ) + X h )
where MarketPrice h is the energy price at the hour h, Lh is the energy demand, vh is the availability of power, meaning the ratio between available power and installed capacity, and Xh is a stochastic process which describes the short-term variability of the energy price. v is assumed to be deterministic and the load is assumed to have two components:
L h = L ^ h + L h
where L ^ h is the deterministic forecast of the demand, which can explain most of the variability, and L h is the error, which can be modelled as a SARIMA time series with a frequency of 24 h.
Function f relates the load with the logarithm of energy prices. To determine the coefficients of the function, a polynomial regression is employed. The inclusion of the availability term v t is showed to improve the performance of the regression. Note that the function also depends on t, meaning that the relationship between market price and demand also changes depending on the day of the week. In practice in this work it is considered the difference between weekdays and weekends and between winter time and summer time. For each one of the four groups, the price-load regression is performed.
Process X describes the fluctuations of the market due to its own nature and to eventualities such as outages and blackouts. It is assumed that both processes X and L are independent. The seasonality of X is much lower than the one that can be seen in L, anyway, it can be modelled as well with a SARIMA model with a frequency of 24 h.
For this work, data of Spanish market prices has been extracted from the CNMC [55] and OMIE [56] databases. The availability and aggregated demand have been extracted from the transmission system operator, REE [57].

3.5. Scenario Reduction

In order to increase the accuracy of the simulation it is convenient to generate the highest possible number of scenarios. However, this must be done without greatly increasing the simulation time. To this aim, a set of representative scenarios has been employed, using the backward algorithm [58].

4. Case Study and Analysis of the Results

4.1. Case Study Definition

A particular location has been analyzed in order to test whether it is suitable or not for transforming it into an energy community. More specifically, the location corresponds to the residential area located at the geographic coordinates 41.65 N, 2.16 E in Spain. This zone was considered adequate because the PV potential is high and the orography is suitable for the installation of wind facilities.
For practical purposes, it is considered that all solar panels are installed on-roof, facing south and with a constant tilt 𝛼 = 15°. In order to transform the global horizontal irradiance into the irradiance over a fixed plane, a linear regression is done on the quotient between horizontal and tilted irradiance data in Helioclim database [33].
For the solar panel model, generic characteristics have been employed. It is considered that the solar panel allows generating 180 W/m2 under an irradiance of 1000 W/m2. The temperature effects on the module efficiency are neglected. Each panel has an area of 1.5 m2 and they are connected to maximum point power tracking (MPPT) inverters, which ensures that the power of the PV string is always the highest possible. These inverters are simplistically modelled, assuming that they start to work with constant efficiency from 2% of nominal power onwards. The batteries considered in this case are of li-ion technology. Self-discharge is neglected. Figure 4 depicts the solar production and the consumption of a dwelling for a single week.
The program has been computed using the AIMMS interface, release 4.73, using the CPLEX solver, on a laptop with an Intel i5-6300HQ CPU and 8 GB RAM. To improve the clarity of the results, a model with D = 10 dwellings and S = 10 representative scenarios is employed, as Table 12 shows.

4.2. First Stage Variables: Sizing Results

The first stage variables lead to determine the total amount to be invested in the microgrid. In this regard, as depicted in Table 13, the optimal investment is 230,210 € (23,021 €/dwelling) and the money must be spent in installing the maximum number of PV panels and wind turbines, limited in this model at 10 kWp/dwelling and one wind turbine for every two houses. Additionally, the battery bank capacity is 19.0 kWh (21.1% of the upper limit, 90 kWh in this case). The contracted power can be reduced to 2.64 kW. It is noteworthy that the optimal solution includes the installation of the maximum solar and wind power, while not wholly relying on batteries, as it indicates that both sources are profitable in this location.
The objective function result, which consists of the undiscounted annualized investment costs minus the savings achieved during a year of operation, is negative, which indicates that the microgrid is viable. According to the results, each year (neglecting the effects of depreciation and inflation) 2799 € extra are saved. On Figure 5 the breakdown of the objective function management costs and savings can be observed, and Table 13 shows the values that the first stage variables take after the optimization is performed.
The total payback time (PT) is calculated as:
PT = CInv CInv LSpan - z
For a lifespan of 20 years, the payback time is equal to 16.09 years.

4.3. Second Stage Variables: Energy Management Results

The second stage variables are the ones which show how the optimal management of the microgrid must be done. According to the results depicted in Figure 6 and Figure 7, PV generation and batteries are the main sources by which loads are satisfied. In Figure 7, it is depicted how the batteries supply the consumption of a single dwelling. The energy storage is working intensively to supply the demand. Only when the solar irradiance is at its peak, the batteries stop running. Besides, the optimal solution leads to injecting all the surplus energy to the grid (see Figure 8), which is possible because the installed peak power is higher than the peak of consumption. Regarding the contribution of PV power to the battery charge, results have shown (see Figure 9) that it is limited, because the batteries are mostly charged by the energy generated by the wind turbines (see Figure 10).
The sizing results lead the rated power of the wind systems to reach its upper limit; as a result, the wind system is able not only to charge the energy system but to sell the rest of the energy to the grid. As it is depicted in Figure 11, the energy management system forces the wind system to inject the surplus of energy to the grid in the night, when the lowest consumption happens while the wind speed is the highest. However, as PV and batteries have priority at supplying the loads, wind turbines’ contribution remains little, as Figure 12 shows.
On the other hand, the supply of the grid is minimal (see Figure 13). One of the main goals when installing a microgrid is to reduce dependence on the grid, and so it has been. Only a few times throughout the year, and particularly during the winter months, it is necessary to import energy from the grid. The new rated power is determined in fact, by the peak power of supplied energy in the most adverse scenario.

4.4. Comparison with a System without Energy Storage

One of the common quandaries when designing an EC is whether to include an energy storage system or not. The main advantage of storage is that it provides more autonomy and independence of the main grid, whereas the main drawback is that it increases the investment cost. To quantify the importance of installing energy storage, a simulation was performed setting the maximum battery capacity to zero. The results are shown in Table 14 and Figure 14.
It is worth noticing, as Figure 14 shows, the difference in the second stage costs between the models with and without energy storage. The absence of a battery saves some O&M costs, although the optimal capacity is low enough for them not to be greatly decreased. Earnings due to the sale of energy increase a little bit due to the reduction in the level of self-consumption, which obligates the management system to dump energy into the grid. This in turn increases the generation taxes. However, what is most noticeable is the increase on the energy bill, which increases by more than two times compared to the model with energy storage. This is due to the reduction of autonomy that supposes not having an energy storage system available.
It is also worth observing how the dependency from the main grid increases drastically without an energy storage system, as Figure 15 shows.

4.5. Quality Metrics

4.5.1. Performance of the Optimization

In order to evaluate the suitability of the approach employed in this study, two quality metrics are employed. The first one is the performance of the optimization (PO). This metric compares the solution that would be chosen in the case that the facility installers would not use any optimization algorithm, with the configuration resulting from the stochastic optimization approach.
One of the most common approaches that EC designers use when sizing a microgrid is to maximize the self-consumption rate, or equivalently, reduce the dependence to the grid as much as possible. To this end, distributed generation facilities are oversized to their maximum capacity, which is just limited by the roof or land area and the amount of investment [59]. Therefore, the solution that, intuitively, distributed generation facilities would take, is to set all design or first-stage variables to the upper limit.
The PO metric is then measured as the difference between the values of the objective function under this intuitive approach and the objective function under the stochastic programming approach:
PO = z Int - z
where z Int is the value of the objective function on the original program after the design variables are taken to their maximum limits.

4.5.2. Value of Stochastic Solution

The Value of Stochastic Solution (VSS) [60] is a parameter that quantifies the benefits of using a stochastic program instead of a deterministic one. The uncertainties of the deterministic program are modelled using their expected value:
EVP :   minz EVP = c T x + q T y s . t .       Ax = b   T ( E [ ξ ] ) x + W ( E [ ξ ] ) y = h ( E [ ξ ] )   x     0   ,   y     0
where EPV is the expected value problem. The solution of this problem leads to the set of first stage variables. If these decisions are taken, the solution would be suboptimal because it is hardly likely that the second stage variables would take their expected value in the future. When fixing the first stage variables of the original problem with the values obtained in the expected value problem, a suboptimal solution is obtained. This is the so-called expected solution of the problem (ESP):
ESP : minz ESP = c T x EVP * + Ε [ Q ( y , ξ ) ] s . t .       T ( ξ ) x + W ( ξ ) y = h ( ξ ) y 0
Thus, the VSS is equal to:
VSS = z ESP - z
Table 15 shows the values of the two quality metrics for this case study:
The VSS indicates that using a statistical approach in front of a deterministic one is worth a mean of 428 €/year, whereas the performance of optimization shows that using a statistical approach in front of an intuitive one is worth a mean of 2439 €/year.

4.6. Final Remarks

The optimal solution of the problem indicates that, at present, given the costs of investment, operation and maintenance of renewable energies, the installation of a microgrid in an energy community is economically feasible.
These results show that, even with detailed characterization of the sources of uncertainty, renewable energy supplied microgrids are a safe option of energy supply. The combination wind-solar is essential, in order not to depend on a single source because they are highly weather-dependent. The stochastic program, unlike deterministic formulations, envisages the possibility that there might be several consecutive hours or days in which there is low or no availability of the renewable energy sources. In consequence, the stochastic solution is more battery dependent, leading to a more conservative energy management than in the deterministic formulation.
It has been shown that even though the inclusion of energy storage increases the investment costs, it reduces the value of the objective function. This means that the energy storage system makes the facility more profitable by reducing dependence on the main grid and increasing autonomy. In the absence of it, however, renewable energy cannot guarantee a reduction of the dependence. Moreover, it is more reliable to supply loads with batteries, as the stochastic program solution demonstrates, than directly from renewable sources. The reason is that the intermittency of renewable energies, especially wind power, needs to be properly addressed by a control system, whereas batteries can supply a constant flow of energy.
However, it is worth noting that, in this case, the intuitive approach has performed worse than the model with no energy storage system. Therefore, oversizing storage can be even more detrimental for the finances of the EC users than not considering it. This strengthens the arguments in favor of using optimization techniques in distributed generation facility sizing problems.
To quantify how valuable is the use of stochastic optimization in front of deterministic optimization, VSS has been calculated. The positive result of the VSS shows that considering different representative scenarios gives a more valuable solution than by just considering a single expected value scenario.

5. Conclusions

A mathematical model that analyses the viability of a microgrid in an energy community has been implemented with satisfactory results. For the case study analyzed in this project, the installation of the facility supposes an average saving of 280 €/dwelling·year in contrast with the original grid-dependent configuration. The model has also proved the suitability of the renewable energy sources and set the storage capacity to 1.9 kWh/dwelling, a value that does not surpass the typical commercial specifications for li-ion batteries for households.
The characterization of the sources of uncertainty has been thorough, adapting methods of forecasting present in the scientific literature. An hourly step of temporal resolution has been chosen in order to consider diverse scenarios that test the resilience of the microgrid, meaning the ability to adapt to improbable future scenarios. This has led to a more battery-intensive management compared with a deterministic approach, which also results in more flexibility at handling different future situations. Each source of uncertainty has been characterized by different methods due to their different idiosyncrasy.
When modelling the solar irradiance, the tendency has been deleted by the use of the clear-sky index, and the seasonal component has been taken into account with a SARIMA model. Regarding the wind speed model, an autoregressive series of first-order has been applied to the data, and the result has been mapped into a Weibull distribution. In the market price model, the strong correlation between it and the demand has been exploited. When characterizing the consumption, a free-data model is used, which is based on the empirical probability of use of the different appliances.
Simulations based on these models have allowed obtaining synthetical data that, while not being a forecast of any particular time, can well represent any realistic year. A high number of scenarios has been generated and then reduced to a set of representative ones by using the backward algorithm.
The methodology developed is expected to be a useful tool for future investors and policy-makers, who will be able to conceive or design effectively energy communities supplied exclusively by renewable energy sources. The uncertainty inherent to generation and consumption is no longer a barrier which compromises the security of supply because it now can be analyzed thoroughly and effectively with models like the ones employed in this work. It is expected that the development of statistical forecasting techniques and optimization algorithms leads to an increase of this type of projects, thus contributing to higher energy independence and a reduction of the pollution caused by the centralized energy generation.

Author Contributions

Conceptualization, À.A. and J.d.l.H.; Methodology, À.A. and J.d.l.H.; Software, À.A.; Validation, À.A., J.d.l.H., S.C., H.M., P.S. and J.M.; Formal Analysis, À.A. and J.d.l.H.; Investigation, À.A. and J.d.l.H.; Resources, À.A. and J.d.l.H.; Data Curation, À.A., S.C. and H.M.; Writing—Original Draft Preparation, À.A. and J.d.l.H.; Writing—Review & Editing, À.A., J.d.l.H., S.C., H.M., P.S. and J.M.; Visualization, À.A. and J.d.l.H.; Supervision, J.d.l.H. and H.M.; Project Administration, M.T.P.; Funding Acquisition, R.P. All authors have read and agreed to the published version of the manuscript.

Funding

This work has been partially supported by the research project MICROEVC, RTI2018-100732-B-C22 (Agencia Estatal de Investigacion) and PECT LITORAL BESÒS TERRITORI SOSTENIBLE GO03-003364–Talent energètic.

Acknowledgments

The authors are especially grateful to all those persons and companies from the electricity sector who (confidentially and anonymously) have contributed to a better understanding of the reality of the regulatory constraints.

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

References

  1. Gangale, F.; Vasiljevska, J.; Covrig, C.F.; Mengolini, A.; Fulli, G. Smart Grid Projects Outlook 2017. 2017. Available online: https://publications.jrc.ec.europa.eu/repository/bitstream/JRC106796/sgp_outlook_2017-online.pdf (accessed on 13 March 2020).
  2. Prasad, B.; Koliou, E.; Friege, J.; Hakvoort, R.A.; Herder, P.M. Energetic communities for community energy: A review of key issues and trends shaping integrated community energy systems. Renew. Sustain. Energy Rev. 2016, 56, 722–744. [Google Scholar] [CrossRef] [Green Version]
  3. Agüera-Pérez, A.; Palomares-Salas, J.C.; Gonzalez-De la Rosa, J.J.; Florencias-Oliveros, O. Weather forecasts for microgrid energy management: Review; discussion and recommendations. Appl. Energy 2018, 228, 265–278. [Google Scholar] [CrossRef]
  4. Moret, S.; Codina, V.; Bierlaire, M.; Maréchal, F. Characterization of input uncertainties in strategic energy planning models. Appl. Energy 2017, 202, 597–617. [Google Scholar] [CrossRef]
  5. Ning, C.; You, F. Optimization under uncertainty in the era of big data and deep learning: When machine learning meets mathematical programming. Comput. Chem. Eng. 2019, 125, 434–448. [Google Scholar] [CrossRef] [Green Version]
  6. Farsangi, A.S.; Hadayeghparast, S.; Mehdinejad, M.; Shayanfar, H. A novel stochastic energy management of a microgrid with various types of distributed energy resources in presence of demand response programs. Energy 2018, 160, 257–274. [Google Scholar] [CrossRef]
  7. Li, B.; Roche, R.; Miraoui, A. Microgrid sizing with combined evolutionary algorithm and MILP unit commitment. Appl. Energy 2017, 188, 547–562. [Google Scholar] [CrossRef] [Green Version]
  8. Shin, J.; Lee, J.H.; Realff, M.J. Operational planning and optimal sizing of microgrid considering multi-scale wind uncertainty. Appl. Energy 2017, 195, 616–633. [Google Scholar] [CrossRef]
  9. Thomas, D.; Deblecker, O.; Ioakimidis, C.S. Optimal operation of an energy management system for a grid-connected smart building considering photovoltaics’ uncertainty and stochastic electric vehicles’ driving schedule. Appl. Energy 2018, 210, 1188–1206. [Google Scholar] [CrossRef]
  10. Fazlalipour, P.; Ehsan, M.; Mohammadi-Ivatloo, B. Optimal participation of low voltage renewable micro-grids in energy and spinning reserve markets under price uncertainties. Int. J. Electr. Power Energy Syst. 2018, 102, 84–96. [Google Scholar] [CrossRef]
  11. Nikmehr, N.; Najafi-Ravadanegh, S.; Khodaei, A. Probabilistic optimal scheduling of networked microgrids considering time-based demand response programs under uncertainty. Appl. Energy 2017, 198, 267–279. [Google Scholar] [CrossRef]
  12. Narayan, A.; Ponnambalam, K. Risk-averse stochastic programming approach for microgrid planning under uncertainty. Renew. Energy 2017, 101, 399–408. [Google Scholar] [CrossRef]
  13. Correa-Florez, C.A.; Gerossier, A.; Michiorri, A.; Kariniotakis, G. Stochastic operation of home energy management systems including battery cycling. Appl. Energy 2018, 225, 1205–1218. [Google Scholar] [CrossRef] [Green Version]
  14. Wang, D.; Qiu, J.; Reedman, L.; Meng, K.; Lai, L.L. Two-stage energy management for networked microgrids with high renewable penetration. Appl. Energy 2018, 226, 39–48. [Google Scholar] [CrossRef]
  15. Mavromatidis, G.; Orehounig, K.; Carmeliet, J. Uncertainty and global sensitivity analysis for the optimal design of distributed energy systems. Appl. Energy 2018, 214, 219–238. [Google Scholar] [CrossRef]
  16. Instituto de la Diversificación y Ahorro de la Energía. Plan de Energías Renovables 2011–2020; IDAE: Madrid, Spain, 2011; Available online: https://www.idae.es/tecnologias/energias-renovables/plan-de-energias-renovables-2011-2020 (accessed on 17 August 2020).
  17. Zakeri, B.; Syri, S. Electrical energy storage systems: A comparative life cycle cost analysis. Renew. Sustain. Energy Rev. 2015, 42, 569–596. [Google Scholar] [CrossRef]
  18. Birge, J.R.; Louveaux, F. Introduction to Stochastic Programming; Springer Science+Buisness Media: New York, NY, USA, 2011; ISBN 978-1-4614-0236-7. [Google Scholar]
  19. Urraca, R.; Polo, J.; Escobar, R. Clear sky solar irradiance models: A review of seventy models. Renew. Sustain. Energy Rev. 2019, 107, 374–387. [Google Scholar] [CrossRef]
  20. Van Der Meer, D.W.; Widén, J.; Munkhammar, J. Review on probabilistic forecasting of photovoltaic power production and electricity consumption. Renew. Sustain. Energy Rev. 2018, 81, 1484–1512. [Google Scholar] [CrossRef]
  21. Lefèvre, M.; Albuisson, M.; Wald, L. Description of the Software Heliosat-II for the Conversion of Images Acquired by Meteosat Satellites in the Visible Band into Maps of Solar Radiation Available at Ground Level; Groupe Télédétection & Modélisation—Centre d’Energétique—Armines/Ecole des Mines de Paris: Paris, France, 2004. [Google Scholar]
  22. Diagne, M.; David, M.; Lauret, P.; Boland, J.; Schmutz, N. Review of solar irradiance forecasting methods and a proposition for small-scale insular grids. Renew. Sustain. Energy Rev. 2013, 27, 65–76. [Google Scholar] [CrossRef] [Green Version]
  23. David, M.; Ramahatana, F.; Trombe, P.J.; Lauret, P. Probabilistic forecasting of the solar irradiance with recursive ARMA and GARCH models. Sol. Energy 2016, 133, 55–72. [Google Scholar] [CrossRef] [Green Version]
  24. Huang, J.; Korolkiewicz, M.; Agrawal, M.; Boland, J. Forecasting solar radiation on an hourly time scale using a Coupled AutoRegressive and Dynamical System (CARDS) model. Sol. Energy 2013, 87, 136–149. [Google Scholar] [CrossRef]
  25. Federico, E.; Bortolini, M.; Gamberi, M.; Regattieri, A. Artificial neural network optimisation for monthly average daily global solar radiation prediction. Energy Convers. Manag. 2016, 120, 320–329. [Google Scholar] [CrossRef]
  26. Chen, C.; Duan, S.; Cai, T.; Liu, B. Online 24-h solar power forecasting based on weather type classification using artificial neural network. Sol. Energy 2011, 85, 2856–2870. [Google Scholar] [CrossRef]
  27. Olatomiwa, L.; Mekhilef, S.; Shamshirband, S.; Mohammadi, K. A support vector machine—Firefly algorithm-based model for global solar radiation prediction. Sol. Energy 2015, 115, 632–644. [Google Scholar] [CrossRef]
  28. Deo, R.C.; Wen, X.; Qi, F. A wavelet-coupled support vector machine model for forecasting global incident solar radiation using limited meteorological dataset. Appl. Energy 2016, 168, 568–593. [Google Scholar] [CrossRef]
  29. Şen, Z. Fuzzy algorithm for estimation of solar irradiation. Sol. Energy 1998, 63, 39–49. [Google Scholar] [CrossRef]
  30. Anwar, I.; Khatib, T. A novel hybrid model for hourly global solar radiation prediction using random forests technique and firefly algorithm. Energy Convers. Manag. 2017, 138, 413–425. [Google Scholar] [CrossRef]
  31. Barbieri, F.; Rajakaruna, S.; Ghosh, A. Very short-term photovoltaic power forecasting with cloud modeling: A review. Renew. Sustain. Energy Rev. 2017, 75, 242–263. [Google Scholar] [CrossRef] [Green Version]
  32. Hyndman, R.J.; Athanasopoulos, G. Forecasting: Principles and Practice, 2nd ed.; OTexts: Melbourne, Australia, 2018; Available online: http://OTexts.com/fpp2 (accessed on 19 August 2019).
  33. MINES Paris-Tech. HelioClim-3. Available online: http://www.soda-pro.com/es/help/helioclim/helioclim-3-overview (accessed on 20 August 2019).
  34. Foley, A.M.; Leahy, P.G.; Marvuglia, A.; Mckeogh, E.J. Current methods and advances in forecasting of wind power generation. Renew. Energy 2012, 37, 1–8. [Google Scholar] [CrossRef] [Green Version]
  35. Jung, J.; Broadwater, R.P. Current status and future advances for wind speed and power forecasting. Renew. Sustain. Energy Rev. 2014, 31, 762–777. [Google Scholar] [CrossRef]
  36. Justus, C.G.; Hargraves, W.R.; Yalcin, A. Nationwide assessment of potential output from wind-powered generators. J. Appl. Meteorol. 1976, 15, 673–678. [Google Scholar] [CrossRef] [Green Version]
  37. Zhang, Y.; Wang, J.; Wang, X. Review on probabilistic forecasting of wind power generation. Renew. Sustain. Energy Rev. 2014, 32, 255–270. [Google Scholar] [CrossRef]
  38. Carapellucci, R.; Giordano, L. A methodology for the synthetic generation of hourly wind speed time series based on some known aggregate input data. Appl. Energy 2013, 101, 541–550. [Google Scholar] [CrossRef]
  39. AEMET-Opendata. Base de Datos Meteorológica. Available online: https://datosclima.es/Aemethistorico/Viento.php (accessed on 4 September 2019).
  40. Badger, J. DTU Global Wind Atlas. Available online: https://globalwindatlas.info/ (accessed on 6 September 2019).
  41. Gelaro, R. The modern-era retrospective analysis for research and applications, version 2 (MERRA-2). J. Clim. 2017, 30, 5419–5454. [Google Scholar] [CrossRef]
  42. Gastón, M. Wind Resources Map of Spain at Mesoscale. Methodology and Validation. 2008. Available online: http://www.cener.com/areas-de-investigacion/energia-eolica/areas-de-actuacion-en-energia-eolica/evaluacion-y-prediccion-del-recurso-eolico-epr/prediccion/mapa-eolico-nacional/ (accessed on 9 September 2019).
  43. Lü, X.; Lu, T.; Kibert, C.J.; Viljanen, M. Modeling and forecasting energy consumption for heterogeneous buildings using a physical—Statistical approach. Appl. Energy 2015, 144, 261–275. [Google Scholar] [CrossRef]
  44. Jain, R.K.; Smith, K.M.; Culligan, P.J.; Taylor, J.E. Forecasting energy consumption of multi-family residential buildings using support vector regression: Investigating the impact of temporal and spatial monitoring granularity on performance accuracy. Appl. Energy 2014, 123, 168–178. [Google Scholar] [CrossRef]
  45. Mcloughlin, F.; Duffy, A.; Conlon, M. Evaluation of time series techniques to characterise domestic electricity demand. Energy 2013, 50, 120–130. [Google Scholar] [CrossRef] [Green Version]
  46. Chujai, P.; Kerdprasop, N.; Kerdprasop, K. Time series analysis of household electric consumption with ARIMA and ARMA Models. Lect. Notes Eng. Comp. 2013, 2202, 295–300. [Google Scholar]
  47. Chaouch, M. Clustering-based improvement of nonparametric functional time series forecasting: Application to intra-day household-level load curves. IEEE Trans. Smart Grid. 2014, 5, 411–419. [Google Scholar] [CrossRef]
  48. Ortiz, J.; Guarino, F.; Salom, J.; Corchero, C.; Cellura, M. Stochastic model for electrical loads in Mediterranean residential buildings: Validation and applications. Energy Build. 2014, 80, 23–36. [Google Scholar] [CrossRef] [Green Version]
  49. Instituto para la Diversificacion y Ahorro de la Energía. Proyecto SECH-SPAHOUSEC: Análisis del Consumo Energético en el Sector Residencial en España. 2011. Available online: https://www.idae.es/uploads/documentos/documentos_Informe_SPAHOUSEC_ACC_f68291a3.pdf (accessed on 3 September 2019).
  50. Aggarwal, S.K.; Saini, L.M.; Kumar, A. Electricity price forecasting in deregulated markets: A review and evaluation. Int. J. Electr. Power Energy Syst. 2009, 31, 13–22. [Google Scholar] [CrossRef]
  51. Contreras, J.; Espínola, R.; Member, S.; Nogales, F.J. ARIMA models to predict next-day electricity prices. IEEE Trans. Power Syst. 2003, 18, 1014–1020. [Google Scholar] [CrossRef]
  52. Conejo, A.J.; Contreras, J.; Espinola, R.; Plazas, M.A. Forecasting electricity prices for a day-ahead pool-based electric energy market. Int. J. Forecast. 2005, 21, 435–462. [Google Scholar] [CrossRef]
  53. Nogales, F.J.; Contreras, J.; Conejo, A.J.; Member, S. Forecasting next-day electricity prices by time series models. IEEE Trans. Power Syst. 2002, 17, 342–348. [Google Scholar] [CrossRef]
  54. Burger, M.; Klar, B.; Müller, A.; Schindlmayr, G. A spot market model for pricing derivatives in electricity markets. J. Quant. Financ. 2004, 4, 109–122. [Google Scholar] [CrossRef]
  55. Comisión Nacional de los Mercados y la Competencia. Precios del Mercado de Producción de Energía Eléctrica. Available online: https://www.cnmc.es/estadistica/precios-mercado-2018 (accessed on 26 August 2019).
  56. Operador del Mercado Ibérico de la Electricidad. Precios Horarios del Mercado Diario en España. Available online: https://www.omie.es/es/file-access-list (accessed on 21 January 2020).
  57. Red Eléctrica Española. Sistema de Información del Operador del Sistema. Available online: https://www.esios.ree.es/es (accessed on 27 August 2019).
  58. Razali, N.M.M.; Member, S.; Hashim, A.H. Backward Reduction application for minimizing wind power scenarios in stochastic programming. In Proceedings of the 4th International Power Engineering and Optimization Conference (PEOCO), Shah Alam, Malaysia, 23–24 June 2010; pp. 430–434. [Google Scholar] [CrossRef]
  59. Deutsche Gesellschaft für Sonnenenergie (DGS). Planning and design of grid-connected photovoltaic systems. In Planning and Installing Photovoltaic Systems: A Guide for Installers, Architects and Engineers; Taylor & Francis Group: Abingdon, UK, 2013. [Google Scholar]
  60. Escudero, L.F.; Garín, A.; Merino, M.; Pérez, G. The value of the stochastic solution in multistage problems. TOP 2007, 15, 48–64. [Google Scholar] [CrossRef]
Figure 1. Diagram of the microgrid model and its different subdivisions. Source: self-elaboration and River Cottage©.
Figure 1. Diagram of the microgrid model and its different subdivisions. Source: self-elaboration and River Cottage©.
Energies 13 05590 g001
Figure 2. Schematized representation of the microgrid configuration. Source: self-elaboration. Images under a CC BY-SA license.
Figure 2. Schematized representation of the microgrid configuration. Source: self-elaboration. Images under a CC BY-SA license.
Energies 13 05590 g002
Figure 3. Physical model and energy flows within the microgrid. Source: self-elaboration. Images under a CC BY-SA license.
Figure 3. Physical model and energy flows within the microgrid. Source: self-elaboration. Images under a CC BY-SA license.
Energies 13 05590 g003
Figure 4. Solar production (green) and individual consumption (orange) for the most probable scenario during one week of April. Source: self-elaboration.
Figure 4. Solar production (green) and individual consumption (orange) for the most probable scenario during one week of April. Source: self-elaboration.
Energies 13 05590 g004
Figure 5. Breakdown of the averaged annualized costs and earnings in the second stage for the energy community. Source: self-elaboration.
Figure 5. Breakdown of the averaged annualized costs and earnings in the second stage for the energy community. Source: self-elaboration.
Energies 13 05590 g005
Figure 6. Energy transmission from PV panels to loads for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Figure 6. Energy transmission from PV panels to loads for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Energies 13 05590 g006
Figure 7. Energy transmission from the battery bank to loads, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Figure 7. Energy transmission from the battery bank to loads, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Energies 13 05590 g007
Figure 8. Energy transmission from PV panels to the grid, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Figure 8. Energy transmission from PV panels to the grid, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Energies 13 05590 g008
Figure 9. Energy transmission from PV panels to the battery bank, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Figure 9. Energy transmission from PV panels to the battery bank, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Energies 13 05590 g009
Figure 10. Energy transmission from the wind turbines to the battery bank. Comparison between the most and least probable scenarios (blue and orange) for one week (April). Source: self-elaboration.
Figure 10. Energy transmission from the wind turbines to the battery bank. Comparison between the most and least probable scenarios (blue and orange) for one week (April). Source: self-elaboration.
Energies 13 05590 g010
Figure 11. Energy transmission from wind turbines to the grid. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Figure 11. Energy transmission from wind turbines to the grid. Comparison between the most and least probable scenarios (blue and orange) for one week of April. Source: self-elaboration.
Energies 13 05590 g011
Figure 12. Energy transmission from wind turbines to loads, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one month (April). Source: self-elaboration.
Figure 12. Energy transmission from wind turbines to loads, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one month (April). Source: self-elaboration.
Energies 13 05590 g012
Figure 13. Energy transmission from grid to loads, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one month (April). Source: self-elaboration.
Figure 13. Energy transmission from grid to loads, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one month (April). Source: self-elaboration.
Energies 13 05590 g013
Figure 14. Breakdown of the averaged annualized costs and earnings in the second stage for the energy community without energy storage. In parenthesis, the second stage costs for the model with energy storage. Source: self-elaboration.
Figure 14. Breakdown of the averaged annualized costs and earnings in the second stage for the energy community without energy storage. In parenthesis, the second stage costs for the model with energy storage. Source: self-elaboration.
Energies 13 05590 g014
Figure 15. Energy transmission from grid to loads in a system without energy storage, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one month (April). Source: self-elaboration.
Figure 15. Energy transmission from grid to loads in a system without energy storage, for a single dwelling. Comparison between the most and least probable scenarios (blue and orange) for one month (April). Source: self-elaboration.
Energies 13 05590 g015
Table 1. Sets of the mathematical program.
Table 1. Sets of the mathematical program.
Set Index Definition Elements
HourshSet of hours of the year1 .. T
DwellingsdSet of dwellings of the energy community1 .. D
ScenariossSet of scenarios of the second stage variables1 .. S
Table 2. Parameters related to renewable generation.
Table 2. Parameters related to renewable generation.
Parameter Definition Value
RPSRatio between peak power and surface of the panel180 W/m2
SmaxdMaximum surface that can be occupied by solar panels0–50 m2
EG _ max d , h , s PV Maximum PV potential on each hour0–10 kWh
EG _ max h , s WT Maximum wind power potential on each hour0–50 kWh
P_WTmaxNominal power of wind turbines10 kW
N_WTmaxMaximum number of wind turbines to installD/2
η panelsMean efficiency of the solar panels18%
η inverterSimplified constant efficiency of the inverter98%
PLineMax Maximum power admission of the low voltage three phase lines50 kW
Table 3. Parameters related to energy storage.
Table 3. Parameters related to energy storage.
Parameter Definition Value
B_maxMaximum capacity of the battery bankD * 9 kWh
η batCharging/discharging efficiency of the batteries99%
SoC_min, SoC_maxMinimum and maximum State of Charge20%, 100%
SoC_0Initial SoC of the batteries20%
PBat_maxMaximum charge/discharge power of the battery bankB max/1h (kW)
Table 4. Parameters related to the sources of uncertainty or stochastic parameters of the physical constraints.
Table 4. Parameters related to the sources of uncertainty or stochastic parameters of the physical constraints.
Parameter Definition Value
ProbsProbability of scenario s0–1
Cd,h,sElectrical consumption 0–3 kWh
Ih,sSolar irradiance0–1000 W/m2
PWTh,sWind turbine supplied power0–10 kW
Table 5. Variables related to physical constraints.
Table 5. Variables related to physical constraints.
Variable Definition
EGPVd,h,sGenerated PV energy (kWh)
PV . to . C d , h , s Energy flow from solar panels to consumption
PV . to . G d , h , s Energy flow from solar panels to the grid
PV . to . B d , h , s Energy flow from solar panels to the battery bank
SdArea occupied by solar panels for each dwelling
EGWTh,sGenerated WT energy (kWh)
WT .   to . G h , s Energy flow from wind turbines to grid
WT . to . B h , s Energy flow from wind turbines to the battery bank
WT . to . C d , h , s Energy flow from wind turbines to consumption
N _ WT         Number of wind turbines to install
Bh,sStored energy (kWh)
BCapCapacity of the battery bank
B . to . C d , h , s Energy flow from the battery bank to consumption
G . to . C d , h , s Energy flow from the grid to consumption
EB_Ch,sBattery charging energy (kWh)
EB_Dh,sBattery discharging energy (kWh)
P peak PV d Peak PV power to install in each dwelling (kW)
Table 6. Parameters related to energy costs.
Table 6. Parameters related to energy costs.
Parameter Definition Value
COpmPVO&M cost of PV power [16]16 €/kWp·year
COpmWTO&M costs of onshore wind power [16]26.6 €/kWp·year
COpmBatO&M costs of lithium-ion batteries [17]6.1 €/kWh·year
Table 7. Parameters related to the energy sale.
Table 7. Parameters related to the energy sale.
Parameter Definition Value
SellingPriceh,sSelling marginal price of surplus electricityMarketPriceh,s
FTaxFlat tax over sold energy7%
VTaxVariable tax over sold energy0.5 c€/kWh
Table 8. Parameters related to the energy billing.
Table 8. Parameters related to the energy billing.
Parameter Definition Value
PcondContracted power without self-consumption2.3–9.2 kW
VATValue Added Tax21%
ETaxFlat tax over purchased electricity5.11%
Te h Variable charges over purchased electricity [16]0.044027 €/kWh
TpFlat charges over purchased electricity [16]38.04 €/kWh·year
Table 9. Parameters related to the sources of uncertainty or stochastic parameters of the economic constraints.
Table 9. Parameters related to the sources of uncertainty or stochastic parameters of the economic constraints.
Parameter Definition Value
MarketPriceh,sPurchase price of energy at the electricity market0–180 €/MWh
Table 10. Variables related to economic constraints.
Table 10. Variables related to economic constraints.
Variable Definition
Pcon d New contracted power after the installation of the community microgrid (kW)
CEd,sCost of energy purchase (€)
PAd,sAccess Cost of energy purchase (€)
FSEd,sTotal cost of energy purchase (€)
TAXd,sTotal cost of taxes for selling energy (€)
INGd,sRevenue for the sale of energy (€)
COpmd,sTotal O&M costs (€)
Table 11. Parameters related to investment cost.
Table 11. Parameters related to investment cost.
Parameter Definition Value
CInvPVInvestment cost of PV power [16]1150 €/kWp
CInvWTInvestment cost of onshore wind power [16]1700 €/kWp
CInvBatInvestment cost of lithium-ion batteries [17]795 €/kWh
Table 12. Parameters of the simulation.
Table 12. Parameters of the simulation.
Set Parameter Value
HoursT8760
DwellingsD10
ScenariosS10
p s 0.250.200.140.110.080.070.060.040.030.02
Table 13. Results of the on-grid model: First-stage variables and objective function.
Table 13. Results of the on-grid model: First-stage variables and objective function.
Variables Value
P peak PV d 10 kWp/dwelling (upper limit)
N_WT5 (upper limit)
BCap19.0 kWh
CInv230,210 €
Pcon’d2.64 kW/dwelling
Objective function z−2799 €/year
Table 14. Results of the on-grid model with no storage: First-stage variables and objective function.
Table 14. Results of the on-grid model with no storage: First-stage variables and objective function.
Variables Value Difference with the Base Case
P peak PV d 10 kWp/dwelling (upper limit)No difference
N_WT5 (upper limit)No difference
BCap0 kWh−19.0 kWh
CInv200,000 €−30,210 €
Pcon’d4.6 kW/dwelling+1.96 kW/dwelling
Objective function znb−2167 €/year+632 €/year
Table 15. Quality metrics definition and value.
Table 15. Quality metrics definition and value.
Variable Definition Value
zOriginal objective function−2799 €/year
z Int Objective function fixing the first stage variables to the solution that would be employed intuitively, without an optimization approach−360 €/year
z ESP Objective function fixing the first stage variables to the results obtained in the expected value program.−2371 €/year
POPerformance of Optimization metric2439 €/year
VSSValue of Stochastic Solution metric428 €/year
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Alonso, À.; de la Hoz, J.; Martín, H.; Coronas, S.; Salas, P.; Matas, J. A Comprehensive Model for the Design of a Microgrid under Regulatory Constraints Using Synthetical Data Generation and Stochastic Optimization. Energies 2020, 13, 5590. https://doi.org/10.3390/en13215590

AMA Style

Alonso À, de la Hoz J, Martín H, Coronas S, Salas P, Matas J. A Comprehensive Model for the Design of a Microgrid under Regulatory Constraints Using Synthetical Data Generation and Stochastic Optimization. Energies. 2020; 13(21):5590. https://doi.org/10.3390/en13215590

Chicago/Turabian Style

Alonso, Àlex, Jordi de la Hoz, Helena Martín, Sergio Coronas, Pep Salas, and José Matas. 2020. "A Comprehensive Model for the Design of a Microgrid under Regulatory Constraints Using Synthetical Data Generation and Stochastic Optimization" Energies 13, no. 21: 5590. https://doi.org/10.3390/en13215590

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop