- 1ETH Zurich, Zurich, Switzerland
- 2ABB Corporate Research, ABB AG, Ladenburg, Germany
- 3ABB n.v., Zaventem, Belgium
This paper presents a stochastic model predictive control approach combined with a time-series forecasting technique to tackle the problem of microgrid energy management in the face of uncertainty. The data-driven non-parametric chance constraint method is used to formulate chance constraints for stochastic model predictive control, while removing the dependency on probability density assumptions of uncertain variables and retaining the linear structure of the resulting optimization problem. The proposed approach is suitable for implementation on systems with limited computational power or limited memory storage, thanks to its simple linear structure and its ability to provide accurate results within pre-defined confidence levels, even when using small data batches. The proposed forecasting and stochastic model predictive control approaches are applied on a numerical example featuring a small grid-connected microgrid with PV generation, a battery storage system, and a non-controllable load, showing the ability to reduce costs by reducing the confidence level, and to satisfy pre-defined confidence levels.
1 Introduction
Optimal energy management in microgrids with distributed energy generation is a key tool to support the integration of renewable energy sources (RES), maximizing their use to lower greenhouse gas emissions, and to mitigate the uncertainties caused by non-dispatchable loads, RES production dependency on weather conditions, and intra-day energy prices (Parisio et al., 2014). Moreover, the increasing availability of local energy storage devices, like batteries, requires proper management to extract their full potential, and it provides additional degrees of freedom for optimal energy management strategies. The topic of energy management in microgrids has been widely investigated in recent years, both for the single-energy and for multi-energy scenarios (Dörfler et al., 2016; Raimondi Cominesi et al., 2018; Khayat et al., 2020; Ceusters et al., 2021; Wang et al., 2021).
The efficient integration of RES into microgrids is a challenging task due to their intermittent generation profile, high variability, and low predictability. In recent years, a variety of approaches have been proposed to address the energy optimization problem with a tractable formulation while taking into account the presence of uncertainties in the problem of optimal operation of microgrids. Such approaches could be, in principle, divided into two main categories: deterministic robust optimization and stochastic optimization methods. Robust, or worst-case, optimization is a class of approaches where constraint violation is not allowed for any possible realization of uncertainties, usually resulting in computationally demanding algorithms and conservative solutions (Magni et al., 2003; Mayne et al., 2006; Cannon et al., 2009; Limon et al., 2009; Rawlings and Mayne, 2009). On the other hand, stochastic optimization methods have been developed to take advantage of possible prior knowledge about the stochastic characteristics of uncertain variables, such as their probability density function (PDF), by reformulating the energy optimization problem in a probabilistic framework.
Several literature contributions indicate stochastic programming as a promising tool for handling uncertainties in optimization problems (Mirkhani and Saboohi, 2012). Usually, the stochastic optimization approaches proposed in the microgrid and smart grid literature address the problem of minimizing energy costs and/or greenhouse gas emissions, while taking into account uncertainties in RES generation and load forecasts (Anderson et al., 2011; Niknam et al., 2012). Quite often, the resulting stochastic optimization problem is formulated as a mixed-integer nonlinear program, on which decomposition techniques or heuristics are applied (Baziar and Kavousi-Fard, 2013; Cardoso et al., 2013; Zhang et al., 2013; Ji et al., 2014; Mohammadi et al., 2014). One example of taking prior knowledge combined with confidence levels is day-ahead interval optimization considering observed historic forecast residuals (Kaffash et al., 2021). Stochastic model predictive control (SMPC) is often considered a promising approach to introduce the presence of stochastic terms into the energy optimization problem (Patrinos et al., 2011; Hooshmand et al., 2012; Farina et al., 2013; Parisio and Glielmo, 2013; Schildbach et al., 2014; Su et al., 2014; Parisio et al., 2016; Raimondi Cominesi et al., 2018). Here, several approaches rely on Monte Carlo methods to generate a set of possible scenarios that are used to represent the fluctuations of the uncertain variables and optimize over the expected costs with respect to each scenario. Other SMPC formulations proposed in the literature rely on probabilistic constraints on input and state variables formulated using the Chebyshev–Cantelli inequality or are based on point-wise reformulation in deterministic terms (Bernardini and Bemporad, 2012; Zhou and Cogill, 2013; Korda et al., 2014; Farina et al., 2015).
Although randomized and scenario-based SMPC approaches are very promising, they could be computationally demanding for practical implementation (Blackmore et al., 2010; Prandini et al., 2012; Calafiore and Fagiano, 2013). Moreover, a common assumption for various SMPC approaches is the knowledge of a parametric PDF for the uncertain variables of the problem, which is not always satisfied. To address those issues, the data-driven non-parametric chance constraint (DNCC) approach was proposed (Ciftci et al., 2019b; Ciftci et al., 2019a; Wu et al., 2019; Wu et al., 2021; Wu and Kargarian, 2023). The DNCC method uses historical data to determine non-parametric PDFs from data for each random variable at each time instant, instead of relying on axiomatic or model-driven probabilistic approaches, i.e., no assumption on the PDF of the random variables is required. The DNCC approach then adjusts the confidence level of the chance constraints based on the uncertainty of the estimated PDF to ensure satisfaction of the constraints with the pre-defined confidence, in face of uncertainties and PDF estimation errors. The DNCC approach results in an accurate, yet simple-to-implement approach, where the probabilistic constraints are reformulated as linear algebraic constraints, allowing one to formulate microgrid energy optimization problems as linear or quadratic programs that are easier to solve, even on systems with low computational power.
In this paper, we apply the DNCC approach to the microgrid energy management problem within an SMPC framework, in combination with a modification of the forecasting model proposed in previous works (Lauricella et al., 2020; Lauricella and Fagiano, 2023). The approach relies on a linear prediction model and on a fictitious input signal to capture the seasonality of time series. We modified the original DNCC approach to apply it to the residuals of the forecasting models. Additionally, instead of the commonly used point-wise error technique to determine the confidence set size for the estimated PDF, we adopt the data bootstrapping approach of Fiorio (2004). Both the DNCC method and the forecasting model provide good accuracy even when using a small dataset for the training phase (here, we use 3 weeks of historical data: the first two for the training of the forecasting model and the third for the estimation of the PDF and confidence intervals of the DNCC approach). This allows us to obtain a receding-horizon SMPC with a linear structure, which is suitable for practical implementation on systems with low computational power and limited memory storage. Numerical results show that the SMPC is able to reduce costs when reducing chance-constraint confidence levels compared to a nominal MPC. The SMPC is able to satisfy the pre-defined confidence levels of the constraints when directly applied during the day with actual realizations of load and PV power generation.
1.1 Contributions
This article presents a receding-horizon SMPC approach for energy management in a microgrid with local non-dispatchable renewable energy generation, a battery storage system, and an uncertain non-controllable electrical load. We use a modified linear forecasting model based on the fictitious input approach of Lauricella et al. (2020) to predict the future PV energy generation and the electrical load using only 2 weeks of data for model training. Then, we apply the modified DNCC approach of Ciftci et al. (2019a) to the residuals of the prediction models evaluated over 1 week of data. This allows us to obtain an algebraic constraint formulation that satisfies operational constraints in face of uncertainties to a pre-defined confidence level. The obtained algebraic constraints are then used to formulate a stochastic model predictive control for optimal energy management in a deterministic way.
The main contributions of this work can be listed as follows:
• We applied, for the first time, the forecasting method of Lauricella et al. (2020) based on the fictitious input in a receding-horizon fashion to the SMPC framework, showing both its accuracy on small datasets and its advantages for optimal control applications.
• We introduced a regularization term to the forecasting method to avoid overfitting during the training of the prediction model for receding-horizon forecasting.
• We modified the original DNCC approach of Ciftci et al. (2019a) to apply it to the prediction residuals instead of applying it directly to forecasts. This allows for adaptivity of the forecasts to changing weather conditions.
• We replaced the point-wise error technique of the original DNCC approach with the bootstrapping approach of Fiorio (2004) to statistically improve the sizing of the confidence set of the estimated PDF.
• We demonstrate with numerical results that the SMPC is able to satisfy the pre-defined operational constraint confidence levels, how the reduction of robustness by choosing lower confidence levels reduces energy costs, and its applicability on a system with limited computational power.
• We provide an easy-to-follow step-by-step guide for the application of the presented SMPC approach to allow an easy repeatability of the obtained results and, in general, of the DNCC implementation.
1.2 Article structure
This paper is organized as follows. Section 2 presents the motivation and approach outline, and Section 3 describes the model learning procedure for time series forecasting. Section 4 presents our formulation of the data-driven non-parametric chance-constrained approach for energy optimization problems, while Section 5 introduces its practical implementation within the SMPC framework, and Section 6 discusses the numerical results. Finally, Section 7 concludes the paper and provides directions for future work.
2 Motivation and approach
The main motivation for this work lies in the desire to have a lightweight microgrid energy optimization approach that could deliver good performance in face of uncertainties due to unknown load and unpredictable RES power generation using a limited amount of data for training and tuning, and having a rather simple mixed-integer linear program (MILP) at its core. The main target for such an approach is the implementation of systems with limited computational power and reduced memory storage. To achieve this goal, we resort to the linear prediction models with fictitious input of Lauricella et al. (2020) to forecast the microgrid’s load and PV power generation, which demonstrated good forecasting accuracy even when trained on a small amount of data (i.e., 1 or 2 weeks of historical data) (Lauricella and Fagiano, 2023). Moreover, we adopt the DNCC approach of Ciftci et al. (2019b) since it requires no a priori knowledge of the true distribution of uncertain quantities, but it provides a method to estimate it from data. In addition, it provides a methodology to convert the resulting chance constraints into linear algebraic constraints, thus allowing us to formulate a mixed-integer linear optimization problem to solve the receding-horizon energy management task.
A high-level conceptual overview of the approach is given in Algorithm 1. We denote the first day of a week with w. Here, the assumption is that the data of past 3 weeks are available ([w − 3, w]). The models described in Section 3 are trained on the first 2 weeks of the dataset. Then, they are evaluated based on the third week, and the distribution of the residuals is learned with the DNCC method described in Section 4. Next, the SMPC described in Section 5 is used to obtain optimal control decisions for every time step t with a control resolution of 15 min within the current week ([w, w + 1]). At the end of the current week, the dataset is shifted by including the data of the newly observed week and discarding the data of the oldest week. This process is then repeated, resulting in a continuous receding-horizon control of the microgrid.
3 Prediction model learning
To predict the future behavior of the microgrid’s load and the PV power generation, we adopt the forecasting method proposed in Lauricella et al. (2020). It relies on a linear time-invariant auto-regressive model with exogenous input (ARX) and on a synthetic input signal. The method allows good prediction accuracy even when trained on small data batches, as shown in Lauricella and Fagiano (2023). The key contribution here is the modification of the forecasting method, by training it for multi-step prediction in a receding-horizon fashion, to be used for multi-step forecasts newly generated at every control step of the receding-horizon SMPC, instead of a single day-ahead forecast. This includes the addition of the regularization term in Eq. 7.
It is worth noting that different forecasting models and methods can be used to predict the behavior of the uncertain variables, in place of the ARX predictors used here. Depending on the size of the available dataset and on the available computational power, methods like double exponential smoothing, persistence algorithms, predictive clustering models, support vector machines, machine learning, and deep learning approaches could be more suitable and achieve better forecasting accuracy, see, for example, Dutta et al. (2017); Nowotarski and Weron (2018); Hong et al. (2020); Aslam et al. (2021)). However, the use of linear ARX predictors trained, and periodically re-trained, on smaller data batches could improve forecasting accuracy in face of unusual and fast-changing energy prices and weather patterns.
3.1 Model description
We consider a multiple-input single-output ARX prediction model, where we have a linear dependency between future predictions of a signal with its past occurrences and with appropriate input signals. Let us denote with
The vector
The regressor Eq. 2 consists of an auto-regressive part denoted by
Since we use the one-step-ahead predictor Eq. 1 recursively, to obtain a multi-step forecast of the load and PV power generation, Yr is initialized with the most recent ny past measurements for the first prediction step. Then, Yr is filled with past predictions as the model is iterated over time until the end of the prediction horizon. For example, to obtain
The decision on the pre-selected time periods is based on the selected non-overlapping windows for the optimization objective in (7) and should be chosen by cross-validation. The variable p represents the period in hours, and for practical implementation on a computational unit, the time step k needs to be converted to ts(k) having a UNIX timestamp representation in seconds to be correctly inserted in (4). This guarantees that the described model is actually time-invariant.
3.2 Model identification
The prediction model Eq. 1 is trained on historical data by minimizing the simulation error obtained by recursive iteration of the one-step day-ahead predictor given the initial conditions
Note that (5) is a nonlinear optimization problem since, by iterating the prediction model recursively, the resulting cost has a polynomial dependency on θ. Even if N is small, the dimension of the objective in (5) can grow very quickly depending on the prediction horizon K. To avoid long computation times during the model identification, we relax the objective to only contain
Due to the small size of the dataset, we introduce a regularizing term which is added to the objective function to reduce overfitting. The relaxation of (5) together with (6) and the regularization term result in
A larger value of the hyperparameter λ corresponds to a sparser structure of θ, and a smaller value corresponds to more flexibility in the magnitudes of θ. Larger values of λ avoid overfitting, but have a negative influence on training accuracy since they force a simpler model structure. On the other hand, smaller values of λ allow for closer resemblance of the training data, which could reduce model generality. The tuning of λ is a trade-off between good fitting performance and model generality; thus, it is recommended to tune its value via cross-validation. Since the optimization problem has become a ridge regression, we need to normalize our data to have a zero mean and unitary variance; otherwise, the regularization term would not function properly due to the different magnitudes of the signals. Thus,
where
4 Data-driven non-parametric chance constraints
This section presents the theoretical background and the implementation details of the data-driven non-parametric chance-constrained approach of Ciftci et al. (2019a), together with the novel contributions proposed in this work. As remarked in Section 1, this approach uses adaptive kernel density estimators to construct an estimate of the probability density functions of random variables from historical data. The use of kernel density estimators requires no assumptions on the real probability distribution and density functions of the random variables affecting the system at hand. Here, data bootstrapping is used to account for forecasting errors, providing a method to adjust the predefined confidence levels with respect to the estimated density function errors evaluated on bootstrapped data samples. The resulting chance constraints are then formulated as algebraic constraints by evaluating the quantile function derived from the estimated density function.
The data-driven non-parametric chance-constrained approach contains the following steps.
• The estimation of the probability density function of a random variable from historical data, using kernel density estimation, and tuning the kernel function bandwidth using Scott’s rule.
• The computation of the confidence set size of the estimated probability density function using data bootstrapping to evaluate the estimation errors.
• The computation of the reduced risk level adjusted to the size of the estimated density function confidence set.
• The reformulation of the corresponding chance constraints with the reduced risk level.
• The reformulation of the chance constraints as algebraic constraints to be included in the stochastic model predictive control problem using the inverse of the estimated cumulative distribution function based on the adjusted risk level.
Each of these steps is described in the following sub-sections.
4.1 Kernel density estimation (KDE)
Let us denote an uncertain quantity as the random variable X and its distribution function as
Here, we designate 1 − α the confidence level, and α is the risk level. We assume no prior knowledge of the true distribution function
Given a dataset
Here,
By law of large numbers, the estimated PDF
4.2 Data-driven chance constraints
Considering that we can only estimate the true PDF using a finite dataset, we know that our estimation will have errors. Jiang and Guan (2016) propose a quantification of these errors and a method to include them in the chance constraint formulation. Here, the estimated distribution function
In this work, we only consider 1-dimensional random variables; therefore,
To account for the uncertainty in the probability distribution estimation, the classic chance constraint Eq. 9 is reformulated to hold for every distribution within the confidence set:
To reformulate the chance constraint that holds for all
To avoid negative values for the risk level, the final risk level
Now, the chance constraint depends only on our estimated distribution and the confidence set of the estimated distribution. This chance constraint can now be easily reformulated to an algebraic representation by calculating the cumulative distribution function
Evaluating
4.3 Confidence set size d
As the last step of the DNCC approach, we need to determine a confidence set size d to construct the reduced risk level. Ciftci et al. (2019a) proposes using point-wise errors between the estimated density function
The general confidence interval for the estimated density function
Since the variance of the estimation is unknown, the sample variance s2 is used to construct the confidence interval. The values u1−(α/2) and uα/2 are the 1 − (α/2) and α/2 quantiles of the t-statistic defined in (18), respectively.
With the t-statistic, the quantiles are defined as
Let xi* denote the bootstrapped data samples obtained by n times random sampling with replacement of data points from the original dataset
The sample variance of the estimated density function
With the bootstrap estimate
Now, the quantiles can be obtained from the unbiased t-statistic with
Finally, we use the obtained confidence intervals to construct the confidence set size of our distribution function estimate
Here, the subscript denotes the 1 − α quantile of the point-wise squared distances between the upper and the lower confidence bound.
5 Stochastic model predictive control
In this work, we focus on a single-energy microgrid consisting of an electric load (Pl [kW]), a photovoltaic power generation system (Ppv [kW]), a battery that can charge
FIGURE 1. Graphical depiction of the considered microgrid, with arrows indicating the permitted energy flow directions.
We choose receding-horizon model predictive control (MPC) to tackle the problem of optimal energy management in the considered microgrid since it allows to easily account for the operational constraints of the battery storage system, and it can react to disturbances in the load and PV power generation. Moreover, to ensure robust performance to a user-specified risk level, we resort to a stochastic model predictive control (SMPC) formulation based on the data-driven non-parametric chance constraints presented in Section 4.
5.1 Preliminaries
Let t be the time instant for which a control decision has to be made, as described in Algorithm 1. Then, by implementing the receding-horizon SMPC with a fixed prediction horizon of length K, the resulting controller will plan the controllable inputs for all the next time steps k ∈ [t, t + K]. Then, only the first control decision corresponding to the time step k = t is implemented. The entire procedure is then iteratively repeated for all the following time steps within the current week of operation. All power variables are defined to be non-negative:
5.2 Objective
Since the goal is to minimize the total grid energy import cost over the considered prediction horizon K, the objective function for the SMPC can be formulated as
5.3 Battery
The battery storage system here is described by a simple state-space model with one state representing the battery state of charge. It is assumed that the battery model is deterministic, i.e., control decisions regarding charging and discharging power will be executed exactly as mandated by the SMPC. We neglect the battery’s internal dynamics and all the external disturbances acting on the battery storage system. Let Esoc(k) denote the state of charge of the battery at time step k in kWh; ηc and ηd the charging and discharging efficiencies in percent, respectively; and Δt the duration of one time step in hours. Hence, the battery model is described by
The state of charge at the first time step k is initialized with the realized state of charge as available from the previous time step t − 1. To protect the battery and increase its lifespan, we add lower and upper bounds for the state of charge in the optimization problem:
Furthermore, the battery charging and discharging capacities are limited as well, and to ensure that the battery is not charged and discharged at the same time, we introduce the binary decision variables δc and δd. Here, δc(k) = 1 means that the battery will be charged at time step k; therefore, δd(k) has to be 0 for the same time instant. These constraints are formulated as follows:
5.4 Power balance
The MPC controller is required to maintain the balance between the overall power generation and consumption of the microgrid over the prediction horizon K. This operational requirement results in the following equality constraint:
In (29), Pg(k) and Pcur(k) are considered state variables,
Here,
We assume that the prediction for time step k at the same time t will have similar errors over different days, i.e.,
Given this probabilistic definition of the prediction errors, we can now define a chance constraint to satisfy the power balance in (29) for the true load and PV realizations with a pre-defined confidence level. By substituting in (29) the true load and PV generation with their forecast plus residual counterpart from (30), we obtain the following equality constraint that depends on the random variables
To ensure that this equality holds with a certain confidence 1 − α, the following chance constraint can be formulated using an inequality that will be later replaced in the optimization with an equality.
Notably, the time step notation t is omitted. Since
Finally, the chance constraint can be reformulated as an equality algebraic constraint that can be easily included in the MPC optimization problem by using the DNCC method described in Section 4.
This chance constraint ensures that the SMPC will plan the battery operation such that there will be enough power generated or consumed in the system to match the true load and PV generation with a confidence of 1 − α while minimizing the overall energy cost.
5.5 SMPC formulation
By combining the objective function defined in Eq. 25, the battery dynamics and constraints of Eqs. 26-28, the power balance chance constraint Eq. 34 with
6 Results
6.1 Dataset description
The models for load and photovoltaic forecasting are trained on the publicly accessible dataset of a small microgrid by TronderEnergi (2021). This dataset includes measured values for weather, load, PV, and prices. Furthermore, it includes dimensioning hyperparameters for the battery. To evaluate the SMPC, we use historic weather forecast data instead of historic measured data to have a better representation of uncertainties. The historic weather forecast data are extracted from the publicly available data from the Norwegian Meteorological Institute METNorway (2023). Both datasets are sorted, cleaned, and merged together in one large dataset. The data are transformed to a time resolution of 15 min, and every data point is accompanied by a timestamp. A description of the final dataset can be found in Table 1.
6.2 Simulation environment
The main assumption for the simulation is that the power balance equation in (29) must hold for the true load Pl and true PV generation Ppv at all times. Next, as mentioned previously in Section 5.3, the battery system is assumed to be deterministic, i.e., the control decision by the SMPC for time step t, denoted as
6.3 Numerical results
All computations are carried out on a MacBook Pro Late 2013 with a 2 GHz Quad-Core Intel Core i7 and 8 Gb of RAM.
6.3.1 Prediction models
The models for load forecasting and PV generation forecasting are trained with the model described in Section 3. The number of initialization steps/auto-regressive features is chosen to be ny = 3, the number of past exogenous inputs is nu = 1, and the prediction horizon is set to K = 12 h. Through initial cross-validation, the regularization parameter is chosen to be λ = 50. Both models share the same weather features as described in 6.1 and the same fictitious input periods represented in hours, p = [4h, 12h, 1d, 2d, 7d, 14d]. These time steps are chosen such that they fit the periodical behavior of the load and PV while producing stable results in regard to the optimization with non-overlapping windows of length K = 12 h in (7). As a key aspect of the presented work is low data availability, the total dataset size for training and validation is 3 weeks of data with a resolution of 15 min. The models are trained on the first 2 weeks of the dataset and evaluated on the third week.
The evaluation of the load model is shown in Table 2 and the PV model in Table 3. Both evaluations use the Root-Mean-Square-Error (RMSE) as a metric. Additionally, the mean absolute percentage error (MAPE) is shown only for the load model since PV generation can take zero values.
TABLE 2. Numerical results for load model trained and evaluated on different datasets. The calendar week specifies the evaluation week.
TABLE 3. Numerical results for PV model trained and evaluated on different datasets. The calendar week specifies the evaluation week.
The comparison between load predictions and true values for the first day of calendar week 12 is shown in Figure 2. Considering the simplicity of the model and the data availability, the results for calendar weeks 32 and 43 are very good. The figure shows that the model is capable of learning the load behavior even in situations with peaks. It can also be observed that training is very fast considering the time resolution of 15 min. This supports the approach of retraining the model every week with new data to obtain the best possible predictions by capturing short-term trends.
FIGURE 2. Comparison between load model predictions and load measurements for the first day of calendar week 12.
An exemplary plot for the PV model is shown in Figure 3. It shows that the PV model is able to capture the typical PV generation trend during the day very well. All in all, the results show that the model structure is applicable to both load consumption and PV generation learning with good prediction results on small data batches and low computational burden.
FIGURE 3. Comparison between PV model predictions and PV generation measurements for the second day of calendar week 24.
6.3.2 DNCC method
As mentioned in Section 5.4, we want to use the DNCC method to estimate the probability distributions of the errors of the trained models. The underlying assumption is that we can capture the uncertainties in the models and in weather predictions in the evaluation errors of the model. Since we assume the availability of data of 3 weeks and the models are trained on 2 weeks, data of 1 week are left for error evaluation and PDF estimation.
The errors are estimated in the following way: we start with a 3-dimensional array A. The first dimension corresponds to the daily time step td ∈ Td and has, in this case, a size of Td = 4 ⋅ 24 = 96. The second dimension corresponds to the kth predicted time step at time td and has a dimension K = 4 ⋅ 12 = 48. The third dimension corresponds to the recorded error values e (k|td) and grows with the size of the validation dataset. Therefore, A has a non-homogeneous third dimension. Following a receding horizon fashion, for each model prediction at every time step t in the validation dataset, we record the error of the kth predicted time step e (k|t). The time step t is mapped to a daily time step td, and the error value at the kth prediction step is put into A [td, k, :]. Finally, for each td and k, we run the DNCC method on the array of error values A [td, k, :]. This results in Td ⋅ K = 96 ⋅ 48 = 4068 probability distributions with their respective chance-constraint formulation. Note that the DNCC method is applied a priori, i.e., before the beginning of a new week. Therefore, a longer initial computation is not a problem. In total, the estimation of 4,068 probability distributions and their corresponding cumulative distributions through integration took 5:20 min. The estimation process is summarized in Algorithm 2.
For illustration of the estimated probability distribution and the confidence intervals, we run the DNCC method with a risk level of α = 0.1 (confidence p = 0.9). Figure 4 shows an exemplary estimated PDF with confidence intervals corresponding to the specified confidence. In this case, the risk level α = 0.1 was reduced by the algorithm to
FIGURE 4. DNCC example of estimated PDF with confidence intervals corresponding to a confidence p =0.9.
Evaluating the DNCCs for every time step of the predictions in Figure 2 yields the exemplary prediction correction displayed in Figure 5.
6.3.3 SMPC
The presented SMPC formulation in Section 5 is used to perform battery set-point control for every control time step on a test dataset with the size of 1 week such that both the models and the DNCCs have not been trained/evaluated on. A high-level overview of the process is described in Algorithm 1 and Section 2. Assuming we are at the first day of the current week denoted by w, the assumption here is that the prior 3-week data are available [w − 3, w]. First, we train the load and PV models on the first 2 weeks of the dataset, the so-called training data [w − 3, w − 1]. Then, we learn the distribution of the model errors on the last week of the dataset, the so-called validation data [w − 1, w]. Finally, the SMPC is run and evaluated on the current week [w, w + 1], the so-called test data. This ensures the most realistic evaluation of the method. The SMPC computes the battery control set-points at each time step t within the current week by planning K = 12h ahead and applying the first control decision at time t. Note that w is updated by Δw = 1week, while t is updated by Δt = 15 min.
We compare the performance of a nominal MPC with that of the SMPC method on five different and randomly chosen calendar weeks representing different times of the year. For each of those weeks, we evaluate the SMPC method for multiple risk levels α ∈ [0.01, 0.05, 0.1, 0.2, 0.3]. The evaluated metrics are the average step computation time, which measures how long the optimization in Eq. 35 takes to solve, the satisfaction of the true realized load
The first result to highlight is the same average computation time of both nominal MPC and SMPC. This is due to the property of computing and evaluating the DNCCs a priori and only inserting the resulting values in the MILP, as described in Eq. 35. Next, we observe that the SMPC with risk level α = 0.3 has the lowest realized average grid energy cost compared to all other methods. The results show that decreasing the confidence level improves the grid energy costs. On the other hand, decreasing the risk level and, therefore, increasing the confidence results in higher costs, yielding a tradeoff between robustness and cost. Although the most robust method has the highest cost between the SMPCs, a very good result is that the average cost of the most robust SMPC is very close to the average cost of the nominal MPC. Additionally, taking into account the load and PV satisfactions, the most robust SMPC delivers a higher satisfaction and, therefore, more guarantees at the same average cost. The last result to point out is that the SMPC is able to satisfy the pre-defined confidence in many cases (marked percentages). In particular, for the risk levels α = 0.2 and α = 0.3, the SMPC satisfies the risk levels and, therefore, the confidences on average. This shows the possibility of maintaining pre-defined confidence levels with the presented method. The mismatch between confidence level and load and PV satisfactions for high confidence levels (lower risk levels) can be explained by the limited data availability, which means that the true error distribution might contain larger errors that we did not observe in the validation data.
To have a greater insight into the SMPCs’ behavior compared to the nominal MPC, we compare the battery state-of-charge (SoC) between the nominal MPC and the SMPC with different risk levels on calendar week 13. The comparison is shown in Figure 6. It shows that with increasing risk level α, the SMPC tends to charge the battery more so that it has more energy to discharge. This can be confirmed with the higher SoC peaks compared to the nominal MPC and with the full battery discharging up until the SoC constraint for both nominal MPC and all SMPCs.
FIGURE 6. Comparison of battery state of charge between SMPCs with various risk levels and the nominal MPC.
7 Conclusion
We presented a stochastic model predictive control approach to address the energy management problem in microgrids based on data-driven non-parametric chance constraints and on linear prediction models with fictitious input signals to forecast uncertain quantities like electric energy load and renewable power generation. The proposed framework allows the formulation of the resulting stochastic model predictive control as a rather simple mixed-integer linear program using appropriate algebraic constraints, making it feasible for implementation in systems with limited computational power. Moreover, numerical results demonstrated the performance of the approach even when only a limited amount of historical data is available for the training and tuning phase of the algorithm. The presented approach is able to reduce costs when reducing robustness through chance constraints, deliver robustness at the same average cost compared to a nominal MPC, and to satisfy constraints up to the pre-defined confidence.
Data availability statement
The original contributions presented in the study are included in the article/Supplementary Material; further inquiries can be directed to the corresponding author.
Author contributions
LB contributed to the problem formulation, the algorithm design, the dataset collection, the numerical simulations and results analysis, and to the preparation of the first draft of the manuscript. ML contributed to the conception and design of the approach, the problem formulation, the literature review and introduction section, and the reading and revision of the manuscript. GC and MB contributed to the conception, the evaluation, and the improvement of the approach, and to the revision of the manuscript. All authors contributed to the article and approved the submitted version.
Funding
This work has been supported in part by the Flemish Agency for Innovation and Entrepreneurship (VLAIO) grant HBC. 2019.2613 and grant HBC. 2018.0529. The authors declare that the funder had no involvement in the study.
Conflict of interest
Authors ML and MB were employed, and author LB was partially employed by ABB AG. Author GC was employed by ABB n.v. The author ML declared that they were an editorial board member of Frontiers, at the time of submission. This had no impact on the peer review process and the final decision.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors, and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
Anderson, R. N., Boulanger, A., Powell, W. B., and Scott, W. (2011). Adaptive stochastic control for the smart grid. Proc. IEEE 99, 1098–1115. doi:10.1109/JPROC.2011.2109671
Aslam, S., Herodotou, H., Mohsin, S. M., Javaid, N., Ashraf, N., and Aslam, S. (2021). A survey on deep learning methods for power load and renewable energy forecasting in smart microgrids. Renew. Sustain. Energy Rev. 144, 110992. doi:10.1016/j.rser.2021.110992
Baziar, A., and Kavousi-Fard, A. (2013). Considering uncertainty in the optimal energy management of renewable micro-grids including storage devices. Renew. Energy 59, 158–166. doi:10.1016/j.renene.2013.03.026
Bernardini, D., and Bemporad, A. (2012). Stabilizing model predictive control of stochastic constrained linear systems. IEEE Trans. Automatic Control 57, 1468–1480. doi:10.1109/TAC.2011.2176429
Blackmore, L., Ono, M., Bektassov, A., and Williams, B. C. (2010). A probabilistic particle-control approximation of chance-constrained stochastic predictive control. IEEE Trans. Robotics 26, 502–517. doi:10.1109/TRO.2010.2044948
Calafiore, G. C., and Fagiano, L. (2013). Robust model predictive control via scenario optimization. IEEE Trans. Automatic Control 58, 219–224. doi:10.1109/TAC.2012.2203054
Cannon, M., Kouvaritakis, B., and Ng, D. (2009). Probabilistic tubes in linear stochastic model predictive control. Syst. Control Lett. 58, 747–753. doi:10.1016/j.sysconle.2009.08.004
Cardoso, G., Stadler, M., Siddiqui, A., Marnay, C., DeForest, N., Barbosa-Póvoa, A., et al. (2013). Microgrid reliability modeling and battery scheduling using stochastic linear programming. Electr. Power Syst. Res. 103, 61–69. doi:10.1016/j.epsr.2013.05.005
Ceusters, G., Rodríguez, R. C., García, A. B., Franke, R., Deconinck, G., Helsen, L., et al. (2021). Model-predictive control and reinforcement learning in multi-energy system case studies. Appl. Energy 303, 117634. doi:10.1016/j.apenergy.2021.117634
Ciftci, O., Mehrtash, M., and Kargarian, A. (2019a). Data-driven nonparametric chance-constrained optimization for microgrid energy management. IEEE Trans. Industrial Inf. 16, 2447–2457. doi:10.1109/tii.2019.2932078
Ciftci, O., Mehrtash, M., Safdarian, F., and Kargarian, A. (2019b). “Chance-constrained microgrid energy management with flexibility constraints provided by battery storage,” in 2019 IEEE Texas Power and Energy Conference (TPEC), College Station, TX, USA, 07-08 February 2019 (IEEE). doi:10.1109/TPEC.2019.8662200
Dörfler, F., Simpson-Porco, J. W., and Bullo, F. (2016). Breaking the hierarchy: distributed control and economic optimality in microgrids. IEEE Trans. Control Netw. Syst. 3, 241–253. doi:10.1109/TCNS.2015.2459391
Dutta, S., Li, Y., Venkataraman, A., Costa, L. M., Jiang, T., Plana, R., et al. (2017). Load and renewable energy forecasting for a microgrid using persistence technique. Energy Procedia 143, 617–622. doi:10.1016/j.egypro.2017.12.736
Farina, M., Giulioni, L., Magni, L., and Scattolini, R. (2013). “A probabilistic approach to model predictive control,” in 52nd IEEE conference on decision and control, Firenze, Italy, 10-13 December 2013 (IEEE), 7734–7739.
Farina, M., Giulioni, L., Magni, L., and Scattolini, R. (2015). An approach to output-feedback mpc of stochastic linear discrete-time systems. Automatica 55, 140–149. doi:10.1016/j.automatica.2015.02.039
Fiorio, C. V. (2004). Confidence intervals for kernel density estimation. Stata J. 4, 168–179. doi:10.1177/1536867x0400400207
Hong, T., Pinson, P., Wang, Y., Weron, R., Yang, D., and Zareipour, H. (2020). Energy forecasting: A review and outlook. IEEE Open Access J. Power Energy 7, 376–388. doi:10.1109/oajpe.2020.3029979
Hooshmand, A., Poursaeidi, M. H., Mohammadpour, J., Malki, H. A., and Grigoriads, K. (2012). “Stochastic model predictive control method for microgrid management,” in 2012 IEEE PES Innovative Smart Grid Technologies (ISGT), Washington, DC, USA, 16-20 January 2012 (IEEE), 1–7.
Ji, L., Niu, D., and Huang, G. (2014). An inexact two-stage stochastic robust programming for residential micro-grid management-based on random demand. Energy 67, 186–199. doi:10.1016/j.energy.2014.01.099
Jiang, R., and Guan, Y. (2016). Data-driven chance constrained stochastic program. Math. Program. 158, 291–327. doi:10.1007/s10107-015-0929-7
Kaffash, M., Ceusters, G., and Deconinck, G. (2021). Interval optimization to schedule a multi-energy system with data-driven pv uncertainty representation. Energies 14, 2739. doi:10.3390/en14102739
Khayat, Y., Shafiee, Q., Heydari, R., Naderi, M., Dragičević, T., Simpson-Porco, J. W., et al. (2020). On the secondary control architectures of ac microgrids: an overview. IEEE Trans. Power Electron. 35, 6482–6500. doi:10.1109/TPEL.2019.2951694
Korda, M., Gondhalekar, R., Oldewurtel, F., and Jones, C. N. (2014). Stochastic mpc framework for controlling the average constraint violation. IEEE Trans. Automatic Control 59, 1706–1721. doi:10.1109/TAC.2014.2310066
Lauricella, M., Cai, Z., and Fagiano, L. (2020). Day-ahead building load forecasting with a small dataset. IFAC-PapersOnLine 42, 13076–13081. doi:10.1016/j.ifacol.2020.12.2257
Lauricella, M., and Fagiano, L. (2023). Day-ahead and intra-day building load forecast with uncertainty bounds using small data batches. IEEE Trans. Control Syst. Technol. 1, 1–12. doi:10.1109/TCST.2023.3274955
Limon, D., Alamo, T., Raimondo, D. M., de la Peña, D. M., Bravo, J. M., Ferramosca, A., et al. (2009). “Input-to-state stability: A unifying framework for robust model predictive control,” in Nonlinear model predictive control: Towards new challenging applications (Berlin, Heidelberg: Springer Berlin Heidelberg), 1–26.
Magni, L., De Nicolao, G., Scattolini, R., and Allgöwer, F. (2003). Robust model predictive control for nonlinear discrete-time systems. Int. J. Robust Nonlinear Control 13, 229–246. doi:10.1002/rnc.815
Mayne, D., Raković, S., Findeisen, R., and Allgöwer, F. (2006). Robust output feedback model predictive control of constrained linear systems. Automatica 42, 1217–1222. doi:10.1016/j.automatica.2006.03.005
METNorway (2023). THREDDS historical weather data. Avaliable At: https://thredds.met.no.
Mirkhani, S., and Saboohi, Y. (2012). Stochastic modeling of the energy supply system with uncertain fuel price – A case of emerging technologies for distributed power generation. Appl. Energy 93, 668–674. doi:10.1016/j.apenergy.2011.12.099
Mohammadi, S., Soleymani, S., and Mozafari, B. (2014). Scenario-based stochastic operation management of microgrid including wind, photovoltaic, micro-turbine, fuel cell and energy storage devices. Int. J. Electr. Power & Energy Syst. 54, 525–535. doi:10.1016/j.ijepes.2013.08.004
Niknam, T., Azizipanah-Abarghooee, R., and Narimani, M. R. (2012). An efficient scenario-based stochastic programming framework for multi-objective optimal micro-grid operation. Appl. Energy 99, 455–470. doi:10.1016/j.apenergy.2012.04.017
Nowotarski, J., and Weron, R. (2018). Recent advances in electricity price forecasting: A review of probabilistic forecasting. Renew. Sustain. Energy Rev. 81, 1548–1568. doi:10.1016/j.rser.2017.05.234
Parisio, A., and Glielmo, L. (2013). “Stochastic model predictive control for economic/environmental operation management of microgrids,” in 2013 European Control Conference (ECC), Zurich, Switzerland, 17-19 July 2013 (IEEE), 2014–2019. doi:10.23919/ECC.2013.6669807
Parisio, A., Rikos, E., and Glielmo, L. (2014). A model predictive control approach to microgrid operation optimization. IEEE Trans. Control Syst. Technol. 22, 1813–1827. doi:10.1109/tcst.2013.2295737
Parisio, A., Rikos, E., and Glielmo, L. (2016). Stochastic model predictive control for economic/environmental operation management of microgrids: an experimental case study. J. Process Control 43, 24–37. doi:10.1016/j.jprocont.2016.04.008
Patrinos, P., Trimboli, S., and Bemporad, A. (2011). “Stochastic mpc for real-time market-based optimal power dispatch,” in 2011 50th IEEE Conference on Decision and Control and European Control Conference, Orlando, FL, USA, 12-15 December 2011 (IEEE), 7111–7116. doi:10.1109/CDC.2011.6160798
Prandini, M., Garatti, S., and Lygeros, J. (2012). “A randomized approach to stochastic model predictive control,” in 2012 IEEE 51st IEEE Conference on Decision and Control (CDC), Maui, HI, USA, 10-13 December 2012 (IEEE), 7315–7320. doi:10.1109/CDC.2012.6426462
Raimondi Cominesi, S., Farina, M., Giulioni, L., Picasso, B., and Scattolini, R. (2018). A two-layer stochastic model predictive control scheme for microgrids. IEEE Trans. Control Syst. Technol. 26, 1–13. doi:10.1109/TCST.2017.2657606
Rawlings, J. B., and Mayne, D. Q. (2009). Model predictive control: Theory and design. USA: Nob Hill Publishing.
Schildbach, G., Fagiano, L., Frei, C., and Morari, M. (2014). The scenario approach for stochastic model predictive control with bounds on closed-loop constraint violations. Automatica 50, 3009–3018. doi:10.1016/j.automatica.2014.10.035
Su, W., Wang, J., and Roh, J. (2014). Stochastic energy scheduling in microgrids with intermittent renewable energy resources. IEEE Trans. Smart Grid 5, 1876–1883. doi:10.1109/TSG.2013.2280645
TronderEnergi (2021). NTNU brain AI Hackathon 2021. Avaliable At: https://github.com/TronderEnergi/tronderenergi-ai-hackathon-2021.
Tsybakov, A. B. (2009). Introduction to nonparametric estimation. New York: Springer. doi:10.1007/b13794
Wang, J., Wang, C., Liang, Y., Bi, T., Shafie-khah, M., and Catalao, J. P. (2021). Data-driven chance-constrained optimal gas-power flow calculation: A bayesian nonparametric approach. IEEE Trans. Power Syst. 36, 4683–4698. doi:10.1109/tpwrs.2021.3065465
Wu, C., and Kargarian, A. (2023). Computationally efficient data-driven joint chance constraints for power systems scheduling. IEEE Trans. Power Syst. 38, 2858–2867. doi:10.1109/TPWRS.2022.3195127
Wu, C., Kargarian, A., and Jeon, H. W. (2021). Data-driven nonparametric joint chance constraints for economic dispatch with renewable generation. IEEE Trans. Industry Appl. 57, 6537–6546. doi:10.1109/tia.2021.3105364
Wu, C., Mohammadi, A., Mehrtash, M., and Kargarian, A. (2019). “Non-parametric joint chance constraints for economic dispatch problem with solar generation,” in 2019 IEEE Texas Power and Energy Conference (TPEC), College Station, TX, USA, 07-08 February 2019 (IEEE). doi:10.1109/TPEC.2019.8662145
Zhang, Y., Gatsis, N., and Giannakis, G. B. (2013). Robust energy management for microgrids with high-penetration renewables. IEEE Trans. Sustain. Energy 4, 944–953. doi:10.1109/TSTE.2013.2255135
Keywords: microgrid energy management, model predictive control, data-driven chance constraints, energy optimization, stochastic optimization
Citation: Babić L, Lauricella M, Ceusters G and Biskoping M (2023) Data-driven non-parametric chance-constrained model predictive control for microgrids energy management using small data batches. Front. Control. Eng. 4:1237759. doi: 10.3389/fcteg.2023.1237759
Received: 09 June 2023; Accepted: 13 July 2023;
Published: 17 August 2023.
Edited by:
Agostino Marcello Mangini, Politecnico di Bari, ItalyReviewed by:
Gaetano Volpe, Politecnico di Bari, ItalyManuel Berenguel, University of Almeria, Spain
Ruotian Liu, Politecnico di Bari, Italy
Copyright © 2023 Babić, Lauricella, Ceusters and Biskoping. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Marco Lauricella, bWFyY28ubGF1cmljZWxsYUBkZS5hYmIuY29t