# Stochastic Modeling of Consumption and Solar Radiation Variation and its Application to the Optimal Control of an Autonomous Microgrid of a Cluster of Houses

Paulisimone Rasoavonjy, Oanh Chau, Tovondahiniriko Fanjirindratovo, Olga

Ramiarinjanahary, Sylvain Dotti

► To cite this version:

Paulisimone Rasoavonjy, Oanh Chau, Tovondahiniriko Fanjirindratovo, Olga Ramiarinjanahary, Sylvain Dotti. Stochastic Modeling of Consumption and Solar Radiation Variation and its Application to the Optimal Control of an Autonomous Microgrid of a Cluster of Houses. European Journal of Applied Sciences, 2024, 12 (1), pp.420-441. 10.14738/aivp.121.16280. hal-04615563v2

HAL Id: hal-04615563

https://hal.univ-reunion.fr/hal-04615563v2

Submitted on 20 Jun 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Stochastic Modeling of Consumption and Solar Radiation Variation and its Application to the Optimal Control of An Autonomous Microgrid of a Cluster of Houses

**Paulisimone Rasoavonjy**

PIMENT Laboratory, University of Reunion Island,
117 rue du Général Ailleret, 97430 Le Tampon, La Réunion, France

**Oanh Chau**

PIMENT Laboratory, University of Reunion Island,
117 rue du Général Ailleret, 97430 Le Tampon, La Réunion, France

**Tovondahiniriko Fanjirindratovo**

Physics and Environment Laboratory, University of Toliara, Madagascar

**Olga Ramiarinjanahary**

Physics and Environment Laboratory, University of Toliara, Madagascar

**Sylvain Dotti**

PIMENT Laboratory, University of Reunion Island,
117 rue du Général Ailleret, 97430 Le Tampon, La Réunion, France

## ABSTRACT

In non-interconnected areas, the efficient use of renewable energies requires an optimal management of power consumption. We study the case of the "Cirque de Mafate" on Reunion Island. A model based on mixed integer linear programming has been developed as optimization tool. In order to minimize energy losses by maximizing the use of electrical appliances or the use of solar energy and the energy stored in the battery during the day, this paper aims to find the optimal balance between the production system and the consumption of the microgrid by considering uncertainties of demand as well as the production resources. Theloads are the electrical appliances of a group of three houses. It consists to model, optimize and simulate the stochastic operation of an autonomous microgrid by mutualizing production and storage resources. The uncertainty propagation method is developed to take into account uncertainty of solar radiation as well as electrical consumption of the users in the optimization model. Indeed, to estimate the probability density function of the electricity consumption, non-parametric methods for the estimation of probability density functions are applied. These same methods were used to estimate the probability density functions of solar radiation for the solar resource forecast. Indeed, the prediction of the intermittent resource and the combination of generation sources taking into account the uncertainty of the users' demand is the key for the proper operation of a microgrid in autonomous mode. The results show the performance of the system to achieve self-consumption for three days if the solar forecast is pessimistic and allow us to evaluate the
# Stochastic Modeling of Consumption and Solar Radiation Variation and its Application to the Optimal Control of An Autonomous Microgrid of a Cluster of Houses

**Paulisimone Rasoavonjy**

PIMENT Laboratory, University of Reunion Island,
117 rue du Général Ailleret, 97430 Le Tampon, La Réunion, France

**Oanh Chau**

PIMENT Laboratory, University of Reunion Island,
117 rue du Général Ailleret, 97430 Le Tampon, La Réunion, France

**Tovondahiniriko Fanjirindratovo**

Physics and Environment Laboratory, University of Toliara, Madagascar

**Olga Ramiarinjanahary**

Physics and Environment Laboratory, University of Toliara, Madagascar

**Sylvain Dotti**

PIMENT Laboratory, University of Reunion Island,
117 rue du Général Ailleret, 97430 Le Tampon, La Réunion, France

## ABSTRACT

In non-interconnected areas, the efficient use of renewable energies requires an optimal management of power consumption. We study the case of the "Cirque de Mafate" on Reunion Island. A model based on mixed integer linear programming has been developed as optimization tool. In order to minimize energy losses by maximizing the use of electrical appliances or the use of solar energy and the energy stored in the battery during the day, this paper aims to find the optimal balance between the production system and the consumption of the microgrid by considering uncertainties of demand as well as the production resources. Theloads are the electrical appliances of a group of three houses. It consists to model, optimize and simulate the stochastic operation of an autonomous microgrid by mutualizing production and storage resources. The uncertainty propagation method is developed to take into account uncertainty of solar radiation as well as electrical consumption of the users in the optimization model. Indeed, to estimate the probability density function of the electricity consumption, non-parametric methods for the estimation of probability density functions are applied. These same methods were used to estimate the probability density functions of solar radiation for the solar resource forecast. Indeed, the prediction of the intermittent resource and the combination of generation sources taking into account the uncertainty of the users' demand is the key for the proper operation of a microgrid in autonomous mode. The results show the performance of the system to achieve self-consumption for three days if the solar forecast is pessimistic and allow us to evaluate the
performance of the system under random constraints. Indeed, they allow us to
make decisions in order to advise users on the use of electrical appliances by taking
into account their behavior and the last-minute modification of their time slots of
use of electrical appliances.

**Keywords:** Mixed integer linear programming, smart grid, autonomous microgrid, stochastic modeling, propagation of uncertainties, nonparametric estimation of probability density's function.

INTRODUCTION

In off-grid areas, residents are confronted with high electricity costs, which are higher than the cost of electricity from the main grid if only the costs of transportation and fueldelivery are considered. In fact, for isolated sites, decentralized electrification presents the mosteconomical solution for the comfort of the inhabitants. Current technology makes it possible to exploit renewable energy as local production source. However, the efficient use of intermittent renewable energies requires an optimal control of power consumption to achieve users' self-consumption. This paper presents a model of electric energy management in order to supply the load of a remote mountainous area consisting of a cluster of three houses. Our case study is located at Mafate Circus in Reunion Island. There are no roads. All access, including for supplies and emergencies, is on foot or by helicopter. There is no main power supply. Residentsgenerate their own electricity using solar panels, with battery storage, and back-up diesel generators. However, the fuel for these must be brought by helicopter at a high cost. Due to thereduced power supply available, residents regularly use low-energy light bulbs. Likewise, all residents use solar water heaters. These can be supplemented by gas heaters, but gas cylindersmust also be brought in by helicopter. An individual production for each house is set up in theMafate Circus to this day. However, this equipment is obsolete. In addition, these storage devices are mainly based on lead acid technology, so it has proven to be ineffective [1].

The Syndicat Intercommunal d'Electricité (SIDELEC) of Reunion Island in partnershipwith the PIMENT laboratory within the framework of the project financed by the European Regional Development Fund (FEDER) "Micro Réseau Mafate" has realized an experimental platform of 3 individual houses on the site of Roche Plate in Mafate [1]. To set up the model, the different types of individual consumption and the local energy production available have been described [1]. Power management leads to a large integer mixed linear programming system [1], [2], [3]. Numerical calculations have been carried out in order to determine an optimal solution to minimize energy consumption by keeping comfort at a good level [4], [5]. The most effective and efficient use of solar resources aims at a reasoned management of electric energy.

For the state of the art, in his thesis, Ha Duy Long developed a formulation of the building energy
management problem in a general framework in the form of mixed linear programming,
optimizing three criteria: ecological, economic and user comfort [2]. Ha Duy Long has proposed
algorithms based on optimization techniques including mixed linear programming. Minh
Hoang Le's thesis describes the modeling of the energy flow managementproblem, based on the
notion of energy service, in which he characterizes services by energy supplier services and
inhabitant services [3]. The proposed optimization problem consists in finding the best
compromise between energy cost and user comfort. This compromise is definedon the basis of
performance of the system under random constraints. Indeed, they allow us to
make decisions in order to advise users on the use of electrical appliances by taking
into account their behavior and the last-minute modification of their time slots of
use of electrical appliances.

**Keywords:** Mixed integer linear programming, smart grid, autonomous microgrid, stochastic modeling, propagation of uncertainties, nonparametric estimation of probability density's function.

INTRODUCTION

In off-grid areas, residents are confronted with high electricity costs, which are higher than the cost of electricity from the main grid if only the costs of transportation and fueldelivery are considered. In fact, for isolated sites, decentralized electrification presents the mosteconomical solution for the comfort of the inhabitants. Current technology makes it possible to exploit renewable energy as local production source. However, the efficient use of intermittent renewable energies requires an optimal control of power consumption to achieve users' self-consumption. This paper presents a model of electric energy management in order to supply the load of a remote mountainous area consisting of a cluster of three houses. Our case study is located at Mafate Circus in Reunion Island. There are no roads. All access, including for supplies and emergencies, is on foot or by helicopter. There is no main power supply. Residentsgenerate their own electricity using solar panels, with battery storage, and back-up diesel generators. However, the fuel for these must be brought by helicopter at a high cost. Due to thereduced power supply available, residents regularly use low-energy light bulbs. Likewise, all residents use solar water heaters. These can be supplemented by gas heaters, but gas cylindersmust also be brought in by helicopter. An individual production for each house is set up in theMafate Circus to this day. However, this equipment is obsolete. In addition, these storage devices are mainly based on lead acid technology, so it has proven to be ineffective [1].

The Syndicat Intercommunal d'Electricité (SIDELEC) of Reunion Island in partnershipwith the PIMENT laboratory within the framework of the project financed by the European Regional Development Fund (FEDER) "Micro Réseau Mafate" has realized an experimental platform of 3 individual houses on the site of Roche Plate in Mafate [1]. To set up the model, the different types of individual consumption and the local energy production available have been described [1]. Power management leads to a large integer mixed linear programming system [1], [2], [3]. Numerical calculations have been carried out in order to determine an optimal solution to minimize energy consumption by keeping comfort at a good level [4], [5]. The most effective and efficient use of solar resources aims at a reasoned management of electric energy.

For the state of the art, in his thesis, Ha Duy Long developed a formulation of the building energy
management problem in a general framework in the form of mixed linear programming,
optimizing three criteria: ecological, economic and user comfort [2]. Ha Duy Long has proposed
algorithms based on optimization techniques including mixed linear programming. Minh
Hoang Le's thesis describes the modeling of the energy flow managementproblem, based on the
notion of energy service, in which he characterizes services by energy supplier services and
inhabitant services [3]. The proposed optimization problem consists in finding the best
compromise between energy cost and user comfort. This compromise is definedon the basis of
preferences expressed by the users. M.H. Le's thesis is in fact a continuation of D.L. Ha's thesis. It describes the problem of energy management in buildings, based on the notions of energy supplier services and inhabitant services, and the mathematical formulation in the form of mixed linear programming that was carried out in D.L. Ha's thesis.

The paper by Calogine et al [1] presents an operational model of a power supply to meet the load demand of a group of houses in a remote mountain region. Indeed, the implementation of a cluster of houses in a microgrid requires optimal management of power supply demand to meet the needs of the users. Energy management is achieved using a large mixed integer linear programming system. The main idea of the paper is to manage the battery using a fractional model that takes into account constraints over the whole 24hour day. To estimate clear sky irradiance, Bird's model is developed in the article, and information given by users has been deployed to set the values of the service parameters at the model input. To model clear sky solar radiation, the clear sky Bird model was proposed in the article. The Bird and Hulstrom model [6] in "Simplified clear sky model for direct and diffuse insolation on horizontal surfaces" in 1981 and "Direct insolation models" in 1980 [7] proposes a theoretical model for estimating global solar radiation received at ground level under clear skies. This model takes into account the diffusion and absorption effects of solar radiation as it passes through the atmosphere. It is based on the determination of the transmission coefficients of the various atmospheric constituents. These coefficients require the availability of conventional meteorological parameters (relative humidity, ambient temperature, atmospheric pressure, etc.) and geographical site parameters (latitude, longitude and altitude). In this article [1], production and consumption services have been modeled within a deterministic framework. To take into account the uncertainties in solar production Khalllat, M. et al, 1986 [8], Atwa et al, 2009 [9], Shaobo. Lin et al in 2011 [10], Abdulaziz. A. Alkuhayli, et al, 2012 [11], Arefi fiar et al, 2013 [12] and A. R. Abul'Wafa et al, 2014 [13] propose that solar radiation variation can be modeled by probability distributions. Indeed, to take into account intermittency of solar production and make the PV model much more realistic, prediction tool must be proposed, using probability distribution laws for example.

The theses by D.L. Ha [2] and M.H. Le [3] focused on optimizing consumption costs and user dissatisfaction in tertiary buildings. This work was extended by Calogine et al. on the management of a microgrid in an isolated mountainous area of the Mafate cirque on Reunion Island [1] by developing a deterministic model based on large mixed integer linear programming. This optimization tool was exploited by Rasoavonjy et al in previous works [4], [5] in order to minimize consumption and user dissatisfaction by considering the uncertainties of the intermittent source in the control system by integrating the variation of solar radiation.

This paper contributes to the search for optimal balance and the consideration of uncertainties in the physical quantities of the microgrid studied, by exploiting the study by Calogine et al. on the management of a microgrid in an isolated mountainous area of the Mafate cirque on Reunion Island [1]. It integrates a stochastic model for the study of an isolated elec- trical microgrid operating in an isolated site on Reunion Island and under autonomous management. The application of the uncertainty propagation method and the two non- parametric probability density estimation methods proposed for the various random variables governing the evolution of production and consumption service parameters mark an original feature in the
preferences expressed by the users. M.H. Le's thesis is in fact a continuation of D.L. Ha's thesis. It describes the problem of energy management in buildings, based on the notions of energy supplier services and inhabitant services, and the mathematical formulation in the form of mixed linear programming that was carried out in D.L. Ha's thesis.

The paper by Calogine et al [1] presents an operational model of a power supply to meet the load demand of a group of houses in a remote mountain region. Indeed, the implementation of a cluster of houses in a microgrid requires optimal management of power supply demand to meet the needs of the users. Energy management is achieved using a large mixed integer linear programming system. The main idea of the paper is to manage the battery using a fractional model that takes into account constraints over the whole 24hour day. To estimate clear sky irradiance, Bird's model is developed in the article, and information given by users has been deployed to set the values of the service parameters at the model input. To model clear sky solar radiation, the clear sky Bird model was proposed in the article. The Bird and Hulstrom model [6] in "Simplified clear sky model for direct and diffuse insolation on horizontal surfaces" in 1981 and "Direct insolation models" in 1980 [7] proposes a theoretical model for estimating global solar radiation received at ground level under clear skies. This model takes into account the diffusion and absorption effects of solar radiation as it passes through the atmosphere. It is based on the determination of the transmission coefficients of the various atmospheric constituents. These coefficients require the availability of conventional meteorological parameters (relative humidity, ambient temperature, atmospheric pressure, etc.) and geographical site parameters (latitude, longitude and altitude). In this article [1], production and consumption services have been modeled within a deterministic framework. To take into account the uncertainties in solar production Khalllat, M. et al, 1986 [8], Atwa et al, 2009 [9], Shaobo. Lin et al in 2011 [10], Abdulaziz. A. Alkuhayli, et al, 2012 [11], Arefi fiar et al, 2013 [12] and A. R. Abul'Wafa et al, 2014 [13] propose that solar radiation variation can be modeled by probability distributions. Indeed, to take into account intermittency of solar production and make the PV model much more realistic, prediction tool must be proposed, using probability distribution laws for example.

The theses by D.L. Ha [2] and M.H. Le [3] focused on optimizing consumption costs and user dissatisfaction in tertiary buildings. This work was extended by Calogine et al. on the management of a microgrid in an isolated mountainous area of the Mafate cirque on Reunion Island [1] by developing a deterministic model based on large mixed integer linear programming. This optimization tool was exploited by Rasoavonjy et al in previous works [4], [5] in order to minimize consumption and user dissatisfaction by considering the uncertainties of the intermittent source in the control system by integrating the variation of solar radiation.

This paper contributes to the search for optimal balance and the consideration of uncertainties in the physical quantities of the microgrid studied, by exploiting the study by Calogine et al. on the management of a microgrid in an isolated mountainous area of the Mafate cirque on Reunion Island [1]. It integrates a stochastic model for the study of an isolated electrical microgrid operating in an isolated site on Reunion Island and under autonomous management. The application of the uncertainty propagation method and the two non-parametric probability density estimation methods proposed for the various random variables governing the evolution of production and consumption service parameters mark an original feature in the
management of an autonomous microgrid in an isolated site on Reunion Island. Indeed, the
contribution of this paper corresponds well to its main objective, which is to model, optimize and
simulate the stochastic operation of an autonomous microgrid by pooling production and
storage resources.

Compared to previous studies, firstly, in this paper the objective function is modified and
normalized. In this paper, the objective function to be minimized is the gap between the
production system and consumption (i.e minimizing energy losses) and user dissatisfaction.
Weighting coefficients are also added to both terms of the objective function in this paper.
Minimizing energy losses optimizes battery use and maximizes the energy stored in the battery.
It also enables massive use of the solar production source by maximizing the energy consumed
in the solar radiation zone. Secondly, stochastic modelling of consumption variation is
performed in this paper using non-parametric probability density estimation methods. And
finally, in addition to considering intermittent generation in the optimization problem, the
variation in consumption is also considered in the optimization problem for decision making.

The objective of this work is to take into account these uncertainties due to the
intermittent nature of the solar production and user consumption variation in the optimal
management of the microgrid system and to demonstrate whether the system remains efficient
under these random constraints. The results allow to make optimal decisions on the use of
electrical appliances taking into account the uncertainty of the solar production as well as the
user's behavior.

PROBLEM STATEMENT

The study concerns a microgrid on the Roche Plate site, in the « Cirque de Mafate » in Reunion
Island. Three neighboring houses are included in this study [1]. The characteristics of these
houses are different: two of them are occupied by families with 1 or 2 children, the third one is
a cottage with 3 rooms to accommodate hikers (tourists) [1]. An inventory of electrical
appliances was performed in situ to measure the daily consumption of users [1].

By observing the lifestyle of the inhabitants, we can say that the electricity needs of the
individuals are relatively low. Indeed, the houses are equipped with the necessary and essential
facilities. However, to ensure the comfort of tourists, house one (cottage) consumes much more
than the two others. In this case, the three houses have proposed to pool their resources because
they can become complementary, the energy autonomy of these three houses is achieved. Some
electrical appliances will be "defferable" i.e., the demand for energy which can be deferred
throughout the day until a much more suitable time slot is found for their execution [1]. The
production device consists of photovoltaic panels with a peak power of 7 kWp.

STOCHASTIC APPROACH

We define a stochastic process $X = (X_t)_{t \in E}$ as a family of random variables $X_t$ indexed by a set $E$.
As the set $E$ represents usually the time, $E$ is generally a subset of $\mathbb{R}_+$. If $E$ is finite, the process is
a random vector. If $E = \mathbb{N}$, the process is a sequence of random variables [14], [15], [16], [17],
[18].
management of an autonomous microgrid in an isolated site on Reunion Island. Indeed, the
contribution of this paper corresponds well to its main objective, which is to model, optimize and
simulate the stochastic operation of an autonomous microgrid by pooling production and
storage resources.

Compared to previous studies, firstly, in this paper the objective function is modified and
normalized. In this paper, the objective function to be minimized is the gap between the
production system and consumption (i.e minimizing energy losses) and user dissatisfaction.
Weighting coefficients are also added to both terms of the objective function in this paper.
Minimizing energy losses optimizes battery use and maximizes the energy stored in the battery.
It also enables massive use of the solar production source by maximizing the energy consumed
in the solar radiation zone. Secondly, stochastic modelling of consumption variation is
performed in this paper using non-parametric probability density estimation methods. And
finally, in addition to considering intermittent generation in the optimization problem, the
variation in consumption is also considered in the optimization problem for decision making.

The objective of this work is to take into account these uncertainties due to the
intermittent nature of the solar production and user consumption variation in the optimal
management of the microgrid system and to demonstrate whether the system remains efficient
under these random constraints. The results allow to make optimal decisions on the use of
electrical appliances taking into account the uncertainty of the solar production as well as the
user's behavior.

## PROBLEM STATEMENT

The study concerns a microgrid on the Roche Plate site, in the « Cirque de Mafate » in Reunion
Island. Three neighboring houses are included in this study [1]. The characteristics of these
houses are different: two of them are occupied by families with 1 or 2 children, the third one is
a cottage with 3 rooms to accommodate hikers (tourists) [1]. An inventory of electrical
appliances was performed in situ to measure the daily consumption of users [1].

By observing the lifestyle of the inhabitants, we can say that the electricity needs of the
individuals are relatively low. Indeed, the houses are equipped with the necessary and essential
facilities. However, to ensure the comfort of tourists, house one (cottage) consumes much more
than the two others. In this case, the three houses have proposed to pool their resources because
they can become complementary, the energy autonomy of these three houses is achieved. Some
electrical appliances will be "defferable" i.e., the demand for energy which can be deferred
throughout the day until a much more suitable time slot is found for their execution [1]. The
production device consists of photovoltaic panels with a peak power of 7 kWp.

## STOCHASTIC APPROACH

We define a stochastic process $X = (X_t)_{t \in E}$ as a family of random variables $X_t$ indexed by a set $E$.
As the set $E$ represents usually the time, $E$ is generally a subset of $\mathbb{R}_+$. If $E$ is finite, the process is
a random vector. If $E = \mathbb{N}$, the process is a sequence of random variables [14], [15], [16], [17],
[18].
## Stochastic Modeling of Solar Irradiance Variation

In the stochastic approach, a model taking into account uncertainties of the input parameters is developed. The intermittent nature of solar radiation requires consideration of uncertainties to predict daily solar radiation. In fact, to make the prediction of solar radiation much more realistic, we used the actual data from the test site (Roche Plate, Mafate), and estimate its distribution for each hour [4], [5].

To estimate the distribution of solar radiation, two nonparametric methods for the estimation of probability density functions were used: the histogram method and the kernel method. For the kernel method, we used the Gaussian kernel and the Epanechnikov kernel [4], [5], [19], [20], [21], [22], [23].

Indeed, it is possible to estimate the probability density function from a sample of $n$ observed values of $X$ denoted by $x_1, x_2, \dots, x_n$; which are assumed to be independently and identically distributed according to the law of $X$ [11]. The aim is to deduce from the sample an estimate of the probability density function of the random variable $X$.

Let $h \in \mathbb{R}^*+$ be a parameter called bin width. Let $([kh, (k + 1)h)) k \in \mathbb{N}$ be a partition of $\mathbb{R}^+$. The histogram method gives the following estimator of the probability density function:

Let $h \in \mathbb{R}^*+$ be a parameter called bin width. Let $([kh, (k + 1)h)) k \in \mathbb{N}$ be a partition of $\mathbb{R}^+$. The histogram method gives the following estimator of the probability density function:

$$ \hat{f}_h(x) = \frac{1}{nh} \sum_{k=1}^{+\infty} N_k 1_{[kh,(k+1)h)}(x) \quad \forall x \in \mathbb{R}, \quad (1) $$

where $1_{[kh,(k+1)h)}(\cdot)$ is the indicator function of the interval $[kh, (k + 1)h)$ and $N_k = \#\{i: x_i \in [kh, (k + 1)h), 1 \le i \le n\}$ is the number of observations in $[kh, (k + 1)h)$.

However, the histogram estimator has a non-negligible defect that is to be non-continuous. To obtain a continuous probability density function, we use the kernel (or Parzen) method. This method is a generalization of the histogram method [13]. The probability density function is then estimated by:

$$ \hat{f}_h(x) = \frac{1}{nh} \sum_{i=1}^{n} K\left(\frac{x-x_i}{h}\right) \quad \forall x \in \mathbb{R}, \quad (2) $$

where $K$ is an even probability density function called kernel and $h \in \mathbb{R}^*+$ is a parameter called bandwidth, which governs the degree of smoothness of the estimator.

To select the bandwidth of kernel density estimators, we used Silverman's rule of thumb [23], plug-in and cross-validation methods as described in the Scott's study [24]. Results of estimators are similar. Using annual radiation data from the Roche Plate test site and applying these two non-parametric estimation methods, we can estimate the probability density function of solar radiation for each hour [4]:
## Stochastic Modeling of Solar Irradiance Variation

In the stochastic approach, a model taking into account uncertainties of the input parameters is developed. The intermittent nature of solar radiation requires consideration of uncertainties to predict daily solar radiation. In fact, to make the prediction of solar radiation much more realistic, we used the actual data from the test site (Roche Plate, Mafate), and estimate its distribution for each hour [4], [5].

To estimate the distribution of solar radiation, two nonparametric methods for the estimation of probability density functions were used: the histogram method and the kernel method. For the kernel method, we used the Gaussian kernel and the Epanechnikov kernel [4], [5], [19], [20], [21], [22], [23].

Indeed, it is possible to estimate the probability density function from a sample of n observed values of X denoted by $x_1, x_2, \dots, x_n$; which are assumed to be independently and identically distributed according to the law of X [11]. The aim is to deduce from the sample an estimate of the probability density function of the random variable X.

Let $h \in \mathbb{R}^*+$ be a parameter called bin width. Let $([kh, (k + 1)h)) k \in \mathbb{N}$ be a partition of $\mathbb{R}^+$. The histogram method gives the following estimator of the probability density function:

Let $h \in \mathbb{R}^*+$ be a parameter called bin width. Let $([kh, (k + 1)h)) k \in \mathbb{N}$ be a partition of $\mathbb{R}^+$. The histogram method gives the following estimator of the probability density function:

$$ \hat{f}_h(x) = \frac{1}{nh} \sum_{k=1}^{+\infty} N_k 1_{[kh,(k+1)h)}(x) \quad \forall x \in \mathbb{R}, \quad (1) $$

where $1_{[kh,(k+1)h)}(\cdot)$ is the indicator function of the interval $[kh, (k + 1)h)$ and $N_k = \#\{i: x_i \in [kh, (k + 1)h), 1 \le i \le n\}$ is the number of observations in $[kh, (k + 1)h)$.

However, the histogram estimator has a non-negligible defect that is to be non-continuous. To obtain a continuous probability density function, we use the kernel (or Parzen) method. This method is a generalization of the histogram method [13]. The probability density function is then estimated by:

$$ \hat{f}_h(x) = \frac{1}{nh} \sum_{i=1}^{n} K\left(\frac{x-x_i}{h}\right) \quad \forall x \in \mathbb{R}, \quad (2) $$

where K is an even probability density function called kernel and $h \in \mathbb{R}^*+$ is a parameter called bandwidth, which governs the degree of smoothness of the estimator.

To select the bandwidth of kernel density estimators, we used Silverman's rule of thumb [23], plug-in and cross-validation methods as described in the Scott's study [24]. Results of estimators are similar. Using annual radiation data from the Roche Plate test site and applying these two non-parametric estimation methods, we can estimate the probability density function of solar radiation for each hour [4]:
* At 5 a.m., 6 a.m., 7 a.m., 4 p.m., 5 p.m., 6 p.m., and 7 p.m., the solar radiation may be modeled by random variables following log-normal distributions.

* From $k = 8$ a.m. to $k = 12$ a.m., the solar radiation $R_k$ may be modeled by:

$$R_k = M_k - S_k \quad (3)$$

where $M_k > 0$ is the upper bound of the solar radiations given by the data and $S_k$ is a random variable following a log-normal distribution truncated to the interval $[0; M_k]$.

* From 1 p.m. to 3 p.m., the solar radiation may be modeled by random variables following bimodal distributions, their probability density functions are convex combinations of two gaussian densities $f_1$ and $f_2$ that is for some $\alpha \in ]0; 1[$:

$$f = \alpha f_1 + (1 - \alpha) f_2 \quad (4)$$

## Stochastic Modeling of Electricity Consumption Variation

The variation of consumption is also related to the modification of time slots of use of electrical appliances by users. In fact, the desired end time of service is one of the random parameters whose probability distribution must be known. To model the variation of the desired end time of service, we need to model the total consumption of users and determine a probability distribution.

To take into account the uncertainties on the consumption of users in the model, it is necessary to know the behavior of users of the experimental site. In the "Micro réseau Mafate" project, we have the consumption data of the users of the three houses studied in Roche Plate of the Mafate circus. And for this study, the data of the consumptions of one year are exploited in order to determine the behaviors of the users in the three houses concerned. To investigate the variation of consumption of the three houses, we applied the two nonparametric estimation methods, the histogram method and the kernel method mentioned before [4]. Using one year's consumption data of the three houses and applying the two nonparametric estimation methods of probability density function estimation, we can estimate the probability density function of the total consumption of users for each hour. In this study, we estimate the probability density function of the consumption of the three houses every hour to know the evolution of the consumption of the users of the three houses at each hour interval.

Figures 1 to 4 show us some examples of the estimated probability density function of the total consumption of the three houses of the experimental site. These figures show that the variation of total consumption of the services of the three houses for each hour can be modeled by a log normal distribution and a normal distribution. These results will allow us to estimate a distribution associated with the input parameters related to consumption in the optimization model. Thus, we can propose that the random variable of the desired end time of service $f \tilde{op} t(t)$ follows a lognormal distribution if it is defined over the end time windows where users' consumption follows a lognormal distribution and follows a normal distribution if it is defined over the end time windows where users' consumption follows a normal distribution.
* At 5 a.m., 6 a.m., 7 a.m., 4 p.m., 5 p.m., 6 p.m., and 7 p.m., the solar radiation may be modeled by random variables following log-normal distributions.

* From $k = 8$ a.m. to $k = 12$ a.m., the solar radiation $R_k$ may be modeled by:

$$R_k = M_k - S_k \qquad (3)$$

where $M_k > 0$ is the upper bound of the solar radiations given by the data and $S_k$ is a random variable following a log-normal distribution truncated to the interval $[0; M_k]$.

* From 1 p.m. to 3 p.m., the solar radiation may be modeled by random variables following bimodal distributions, their probability density functions are convex combinations of two gaussian densities $f_1$ and $f_2$ that is for some $\alpha \in ]0; 1[$:

$$f = \alpha f_1 + (1 - \alpha) f_2 \qquad (4)$$

## Stochastic Modeling of Electricity Consumption Variation

The variation of consumption is also related to the modification of time slots of use of electrical appliances by users. In fact, the desired end time of service is one of the random parameters whose probability distribution must be known. To model the variation of the desired end time of service, we need to model the total consumption of users and determine a probability distribution.

To take into account the uncertainties on the consumption of users in the model, it is necessary to know the behavior of users of the experimental site. In the "Micro réseau Mafate" project, we have the consumption data of the users of the three houses studied in Roche Plate of the Mafate circus. And for this study, the data of the consumptions of one year are exploited in order to determine the behaviors of the users in the three houses concerned. To investigate the variation of consumption of the three houses, we applied the two nonparametric estimation methods, the histogram method and the kernel method mentioned before [4]. Using one year's consumption data of the three houses and applying the two nonparametric estimation methods of probability density function estimation, we can estimate the probability density function of the total consumption of users for each hour. In this study, we estimate the probability density function of the consumption of the three houses every hour to know the evolution of the consumption of the users of the three houses at each hour interval.

Figures 1 to 4 show us some examples of the estimated probability density function of the total consumption of the three houses of the experimental site. These figures show that the variation of total consumption of the services of the three houses for each hour can be modeled by a log normal distribution and a normal distribution. These results will allow us to estimate a distribution associated with the input parameters related to consumption in the optimization model. Thus, we can propose that the random variable of the desired end time of service $f \tilde{op} t(t)$ follows a lognormal distribution if it is defined over the end time windows where users' consumption follows a lognormal distribution and follows a normal distribution if it is defined over the end time windows where users' consumption follows a normal distribution.
<figure><img src="image_1.png" /><figcaption>Fig.1: Estimated probability density function of the electrical consumption of the three houses at 1 a.m.(a) and 5 a.m. (b).</figcaption></figure>

<figure><img src="image_2.png" /><figcaption>Fig.2: Estimated probability density function of the electrical consumption of the three houses at 7 a.m.(a) and 11 a.m. (b).</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig.3: Estimated probability density function of the electrical consumption of the three houses at 3 p.m.(a) and 7p.m. (b).</figcaption></figure>
<figure><img src="image_2.png" /><figcaption>Fig.1: Estimated probability density function of the electrical consumption of the three houses at 1 a.m.(a) and 5 a.m. (b).</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig.2: Estimated probability density function of the electrical consumption of the three houses at 7 a.m.(a) and 11 a.m. (b).</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig.3: Estimated probability density function of the electrical consumption of the three houses at 3 p.m.(a) and 7p.m. (b).</figcaption></figure>
<figure><img src="image_4.png" /><figcaption>Fig.4: Estimated probability density function of the electrical consumption of the three houses at 8 p.m.(a) and 11 p.m. (b).</figcaption></figure>

## Mathematical Models

The stochastic approach consists in developing a stochastic model which is a mathematical formulation allowing to describe random events that evolve over time. The input parameters of consumption, production and storage of the system which are impacted by the different uncertainties will be considered as random variables to be studied in order to evaluate their greater or lesser chances of occurrence.

A stochastic model is a mathematical formulation making it possible to describe a random event and the various uncertainties of the system's parameters in order to assess its greater or lesser chances of occurrence. The evaluation and validation of the model are based on the technical simulation of experiments. In mathematical terms, a stochastic model is defined by the notion of random variables, the realization of which follows laws or probability distributions, the choice of which must be appropriate [25], [26].

To take into account the uncertainties in the production and consumption of the microgrid system, we are interested in the method of propagation of uncertainties which consists in associating with the input quantities (input parameters) random variables determined by their probability distribution function [27], [28], [29], [30]. The objective is to study how the uncertainties added to the input quantities will propagate through this algorithm by applying the Monte-Carlo method [27], [28], [29], [30] and to understand how it impacts the output quantities. Monte Carlo simulation is a non-deterministic method used to approximate complex mathematical expressions. The method is based on repeated random sampling to obtain numerical results and is used in a wide range of problems, including those related to optimization, numerical integration and probability distribution [26], [31]. Using the law of large numbers, the Monte Carlo method runs a model a large number of times by generating random inputs into a deterministic model, then aggregating the results obtained. After different samples, the results are aggregated (depending on the input, the result has a different output) and it is then possible to determine a range of possibilities [32], [33], [34].
<figure><img src="image_5.png" /><figcaption>Fig.4: Estimated probability density function of the electrical consumption of the three houses at 8 p.m.(a) and 11 p.m. (b).</figcaption></figure>

## Mathematical Models

The stochastic approach consists in developing a stochastic model which is a mathematical formulation allowing to describe random events that evolve over time. The input parameters of consumption, production and storage of the system which are impacted by the different uncertainties will be considered as random variables to be studied in order to evaluate their greater or lesser chances of occurrence.

A stochastic model is a mathematical formulation making it possible to describe a random event and the various uncertainties of the system's parameters in order to assess its greater or lesser chances of occurrence. The evaluation and validation of the model are based on the technical simulation of experiments. In mathematical terms, a stochastic model is defined by the notion of random variables, the realization of which follows laws or probability distributions, the choice of which must be appropriate [25], [26].

To take into account the uncertainties in the production and consumption of the microgrid system, we are interested in the method of propagation of uncertainties which consists in associating with the input quantities (input parameters) random variables determined by their probability distribution function [27], [28], [29], [30]. The objective is to study how the uncertainties added to the input quantities will propagate through this algorithm by applying the Monte-Carlo method [27], [28], [29], [30] and to understand how it impacts the output quantities. Monte Carlo simulation is a non-deterministic method used to approximate complex mathematical expressions. The method is based on repeated random sampling to obtain numerical results and is used in a wide range of problems, including those related to optimization, numerical integration and probability distribution [26], [31]. Using the law of large numbers, the Monte Carlo method runs a model a large number of times by generating random inputs into a deterministic model, then aggregating the results obtained. After different samples, the results are aggregated (depending on the input, the result has a different output) and it is then possible to determine a range of possibilities [32], [33], [34].
For the deterministic part, we use the Mixed Integer Linear Programming (MILP) as an optimization tool. The algorithms that can be intervened are already detailed by the previous mathematical formulations [1], [2], [3]. The objective of the stochastic part is to introduce uncertainties into these algorithms. It is about associating a probability distribution to the uncertain input parameters in order to have an output distribution.

Based on this optimization tool, previous studies have tackled the stochastic approach by modeling the variation of solar radiation in order to integrate it into the optimization model using the Monte Carlo method of uncertainty propagation [4], [5]. However, the objective function was modified, as the aim of these studies was to minimize electricity consumption while keeping user comfort at a good level [4], [5].

Still exploiting this optimization tool, the present study continues to extend the stochastic approach by also modeling the variation in user consumption in order to integrate not only the variation of solar radiation but also of consumption into the optimization problem, still using the Monte Carlo method of uncertainty propagation. In the present study, it is important to mention that the objective function is also modified, as the aim this time is to minimize energy losses or the gap between the production system and consumption without degrading user comfort. In addition, the objective function is normalized to have the same units between the two terms of the objective function. Weighting is also associated with each objective function term to control the dominance of one over the other.

The description of each power consumption is given for a period T hours. Typically, T =24 hours for a day. For this period, the time interval $[k\Delta t, (k + 1)\Delta t[$, is defined for $k \in \mathbb{N} \cap [1; T]$ in the group of three houses and $\Delta t = 1$ is the time step and i represents electrical appliances or services. The problem is formulated as an optimization problem with constraints and a formula for the cost (objective) function to be minimized. The input parameters of the objective function to be minimized are $P_{PV}(k), f_j^{opt}(i), f_j^{min}(i), f_j^{max}(i), \beta, \theta_j(i)$ and the output variables are $P_{Load}(k), f_j(i), P_{Bin}(k), P_{Bout}(k)$ et $\overline{U}_j(i)$.

$f_j^{opt}(i)$ is the random variable for the desired end date of service of house j, $f_j^{min}(i)$ and $f_j^{max}(i)$ are respectively the earliest and latest end dates of service of house j acceptable to the inhabitant and $\overline{f}_j(i)$ is the random variable of the end date of execution of service of house j, $\beta$ is a parameter defining the relative importance between the first and the second term of the objective function J, $\theta_j(i)$ is a parameter defining the priority among services relative to the user dissatisfaction [3].

With $\theta_j(i) \in ]0,1[$ and $\beta \in ]0,1[$ and $\sum_{i=1}^J \theta_j(i) = 1$

$P_{PV}(k)$ is the random variable of the energy produced by the photovoltaic panel during the interval time $[k\Delta t, (k + 1)\Delta t[$, $P_{Bin}(k)$ is the random variable of the energy entering in the
For the deterministic part, we use the Mixed Integer Linear Programming (MILP) as an optimization tool. The algorithms that can be intervened are already detailed by the previous mathematical formulations [1], [2], [3]. The objective of the stochastic part is to introduce uncertainties into these algorithms. It is about associating a probability distribution to the uncertain input parameters in order to have an output distribution.

Based on this optimization tool, previous studies have tackled the stochastic approach by modeling the variation of solar radiation in order to integrate it into the optimization model using the Monte Carlo method of uncertainty propagation [4], [5]. However, the objective function was modified, as the aim of these studies was to minimize electricity consumption while keeping user comfort at a good level [4], [5].

Still exploiting this optimization tool, the present study continues to extend the stochastic approach by also modeling the variation in user consumption in order to integrate not only the variation of solar radiation but also of consumption into the optimization problem, still using the Monte Carlo method of uncertainty propagation. In the present study, it is important to mention that the objective function is also modified, as the aim this time is to minimize energy losses or the gap between the production system and consumption without degrading user comfort. In addition, the objective function is normalized to have the same units between the two terms of the objective function. Weighting is also associated with each objective function term to control the dominance of one over the other.

The description of each power consumption is given for a period T hours. Typically, T =24 hours for a day. For this period, the time interval $[k\Delta t, (k + 1)\Delta t[$, is defined for $k \in \mathbb{N} \cap [1; T]$ in the group of three houses and $\Delta t = 1$ is the time step and i represents electrical appliances or services. The problem is formulated as an optimization problem with constraints and a formula for the cost (objective) function to be minimized. The input parameters of the objective function to be minimized are $P_{PV}(k), f_j^{opt}(i), f_j^{min}(i), f_j^{max}(i), \beta, \theta_j(i)$ and the output variables are $P_{Load}(k), f_j(i), P_{Bin}(k), P_{Bout}(k)$ et $\overline{U}_j(i)$.

$f_j^{opt}(i)$ is the random variable for the desired end date of service of house j, $f_j^{min}(i)$ and $f_j^{max}(i)$ are respectively the earliest and latest end dates of service of house j acceptable to the inhabitant and $\overline{f}_j(i)$ is the random variable of the end date of execution of service of house j, $\beta$ is a parameter defining the relative importance between the first and the second term of the objective function J, $\theta_j(i)$ is a parameter defining the priority among services relative to the user dissatisfaction [3].

With $\theta_j(i) \in ]0,1[$ and $\beta \in ]0,1[$ and $\sum_{i=1}^J \theta_j(i) = 1$

$P_{PV}(k)$ is the random variable of the energy produced by the photovoltaic panel during the interval time $[k\Delta t, (k + 1)\Delta t[$, $P_{Bin}(k)$ is the random variable of the energy entering in the
battery at $[k\Delta t, (k + 1)\Delta t[$, $P_{\widetilde{Bout}}(k)$ is the random variable of the energy supplied by the battery at $[k\Delta t, (k + 1)\Delta t[$.

$P_{\widetilde{Load}}(k) = \sum_{k=1}^{T} \sum_{j=1}^{3} \sum_{i=1}^{I_j} E_{\widetilde{J}(i, k)}$ is the random variable of the energy consumed at Where $[k\Delta t, (k + 1)\Delta t[$, $E_{\widetilde{J}(i, k)}$ is the random variable of the energy consumed by the service $n^o i$ in the house $n^o j$ at $[k\Delta t, (k + 1)\Delta t[$.

$I_j$ is the number of electrical appliances in the house number $j$ with $j = 1,2,3$ and $U_j(i)$ the comfort criteria for service $i$ of the house $j$.

As we can see in the parameter's declaration, one of the input parameters impacted by uncertainties is the desired end time $\widetilde{f}_j^{opt}(i)$ which is a parameter related to the consumption of services. Knowing the users' behavior, the desired end time $\widetilde{f}_j^{opt}(i)$ can be modeled as a log normal or normal distribution.

Starting by:

$$f_j^{min}(i) \widetilde{f}_j(i) \le f_j^{max}(i) \qquad (5)$$

$\widetilde{U}_j(i)$, the distance entre $\widetilde{f}_j(i)$ and $f_j^{opt}(i)$ est définie par [1],[2],[3]:

$$\widetilde{U}_j(i) = \begin{cases} \frac{\widetilde{f}_j(i) - f_j^{opt}(i)}{f_j^{max}(i) - f_j^{opt}(i)} & \text{si } \widetilde{f}_j(i) > f_j^{opt}(i) \\ \frac{f_j^{opt}(i) - f_j(i)}{f_j^{opt}(i) - f_j^{min}(i)} & \text{si } \widetilde{f}_j(i) \le f_j^{opt}(i) \end{cases} \qquad (6)$$

which should be reduced as little as possible in order to satisfy greatly the comfort of the users.

It is easy to verify that $0 \le \widetilde{U}_j(i) \le 1$, and the fact that $\widetilde{U}_j(i)$ is closer to 0 means that the user is more satisfied.

This latter may be written by:

$$\widetilde{U}_j(i) = \delta_{ju}(i) \frac{(\widetilde{f}_j^{opt}(i) - f_j(i))}{f_j^{opt}(i) - f_j^{min}(i)} + (1 - \delta_{ju}(i)) \frac{(\widetilde{f}_j(i) - f_j^{opt}(i))}{(f_j^{max}(i) - f_j^{opt}(i))} \qquad (7)$$

where $\delta_{ju}(i) \in \{0; 1\}$ is a logical variable defined by [1],[2],[3]:

$$\delta_{ju}(i) = 1 \text{ if and only if } \widetilde{f}_j(i) \le \widetilde{f}_j^{opt}(i) \qquad (8)$$
battery at $[k\Delta t, (k + 1)\Delta t[$, $P_{\widetilde{Bout}}(k)$ is the random variable of the energy supplied by the battery at $[k\Delta t, (k + 1)\Delta t[$.

$P_{\widetilde{Load}}(k) = \sum_{k=1}^{T} \sum_{j=1}^{3} \sum_{i=1}^{I_j} E_{\widetilde{J}(i, k)}$ is the random variable of the energy consumed at Where $[k\Delta t, (k + 1)\Delta t[$, $E_{\widetilde{J}(i, k)}$ is the random variable of the energy consumed by the service $n^o i$ in the house $n^o j$ at $[k\Delta t, (k + 1)\Delta t[$.

$I_j$ is the number of electrical appliances in the house number $j$ with $j = 1,2,3$ and $U_j(i)$ the comfort criteria for service $i$ of the house $j$.

As we can see in the parameter's declaration, one of the input parameters impacted by uncertainties is the desired end time $\widetilde{f}_j^{opt}(i)$ which is a parameter related to the consumption of services. Knowing the users' behavior, the desired end time $\widetilde{f}_j^{opt}(i)$ can be modeled as a log normal or normal distribution.

Starting by:

$$f_j^{min}(i) \widetilde{f}_j(i) \le f_j^{max}(i) \qquad (5)$$

$\widetilde{U}_j(i)$, the distance entre $\widetilde{f}_j(i)$ and $f_j^{opt}(i)$ est définie par [1],[2],[3]:

$$\widetilde{U}_j(i) = \begin{cases} \frac{\widetilde{f}_j(i) - f_j^{opt}(i)}{f_j^{max}(i) - f_j^{opt}(i)} & \text{si } \widetilde{f}_j(i) > f_j^{opt}(i) \\ \frac{f_j^{opt}(i) - \widetilde{f}_j(i)}{f_j^{opt}(i) - f_j^{min}(i)} & \text{si } \widetilde{f}_j(i) \le f_j^{opt}(i) \end{cases} \qquad (6)$$

which should be reduced as little as possible in order to satisfy greatly the comfort of the users.

It is easy to verify that $0 \le \widetilde{U}_j(i) \le 1$, and the fact that $\widetilde{U}_j(i)$ is closer to 0 means that the user is more satisfied.

This latter may be written by:

$$\widetilde{U}_j(i) = \delta_{ju}(i) \frac{(\widetilde{f}_j^{opt}(i) - \widetilde{f}_j(i))}{f_j^{opt}(i) - f_j^{min}(i)} + (1 - \delta_{ju}(i)) \frac{(\widetilde{f}_j(i) - f_j^{opt}(i))}{(f_j^{max}(i) - f_j^{opt}(i))} \qquad (7)$$

where $\delta_{ju}(i) \in \{0; 1\}$ is a logical variable defined by [1],[2],[3]:

$$\delta_{ju}(i) = 1 \text{ if and only if } \widetilde{f}_j(i) \le \widetilde{f}_j^{opt}(i) \qquad (8)$$
Finally, equation (8) is written in the form [1], [2], [3]:

$$ \overline{U_j(t)} = \left( \frac{f_j^{\text{opt}}(i)}{f_j^{\text{opt}}(i)-f_j^{\text{min}}(i)} + \frac{f_j^{\text{opt}}(i)}{f_j^{\text{max}}(i)-f_j^{\text{opt}}(i)} \right) \times \delta_{ju}(i) - \left( \frac{1}{f_j^{\text{opt}}(i)-f_j^{\text{min}}(i)} + \frac{1}{f_j^{\text{max}}(i)-f_j^{\text{opt}}(i)} \right) \times \overline{z_{ju}(i)} + \frac{\overline{(f_j(t)-f_j^{\text{opt}}(i))}}{\overline{(f_j^{\text{max}}(i)-f_j^{\text{opt}}(i))}} \quad (9) $$

Where,

$$ \overline{z_{ju}(i)} = \delta_{ju}(i) \times \overline{f_j(t)} \quad (10) $$

The objective function to be minimized is given by:

$$ J = \beta \sum_{k=1}^{T} \frac{P_{PV}(k) - P_{Bln}(k) + P_{Bout}(k) - P_{Load}(k)}{\sum_{k=1}^{T} P_{PV}(k) + P_{Bout}^{max}} + (1 - \beta) \sum_{j=1}^{3} \frac{1}{\sum_{i=1}^{I_j} \theta_j(i)} \sum_{i=1}^{I_j} \theta_j(i) \overline{U_j(t)} \quad (11) $$

$P_{Bout}^{max}$ is the maximum power supplied by the battery in 24 hours.

The two terms of the objective function are therefore the gap between the production system and consumption and dissatisfaction (comfort criteria). The addition of the denominator for the first term of the objective function serves to normalize it so as to have the same unit for both terms of the objective function. Weighting parameters are also considered in the objective function, such as $\beta$ and $\theta_j(i)$ to control the dominance of one term over the other in the objective function and priority of service (electrical appliances).

Regarding the constraints that govern the storage of the battery [35], for each instant $t$ (in hour), $1 \le t \le T$, the supply power balance is:

$$ -P_{Bln}(t) + P_{Bout}(t) - P_{Load}(t) + P_{PV}(t) = 0 \quad (12) $$

$$ P_{PV}(t) - P_{Bln}(t) \le 0 \quad (13) $$

Where $P_{Bln}(t)$ is the random variable of the power entering in the battery and $P_{Bout}(t)$ the random variable of the power supplied by it, $P_{Load}(t)$ is the random variable of the energy consumed by the electric devices, $P_{PV}(t)$ the energy produced by the photovoltaic panel.

Supplementary inequality constraints will be introduced in the system due to the introduction of the new variables to linearize the nonlinear part of the problem [2], [3], [36]. For this, we apply the procedure described by Bemporad et al [37].
Finally, equation (8) is written in the form [1], [2], [3]:

$$ \overline{U_j(t)} = \left( \frac{\overline{f_j^{opt}(i)}}{\overline{f_j^{opt}(i)-f_j^{min}(i)}} + \frac{\overline{f_j^{opt}(i)}}{\overline{f_j^{max}(i)-f_j^{opt}(i)}} \right) \times \delta_{ju}(i) - \left( \frac{1}{\overline{f_j^{opt}(i)-f_j^{min}(i)}} + \frac{1}{\overline{f_j^{max}(i)-f_j^{opt}(i)}} \right) \times \overline{z_{ju}(i)} + \frac{\overline{(f_j(t)-f_j^{opt}(i))}}{\overline{(f_j^{max}(i)-f_j^{opt}(i))}} \quad (9) $$

Where,

$$ \tilde{z}_{ju}(i) = \delta_{ju}(i) \times \overline{f_j(t)} \quad (10) $$

The objective function to be minimized is given by:

$$ J = \beta \sum_{k=1}^{T} \frac{P_{PV}(k) - P_{Bln}(k) + P_{Bout}(k) - P_{Load}(k)}{\sum_{k=1}^{T} P_{PV}(k) + P_{Bout}^{max}} + (1 - \beta) \sum_{j=1}^{3} \frac{1}{\sum_{i=1}^{I_j} \theta_j(i)} \sum_{i=1}^{I_j} \theta_j(i) \overline{U_j(t)} \quad (11) $$

$P_{Bout}^{max}$ is the maximum power supplied by the battery in 24 hours.

The two terms of the objective function are therefore the gap between the production system and consumption and dissatisfaction (comfort criteria). The addition of the denominator for the first term of the objective function serves to normalize it so as to have the same unit for both terms of the objective function. Weighting parameters are also considered in the objective function, such as $\beta$ and $\theta_j(i)$ to control the dominance of one term over the other in the objective function and priority of service (electrical appliances).

Regarding the constraints that govern the storage of the battery [35], for each instant $t$ (in hour), $1 \le t \le T$, the supply power balance is:

$$ -P_{Bln}(t) + P_{Bout}(t) - P_{Load}(t) + P_{PV}(t) = 0 \quad (12) $$

$$ P_{PV}(t) - P_{Bln}(t) \le 0 \quad (13) $$

Where $P_{Bln}(t)$ is the random variable of the power entering in the battery and $P_{Bout}(t)$ the random variable of the power supplied by it, $P_{Load}(t)$ is the random variable of the energy consumed by the electric devices, $P_{PV}(t)$ the energy produced by the photovoltaic panel.

Supplementary inequality constraints will be introduced in the system due to the introduction of the new variables to linearize the nonlinear part of the problem [2], [3], [36]. For this, we apply the procedure described by Bemporad et al [37].
The evolution of the random variable of the battery state of charge is governed by the following equation: for all $1 \le t \le T - 1$,

$$ (SOC)(t+1) = (SOC)(t) + (\omega_{B_{in}}(t) - \omega_{B_{out}}(t)) \times \Delta(t) \quad (14) $$

Where $\omega_{B_{in}}(t)$ and $\omega_{B_{out}}(t)$ are respectively the random variables of the battery current of charge and discharge.

The random variable of the battery state of charge is again limited by the upper bound $SOC_{max}$ and lower bound $SOC_{min}$: for all $1 \le t \le T$,

$$ SOC_{min} \le (SOC)(t) \le SOC_{max} \quad (15) $$

Finally, the random variables of the battery currents of charge and discharge are bounded by a control parameter $\gamma(t)$, a logic variable satisfying: for all $1 \le t \le T$,

$$ \begin{cases} 0 \le \widetilde{\omega}_{B_{in}}(t) \le \gamma(t) \times \omega_{max_c} \\ 0 \le \widetilde{\omega}_{B_{out}}(t) \le (1 - \gamma(t)) \times \omega_{max_d} \end{cases} \quad (16) $$

where $\omega_{max_c}$ and $\omega_{max_d}$ are respectively the maximum limit value of the battery current of charge and discharge.

## Numerical Simulation Results

For the stochastic modeling of an autonomous micro-grid, the intermittency of production is taken into account, thus the photovoltaic production is modeled by using the experimental data, the nonparametric methods for the estimation of probability density functions and the numerical simulations [4], [5]. Thus, we can predict the possible productions for each day, for each month and for each season and forecast our ability to meet the demand, and therefore decide on the amount of energy to keep at the battery level for the days following. As said before, self-consumption for three days is targeted.

For the implementation of the stochastic operation of an autonomous microgrid, the intermittency of the production has been taken into account [4], [5]. In this paper, the changes of users' time slots for the use of electrical appliances are taken into account. These changes lead to variations of power consumption. In fact, in this paper the uncertainties on the variation of the energy consumption are also taken into account in the input parameters. Indeed, the uncertain input parameters are the parameters related to the production and consumption of users. Since the objective is to find an optimal balance of the microgrid system by considering intermittent generation and user behavior when uncertainties occur, it is necessary to take into account the probability laws governing user power consumption. To achieve this, we have studied the real measurement data of one year of the consumption of the three houses involved in this study, and we have found that the variation of consumption can be modeled by a lognormal and a normal distribution.
The evolution of the random variable of the battery state of charge is governed by the following equation: for all $1 \le t \le T - 1$,

$$ (SOC)(t+1) = (SOC)(t) + (\omega_{B_{in}}(t) - \omega_{B_{out}}(t)) \times \Delta(t) \quad (14) $$

Where $\omega_{B_{in}}(t)$ and $\omega_{B_{out}}(t)$ are respectively the random variables of the battery current of charge and discharge.

The random variable of the battery state of charge is again limited by the upper bound $SOC_{max}$ and lower bound $SOC_{min}$: for all $1 \le t \le T$,

$$ SOC_{min} \le (SOC)(t) \le SOC_{max} \quad (15) $$

Finally, the random variables of the battery currents of charge and discharge are bounded by a control parameter $\gamma(t)$, a logic variable satisfying: for all $1 \le t \le T$,

$$ \begin{cases} 0 \le \widetilde{\omega_{B_{in}}}(t) \le \gamma(t) \times \omega_{max_c} \\ 0 \le \widetilde{\omega_{B_{out}}}(t) \le (1 - \gamma(t)) \times \omega_{max_d} \end{cases} \quad (16) $$

where $\omega_{max_c}$ and $\omega_{max_d}$ are respectively the maximum limit value of the battery current of charge and discharge.

## Numerical Simulation Results

For the stochastic modeling of an autonomous micro-grid, the intermittency of production is taken into account, thus the photovoltaic production is modeled by using the experimental data, the nonparametric methods for the estimation of probability density functions and the numerical simulations [4], [5]. Thus, we can predict the possible productions for each day, for each month and for each season and forecast our ability to meet the demand, and therefore decide on the amount of energy to keep at the battery level for the days following. As said before, self-consumption for three days is targeted.

For the implementation of the stochastic operation of an autonomous microgrid, the intermittency of the production has been taken into account [4], [5]. In this paper, the changes of users' time slots for the use of electrical appliances are taken into account. These changes lead to variations of power consumption. In fact, in this paper the uncertainties on the variation of the energy consumption are also taken into account in the input parameters. Indeed, the uncertain input parameters are the parameters related to the production and consumption of users. Since the objective is to find an optimal balance of the microgrid system by considering intermittent generation and user behavior when uncertainties occur, it is necessary to take into account the probability laws governing user power consumption. To achieve this, we have studied the real measurement data of one year of the consumption of the three houses involved in this study, and we have found that the variation of consumption can be modeled by a lognormal and a normal distribution.
It is important to take into account the uncertainties related to the changes in the time of use of the electrical appliances of the users. It is interesting to add uncertainties to the electricity consumption of users, so as not to fix demand as in the deterministic case. Tolerances must be taken into account in the stochastic approach. If there are changes in the time slots of the last minutes of use of the electrical appliances, the system must be able to cope. Indeed, it is important to involve in the optimal management of the microgrid the variation of the consumption as well as the variation of the production when the uncertainties occur. So, if the use planning for some electrical devices suddenly changes, we want to make sure the system is still going to be able to cope.

Figure 5, 6 and 7 show us the four random scenarios of the sequences of the electrical appliances of the three houses, the significant difference between the consumptions of each house presented through the two scenarios proves us that in addition to the consideration of the intermittent production, the uncertainty of the loads was also considered in the input parameters of the system. Indeed, the uncertainty of the input parameters impacts the output variables. These figures show us, for each hourly interval, the optimal consumption of all the electrical appliances in use in the three houses with the intermittent solar radiation and the desired end time of the services as uncertain input parameters. In the stochastic case these input parameters are random variables. By iterating many more possible scenarios, we will have several random results of optimal consumption allowing us to create a sample to build a distribution for each time slot.

These figures are characterized by the permanent consumption service from 1 a.m. to 12 p.m., due to the activity of refrigerators and freezers. Occasional services are localized from the beginning of the morning to the end of the evening. Most of the services are active around 12 a.m., except for the lamps which are only needed in the evening and early in the morning and in the four cases, the high demand for consumption is localized in solar radiation zone, around 12 a.m., Indeed, this configuration corresponds to the optimal distribution of services proposed by the solver.

<figure><img src="image_5.png" /></figure>
It is important to take into account the uncertainties related to the changes in the time of use of the electrical appliances of the users. It is interesting to add uncertainties to the electricity consumption of users, so as not to fix demand as in the deterministic case. Tolerances must be taken into account in the stochastic approach. If there are changes in the time slots of the last minutes of use of the electrical appliances, the system must be able to cope. Indeed, it is important to involve in the optimal management of the microgrid the variation of the consumption as well as the variation of the production when the uncertainties occur. So, if the use planning for some electrical devices suddenly changes, we want to make sure the system is still going to be able to cope.

Figure 5, 6 and 7 show us the four random scenarios of the sequences of the electrical appliances of the three houses, the significant difference between the consumptions of each house presented through the two scenarios proves us that in addition to the consideration of the intermittent production, the uncertainty of the loads was also considered in the input parameters of the system. Indeed, the uncertainty of the input parameters impacts the output variables. These figures show us, for each hourly interval, the optimal consumption of all the electrical appliances in use in the three houses with the intermittent solar radiation and the desired end time of the services as uncertain input parameters. In the stochastic case these input parameters are random variables. By iterating many more possible scenarios, we will have several random results of optimal consumption allowing us to create a sample to build a distribution for each time slot.

These figures are characterized by the permanent consumption service from 1 a.m. to 12 p.m., due to the activity of refrigerators and freezers. Occasional services are localized from the beginning of the morning to the end of the evening. Most of the services are active around 12 a.m., except for the lamps which are only needed in the evening and early in the morning and in the four cases, the high demand for consumption is localized in solar radiation zone, around 12 a.m., Indeed, this configuration corresponds to the optimal distribution of services proposed by the solver.

<figure><img src="image_6.png" /></figure>
<figure><img src="image_6.png" /><figcaption>Fig. 5: Scenarios 1, 2, 3 and 4 of consumption of electrical appliances of the first house.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6: Scenarios 1, 2, 3 and 4 of consumption of electrical appliances of the second house.</figcaption></figure>
<figure><img src="image_7.png" /><figcaption>Fig. 5: Scenarios 1, 2, 3 and 4 of consumption of electrical appliances of the first house.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Fig. 6: Scenarios 1, 2, 3 and 4 of consumption of electrical appliances of the second house.</figcaption></figure>
<figure><img src="image_8.png" /><figcaption>Fig. 7: Scenarios 1, 2,3 and 4 of consumption of electrical appliances of the third house.</figcaption></figure>

Figures 8 show the four possible scenarios of real and optimized daily consumptions of the three houses when taking into account the uncertainties of intermittent production and consumption variation. A comparison between the actual use of the electrical appliances and the optimized configuration proposed by the solver allows to highlight the low electrical consumption at the end of the day, even if the variation of the consumption is taken into account, the system remains efficient for the optimized configuration. Indeed, in the optimized configuration, while taking into account the intermittent production and the variation of the consumption, only the permanent appliances and the evening lamps remain after 6 p.m. Thus, the solver can manage the system well in the face of random constraints related to the production and consumption of the system.

The difference between the four scenarios shows the influence of the input uncertainties on the output results, which vary according to the input quantities. We thus have random optimized consumption at the output variables. These random results allow us to construct the probability distribution of the optimal consumption for each hour by estimating the corresponding density function.
<figure><img src="image_9.png" /><figcaption>Fig. 7: Scenarios 1, 2,3 and 4 of consumption of electrical appliances of the third house.</figcaption></figure>

Figures 8 show the four possible scenarios of real and optimized daily consumptions of the three houses when taking into account the uncertainties of intermittent production and consumption variation. A comparison between the actual use of the electrical appliances and the optimized configuration proposed by the solver allows to highlight the low electrical consumption at the end of the day, even if the variation of the consumption is taken into account, the system remains efficient for the optimized configuration. Indeed, in the optimized configuration, while taking into account the intermittent production and the variation of the consumption, only the permanent appliances and the evening lamps remain after 6 p.m. Thus, the solver can manage the system well in the face of random constraints related to the production and consumption of the system.

The difference between the four scenarios shows the influence of the input uncertainties on the output results, which vary according to the input quantities. We thus have random optimized consumption at the output variables. These random results allow us to construct the probability distribution of the optimal consumption for each hour by estimating the corresponding density function.
<figure><img src="image_9.png" /><figcaption>Fig. 8: Four scenarios of classic and optimized daily electrical consumption for the three houses.</figcaption></figure>

Figures 9 show us the four possible scenarios of service comfort or comfort criteria for each house. When taking into account the intermittent production and the variation of the users' consumption, a difference of the highest level of 50% is observed for the four scenarios. However, the variation of the consumption, thus of the desired end time of the service impacts considerably the users' comfort. The result allows to validate the proposed service configuration and the influence of the consumption variation on the users' comfort, knowing that the goal is to minimize the difference between production system and consumption, thus to find the optimal balance by minimizing the energy losses while keeping the comfort of the users at a good level. That is to say to optimize the battery without degrading the comfort of the users.
<figure><img src="image_10.png" /><figcaption>Fig. 8: Four scenarios of classic and optimized daily electrical consumption for the three houses.</figcaption></figure>

Figures 9 show us the four possible scenarios of service comfort or comfort criteria for each house. When taking into account the intermittent production and the variation of the users' consumption, a difference of the highest level of 50% is observed for the four scenarios. However, the variation of the consumption, thus of the desired end time of the service impacts considerably the users' comfort. The result allows to validate the proposed service configuration and the influence of the consumption variation on the users' comfort, knowing that the goal is to minimize the difference between production system and consumption, thus to find the optimal balance by minimizing the energy losses while keeping the comfort of the users at a good level. That is to say to optimize the battery without degrading the comfort of the users.
<figure><img src="image_10.png" /><figcaption>Fig. 9: Four Scenarios of evaluation of users' comfort for each consumption service for the three houses.</figcaption></figure>

The figures 10 show us the four possible scenarios of the random production and total optimized random consumption, the four random scenarios of the evolution of the state of charge of the battery and the four random scenarios of the variation of the powers entering in the battery and supplied by it. As shown in the figures, the intermittency of the solar production as well as the variation of the consumption are observed, the variation of the total optimized consumption is thus observed in a remarkable way due to the variation of the input parameters related to the consumption that is the desired end time of the service, this does not change the fact that most of the consumptions are placed in the solar radiation area. It should be noted that the variation of consumption is significant in this area, as much as in the non-sunny area because consumption is also influenced by the variation of the desired end time of each service. However, the consumption remains low at the end of the day despite the variations. This shows that the configuration corresponds to the optimal distribution of services proposed by the solver.

We can notice in both cases a state of charge of more than 70% which can even exceed 80% at the end of the day. The graph allows us to follow the dynamics of the flows exchanged between generation and storage. The power flow $\tilde{P}_{B,t}$ giving the power entering in the battery logically
<figure><img src="image_11.png" /><figcaption>Fig. 9: Four Scenarios of evaluation of users' comfort for each consumption service for the three houses.</figcaption></figure>

The figures 10 show us the four possible scenarios of the random production and total optimized random consumption, the four random scenarios of the evolution of the state of charge of the battery and the four random scenarios of the variation of the powers entering in the battery and supplied by it. As shown in the figures, the intermittency of the solar production as well as the variation of the consumption are observed, the variation of the total optimized consumption is thus observed in a remarkable way due to the variation of the input parameters related to the consumption that is the desired end time of the service, this does not change the fact that most of the consumptions are placed in the solar radiation area. It should be noted that the variation of consumption is significant in this area, as much as in the non-sunny area because consumption is also influenced by the variation of the desired end time of each service. However, the consumption remains low at the end of the day despite the variations. This shows that the configuration corresponds to the optimal distribution of services proposed by the solver.

We can notice in both cases a state of charge of more than 70% which can even exceed 80% at the end of the day. The graph allows us to follow the dynamics of the flows exchanged between generation and storage. The power flow $\tilde{P}_{B,t}$ giving the power entering in the battery logically
follows the solar radiation curve as shown in figure 10. Thus, the stochastic study demonstrates
well the performance of the system in the front of random constraints due to the intermittent
source and the variation of consumption.

Indeed, the evolution of the state of charge of the battery depends on the available solar
production and the calculated optimal consumption. But for autonomy, the system minimizes
the power supplied by the battery and therefore maximizes the state of charge of the battery as
much as possible, in order to store power for the next two days if the solar forecasts are
pessimistic. In the stochastic study, we may well have a non-promising day of solar production
and for that, the only means of production will be the battery, and precisely in this kind of case
we need to minimize the power supplied by the battery in the previous clear sky day so that the
system will be autonomous for the next two days.

<figure><img src="image_11.png" /><figcaption>Fig. 10: Four scenarios of predicted production and optimized consumption, evolution of the battery state of charge and variation of charge and transfer power for the battery</figcaption></figure>

CONCLUSION

Optimal management of an autonomous microgrid is an opportunity to achieve efficient use of
renewable energy resources. The search of the optimal consumption of a house is not sufficient
follows the solar radiation curve as shown in figure 10. Thus, the stochastic study demonstrates
well the performance of the system in the front of random constraints due to the intermittent
source and the variation of consumption.

Indeed, the evolution of the state of charge of the battery depends on the available solar
production and the calculated optimal consumption. But for autonomy, the system minimizes
the power supplied by the battery and therefore maximizes the state of charge of the battery as
much as possible, in order to store power for the next two days if the solar forecasts are
pessimistic. In the stochastic study, we may well have a non-promising day of solar production
and for that, the only means of production will be the battery, and precisely in this kind of case
we need to minimize the power supplied by the battery in the previous clear sky day so that the
system will be autonomous for the next two days.

<figure><img src="image_12.png" /><figcaption>Fig. 10: Four scenarios of predicted production and optimized consumption, evolution of the battery state of charge and variation of charge and transfer power for the battery</figcaption></figure>

CONCLUSION

Optimal management of an autonomous microgrid is an opportunity to achieve efficient use of
renewable energy resources. The search of the optimal consumption of a house is not sufficient
to realize the efficient use of intermittent solar generation. Nano grid modeling at the domestic scale should be used for the top end at the microgrid level. The main advantage of grouping houses together in the optimal management of a microgrid is to mix all electrical devices. This aggregation of loads offers greater flexibility in negotiating power supplies and reduces load shedding. By grouping houses together, we can achieve the autonomy of a microgrid.

In order to make our system much more realistic, uncertainties have been taken into account in the solar resource and electrical energy demand forecasts, for which stochastic modeling of microgrid management has been developed. The model allows us to forecast the available production, the optimal consumption, the state of charge of the battery, for a day, for a month and for a season according to our choice. The analysis of the results allowed us to show that the system can adapt well to random constraints.

The consideration of consumption uncertainties in the microgrid system allows to take into account the modifications of the time slots of the users' electrical appliances and to demonstrate if the system remains efficient in front of the random constraints generated by the variation of the solar radiation and of the time slots of the users' electrical appliances.

Only by considering the variation of solar production in the management of the microgrid, the variation of consumption is already observed in the solar radiation zone, as the uncertainty of the input parameters influences the output results. By taking into account not only the variation of solar production, but also the parameters related to the time of use of electrical appliances, the variation of consumption can be observed not only in the solar radiation area, but also from the beginning of the day to the end of the evening, and this variation becomes increasingly significant in the solar radiation area. This means that taking into account the variation of the time slots of use of electrical appliances has amplified the influence of the uncertainties of the input parameters to the output variables of the model. It is therefore interesting to consider changes in the last few minutes of the users' electrical appliance usage time slots. Indeed, this is one of the advantages over previous studies [1], [4], [5], as we don't fix the parameters related to time slots for the use of electrical appliances. In the perspective, it would be interesting to generate several possible scenarios of results and to create a sample of them and to build from this sample an empirical distribution in order to make decisions and to give advice to users on their use of electrical appliances by considering their behavior of use of these electrical appliances.

**Ethical Approval**

Not applicable

**Competing Interests**

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

**Authors' Contributions**

Paulisimone Rasoavonjy: Conceptualization, Methodology, Software, Formal analysis, Writing - original draft. Sylvain Dotti: Methodology, Writing - review & editing. Oanh Chau,
to realize the efficient use of intermittent solar generation. Nano grid modeling at the domestic scale should be used for the top end at the microgrid level. The main advantage of grouping houses together in the optimal management of a microgrid is to mix all electrical devices. This aggregation of loads offers greater flexibility in negotiating power supplies and reduces load shedding. By grouping houses together, we can achieve the autonomy of a microgrid.

In order to make our system much more realistic, uncertainties have been taken into account in the solar resource and electrical energy demand forecasts, for which stochastic modeling of microgrid management has been developed. The model allows us to forecast the available production, the optimal consumption, the state of charge of the battery, for a day, for a month and for a season according to our choice. The analysis of the results allowed us to show that the system can adapt well to random constraints.

The consideration of consumption uncertainties in the microgrid system allows to take into account the modifications of the time slots of the users' electrical appliances and to demonstrate if the system remains efficient in front of the random constraints generated by the variation of the solar radiation and of the time slots of the users' electrical appliances.

Only by considering the variation of solar production in the management of the microgrid, the variation of consumption is already observed in the solar radiation zone, as the uncertainty of the input parameters influences the output results. By taking into account not only the variation of solar production, but also the parameters related to the time of use of electrical appliances, the variation of consumption can be observed not only in the solar radiation area, but also from the beginning of the day to the end of the evening, and this variation becomes increasingly significant in the solar radiation area. This means that taking into account the variation of the time slots of use of electrical appliances has amplified the influence of the uncertainties of the input parameters to the output variables of the model. It is therefore interesting to consider changes in the last few minutes of the users' electrical appliance usage time slots. Indeed, this is one of the advantages over previous studies [1], [4], [5], as we don't fix the parameters related to time slots for the use of electrical appliances. In the perspective, it would be interesting to generate several possible scenarios of results and to create a sample of them and to build from this sample an empirical distribution in order to make decisions and to give advice to users on their use of electrical appliances by considering their behavior of use of these electrical appliances.

**Ethical Approval**

Not applicable

**Competing Interests**

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

**Authors' Contributions**

Paulisimone Rasoavonjy: Conceptualization, Methodology, Software, Formal analysis, Writing - original draft. Sylvain Dotti: Methodology, Writing - review & editing. Oanh Chau,
Tovondahiniriko Fanjirindratovo, Olga Ramiarinjanahary: Supervision, Methodology, Writing
– review & editing.

Funding

This work was funded by the Region Reunion and the European Regional Development Fund (FEDER) under the POE-FEDER 2014-2020 (DIRED/20181196 - TIERS: 263164).

**Availability of Data and Materials**

Not applicable

ACKNOWLEDGMENTS

The authors would like to thank the European Regional Development Fund, the Region Reunion and the French Government for their financial support in this work and in the "Micro Réseau Mafate" project.

References

[1] D. Calogine, O. Chau, and P. Lauret, "A fractional derivative approach to modelling a smart grid-off cluster of houses in an isolated area," J. Appl. Numer. Optim., vol. 1 n°3, pp. 347-362, 2019.

[2] D. L. Ha, "Un système avancé de gestion d'énergie dans le bâtiment pour coordonner production et consommation," Modélisation et Simulation, Institut National Polytechnique, Grenoble, 2007.

[3] M. H. Le, "Prise en compte des incertitudes de prédiction dans la gestion des flux d'énergie dans l'habitat," Automatique Robotique, Université de Grenoble, 2011.

[4] P. Rasoavonjy, T. Fanjirindratovo, O. Chau, O. Ramiarinjanahary, S.Dotti, "Stochastic modeling of the optimal management of an autonomous microgrid", Int. J Smart Grid Clean Energy, vol. 11 n°3, pp. 109117, 2022.

[5] P. Rasoavonjy, T. Fanjirindratovo, O. Chau, O. Ramiarinjanahary, S.Dotti, "Stochastic simulations of the optimal control of a standalone microgrid at the scale of two houses, Proc. of 3rd Int conference on Smart Grid and Renewable Energy, Doha, Qatar, 2022.

[6] R. E. Bird et R. L. Hulstrom, « Simplified clear sky model for direct and diffuse insolation on horizontal surfaces », Solar Energy Research Inst., Golden, CO (USA), SERI/TR-642-761, févr. 1981. doi: 10.2172/6510849.

[7] R. Bird et R. L. Hulstrom, « Direct insolation models », Solar Energy Research Inst., Golden, CO (USA), SERI/TR-335-344, janv. 1980. doi: 10.2172/5626683.

[8] M. A. Khallat et S. Rahman, « A probabilistic approach to photovoltaic generator performance prediction », *IEEE Transactions on Energy Conversion*, nº 3, p. 34-40, 1986.

[9] Y. M. Atwa, E. F. El-Saadany, M. M. A. Salama, et R. Seethapathy, « Optimal renewable resources mix for distribution system energy loss minimization », *IEEE Transactions on Power Systems*, vol. 25, nº 1, p. 360-370, 2009.

[10] Shaobo Lin, Minxiao Han, Ruixiang Fan, et Xiaodong Hu, « Configuration of energy storage system for distribution network with high penetration of PV », in *IET Conference on Renewable Power Generation (RPG 2011)*, Edinburgh, UK: IET, 2011, p. P16-P16. doi: 10.1049/cp.2011.0213.
Tovondahiniriko Fanjirindratovo, Olga Ramiarinjanahary: Supervision, Methodology, Writing
– review & editing.

Funding

This work was funded by the Region Reunion and the European Regional Development Fund (FEDER) under the POE-FEDER 2014-2020 (DIRED/20181196 - TIERS: 263164).

Availability of Data and Materials

Not applicable

ACKNOWLEDGMENTS

The authors would like to thank the European Regional Development Fund, the Region Reunion and the French Government for their financial support in this work and in the "Micro Réseau Mafate" project.

References

[1] D. Calogine, O. Chau, and P. Lauret, "A fractional derivative approach to modelling a smart grid-off cluster of houses in an isolated area," J. Appl. Numer. Optim., vol. 1 n°3, pp. 347-362, 2019.

[2] D. L. Ha, "Un système avancé de gestion d'énergie dans le bâtiment pour coordonner production et consommation," Modélisation et Simulation, Institut National Polytechnique, Grenoble, 2007.

[3] M. H. Le, "Prise en compte des incertitudes de prédiction dans la gestion des flux d'énergie dans l'habitat," Automatique Robotique, Université de Grenoble, 2011.

[4] P. Rasoavonjy, T. Fanjirindratovo, O. Chau, O. Ramiarinjanahary, S.Dotti, "Stochastic modeling of the optimal management of an autonomous microgrid", Int. J Smart Grid Clean Energy, vol. 11 n°3, pp. 109117, 2022.

[5] P. Rasoavonjy, T. Fanjirindratovo, O. Chau, O. Ramiarinjanahary, S.Dotti, "Stochastic simulations of the optimal control of a standalone microgrid at the scale of two houses, Proc. of 3rd Int conference on Smart Grid and Renewable Energy, Doha, Qatar, 2022.

[6] R. E. Bird et R. L. Hulstrom, « Simplified clear sky model for direct and diffuse insolation on horizontal surfaces », Solar Energy Research Inst., Golden, CO (USA), SERI/TR-642-761, févr. 1981. doi: 10.2172/6510849.

[7] R. Bird et R. L. Hulstrom, « Direct insolation models », Solar Energy Research Inst., Golden, CO (USA), SERI/TR-335-344, janv. 1980. doi: 10.2172/5626683.

[8] M. A. Khallat et S. Rahman, « A probabilistic approach to photovoltaic generator performance prediction », *IEEE Transactions on Energy Conversion*, n° 3, p. 34-40, 1986.

[9] Y. M. Atwa, E. F. El-Saadany, M. M. A. Salama, et R. Seethapathy, « Optimal renewable resources mix for distribution system energy loss minimization », *IEEE Transactions on Power Systems*, vol. 25, n° 1, p. 360-370, 2009.

[10] Shaobo Lin, Minxiao Han, Ruixiang Fan, et Xiaodong Hu, « Configuration of energy storage system for distribution network with high penetration of PV », in *IET Conference on Renewable Power Generation (RPG 2011)*, Edinburgh, UK: IET, 2011, p. P16-P16. doi: 10.1049/cp.2011.0213.
[11] Abdulaziz. A. Alkuhayli, S. Raghavan, et B. H. Chowdhury, « Reliability evaluation of distribution systems containing renewable distributed generations », in *2012 North American Power Symposium (NAPS)*, Champaign, IL, USA: IEEE, sept. 2012, p. 1-6. doi: 10.1109/NAPS.2012.6336324.

[12] S. A. Arefifar, A.-R. M. Yasser, et T. H. El-Fouly, « Optimum microgrid design for enhancing reliability and supply-security », *IEEE Transactions on Smart Grid*, vol. 4, n° 3, p. 1567-1575, 2013.

[13] A. R. Abul'Wafa et A. T. M. Taha, « Reliability evaluation of distribution systems under μ grid-tied and islanded μ grid modes using Monte Carlo simulation », *Smart Grid and Renewable Energy*, vol. 2014, 2014.

[14] E. Parzen, *Stochastic processes*. SIAM, 1999.

[15] S. M. Ross, *Stochastic processes*. John Wiley & Sons, 1995.

[16] D. R. Cox, *The theory of stochastic processes*. Routledge, 2017.

[17] E. Cinlar, *Introduction to stochastic processes*. Courier Corporation, 2013.

[18] R. Serfozo, *Basics of applied stochastic processes*. Springer Science & Business Media, 2009.

[19] A. Z. Zambon, and R. Dias, "A review of kernel density estimation with applications to econometrics", Int. Economic Review, vol.5, pp. 20-42, 2012.

[20] W. K. Härdle, Smoothing techniques: with implementation in S, Springer Series in Statistics, 1991.

[21] P. Deheuvels, "Estimation non paramétrique de la densité par histogrammes généralisés", Revue de Statistique Appliquée, vol. 25 n° 3-pp.5-42, 1977.

[22] M. Rudemo, "Empirical choice of histograms and kernel density estimators", Scand. J. Statist., vol. 9, pp. 6578, 1982.

[23] B. W. Silverman, "Density Estimation for Statistics and Data Analysis," Monographs on Statistics and Applied Probability, vol. 26, 1986.

[24] D. W. Scott, "Multivariate Density Estimation: Theory, Practice, and Visualisation", 1992.

[25] M. A. Pinsky, and S. Karlin, "An introduction to stochastic modeling", Academic Press, USA, 2010.

[26] J. Paniagua Sánchez-Mateos, « Reliability-Constrained Microgrid Design », Master of Science Thesis, KTH royal Institute of Technology School of Electrical Engineering, Stockholm Sweden, 2016.

[27] M. Desenfant, N. Fischer, B. Blanquart, and N. Bédiat, "Evaluation of uncertainty using Monte Carlo simulations", Proc. of the 13th Int. Metrology Congress, Lille, France, 2007.

[28] Hennebelle and T. Coorevits, "Propagation des distributions-Détermination des incertitudes per la méthode de Monte Carlo", 2013.

[29] M. Angeles Herrador, Agustiin G. Asuero and A. Gustavo Gonzalez, "Estimation of the uncertainty of indirect measurements from the propagation of distributions by using the Monte-Carlo method: An overview", Chemometrics and Intelligent Laboratory Systems, vol. 79 pp.115 – 122, 2005.

[30] A. Balsamo, M. Di Ciommo, R. Mugno, B. I. Rebaglia, E. Ricci, et R. Grella, « Evaluation of CMM uncertainty through Monte Carlo simulations », *CIRP Annals*, vol. 48, n° 1, p. 425-428, 1999.
[11] Abdulaziz. A. Alkuhayli, S. Raghavan, et B. H. Chowdhury, « Reliability evaluation of distribution systems containing renewable distributed generations », in *2012 North American Power Symposium (NAPS)*, Champaign, IL, USA: IEEE, sept. 2012, p. 1-6. doi: 10.1109/NAPS.2012.6336324.

[12] S. A. Arefifar, A.-R. M. Yasser, et T. H. El-Fouly, « Optimum microgrid design for enhancing reliability and supply-security », *IEEE Transactions on Smart Grid*, vol. 4, n° 3, p. 1567-1575, 2013.

[13] A. R. Abul'Wafa et A. T. M. Taha, « Reliability evaluation of distribution systems under μ grid-tied and islanded μ grid modes using Monte Carlo simulation », *Smart Grid and Renewable Energy*, vol. 2014, 2014.

[14] E. Parzen, *Stochastic processes*. SIAM, 1999.

[15] S. M. Ross, *Stochastic processes*. John Wiley & Sons, 1995.

[16] D. R. Cox, *The theory of stochastic processes*. Routledge, 2017.

[17] E. Cinlar, *Introduction to stochastic processes*. Courier Corporation, 2013.

[18] R. Serfozo, *Basics of applied stochastic processes*. Springer Science & Business Media, 2009.

[19] A. Z. Zambon, and R. Dias, "A review of kernel density estimation with applications to econometrics", Int. Economic Review, vol.5, pp. 20-42, 2012.

[20] W. K. Härdle, Smoothing techniques: with implementation in S, Springer Series in Statistics, 1991.

[21] P. Deheuvels, "Estimation non paramétrique de la densité par histogrammes généralisés", Revue de Statistique Appliquée, vol. 25 n° 3-pp.5-42, 1977.

[22] M. Rudemo, "Empirical choice of histograms and kernel density estimators", Scand. J. Statist., vol. 9, pp. 6578, 1982.

[23] B. W. Silverman, "Density Estimation for Statistics and Data Analysis," Monographs on Statistics and Applied Probability, vol. 26, 1986.

[24] D. W. Scott, "Multivariate Density Estimation: Theory, Practice, and Visualisation", 1992.

[25] M. A. Pinsky, and S. Karlin, "An introduction to stochastic modeling", Academic Press, USA, 2010.

[26] J. Paniagua Sánchez-Mateos, « Reliability-Constrained Microgrid Design », Master of Science Thesis, KTH royal Institute of Technology School of Electrical Engineering, Stockholm Sweden, 2016.

[27] M. Desenfant, N. Fischer, B. Blanquart, and N. Bédiat, "Evaluation of uncertainty using Monte Carlo simulations", Proc. of the 13th Int. Metrology Congress, Lille, France, 2007.

[28] Hennebelle and T. Coorevits, "Propagation des distributions-Détermination des incertitudes per la méthode de Monte Carlo", 2013.

[29] M. Angeles Herrador, Agustiin G. Asuero and A. Gustavo Gonzalez, "Estimation of the uncertainty of indirect measurements from the propagation of distributions by using the Monte-Carlo method: An overview", Chemometrics and Intelligent Laboratory Systems, vol. 79 pp.115-122, 2005.

[30] A. Balsamo, M. Di Ciommo, R. Mugno, B. I. Rebaglia, E. Ricci, et R. Grella, « Evaluation of CMM uncertainty through Monte Carlo simulations », *CIRP Annals*, vol. 48, n° 1, p. 425-428, 1999.
[31] S. Bahramirad, W. Reder, et A. Khodaei, « Reliability-Constrained Optimal Sizing of Energy Storage System in a Microgrid », *IEEE Transactions on Smart Grid*, vol. 3, nº 4, p. 2056-2062, déc. 2012, doi: 10.1109/TSG.2012.2217991.

[32] L. Wu, M. Shahidehpour, et T. Li, « Stochastic security-constrained unit commitment », *IEEE Transactions on power systems*, vol. 22, nº 2, p. 800-811, 2007.

[33] S. Mahadevan, « Monte carlo simulation », *Mechanical Engineering-New York and Basel-Marcel Dekker*-, p. 123-146, 1997.

[34] S. Raychaudhuri, « Introduction to monte carlo simulation », in *2008 Winter simulation conference*, IEEE, 2008, p. 91-100.

[35] Foggia G. Optimal control of a multi-source system for the Engineering Sciences building. PhD thesis. National Polytechnic [36] Institute, Grenoble; 2009.

[37] D. L. Ha, H. Joumaa, S. Ploix and M. Jacomino, "An optimal approach for electrical management problem in dwellings," *Energy and Buildings* 45, p.1-14, 2012.

[38] A. Bemporad, and M. Morari, "Control of systems integrating logic, dynamics and constraints" Automatica, vol. 35, pp. 407-427, 1998.
[31] S. Bahramirad, W. Reder, et A. Khodaei, « Reliability-Constrained Optimal Sizing of Energy Storage System in a Microgrid », *IEEE Transactions on Smart Grid*, vol. 3, nº 4, p. 2056-2062, déc. 2012, doi: 10.1109/TSG.2012.2217991.

[32] L. Wu, M. Shahidehpour, et T. Li, « Stochastic security-constrained unit commitment », *IEEE Transactions on power systems*, vol. 22, nº 2, p. 800-811, 2007.

[33] S. Mahadevan, « Monte carlo simulation », *Mechanical Engineering-New York and Basel-Marcel Dekker*-, p. 123-146, 1997.

[34] S. Raychaudhuri, « Introduction to monte carlo simulation », in *2008 Winter simulation conference*, IEEE, 2008, p. 91-100.

[35] Foggia G. Optimal control of a multi-source system for the Engineering Sciences building. PhD thesis. National Polytechnic [36] Institute, Grenoble; 2009.

[37] D. L. Ha, H. Joumaa, S. Ploix and M. Jacomino, "An optimal approach for electrical management problem in dwellings," *Energy and Buildings* 45, p.1-14, 2012.

[38] A. Bemporad, and M. Morari, "Control of systems integrating logic, dynamics and constraints" Automatica, vol. 35, pp. 407-427, 1998.