# MAPCAST: an Adaptive Control Approach using Predictive Analytics for Energy Balance in Micro-Grid Systems

Abdellatif Elmouatamid, Radouane Ouladsine, Mohamed Bakhouya, Najib El Kamoun, Khalid Zine-Dine, Mohammed Khaida

► To cite this version:

Abdellatif Elmouatamid, Radouane Ouladsine, Mohamed Bakhouya, Najib El Kamoun, Khalid Zine-Dine, et al.. MAPCAST: an Adaptive Control Approach using Predictive Analytics for Energy Balance in Micro-Grid Systems. International Journal of Renewable Energy Research, 2020, v10i2, 10.20508/ijrer.v10i2.11000.g7961. hal-04590810

HAL Id: hal-04590810

https://hal.science/hal-04590810

Submitted on 30 May 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>
# MAPCAST: an Adaptive Control Approach using Predictive Analytics for Energy Balance in Micro-Grid Systems

Abdellatif Elmouatamid, Radouane Ouladsine, Mohamed Bakhouya, Najib El Kamoun, Khalid Zine-Dine, Mohammed Khaida

► To cite this version:

Abdellatif Elmouatamid, Radouane Ouladsine, Mohamed Bakhouya, Najib El Kamoun, Khalid Zine-Dine, et al.. MAPCAST: an Adaptive Control Approach using Predictive Analytics for Energy Balance in Micro-Grid Systems. International Journal of Renewable Energy Research, 2020, v10i2, 10.20508/ijrer.v10i2.11000.g7961. hal-04590810

HAL Id: hal-04590810

https://hal.science/hal-04590810v1

Submitted on 30 May 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>
MAPCAST: an Adaptive Control Approach using
Predictive Analytics for Energy Balance in Micro-
Grid Systems

Abdellatif Elmouatamid*,***‡, Radouane Ouladsine**, Mohamed Bakhouya**, Najib El kamoun*,
Khalid Zine-Dine***, Mohammed Khaidar*

* Chouaib Doukkali University, Faculty of Sciences, STIC Lab, CUR’’EnR&SIE’’, El Jadida, Morocco

** International University of Rabat, College of Engineering and Architecture, LERMA Lab, Sala El Jadida, Morocco

*** Mohammed V University, Faculty of Sciences, Rabat, Morocco

(abdellatif.elmouatamid@uir.ac.ma, radouane.ouladsine@uir.ac.ma, mohamed.bakhouya@uir.ac.ma, elkamoun.n@ucd.ac.ma, khalid.zinedine@um5.ac.ma, khaidar.m@ucd.ac.ma)

‡ Corresponding Author; Abdellatif Elmouatamid, International University of Rabat, Faculty of Computing and Logistics, ECINE, LERMA and TICLab, Sala El Jadida, Morocco, Tel: +212 649966652, abdellatif.elmouatamid@uir.ac.ma

Received: 29.05.2020 Accepted: 27.06.2020

**Abstract-** Control approaches for micro-grid (MG) systems are recently developed for efficient energy management in distributed systems. The aim is to increase the integration of renewable energy sources (RES) in buildings while keeping optimal operational conditions of storage devices. However, the variability and the unpredictable behavior of the power produced by RESs require the use of energy management systems and adaptive control strategies for their seamless integration within the traditional electric grid. In this paper, a model predictive control (MPC) strategy is developed, named MAPCAST, for measuring, analyzing, predicting, and forecasting actions in order to ensure efficient and optimal operation of MG systems. The control strategy is based on machine-learning algorithms to predict main parameter inputs, which are used for forecasting suitable actions. Its main objective is to manage the batteries' charge/discharge (C/D) currents, and consequently, the battery state of charge (SoC), taking into consideration the variable nature of RES generation and loads demand satisfaction. A real data-set was gathered from our actual MG system using an IoT/Big-Data platform, which was deployed to measure the different input control parameters. Simulation results are presented to show the utility of the proposed control strategy for efficient operation and optimal energy balance in MG systems.

**Keywords:** Micro-grid systems, Energy management system, IoT and Big-Data platform, Machine-learning algorithms, Model predictive control.

# 1. Introduction

In the past few years, RES technologies have been
developed as potential clean energy sources to minimize
greenhouse gas emissions by reducing electricity
consumption from traditional electricity generators [1].
Moreover, the deployment of RES, loads, and storage
devices together with the TEG has enabled the deployment
of the new concept of MG systems into energy efficient

buildings [2]. However, the uncertainty and intermittency of
power generated from RES, the variability of power
consumption together with the storage limits have created
many challenges for their seamless integration into buildings.
Moreover, the stochastic nature of weather conditions (e.g.,
irradiance, temperature) and buildings' occupancy (e.g.,
activities) could influence the power production and
consumption (i.e., Demand/Response). Control strategies and
optimal energy management approaches are proposed to
MAPCAST: an Adaptive Control Approach using
Predictive Analytics for Energy Balance in Micro-
Grid Systems

Abdellatif Elmouatamid*,**‡, Radouane Ouladsine**, Mohamed Bakhouya**, Najib El kamoun*,
Khalid Zine-Dine***, Mohammed Khaidar*

* Chouaib Doukkali University, Faculty of Sciences, STIC Lab, CUR’’EnR&SIE’’, El Jadida, Morocco

** International University of Rabat, College of Engineering and Architecture, LERMA Lab, Sala El Jadida, Morocco

*** Mohammed V University, Faculty of Sciences, Rabat, Morocco

(abdellatif.elmouatamid@uir.ac.ma, radouane.ouladsine@uir.ac.ma, mohamed.bakhouya@uir.ac.ma, elkamoun.n@ucd.ac.ma, khalid.zinedine@um5.ac.ma, khaidar.m@ucd.ac.ma)

‡ Corresponding Author; Abdellatif Elmouatamid, International University of Rabat, Faculty of Computing and Logistics, ECINE, LERMA and TICLab, Sala El Jadida, Morocco, Tel: +212 649966652, abdellatif.elmouatamid@uir.ac.ma

Received: 29.05.2020 Accepted: 27.06.2020

**Abstract-** Control approaches for micro-grid (MG) systems are recently developed for efficient energy management in distributed systems. The aim is to increase the integration of renewable energy sources (RES) in buildings while keeping optimal operational conditions of storage devices. However, the variability and the unpredictable behavior of the power produced by RESs require the use of energy management systems and adaptive control strategies for their seamless integration within the traditional electric grid. In this paper, a model predictive control (MPC) strategy is developed, named MAPCAST, for measuring, analyzing, predicting, and forecasting actions in order to ensure efficient and optimal operation of MG systems. The control strategy is based on machine-learning algorithms to predict main parameter inputs, which are used for forecasting suitable actions. Its main objective is to manage the batteries' charge/discharge (C/D) currents, and consequently, the battery state of charge (SoC), taking into consideration the variable nature of RES generation and loads demand satisfaction. A real data-set was gathered from our actual MG system using an IoT/Big-Data platform, which was deployed to measure the different input control parameters. Simulation results are presented to show the utility of the proposed control strategy for efficient operation and optimal energy balance in MG systems.

**Keywords:** Micro-grid systems, Energy management system, IoT and Big-Data platform, Machine-learning algorithms, Model predictive control.

# 1. Introduction

In the past few years, RES technologies have been
developed as potential clean energy sources to minimize
greenhouse gas emissions by reducing electricity
consumption from traditional electricity generators [1].
Moreover, the deployment of RES, loads, and storage
devices together with the TEG has enabled the deployment
of the new concept of MG systems into energy efficient

buildings [2]. However, the uncertainty and intermittency of
power generated from RES, the variability of power
consumption together with the storage limits have created
many challenges for their seamless integration into buildings.
Moreover, the stochastic nature of weather conditions (e.g.,
irradiance, temperature) and buildings' occupancy (e.g.,
activities) could influence the power production and
consumption (i.e., Demand/Response). Control strategies and
optimal energy management approaches are proposed to
ensure the energy balance (Demand/Response) in MG systems.

Generally, these control strategies use three main inputs for computing real-time decisions: the RES power production, the power consumption, and storage devices states. This kind of approaches requires the deployment of the control loop (i.e., sense, transmit, analyze data, and compute the required action). In fact, in real-sitting scenarios, these control approaches could spend a lot of time to make decisions, which might be generated right after the moment of the blackouts. Intelligent and predictive control strategies are, therefore, required to ensure a safe and flexible operation for MG systems.

In the past few years, different control strategies have been introduced for managing the power flows and quality in MG systems [3, 4]. For instance, Authors in [5] have proposed an MPC strategy in order to control a PV plant connected to the storage system. The objective was to reduce the cost of electricity bills by optimizing the system's operation using predictive electricity price, PV power production, and load consumption. In [6], an MPC strategy is presented to balance power flows of a multi-energy system, which is composed of a fuel cell, hydrogen storage, and PV panels. The work presented in [7] uses an MPC strategy to optimize the energy flow in MG systems. A framework was investigated by deploying an experimental grid-connected MG that includes RES and battery storage system. In this work, neither the platform, which is used to generate the input parameters for the MPC, nor the C/D battery is clearly stated.

Another interesting work was presented in [8] in which authors investigated an MPC strategy for real-time control of power produced by a PV plant. The installed strategy allowed adapting the PV and storage's generation depending on the actual load's demand. In [9], the HOMER software is utilized for electrical resources sizing in a MG system taking into account the power price forecasts. The objective of the proposed method is related to optimal sizing and energy management of RES and storage devices by considering the satisfaction of loads demand and the reduction of fossil fuel

dependency. Moreover, the work presented in [10] proposed an energy management system to establish the best possible situation between technologies cost and reliability in a standalone hybrid system. This later is composed of wind turbines, PV panels, and batteries. The system costs consist of the initial investment and the maintenance of equipment replacement. In [11], a control strategy for energy management in multi-MG Park is developed. It allowed balancing the power demand/response while reducing the electricity cost delivered to consumers. Based on the MPC, this control strategy is used to efficiently coordinate the energy produced between different MG systems. Alike MG systems, MPC strategies were also used for energy management of passive/active systems' control in buildings. For instance, in [12], an MPC control strategy is used for ventilations' speed control in buildings. Using appropriate building data (e.g., energy consumption, CO₂ regulation), authors showed the efficient deployment of the MPC to reduce the ventilators' energy consumption by keeping the occupants' comfort. Moreover, authors in [13] propose a hierarchical spectral clustering method, which meets the practical requirements and constraints of the power system only for islanded MG. Hence, other interesting work are presented in literature, which use the real-time data monitoring for energy management, control, and power quality in MG systems [14-17].

It is worth noting that the aim of these approaches is to control and efficiently manage MG systems by forecasting the right control decisions. However, in order to carry out these approaches platforms are required for data gathering, processing, and real-time forecasting. Recent technologies, such as Internet-of-Things combined with Big-data technologies for real-time machine-learning (ML) algorithms, could be used in the MG system in order to autonomously measure, analyze, predict, and forecast actions (MAPCAST) depending on the actual and predicted context. In fact, ML algorithms could predict inputs values for the control strategy in order to generate Demand/Response schedules/actions. This could increase the system's reliability and minimize/avoid blackouts.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Operation schemes for power forecasting process and MPC for energy management</figcaption></figure>
ensure the energy balance (Demand/Response) in MG systems.

Generally, these control strategies use three main inputs for computing real-time decisions: the RES power production, the power consumption, and storage devices states. This kind of approaches requires the deployment of the control loop (i.e., sense, transmit, analyze data, and compute the required action). In fact, in real-sitting scenarios, these control approaches could spend a lot of time to make decisions, which might be generated right after the moment of the blackouts. Intelligent and predictive control strategies are, therefore, required to ensure a safe and flexible operation for MG systems.

In the past few years, different control strategies have been introduced for managing the power flows and quality in MG systems [3, 4]. For instance, Authors in [5] have proposed an MPC strategy in order to control a PV plant connected to the storage system. The objective was to reduce the cost of electricity bills by optimizing the system's operation using predictive electricity price, PV power production, and load consumption. In [6], an MPC strategy is presented to balance power flows of a multi-energy system, which is composed of a fuel cell, hydrogen storage, and PV panels. The work presented in [7] uses an MPC strategy to optimize the energy flow in MG systems. A framework was investigated by deploying an experimental grid-connected MG that includes RES and battery storage system. In this work, neither the platform, which is used to generate the input parameters for the MPC, nor the C/D battery is clearly stated.

Another interesting work was presented in [8] in which authors investigated an MPC strategy for real-time control of power produced by a PV plant. The installed strategy allowed adapting the PV and storage's generation depending on the actual load's demand. In [9], the HOMER software is utilized for electrical resources sizing in a MG system taking into account the power price forecasts. The objective of the proposed method is related to optimal sizing and energy management of RES and storage devices by considering the satisfaction of loads demand and the reduction of fossil fuel

dependency. Moreover, the work presented in [10] proposed an energy management system to establish the best possible situation between technologies cost and reliability in a standalone hybrid system. This later is composed of wind turbines, PV panels, and batteries. The system costs consist of the initial investment and the maintenance of equipment replacement. In [11], a control strategy for energy management in multi-MG Park is developed. It allowed balancing the power demand/response while reducing the electricity cost delivered to consumers. Based on the MPC, this control strategy is used to efficiently coordinate the energy produced between different MG systems. Alike MG systems, MPC strategies were also used for energy management of passive/active systems' control in buildings. For instance, in [12], an MPC control strategy is used for ventilations' speed control in buildings. Using appropriate building data (e.g., energy consumption, CO2 regulation), authors showed the efficient deployment of the MPC to reduce the ventilators' energy consumption by keeping the occupants' comfort. Moreover, authors in [13] propose a hierarchical spectral clustering method, which meets the practical requirements and constraints of the power system only for islanded MG. Hence, other interesting work are presented in literature, which use the real-time data monitoring for energy management, control, and power quality in MG systems [14-17].

It is worth noting that the aim of these approaches is to control and efficiently manage MG systems by forecasting the right control decisions. However, in order to carry out these approaches platforms are required for data gathering, processing, and real-time forecasting. Recent technologies, such as Internet-of-Things combined with Big-data technologies for real-time machine-learning (ML) algorithms, could be used in the MG system in order to autonomously measure, analyze, predict, and forecast actions (MAPCAST) depending on the actual and predicted context. In fact, ML algorithms could predict inputs values for the control strategy in order to generate Demand/Response schedules/actions. This could increase the system's reliability and minimize/avoid blackouts.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Operation schemes for power forecasting process and MPC for energy management</figcaption></figure>
In this work, we have deployed an IoT/BigData platform together with ML algorithms to develop an energy management system for energy balance in MG systems. In fact, a ML algorithm was deployed to predict future values, which are used by the control strategy as is depicted in Fig. 1. An MPC strategy is developed to solve the optimal constraints function by computing efficient management actions. It presents an essential control approach that can be used to predict and forecast the suitable actions in MG systems according to the system's constraints [5, 11, 17, 19]. More precisely, the main contribution of this article is the development of an intelligent and predictive control strategy for energy management in MG system based on a MPC model. To reach this aim, the following studies are realized:

* An energy management approach based on the MAPCAST principles is introduced for MG system's control.

* The controllable system and the operational constraints are modeled by a state-space equation for MPC deployment.

* A data-monitoring platform is installed for real-time data forecasting in order to carry out the MAPCAST control loop.

* The effectiveness of the deployed control approach is studied in real-sitting scenarios using our MG system.

The rest of this paper is structured as follows. In section 2, introduces the MPC strategy and the MG model together with the deployed platform. Experimental and simulation results of the proposed approach using real-sitting scenarios are presented in Section 3. Section 4 provides conclusions and perspectives.

## 2. Materials and methods

### 2.1. Micro-grid platform

A MG system is installed for testing and performance evaluation of control approaches. It is composed of RES source (e.g., wind turbine, PV panels) and electrical storage

systems (e.g., batteries) coupled together with the TEG to ensure the power to our building's demand (e.g., lighting system, ventilation). The RESs power production, the loads' demand, and the SoC values are gathered from the different installed sensors (e.g., voltage and current sensors), which are mounted in our data collection platform [8]. In fact, an IoT and Big-Data platform is also installed and tested for data collection, processing, and ML algorithms deployment. Mainly, the platform is studied, simulated and experimented [20-23], and the models used in this work have been already validated. In fact, to examine and validate the behavior of the deployed approaches using simulations and experimentation, the weather conditions (e.g., wind speed, temperature, and irradiance) are collected for the same days of the experiments. Furthermore, a set of sensors and actuators are deployed to measure the outputs of the PV panels (e.g., voltage, current) together with the loads' consumption and the battery's SoC. In order to figure out the accurate control actions, the data gathered from the sensors should be analyzed and processed. For that, the deployed IoT/Big-Data platform stores the data (e.g., power generation-consumption patterns, and weather conditions) and data history is used to evaluate the accuracy of ARIMA, which is used to develop the intelligent and predictive control strategies. As depicted in Fig. 2, a programmable control/card is installed and contains different sensors. The control card is connected to a micro-computer (Raspberry pi), which is connected directly to a Big/Data cluster for analyzes and data storage.

To summarize, weather conditions are collected to test and simulate the deployed system using the real gathered data; it is can be used to develop other approaches and applications (e.g., PV/Wind power production forecast using weather conditions). In addition, power production and consumption are collected to simulate and experiment with the whole system for the same context. All these data are collected and analyzed using our Big-Data platform, it stores the data to develop and train ML algorithms [22, 24, 25].

<figure><img src="image_3.png" /><figcaption>Fig. 2. The architecture for the deployed MG system</figcaption></figure>
In this work, we have deployed an IoT/BigData platform together with ML algorithms to develop an energy management system for energy balance in MG systems. In fact, a ML algorithm was deployed to predict future values, which are used by the control strategy as is depicted in Fig. 1. An MPC strategy is developed to solve the optimal constraints function by computing efficient management actions. It presents an essential control approach that can be used to predict and forecast the suitable actions in MG systems according to the system's constraints [5, 11, 17, 19]. More precisely, the main contribution of this article is the development of an intelligent and predictive control strategy for energy management in MG system based on a MPC model. To reach this aim, the following studies are realized:

* An energy management approach based on the MAPCAST principles is introduced for MG system's control.

* The controllable system and the operational constraints are modeled by a state-space equation for MPC deployment.

* A data-monitoring platform is installed for real-time data forecasting in order to carry out the MAPCAST control loop.

* The effectiveness of the deployed control approach is studied in real-sitting scenarios using our MG system.

The rest of this paper is structured as follows. In section 2, introduces the MPC strategy and the MG model together with the deployed platform. Experimental and simulation results of the proposed approach using real-sitting scenarios are presented in Section 3. Section 4 provides conclusions and perspectives.

## 2. Materials and methods

### 2.1. Micro-grid platform

A MG system is installed for testing and performance evaluation of control approaches. It is composed of RES source (e.g., wind turbine, PV panels) and electrical storage

systems (e.g., batteries) coupled together with the TEG to ensure the power to our building's demand (e.g., lighting system, ventilation). The RESs power production, the loads' demand, and the SoC values are gathered from the different installed sensors (e.g., voltage and current sensors), which are mounted in our data collection platform [8]. In fact, an IoT and Big-Data platform is also installed and tested for data collection, processing, and ML algorithms deployment. Mainly, the platform is studied, simulated and experimented [20-23], and the models used in this work have been already validated. In fact, to examine and validate the behavior of the deployed approaches using simulations and experimentation, the weather conditions (e.g., wind speed, temperature, and irradiance) are collected for the same days of the experiments. Furthermore, a set of sensors and actuators are deployed to measure the outputs of the PV panels (e.g., voltage, current) together with the loads' consumption and the battery's SoC. In order to figure out the accurate control actions, the data gathered from the sensors should be analyzed and processed. For that, the deployed IoT/Big-Data platform stores the data (e.g., power generation-consumption patterns, and weather conditions) and data history is used to evaluate the accuracy of ARIMA, which is used to develop the intelligent and predictive control strategies. As depicted in Fig. 2, a programmable control/card is installed and contains different sensors. The control card is connected to a micro-computer (Raspberry pi), which is connected directly to a Big/Data cluster for analyzes and data storage.

To summarize, weather conditions are collected to test and simulate the deployed system using the real gathered data; it is can be used to develop other approaches and applications (e.g., PV/Wind power production forecast using weather conditions). In addition, power production and consumption are collected to simulate and experiment with the whole system for the same context. All these data are collected and analyzed using our Big-Data platform, it stores the data to develop and train ML algorithms [22, 24, 25].

<figure><img src="image_3.png" /><figcaption>Fig. 2. The architecture for the deployed MG system</figcaption></figure>
## 2.2. MG modeling and control approach

In the deployed MG, RESs are installed to supply the electrical power to the active loads. The production surplus is stored in the batteries. However, the stochastic nature of the weather conditions generates a large variability on the RES power production depending on the periods of the days and years. Generally, this factor increases the complexity of controlling and managing the MG power flows. For that, batteries play an important role by balancing and smoothing the variability of RESs production. Therefore, the deployed control approach considers the batteries SoC evolution in order to keep the operating costs of the whole system at a reasonable level. For this aim, the deployed batteries are modeled and simulated using the OCV model (open-circuit voltage) with resistance. As mentioned in equation (1), the OCV is written as a SoC function [5, 26, 27].

$$V_{bat}(t) = OCV(SoC(t)) + R.I_{bat}(t) \quad (1)$$

The dynamic voltage of the Ohmic resistance R and the OCV present the behavior of the battery voltage variability. This equation can be stated as follows:

$$Y(t) = a.SOC(t) + R.I \quad (2)$$

where I represents the C/D battery current, a is a factor defined by the experimental battery characterization using the least-squares method [5, 26], and R presents the Ohmic resistance. By considering that the battery current is null during the full charged mode of the battery, we can then calculate the SoC by exploiting directly the battery's voltage variability. In fact, equation (2) can be presented as follows:

$$Y(t) = SoC(t) \quad (3)$$

Moreover, using the Coulomb method, the SoC can be formulated as the nominal capacity C ratio and is accumulated on the operation period τ. It is calculated by the current flow-rate measurement and integration over the interval of time (equation (4)).

$$C(t + \tau) = C(t) + \Delta C \quad (4)$$

We can use the measured battery C/D current $I_{bat}$ together with the actual $SoC(t)$ in order to estimate the future values $SoC(t+1)$ by applying equation (5). In this work, the measured $I_{bat}$ is implemented to train the ML algorithm and the forecasted current is used to calculate the SoC. The deployed predictive control approach uses input prediction values to generate the feed-forward.

$$SoC(t + 1) = SoC(t) + I_{bat}(t) \cdot \Delta t/C \quad (5)$$

The main aim is to manage the C/D current based on the control strategy. Therefore, the MPC adjusts the $I_{bat}$ by considering the variability of RESs generation and loads demand in order to define the operation mode: battery charging, battery discharging, or battery-at-rest. The constraints of the model are presented by equation (6):

$$P_{load} = \begin{cases} P_{pv} \pm P_{bat} ; & \text{if } P_{pv} \ge 0 \text{ and SoC} > SoC_{min} \\ P_{grid} ; & \text{if } P_{pv} < P_{load} \text{ and SoC} < SoC_{min} \end{cases} \quad (6)$$

where $P_{pv}$ is the PV panels generation, $P_{load}$ is the loads' consumption, $P_{bat}$ and $P_{grid}$ represent respectively the power extracted or generated from batteries, and the power extracted from the TEG. In fact, the control strategy specifies a discharge limit to evade battery deep-discharge when the RESs production is unavailable and the battery is at its minimum SoC. Moreover, the batteries store the surplus of the PV panels generation according to the following cases: the battery starts charging during the peak production ($P_{load} < P_{pv}$), it starts to supply the loads when the demand surpasses the PV panels' production ($P_{load} > P_{pv}$), and finally the battery is at rest if the SoC is at the fixed threshold and the PV power generation is unavailable ($SoC < SoC_{min}$ and $P_{pv} = 0$) or the battery SoC is at the maximum. To keep the SoC at its maximum as much as possible, the optimization function can be represented by the given objective function $E_N$ (equation (7)), which should be minimized within a future horizon n.

$$E_N = SoC_{max} \begin{pmatrix} 1 \\ \vdots \\ 1^n \end{pmatrix} - SoC(t) \begin{pmatrix} SoC(t) \\ \vdots \\ SoC(t+n) \end{pmatrix} \quad (7)$$

The problem constraints that should be satisfied are formulated in equation (8) as follows:

$$\begin{cases} SoC_{min} < SoC_k(t + k) < SoC_{max} \\ P_{pv} \pm P_{bat} = P_{load} \end{cases} \quad (8)$$

Now, the MPC strategy could be designed based on the formulated constraints and the above-mentioned equations, which we have defined for managing the power exchange in the MG system. In fact, for our system modeling, the $SoC(t)$ is considered as the system state equation. The equation (3) expression can be rewritten in the state equation form as follows:

$$x(k + 1) = Ax(k) + BU(k) \quad (9)$$

where $x(k)$ represents the system state for $A=1$. In this case, the $I_{bat}$ is the systems' input. The equality could be interpolated to n-steps-ahead to obtain the following representation (equation 10):

$$\begin{cases} x(k + 2) = A^2x(k) + ABU(k) + BU(k) \\ x(k + 3) = A^3x(k) + A^2BU(k) + ABU(k + 1) + BU(k + 2) \\ \vdots \\ x(k + n) = A^n x(k) + A^{n-1}BU(k) + \cdots + BU(k + n - 1) \end{cases} \quad (10)$$

The matrix form for this representation could be written as follows:

$$\begin{pmatrix} x(k+1) \\ \vdots \\ x(k+n) \end{pmatrix} = \begin{pmatrix} A \\ \vdots \\ A^n \end{pmatrix} x(k) + \begin{pmatrix} B \\ \vdots \\ A^{n-1}B \\ \vdots \\ A^{n-1}B \\ \vdots \\ B \end{pmatrix} \begin{pmatrix} U(k) \\ \vdots \\ U(k+n+1) \end{pmatrix} \quad (11)$$

This equation takes the following form:

$$\bar{X} = \bar{A}x(k) + \bar{B}U(k) \quad (12)$$
## 2.2. MG modeling and control approach

In the deployed MG, RESs are installed to supply the electrical power to the active loads. The production surplus is stored in the batteries. However, the stochastic nature of the weather conditions generates a large variability on the RES power production depending on the periods of the days and years. Generally, this factor increases the complexity of controlling and managing the MG power flows. For that, batteries play an important role by balancing and smoothing the variability of RESs production. Therefore, the deployed control approach considers the batteries SoC evolution in order to keep the operating costs of the whole system at a reasonable level. For this aim, the deployed batteries are modeled and simulated using the OCV model (open-circuit voltage) with resistance. As mentioned in equation (1), the OCV is written as a SoC function [5, 26, 27].

$$V_{bat}(t) = OCV(SoC(t)) + R.I_{bat}(t) \quad (1)$$

The dynamic voltage of the Ohmic resistance R and the OCV present the behavior of the battery voltage variability. This equation can be stated as follows:

$$Y(t) = a.SOC(t) + R.I \quad (2)$$

where I represents the C/D battery current, a is a factor defined by the experimental battery characterization using the least-squares method [5, 26], and R presents the Ohmic resistance. By considering that the battery current is null during the full charged mode of the battery, we can then calculate the SoC by exploiting directly the battery's voltage variability. In fact, equation (2) can be presented as follows:

$$Y(t) = SoC(t) \quad (3)$$

Moreover, using the Coulomb method, the SoC can be formulated as the nominal capacity C ratio and is accumulated on the operation period τ. It is calculated by the current flow-rate measurement and integration over the interval of time (equation (4)).

$$C(t + \tau) = C(t) + \Delta C \quad (4)$$

We can use the measured battery C/D current $I_{bat}$ together with the actual $SoC(t)$ in order to estimate the future values $SoC(t+1)$ by applying equation (5). In this work, the measured $I_{bat}$ is implemented to train the ML algorithm and the forecasted current is used to calculate the SoC. The deployed predictive control approach uses input prediction values to generate the feed-forward.

$$SoC(t + 1) = SoC(t) + I_{bat}(t) \cdot \Delta t/C \quad (5)$$

The main aim is to manage the C/D current based on the control strategy. Therefore, the MPC adjusts the $I_{bat}$ by considering the variability of RESs generation and loads demand in order to define the operation mode: battery charging, battery discharging, or battery-at-rest. The constraints of the model are presented by equation (6):

$$P_{load} = \begin{cases} P_{pv} \pm P_{bat} ; & \text{if } P_{pv} \ge 0 \text{ and SoC} > SoC_{min} \\ P_{grid} ; & \text{if } P_{pv} < P_{load} \text{ and SoC} < SoC_{min} \end{cases} \quad (6)$$

where $P_{pv}$ is the PV panels generation, $P_{load}$ is the loads' consumption, $P_{bat}$ and $P_{grid}$ represent respectively the power extracted or generated from batteries, and the power extracted from the TEG. In fact, the control strategy specifies a discharge limit to evade battery deep-discharge when the RESs production is unavailable and the battery is at its minimum SoC. Moreover, the batteries store the surplus of the PV panels generation according to the following cases: the battery starts charging during the peak production ($P_{load} < P_{pv}$), it starts to supply the loads when the demand surpasses the PV panels' production ($P_{load} > P_{pv}$), and finally the battery is at rest if the SoC is at the fixed threshold and the PV power generation is unavailable ($SoC < SoC_{min}$ and $P_{pv} = 0$) or the battery SoC is at the maximum. To keep the SoC at its maximum as much as possible, the optimization function can be represented by the given objective function $E_N$ (equation (7)), which should be minimized within a future horizon n.

$$E_N = SoC_{max} \begin{pmatrix} 1 \\ \vdots \\ 1^n \end{pmatrix} - SoC(t) \begin{pmatrix} SoC(t) \\ \vdots \\ SoC(t+n) \end{pmatrix} \quad (7)$$

The problem constraints that should be satisfied are formulated in equation (8) as follows:

$$\begin{cases} SoC_{min} < SoC_k(t + k) < SoC_{max} \\ P_{pv} \pm P_{bat} = P_{load} \end{cases} \quad (8)$$

Now, the MPC strategy could be designed based on the formulated constraints and the above-mentioned equations, which we have defined for managing the power exchange in the MG system. In fact, for our system modeling, the $SoC(t)$ is considered as the system state equation. The equation (3) expression can be rewritten in the state equation form as follows:

$$x(k + 1) = Ax(k) + BU(k) \quad (9)$$

where $x(k)$ represents the system state for $A=1$. In this case, the $I_{bat}$ is the systems' input. The equality could be interpolated to n-steps-ahead to obtain the following representation (equation 10):

$$\left\{ \begin{array}{l} x(k + 2) = A^2 x(k) + ABU(k) + BU(k) \\ x(k + 3) = A^3 x(k) + A^2 BU(k) + ABU(k + 1) + BU(k + 2) \\ \vdots \\ x(k + n) = A^n x(k) + A^{n-1} BU(k) + \cdots + BU(k + n - 1) \end{array} \right. \quad (10)$$

The matrix form for this representation could be written as follows:

$$\begin{pmatrix} x(k+1) \\ \vdots \\ x(k+n) \end{pmatrix} = \begin{pmatrix} A \\ \vdots \\ A^n \end{pmatrix} x(k) + \begin{pmatrix} B \\ \vdots \\ A^{n-1}B \\ \vdots \\ A^{n-1}B \\ \vdots \\ B \end{pmatrix} \begin{pmatrix} U(k) \\ \vdots \\ U(k+n+1) \end{pmatrix} \quad (11)$$

This equation takes the following form:

$$\bar{X} = \bar{A} x(k) + \bar{B} U(k) \quad (12)$$
The observation equation could be interpolated to n steps as
follows:

$$
\begin{pmatrix} y(k+1) \\ \vdots \\ y(k+n) \end{pmatrix} = \begin{pmatrix} CA \\ \vdots \\ CA^n \end{pmatrix} x(k) + \begin{pmatrix} CB \\ \vdots \\ CA^{n-1}B \end{pmatrix} \begin{pmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ \vdots & \cdots & CB \\ \vdots & \cdots & CB \end{pmatrix} \begin{pmatrix} U(k) \\ \vdots \\ U(k+n+1) \end{pmatrix} \quad (13)
$$

$$
This representation is equivalent to: \bar{Y} = \bar{C}x(k) + \bar{D}\bar{U} \quad (14)
$$

The following variation of the input vectors is considered as
follows,

$$
\left\{
\begin{array}{l}
U(k) = U(k-1) + \Delta U(k) \\
U(k+1) = U(k) + \Delta U(k+1) = U(k-1) + \Delta U(k) + \Delta U(k+1) \\
\qquad \vdots \\
U(k+n-1) = U(k-1) + \Delta U(k) + \Delta U(k-1) + \dots + \Delta U(k+n-1)
\end{array}
\right.
\qquad (15)
$$

The matrix form for this representation is:

$$
\begin{pmatrix} U(k) \\ U(k+1) \\ \vdots \\ U(k+n) \end{pmatrix} = \begin{pmatrix} 1 \\ \vdots \\ 1^n \end{pmatrix} U(k-1) + \begin{pmatrix} 1 & 0 & \cdots & 0 \\ \vdots & \ddots & \ddots & \vdots \\ 1 & \cdots & 1 & 1 \end{pmatrix} \begin{pmatrix} \Delta U(k) \\ \Delta U(k+1) \\ \vdots \\ \Delta U(k+n+1) \end{pmatrix} \quad (16)
$$

This representation is equivalent to:

$$
\bar{U} = I_1 \Delta \bar{U} (k-1) + I_2 \Delta \bar{U} (k) \quad (17)
$$

Equations (17) and (12) can be combined to obtain the
following predictive model (equation 18):

$$
\bar{X} = \bar{A} x(k) + \bar{B} I_1 U(k-1) + \bar{B} I_2 \Delta \bar{U}(k) \quad (18)
$$

Combining equations (11) and (12), the predictive
observation model is presented as follows:

$$
\bar{Y} = \bar{C} x(k) + \bar{D} I_1 U(k-1) + \bar{D} I_2 \Delta \bar{U}(k) \quad (19)
$$

The constraint function to optimize is represented by the
equation (20), which is equivalent to the command Δ**U**(k) to
reduce the error. In fact, the battery is used to absorb or
generate the power satisfying the energy balance
(Demand/Response). At the same time, it is more important
to keep the battery at its maximum SoC<sub>max</sub> when it is
possible.

$$
Y_{ref} = [SoC_{max}(k+1), SoC_{max}(k+2), \dots, SoC_{max}(k+n)] \quad (20)
$$

Finally, the error is formulated by $E = Y - Y_{ref}$ by
considering the desired regulation, which is required to reach
by the control model. Then, to get the control series $\Delta U$, the
criterion function to optimize is represented by the
following:

$$
J = \frac{1}{2} (EQE^T + \Delta \bar{U} R \Delta \bar{U}^T) \quad (21)
$$

where *Q* and *R* are, respectively, the error and the inputs'
variation covariance matrices. A priory is choosing for the
diagonal matrix *R* to ensure the algorithm convergence. The
control approach manages the system to generate the values

that minimize the *J* while respecting the constraint (equation
(8)).

<figure><img src="image_4.png" /><figcaption>**Fig. 3.** A schematic view of the predictive control model</figcaption></figure>

As illustrated in Fig. 3, by respecting the constraints, the deployed MPC controls the battery charged/discharged state accordingly. The MPC controller either charges the batteries, absorbing the PV panels’ production surplus or discharges the batteries to ensure the power demand to the consumers. Mainly, by considering the constraints, the TEG is integrated and it is used when the battery SoC extents the limit value and the PV panels’ production cannot satisfy completely the demand. The SoC is considered as an input parameter to the MPC model, it is calculated by predicting the battery C/D current using the deployed ARIMA algorithm. The battery current is also obtained by the prediction of the PV panels’ generation as well as the load consumption.

**3. Simulation and experimental results**

The studied MG system is connected to the TEG in order
to supply the power to the equipment when RESs and storage
are unavailable. It is mainly composed of PV panels, storage
devices, and different loads. For the simulated system, excess
power can be shunted to the battery system to be stored for
later usage or it is injected to a buffer load that is used to
simulate the power exchange with the TEG. If the power is
unavailable from RES, the storage devices continue
delivering the electricity to the dedicated loads, depending on
the delivered commands from the MPC model, and when the
batteries are discharged, the TEG ensures the power supply
to the loads.

As described early, we are aiming to deploy the
MAPCAST closed-loop (measure, analyze, predict, forecast)
for MG management. A platform was deployed to allow
sensing and analyzing data generated by sensors. The stored
data are used to train the ARIMA model and the predicted
values are used as inputs for the control strategy [7]. In fact,
input parameters are predicted using ARIMA while control
actions' forecasting are computed using the MPC controller.
These two last phases are described in this section together
with the performance evaluation.

3.1. ARIMA model deployment and validation

In MG control and management, the time horizon is used
as the main criterion in order to select a suitable forecasting
algorithm. There are four main categories of algorithms,
which could be used in MG control and management. They
are classified according to the forecasting horizon as follows:
i) very-short term, which is desired for power regulation and
The observation equation could be interpolated to n steps as
follows:

$$
\begin{pmatrix} y(k+1) \\ \vdots \\ y(k+n) \end{pmatrix} = \begin{pmatrix} CA \\ \vdots \\ CA^n \end{pmatrix} x(k) + \begin{pmatrix} CB \\ \vdots \\ CA^{n-1}B \end{pmatrix} \begin{pmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ \vdots & \cdots & CB \\ \vdots & \cdots & CB \end{pmatrix} \begin{pmatrix} U(k) \\ \vdots \\ U(k+n+1) \end{pmatrix} \quad (13)
$$

$$
This representation is equivalent to: \bar{Y} = \bar{C}x(k) + \bar{D}\bar{U} \quad (14)
$$

The following variation of the input vectors is considered as
follows,

$$
\left\{
\begin{array}{l}
U(k) = U(k-1) + \Delta U(k) \\
U(k+1) = U(k) + \Delta U(k+1) = U(k-1) + \Delta U(k) + \Delta U(k+1) \\
\qquad \vdots \\
U(k+n-1) = U(k-1) + \Delta U(k) + \Delta U(k-1) + \dots + \Delta U(k+n-1)
\end{array}
\right.
\qquad (15)
$$

The matrix form for this representation is:

$$
\begin{pmatrix} U(k) \\ U(k+1) \\ \vdots \\ U(k+n) \end{pmatrix} = \begin{pmatrix} 1 \\ \vdots \\ 1^n \end{pmatrix} U(k-1) + \begin{pmatrix} 1 & 0 & \cdots & 0 \\ \vdots & \ddots & \ddots & \vdots \\ 1 & \cdots & 1 & 1 \end{pmatrix} \begin{pmatrix} \Delta U(k) \\ \Delta U(k+1) \\ \vdots \\ \Delta U(k+n+1) \end{pmatrix} \quad (16)
$$

This representation is equivalent to:

$$
\bar{U} = I_1 \Delta \bar{U}(k-1) + I_2 \Delta \bar{U}(k) \quad (17)
$$

Equations (17) and (12) can be combined to obtain the
following predictive model (equation 18):

$$
\bar{X} = \bar{A} x(k) + \bar{B} I_1 U(k-1) + \bar{B} I_2 \Delta \bar{U}(k) \quad (18)
$$

Combining equations (11) and (12), the predictive
observation model is presented as follows:

$$
\bar{Y} = \bar{C} x(k) + \bar{D} I_1 U(k-1) + \bar{D} I_2 \Delta \bar{U}(k) \quad (19)
$$

The constraint function to optimize is represented by the
equation (20), which is equivalent to the command Δ**U**(k) to
reduce the error. In fact, the battery is used to absorb or
generate the power satisfying the energy balance
(Demand/Response). At the same time, it is more important
to keep the battery at its maximum SoC<sub>max</sub> when it is
possible.

$$
Y_{ref} = [SoC_{max}(k+1), SoC_{max}(k+2), \dots, SoC_{max}(k+n)] \quad (20)
$$

Finally, the error is formulated by $E = Y - Y_{ref}$ by
considering the desired regulation, which is required to reach
by the control model. Then, to get the control series $\Delta U$, the
criterion function to optimize is represented by the
following:

$$
J = \frac{1}{2} (EQE^T + \Delta \bar{U} R \Delta \bar{U}^T) \quad (21)
$$

where *Q* and *R* are, respectively, the error and the inputs'
variation covariance matrices. A priory is choosing for the
diagonal matrix *R* to ensure the algorithm convergence. The
control approach manages the system to generate the values

that minimize the *J* while respecting the constraint (equation
(8)).

<figure><img src="image_4.png" /><figcaption>Fig. 3. A schematic view of the predictive control model</figcaption></figure>

As illustrated in Fig. 3, by respecting the constraints, the deployed MPC controls the battery charged/discharged state accordingly. The MPC controller either charges the batteries, absorbing the PV panels’ production surplus or discharges the batteries to ensure the power demand to the consumers. Mainly, by considering the constraints, the TEG is integrated and it is used when the battery SoC extents the limit value and the PV panels’ production cannot satisfy completely the demand. The SoC is considered as an input parameter to the MPC model, it is calculated by predicting the battery C/D current using the deployed ARIMA algorithm. The battery current is also obtained by the prediction of the PV panels’ generation as well as the load consumption.

3. Simulation and experimental results

The studied MG system is connected to the TEG in order
to supply the power to the equipment when RESs and storage
are unavailable. It is mainly composed of PV panels, storage
devices, and different loads. For the simulated system, excess
power can be shunted to the battery system to be stored for
later usage or it is injected to a buffer load that is used to
simulate the power exchange with the TEG. If the power is
unavailable from RES, the storage devices continue
delivering the electricity to the dedicated loads, depending on
the delivered commands from the MPC model, and when the
batteries are discharged, the TEG ensures the power supply
to the loads.

As described early, we are aiming to deploy the
MAPCAST closed-loop (measure, analyze, predict, forecast)
for MG management. A platform was deployed to allow
sensing and analyzing data generated by sensors. The stored
data are used to train the ARIMA model and the predicted
values are used as inputs for the control strategy [7]. In fact,
input parameters are predicted using ARIMA while control
actions' forecasting are computed using the MPC controller.
These two last phases are described in this section together
with the performance evaluation.

3.1. ARIMA model deployment and validation

In MG control and management, the time horizon is used
as the main criterion in order to select a suitable forecasting
algorithm. There are four main categories of algorithms,
which could be used in MG control and management. They
are classified according to the forecasting horizon as follows:
i) very-short term, which is desired for power regulation and
service management, *ii*) short-term, which could be used for energy management in the secondary control level), *iii*) medium-term, which is more suitable for maintenance planning of power system and electricity market), and *iv*) long term, which is could be used for future energy statistics and security for a large scale systems. For each category, a set of algorithms (e.g., ANN, ARX, LSTM) can be deployed depending on the selected approaches (e.g., physical approach, statistical approach). However, some algorithms require a long training time, which could affect the control actions forecasts.

In our study, ARIMA is selected for forecasting the control inputs values. It is a statistical approach that requires little training and forecasting times, from few seconds to some minutes. The use of the ARIMA method has a fundamental impact on the study of the non-stationary time series analysis due to Box and Jenkins approach. This later includes five iterative steps as follows [20]: *i*) the differentiation step, in which the data is prepared for the model training, *ii*) the identification step of best ARIMA parameters, as presented in Fig. 4, *iii*) the estimation step, which is used to identify the stationary time series having the minimum errors, and *iv*) the diagnostic checking step in which a residual is calculated in order to identify if the model is a good fit to the data and the autocorrelation is verified for the obtained results.

The deployed algorithm computes at each time the different parameters based on the minimum Akaike Information Criteria (AIC). As shown in Fig. 4.a, the minimum AIC is calculated and the equivalent ARIMA parameters are selected. For that, the ARIMA steps are realized in order to predict future values by maximizing the accuracy between the predicted and the real values. In fact, to measure the prediction accuracy, the errors are calculated by comparing the predicted and the real values (Fig. 4.b).

<figure><img src="image_5.png" /><figcaption>Fig. 4. a) The minimum Akaike Information Criteria (AIC) b) The errors for ARIMA parameters determination</figcaption></figure>

The prediction of the power generation and the electricity demand can be used to calculate the battery SoC by the equation (13) and the predicted parameter is used as

input to the control strategy. During the day, the PV panels generate the power to the loads, charge the battery, and the surplus is transmitted to a resistance, which is considered as the grid injection. As shown in Fig. 5.a, for 48 hours the PV power production is collected. For the first day, from 02:00 pm to around 06:00 pm and due to the bad weather conditions, the PVs generation decreases. During this period, the battery supplies the power to the load accumulating the need for power caused by the decrease of PV generation (Fig. 5.b).

<figure><img src="image_6.png" /><figcaption>Fig. 5. a) Predictive and real PV generation, b) Predictive and real SoC, c) Predictive and real loads consumption</figcaption></figure>

Moreover, during the night, only the batteries generate electricity to supply the load, and when the SoC is at its minimum, the control strategy switches from RES to the TEG. In addition, to forecast the power consumption during the same period of the tests, ARIMA model is deployed
service management, *ii*) short-term, which could be used for energy management in the secondary control level), *iii*) medium-term, which is more suitable for maintenance planning of power system and electricity market), and *iv*) long term, which is could be used for future energy statistics and security for a large scale systems. For each category, a set of algorithms (e.g., ANN, ARX, LSTM) can be deployed depending on the selected approaches (e.g., physical approach, statistical approach). However, some algorithms require a long training time, which could affect the control actions forecasts.

In our study, ARIMA is selected for forecasting the control inputs values. It is a statistical approach that requires little training and forecasting times, from few seconds to some minutes. The use of the ARIMA method has a fundamental impact on the study of the non-stationary time series analysis due to Box and Jenkins approach. This later includes five iterative steps as follows [20]: *i*) the differentiation step, in which the data is prepared for the model training, *ii*) the identification step of best ARIMA parameters, as presented in Fig. 4, *iii*) the estimation step, which is used to identify the stationary time series having the minimum errors, and *iv*) the diagnostic checking step in which a residual is calculated in order to identify if the model is a good fit to the data and the autocorrelation is verified for the obtained results.

The deployed algorithm computes at each time the different parameters based on the minimum Akaike Information Criteria (AIC). As shown in Fig. 4.a, the minimum AIC is calculated and the equivalent ARIMA parameters are selected. For that, the ARIMA steps are realized in order to predict future values by maximizing the accuracy between the predicted and the real values. In fact, to measure the prediction accuracy, the errors are calculated by comparing the predicted and the real values (Fig. 4.b).

<figure><img src="image_5.png" /><figcaption>Fig. 4. a) The minimum Akaike Information Criteria (AIC) b) The errors for ARIMA parameters determination</figcaption></figure>

The prediction of the power generation and the electricity demand can be used to calculate the battery SoC by the equation (13) and the predicted parameter is used as

input to the control strategy. During the day, the PV panels generate the power to the loads, charge the battery, and the surplus is transmitted to a resistance, which is considered as the grid injection. As shown in Fig. 5.a, for 48 hours the PV power production is collected. For the first day, from 02:00 pm to around 06:00 pm and due to the bad weather conditions, the PVs generation decreases. During this period, the battery supplies the power to the load accumulating the need for power caused by the decrease of PV generation (Fig. 5.b).

<figure><img src="image_6.png" /><figcaption>Fig. 5. a) Predictive and real PV generation, b) Predictive and real SoC, c) Predictive and real loads consumption</figcaption></figure>

Moreover, during the night, only the batteries generate electricity to supply the load, and when the SoC is at its minimum, the control strategy switches from RES to the TEG. In addition, to forecast the power consumption during the same period of the tests, ARIMA model is deployed
using the real data-set of power consumption. It is worth noting that the occupants' activities influence on power consumption. As shown in Fig. 5.c, the energy demand behavior varies due to lighting and the ventilation speed's variation, which is mainly influenced by occupants' activities [12]. The ARIMA model is trained using the gathered data and then the obtained model is used to forecast the desired parameters' values.

Figure 5.a illustrates the power forecast (orange curve) with the real PVs generation (Blue curve). For each instance, the deployed ARIMA model generates a value with a timestamp of about three minutes. The same for the battery SoC, Fig. 5.b indicates that around 06:00 PM the control approach switches from renewable energy to the TEG because the battery SoC reaches the threshold value as predicted. At the same time, the power consumed from RES was measured (Fig. 5.c), the orange curve presents the power consumption generated by ARIMA model and the blue curve is the real power consumption. The Obtained results are used as inputs for the MPC in order to predict the suitable action by respecting the predefined constraints ($P_{load} = P_{pv} \pm P_{bat}$).

## 3.2. MPC strategy deployment and validation

The deployed MG system, presented in section 4, is used to collect real data, which are used to validate the results for both the MPC and a PID controller. As stated above, this system contains RESs (e.g., PV, grid), storage systems, and active loads (e.g., lighting, ventilators). The PV panels charge the batteries, which in turn provide the power to the lighting and ventilation systems. However, during the night or cloudy days, the batteries discharge and the operation of the loads is ensured from the TEG. So, to ensure efficient MG management, the control approach uses the predicted values (from ARIMA model) to forecast the control decisions. The following cases are obtained: i) the PV power production has the priority to generate the electricity in order to satisfy the loads over the TEG and the storage devices; ii) the PV panels supply directly the electricity to the loads when it is more important than the loads demand, iii) when the PV generation could not satisfy the loads demand, PV and the main battery storage supply the power to the loads, v) if the battery SoC is less than 50 % and the RESs generation is less than the loads demand, then the system switches to the TEG. During this period the PV panels charge the main energy storage.

Essentially, the aim of the proposed MAPCAST is to optimize the batteries' C/D current according to the electricity production and consumption. In fact, the MPC controller allows balancing the power flows accordingly. In order to show the effectiveness of the MAPCAST, results obtained when using the MPC are compared with those obtained from a PID controller. Mainly, the PID model is deployed in the charge controller in order to regulate the PV

power production. Unlike PID, the MPC strategy forecasts the suitable actions for either switching to the batteries or to the TEG.

It's worth noting that the PV system is simulated with the same input parameters for real a scenario (e.g., irradiance, temperature) with the same load demand variability. In addition, a model for the deployed battery is characterized in order to be integrated into the simulation. The duty cycle of the charge controller and the converter are controlled by the commands that are generated by the MPC bloc depending on the predicted context of the PV power generation, the battery SoC, and the load consumption. However, due to some technical problems, the machine-learning algorithm is deployed separately of this simulation bloc, but the obtained forecasting parameters are integrated to simulate the MPC bloc. The predictive commands are generated and shifted by the forecast time horizon compared to the real command obtained by the PID control.

Moreover, the C/D current variability depends on the PV panels' generation and the demand variability. In fact, the battery SoC influences directly to the battery current; more the battery is charged more the current decreases. In this scenario, the battery C/D current is the setpoint for the MPC and the PID model (Fig. 6). It is calculated by the predictive C/D current, which depends mainly on the PV panels' production and power consumption as well.

Figure 6 presents the real variability of the C/D current during two days (orange curve). Around 02:00 PM, the batteries start to discharge supplying the power to the load depending on the constraints presented in equation (8). Almost at 06:00 PM, the minimum SoC is reached, and during the night, the control/card switches from RESs to the TEG. In the morning, the RES start producing the electricity, which is used mainly to supply the power to the load, the surplus is used to charge the battery. In fact, the obtained results are used as a set-point for the MPC and the PID model in order to calculate the SoC.

Figure 7 presents the SoC obtained by the MPC (blue curve) and the PID (green curve). The SoC variability is presented depending on the MPC and PID controller command, which is required to reach the desired SoC. Moreover, the ML algorithm predicts future values with insignificant errors. Through the deployment of this model, the current is generated and it is used to predict the future SoC desired at each time. The MPC model uses the SoC to forecast future control actions depending on the operational context. As shown in Fig. 7.b, during sudden change of the values, the PID presents an interesting peak for the transit regime. Unlike the PID, the MPC forecasts the corresponding power to generate or to extract from storage devices avoiding a sudden change of the current. For that, the MPC presents a stable regime compared to the PID (Fig. 7.a).
using the real data-set of power consumption. It is worth noting that the occupants' activities influence on power consumption. As shown in Fig. 5.c, the energy demand behavior varies due to lighting and the ventilation speed's variation, which is mainly influenced by occupants' activities [12]. The ARIMA model is trained using the gathered data and then the obtained model is used to forecast the desired parameters' values.

Figure 5.a illustrates the power forecast (orange curve) with the real PVs generation (Blue curve). For each instance, the deployed ARIMA model generates a value with a timestamp of about three minutes. The same for the battery SoC, Fig. 5.b indicates that around 06:00 PM the control approach switches from renewable energy to the TEG because the battery SoC reaches the threshold value as predicted. At the same time, the power consumed from RES was measured (Fig. 5.c), the orange curve presents the power consumption generated by ARIMA model and the blue curve is the real power consumption. The Obtained results are used as inputs for the MPC in order to predict the suitable action by respecting the predefined constraints ($P_{load} = P_{pv} \pm P_{bat}$).

## 3.2. MPC strategy deployment and validation

The deployed MG system, presented in section 4, is used to collect real data, which are used to validate the results for both the MPC and a PID controller. As stated above, this system contains RESs (e.g., PV, grid), storage systems, and active loads (e.g., lighting, ventilators). The PV panels charge the batteries, which in turn provide the power to the lighting and ventilation systems. However, during the night or cloudy days, the batteries discharge and the operation of the loads is ensured from the TEG. So, to ensure efficient MG management, the control approach uses the predicted values (from ARIMA model) to forecast the control decisions. The following cases are obtained: i) the PV power production has the priority to generate the electricity in order to satisfy the loads over the TEG and the storage devices; ii) the PV panels supply directly the electricity to the loads when it is more important than the loads demand, iii) when the PV generation could not satisfy the loads demand, PV and the main battery storage supply the power to the loads, v) if the battery SoC is less than 50 % and the RESs generation is less than the loads demand, then the system switches to the TEG. During this period the PV panels charge the main energy storage.

Essentially, the aim of the proposed MAPCAST is to optimize the batteries' C/D current according to the electricity production and consumption. In fact, the MPC controller allows balancing the power flows accordingly. In order to show the effectiveness of the MAPCAST, results obtained when using the MPC are compared with those obtained from a PID controller. Mainly, the PID model is deployed in the charge controller in order to regulate the PV

power production. Unlike PID, the MPC strategy forecasts the suitable actions for either switching to the batteries or to the TEG.

It's worth noting that the PV system is simulated with the same input parameters for real a scenario (e.g., irradiance, temperature) with the same load demand variability. In addition, a model for the deployed battery is characterized in order to be integrated into the simulation. The duty cycle of the charge controller and the converter are controlled by the commands that are generated by the MPC bloc depending on the predicted context of the PV power generation, the battery SoC, and the load consumption. However, due to some technical problems, the machine-learning algorithm is deployed separately of this simulation bloc, but the obtained forecasting parameters are integrated to simulate the MPC bloc. The predictive commands are generated and shifted by the forecast time horizon compared to the real command obtained by the PID control.

Moreover, the C/D current variability depends on the PV panels' generation and the demand variability. In fact, the battery SoC influences directly to the battery current; more the battery is charged more the current decreases. In this scenario, the battery C/D current is the setpoint for the MPC and the PID model (Fig. 6). It is calculated by the predictive C/D current, which depends mainly on the PV panels' production and power consumption as well.

Figure 6 presents the real variability of the C/D current during two days (orange curve). Around 02:00 PM, the batteries start to discharge supplying the power to the load depending on the constraints presented in equation (8). Almost at 06:00 PM, the minimum SoC is reached, and during the night, the control/card switches from RESs to the TEG. In the morning, the RES start producing the electricity, which is used mainly to supply the power to the load, the surplus is used to charge the battery. In fact, the obtained results are used as a set-point for the MPC and the PID model in order to calculate the SoC.

Figure 7 presents the SoC obtained by the MPC (blue curve) and the PID (green curve). The SoC variability is presented depending on the MPC and PID controller command, which is required to reach the desired SoC. Moreover, the ML algorithm predicts future values with insignificant errors. Through the deployment of this model, the current is generated and it is used to predict the future SoC desired at each time. The MPC model uses the SoC to forecast future control actions depending on the operational context. As shown in Fig. 7.b, during sudden change of the values, the PID presents an interesting peak for the transit regime. Unlike the PID, the MPC forecasts the corresponding power to generate or to extract from storage devices avoiding a sudden change of the current. For that, the MPC presents a stable regime compared to the PID (Fig. 7.a).
<figure><img src="image_7.png" /><figcaption>Fig. 6. a) Battery C/D current variability, b) Comparison of the current for the different methods</figcaption></figure>

<figure><img src="image_8.png" /></figure>
<figure><img src="image_7.png" /><figcaption>Fig. 6. a) Battery C/D current variability, b) Comparison of the current for the different methods</figcaption></figure>

<figure><img src="image_8.png" /></figure>
<figure><img src="image_9.png" /><figcaption>Fig. 7. a) SoC variability for the different methods, b) The obtained SoC comparison for the different methods</figcaption></figure>

**4. Conclusions and perspectives**

In this work, a MAPCAST framework is introduced for energy balance in MG systems. In fact, this predictive control approach manages the MG by maximizing the usage of the RES while considering the storage devices' limits. For that, an IoT/Big-Data platform was developed for data gathering, processing, and storage. A real MG system was deployed in order to investigate the proposed MAPCAST in real sitting scenarios. Data are collected from the MG system and are used to train the ARIMA model, which is required for the MPC strategy. Moreover, the MPC strategy forecasts future actions to control the C/D currents of the battery, by considering the specific variability of power production and loads' consumption. The optimization function and the constraints are presented for the proposed MPC strategy and the obtained results illustrate the utility of the model for efficient control of the MG compared to the PID control. In addition to the MPC stable behavior, compared to the PID controller, for seamless switching between the MG components (i.e., RES, battery, electric grid), our ongoing work focuses on enhancing it by including the electricity price forecasts as a further constraint. Therefore, the energy price is an interesting exogenous for both the consumer and the central grid. Firstly, as mostly known, the main challenge for the actual grid is the “electricity blackouts” that are generally caused by high demands during the “peak hours” (e.g., morning, evening). Within this context, the electricity operators use the price as penalties for the consumer to avoid “peak demand” during some periods. Thus, the energy price has become an exogenous factor for the grid by minimizing the consumption during the period when the price is expensive, which is equivalent to the “peak demand period”. Secondly, a consumer that has RESs installation with a storage system can locally manage the energy flow depending on electricity price. For a given scenario, the consumer can use the central grid avoiding then the use of

the local storage system, which will be kept at its maximum for usage during the high price periods. Consequently, the electricity bill will be minimized for the consumers, and the high demand from the grid will be minimized to avoid the “electricity blackouts”.

**Acknowledgements**

This work is supported by MIGRID project (grant 5-398, 2017-2019), which is funded by USAID under the PEER program.

**References**

[1] European Commission. Information Society. (2010), available at: http://ec.europa.eu/information_society/activities/sustainable_growth/buildings/index_en.htm (accessed 15 April 2019)

[2] Bakhouya, M., NaitMalek, Y., Elmouatamid, A., Lachhab, F., Berouine, A., Boulmrharj, S., ... & Elkamoune, N. (2017, October). Towards a context-driven platform using IoT and big data technologies for energy efficient buildings. In 2017 3rd International Conference of Cloud Computing Technologies and Applications (CloudTech) (pp. 1-5). IEEE.

[3] Tomita, Y., Nagai, Y., Saito, M., Niina, N., & Zushi, Y. (2019, November). Stable Operation of an Automotive Photovoltaic System under Moving Shadows. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 527-533). IEEE.

[4] Oyegoke, S., Maniatopoulos, M., Keates, S., & Habtay, Y. (2019, November). Frequency and voltage control of island system using power hardware in the loop. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 587-592). IEEE.

[5] Liu, B., Lu, Z., Yao, K., & Gao, F. (2015). A MPC operation method for a photovoltaic system with batteries. IFAC-PapersOnLine, 48(8), 807-812.
<figure><img src="image_9.png" /><figcaption>Fig. 7. a) SoC variability for the different methods, b) The obtained SoC comparison for the different methods</figcaption></figure>

**4. Conclusions and perspectives**

In this work, a MAPCAST framework is introduced for energy balance in MG systems. In fact, this predictive control approach manages the MG by maximizing the usage of the RES while considering the storage devices' limits. For that, an IoT/Big-Data platform was developed for data gathering, processing, and storage. A real MG system was deployed in order to investigate the proposed MAPCAST in real sitting scenarios. Data are collected from the MG system and are used to train the ARIMA model, which is required for the MPC strategy. Moreover, the MPC strategy forecasts future actions to control the C/D currents of the battery, by considering the specific variability of power production and loads' consumption. The optimization function and the constraints are presented for the proposed MPC strategy and the obtained results illustrate the utility of the model for efficient control of the MG compared to the PID control. In addition to the MPC stable behavior, compared to the PID controller, for seamless switching between the MG components (i.e., RES, battery, electric grid), our ongoing work focuses on enhancing it by including the electricity price forecasts as a further constraint. Therefore, the energy price is an interesting exogenous for both the consumer and the central grid. Firstly, as mostly known, the main challenge for the actual grid is the “electricity blackouts” that are generally caused by high demands during the “peak hours” (e.g., morning, evening). Within this context, the electricity operators use the price as penalties for the consumer to avoid “peak demand” during some periods. Thus, the energy price has become an exogenous factor for the grid by minimizing the consumption during the period when the price is expensive, which is equivalent to the “peak demand period”. Secondly, a consumer that has RESs installation with a storage system can locally manage the energy flow depending on electricity price. For a given scenario, the consumer can use the central grid avoiding then the use of

the local storage system, which will be kept at its maximum for usage during the high price periods. Consequently, the electricity bill will be minimized for the consumers, and the high demand from the grid will be minimized to avoid the “electricity blackouts”.

**Acknowledgements**

This work is supported by MIGRID project (grant 5-398, 2017-2019), which is funded by USAID under the PEER program.

**References**

[1] European Commission. Information Society. (2010), available at: http://ec.europa.eu/information_society/activities/sustainable_growth/buildings/index_en.htm (accessed 15 April 2019)

[2] Bakhouya, M., NaitMalek, Y., Elmouatamid, A., Lachhab, F., Berouine, A., Boulmrharj, S., ... & Elkamoune, N. (2017, October). Towards a context-driven platform using IoT and big data technologies for energy efficient buildings. In 2017 3rd International Conference of Cloud Computing Technologies and Applications (CloudTech) (pp. 1-5). IEEE.

[3] Tomita, Y., Nagai, Y., Saito, M., Niina, N., & Zushi, Y. (2019, November). Stable Operation of an Automotive Photovoltaic System under Moving Shadows. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 527-533). IEEE.

[4] Oyegoke, S., Maniatopoulos, M., Keates, S., & Habtay, Y. (2019, November). Frequency and voltage control of island system using power hardware in the loop. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 587-592). IEEE.

[5] Liu, B., Lu, Z., Yao, K., & Gao, F. (2015). A MPC operation method for a photovoltaic system with batteries. IFAC-PapersOnLine, 48(8), 807-812.
[6] Del Real, A. J., Arce, A., & Bordons, C. (2007). Hybrid model predictive control of a two-generator power plant integrating photovoltaic panels and a fuel cell. In 2007 46th IEEE Conference on Decision and Control.

[7] Parisio, A., Rikos, E., Tzamalis, G., & Glielmo, L. (2014). Use of model predictive control for experimental microgrid optimization. Applied Energy, 115, 37-46.

[8] Perez, E., Beltran, H., Aparicio, N., & Rodriguez, P. (2012). Predictive power control for PV plants with energy storage. IEEE Transactions on Sustainable Energy, 4(2), 482-490.

[9] Hosseini, S. J. A. D., Moazzami, M., & Shahinzadeh, H. (2017). Optimal sizing of an isolated hybrid wind/PV/battery system with considering loss of power supply probability. Majlesi Journal of Electrical Engineering, 11(3), 63-69.

[10] Shahinzadeh, H., Moazzami, M., Fathi, S. H., & Gharehpetian, G. B. (2016, December). Optimal sizing and energy management of a grid-connected microgrid using HOMER software. In 2016 Smart Grids Conference (SGC) (pp. 1-6). IEEE.

[11] Hu, K. Y., Li, W. J., Wang, L. D., Cao, S. H., Zhu, F. M., & Shou, Z. X. (2018). Energy management for microgrid system based on model predictive control. Frontiers of Information Technology & Electronic Engineering, 19(11), 1340-1351.

[12] Berouinev, A., Ouladsine, R., Bakhouya, M., Lachhab, F., & Essaaidi, M. (2019, April). A Model Predictive Approach for Ventilation System Control in Energy Efficient Buildings. In 2019 4th World Conference on Complex Systems (WCCS) (pp. 1-6). IEEE.

[13] Amini, M., Seifi, A. R., & Samet, H. (2020). An Efficient Controlled Islanding Technique for Smart Grids. International Journal of Renewable Energy Research (IJRER), 10(1), 24-32.

[14] El Shafei, A., Ozdemir, S., Altin, N., Jean-Pierre, G., & Nasiri, A. (2019, November). A High Power High Frequency Transformer Design for Solid State Transformer Applications. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 904-909). IEEE.

[15] GOUD, B. S., & Rao, B. L. (2020). An Intelligent Technique for Optimal Power Quality Enhancement (OPQE) in a HRES Grid Connected System: ESA Technique. International Journal of Renewable Energy Research (IJRER), 10(1), 317-328.

[16] Hossain, M. S., & Rahman, F. (2020). Hybrid Solar PV/Biomass Powered Energy Efficient Remote Cellular Base Station. International Journal of Renewable Energy Research (IJRER), 10(1), 329-342.

[17] Singh, S., Bagherwal, S., Semwal, S., & Badoni, M. (2020). Design and Development of Standalone Solar

Photovoltaic Battery System with Adaptive Sliding Mode Controller. International Journal of Renewable Energy Research (IJRER), 10(1), 243-250.

[18] Bal, G., Kaplan, O., & Yalcin, S. S. (2019, November). Artificial Neural Network Based Automatic Voltage Regulator for a Stand-Alone Synchronous Generator. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 1032-1037). IEEE.

[19] Shobol, A., Ali, M. H., Wadi, M., & TÜR, M. R. (2019, November). Overview of Big Data in Smart Grid. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 1022-1025). IEEE.

[20] Elmouatamid, A., Ouladsine, R., Bakhouya, M., Zine-Dine, K., & Khaidar, M. (2019, October). A Control Strategy Based on Power Forecasting for Micro-Grid Systems. In 2019 IEEE International Smart Cities Conference (ISC2) (pp. 735-740). IEEE.

[21] Nehrir, H., Wang, C., Strunz, K., Aki, H., Ramakumar, R., Bing, J., ... & Salameh, Z. (2012, July). A review of hybrid renewable/alternative energy systems for electric power generation: Configurations, control and applications. In 2012 IEEE Power and Energy Society General Meeting (pp. 1-1). IEEE.

[22] Elmouatamid, A., NaitMalek, Y., Ouladsine, R., Bakhouya, M., Elkamoun, N., Zine-Dine, K., ... & Abid, R. (2018, April). Towards a Demand/Response Control Approach for Micro-grid Systems. In 2018 5th International Conference on Control, Decision and Information Technologies (CoDIT) (pp. 984-988). IEEE.

[23] El Mouatamid, A., Ouladsine, R., Bakhouya, M., Felix, V., Elkamoun, N., Zine-Dine, K., ... & Abid, R. (2017, December). Modeling and performance evaluation of photovoltaic systems. In 2017 International Renewable and Sustainable Energy Conference (IRSEC) (pp. 1-7). IEEE.

[24] Naitmalek, Y., Najib, M., Bakhouya, M., & Essaaidi, M. (2019, April). Forecasting the state-of-charge of batteries in micro-grid systems. In 2019 4th World Conference on Complex Systems (WCCS) (pp. 1-6). IEEE.

[25] Hadri, S., Naitmalek, Y., Najib, M., Bakhouya, M., Fakhri, Y., & Elaroussi, M. (2019). A Comparative Study of Predictive Approaches for Load Forecasting in Smart Buildings. Procedia Computer Science, 160, 173-180.

[26] Li, J., & Danzer, M. A. (2014). Optimal charge control strategies for stationary photovoltaic battery systems. Journal of Power Sources, 258, 365-373.

[27] Zhang, R., Xia, B., Li, B., Cao, L., Lai, Y., Zheng, W., ... & Wang, M. (2018). A study on the open circuit voltage and state of charge characterization of high capacity lithium-ion battery under different temperature. Energies, 11(9), 2408.
[6] Del Real, A. J., Arce, A., & Bordons, C. (2007). Hybrid model predictive control of a two-generator power plant integrating photovoltaic panels and a fuel cell. In 2007 46th IEEE Conference on Decision and Control.

[7] Parisio, A., Rikos, E., Tzamalis, G., & Glielmo, L. (2014). Use of model predictive control for experimental microgrid optimization. Applied Energy, 115, 37-46.

[8] Perez, E., Beltran, H., Aparicio, N., & Rodriguez, P. (2012). Predictive power control for PV plants with energy storage. IEEE Transactions on Sustainable Energy, 4(2), 482-490.

[9] Hosseini, S. J. A. D., Moazzami, M., & Shahinzadeh, H. (2017). Optimal sizing of an isolated hybrid wind/PV/battery system with considering loss of power supply probability. Majlesi Journal of Electrical Engineering, 11(3), 63-69.

[10] Shahinzadeh, H., Moazzami, M., Fathi, S. H., & Gharehpetian, G. B. (2016, December). Optimal sizing and energy management of a grid-connected microgrid using HOMER software. In 2016 Smart Grids Conference (SGC) (pp. 1-6). IEEE.

[11] Hu, K. Y., Li, W. J., Wang, L. D., Cao, S. H., Zhu, F. M., & Shou, Z. X. (2018). Energy management for microgrid system based on model predictive control. Frontiers of Information Technology & Electronic Engineering, 19(11), 1340-1351.

[12] Berouinev, A., Ouladsine, R., Bakhouya, M., Lachhab, F., & Essaaidi, M. (2019, April). A Model Predictive Approach for Ventilation System Control in Energy Efficient Buildings. In 2019 4th World Conference on Complex Systems (WCCS) (pp. 1-6). IEEE.

[13] Amini, M., Seifi, A. R., & Samet, H. (2020). An Efficient Controlled Islanding Technique for Smart Grids. International Journal of Renewable Energy Research (IJRER), 10(1), 24-32.

[14] El Shafei, A., Ozdemir, S., Altin, N., Jean-Pierre, G., & Nasiri, A. (2019, November). A High Power High Frequency Transformer Design for Solid State Transformer Applications. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 904-909). IEEE.

[15] GOUD, B. S., & Rao, B. L. (2020). An Intelligent Technique for Optimal Power Quality Enhancement (OPQE) in a HRES Grid Connected System: ESA Technique. International Journal of Renewable Energy Research (IJRER), 10(1), 317-328.

[16] Hossain, M. S., & Rahman, F. (2020). Hybrid Solar PV/Biomass Powered Energy Efficient Remote Cellular Base Station. International Journal of Renewable Energy Research (IJRER), 10(1), 329-342.

[17] Singh, S., Bagherwal, S., Semwal, S., & Badoni, M. (2020). Design and Development of Standalone Solar

Photovoltaic Battery System with Adaptive Sliding Mode Controller. International Journal of Renewable Energy Research (IJRER), 10(1), 243-250.

[18] Bal, G., Kaplan, O., & Yalcin, S. S. (2019, November). Artificial Neural Network Based Automatic Voltage Regulator for a Stand-Alone Synchronous Generator. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 1032-1037). IEEE.

[19] Shobol, A., Ali, M. H., Wadi, M., & TÜR, M. R. (2019, November). Overview of Big Data in Smart Grid. In 2019 8th International Conference on Renewable Energy Research and Applications (ICRERA) (pp. 1022-1025). IEEE.

[20] Elmouatamid, A., Ouladsine, R., Bakhouya, M., Zine-Dine, K., & Khaidar, M. (2019, October). A Control Strategy Based on Power Forecasting for Micro-Grid Systems. In 2019 IEEE International Smart Cities Conference (ISC2) (pp. 735-740). IEEE.

[21] Nehrir, H., Wang, C., Strunz, K., Aki, H., Ramakumar, R., Bing, J., ... & Salameh, Z. (2012, July). A review of hybrid renewable/alternative energy systems for electric power generation: Configurations, control and applications. In 2012 IEEE Power and Energy Society General Meeting (pp. 1-1). IEEE.

[22] Elmouatamid, A., NaitMalek, Y., Ouladsine, R., Bakhouya, M., Elkamoun, N., Zine-Dine, K., ... & Abid, R. (2018, April). Towards a Demand/Response Control Approach for Micro-grid Systems. In 2018 5th International Conference on Control, Decision and Information Technologies (CoDIT) (pp. 984-988). IEEE.

[23] El Mouatamid, A., Ouladsine, R., Bakhouya, M., Felix, V., Elkamoun, N., Zine-Dine, K., ... & Abid, R. (2017, December). Modeling and performance evaluation of photovoltaic systems. In 2017 International Renewable and Sustainable Energy Conference (IRSEC) (pp. 1-7). IEEE.

[24] Naitmalek, Y., Najib, M., Bakhouya, M., & Essaaidi, M. (2019, April). Forecasting the state-of-charge of batteries in micro-grid systems. In 2019 4th World Conference on Complex Systems (WCCS) (pp. 1-6). IEEE.

[25] Hadri, S., Naitmalek, Y., Najib, M., Bakhouya, M., Fakhri, Y., & Elaroussi, M. (2019). A Comparative Study of Predictive Approaches for Load Forecasting in Smart Buildings. Procedia Computer Science, 160, 173-180.

[26] Li, J., & Danzer, M. A. (2014). Optimal charge control strategies for stationary photovoltaic battery systems. Journal of Power Sources, 258, 365-373.

[27] Zhang, R., Xia, B., Li, B., Cao, L., Lai, Y., Zheng, W., ... & Wang, M. (2018). A study on the open circuit voltage and state of charge characterization of high capacity lithium-ion battery under different temperature. Energies, 11(9), 2408.