Costs Estimation in Unit Commitment Problems using Simulation-Based Inference
Matthias Pirlet Adrien Bolland Gilles Louppe Damien Ernst



Simplified EPFL GaN HEMT Model

This project is funded by the Swiss National Science Foundation - project 200021 213116.

    Farzan Jazaeri, Majid Shalchian, Ashkhen Yesayan, Amin Rassekh, Anurag Mangla, 
 Bertrand Parvais, and Jean-Michel Sallese
Farzan Jazaeri, Ashkhen Yesayan, and Jean-Michel Sallese are with the Electron Device Modeling and Technology Laboratory (EDLAB) of the École Polytechnique Fédérale de Lausanne (EPFL), Switzerland (e-mail:farzan.jazaeri@epfl.ch).Majid Shalchian is with the department of Electrical Engineering, Amirkabir University of Technology. Amin Rassekh is with InCize, Louvain-la-Neuve, Belgium. Anurag Mangla is an alumnus of EPFL. 
Bertrand Parvais is affiliated with IMEC in Leuven and holds a position as a Guest Professor at Vrije Universiteit Brussels, Belgium.

    September 9, 2024
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================




§ ABSTRACT 
The Unit Commitment (UC) problem is a key optimization task in power systems to forecast the generation schedules of power units over a finite time period by minimizing costs while meeting demand and technical constraints. However, many parameters required by the UC problem are unknown, such as the costs. In this work, we estimate these unknown costs using simulation-based inference on an illustrative UC problem, which provides an approximated posterior distribution of the parameters given observed generation schedules and demands. Our results highlight that the learned posterior distribution effectively captures the underlying distribution of the data, providing a range of possible values for the unknown parameters given a past observation. This posterior allows for the estimation of past costs using observed past generation schedules, enabling operators to better forecast future costs and make more robust generation scheduling forecasts. We present avenues for future research to address overconfidence in posterior estimation, enhance the scalability of the methodology and apply it to more complex UC problems modeling the network constraints and renewable energy sources.




§ INTRODUCTION



Forecasting the generation schedule of power generating units whose energy is sold on the electricity market is key for actors like electricity traders and transmission system operators. Accurate forecasts ensure the efficient and secure power system operation, but market liberalization complicates forecasting due to the unknown behavior of multiple market participants. An approach to forecast the generation schedule is to model the scheduling of generation units of all agents through a centralized total-cost minimization problem. Economic theory supports this strategy, suggesting that well-designed competitive markets yield efficient outcomes, similar to those achieved by centralized decision-making <cit.>. However, the size of these models, with numerous variables and parameters, makes it difficult to solve, leading to the use of reduced models where multiple power plants are aggregated into fewer representative units. The reduced optimization problem is called the Unit Commitment (UC) problem. This UC problem provides a generation schedule over a fixed time interval as a function of extrinsic parameters including technical constraints of the units, energy demand, costs related to fuel, start-up and transmission. However, costs parameters are often unknown and are addressed in the optimization process either by expert knowledge or by robust or stochastic optimization techniques that handle the uncertainty <cit.>. In practice, the generation schedule is made public everyday, allowing the inference of the unknown parameters of the UC model through a probabilistic inverse problem. By estimating a distribution over these parameters, operators can perform better informed forecast of the costs in the short term, leading to more accurate forecasts of generation schedules.

In this paper, we present an illustrative UC problem and apply simulation-based inference (SBI) <cit.> to estimate unknown cost parameters. SBI, widely applied in fields such as particle physics <cit.>, climate science <cit.> and robotics <cit.>, estimates the posterior distribution of model parameters based on observations, capturing inherent uncertainty in these parameters. The simulator, i.e. the UC model, is complex and computationally expensive, making traditional methods like Markov Chain Monte Carlo (MCMC) impossible to use for inference. We propose to use Neural Posterior Estimation (NPE) <cit.> which is an amortized method, meaning that the inference model is trained on a dataset of simulations and then can be used to make inference on new observations without having to retrain the model. In contrast, MCMC would require running the full simulation iteratively for each new observation, making NPE a significantly faster and more scalable solution.



§ PROBLEM FORMULATION



The UC problem determines the generation schedules of power units over a finite time period while meeting demand scenarios and adhering to various technical constraints. These constraints include generation limits, ramping rates, and start-up/shutdown durations, all dictated by the physical characteristics of each unit. Although some of these parameters are well-known to all market participants, key parameters, such as the costs of producing one unit of energy driven by trading strategies for purchasing the fuel to produce it, still remain unknown. This work focuses on estimating these unknown costs parameters from recent historical data, which are critical for improving the accuracy of UC models and enhancing generation scheduling predictions. 

Formally, the solution of the UC problem can be written as G_t = f(ψ_t, θ_t, δ_t), where f defines the UC optimization problem solved over T time steps that will be used to construct the inverse probabilistic model. The vector ψ includes known physical characteristics of generation units, such as generation limits, start-up costs, and ramping rates, G represents the generation schedule for each unit at each time step, and δ denotes the demand. Finally, θ represents unknown parameters, like fuel costs, that we want to estimate to better forecast them in the short term future to improve generation scheduling. All these parameters are defined for each time step t of the horizon of T time steps

In electricity markets, market operators publicly release historical data shortly after operations, including estimated demands δ's which are the forecasted demand values used during the scheduling process. These estimates inform real-time operational decisions and are influenced by various predictive models. Realized generation schedules, G_i which are the actual generation outputs corresponding to the estimated demand, reflect the solutions derived from the UC problem at the time. These publicly available historical data {(δ_i,G_i)}_i=1^N are used to construct empirical prior joint distribution for the demand, p(δ) capturing typical demand profiles and their variability over time. The unknown θ parameters are never observed but are known to be in a certain range, a prior p(θ) can be constructed as a uniform distribution over this range.

The primary objective of this work is to estimate the posterior distribution of the unknown cost parameters θ given the available historical data p(θ| G, δ), as stated in [introduction]Section 1, to better forecast costs parameters that will allow for better informed generation scheduling knowing the uncertainty in the parameters.






§ SBI FOR UC PARAMETERS ESTIMATION



Bayes' rule can be used to write down the posterior distribution p(θ | G, δ). This requires knowing the likelihood p(G|θ, δ), the prior distributions p(θ) and p(δ) assuming θ and δ marginally independent, and the evidence p(G). SBI is used to estimate a neural surrogate of the posterior distribution using simulated observations. Specifically, we use NPE for that purpose, which maximizes the expected log-posterior density 𝔼_p(G,θ, δ)[log q_ϕ(θ | G, δ)]

where q_ϕ(θ|G, δ) is a neural density estimator, such as a normalizing flow, with parameters ϕ. The expectation 𝔼_p(G,θ, δ) of the joint distribution can be estimated by first sampling from the prior costs p(θ) and the prior demand p(δ) and then feeding these samples into the forward model. In practice, this model corresponds to the UC problem defined in [formulation]Section 2 for the fixed parameter ψ.







§ EXPERIMENTS



The practical implementation focuses on an illustrative UC problem, with J = 9 generation units, where all generation costs θ∈ℝ^J are assumed unknown and must be estimated. This problem spans T=24 hourly timesteps, representing a single day (see [sec:math_formulation]Appendix C for its mathematical formulation). Demand-side management (DSM) is integrated as the 10^th unit, designed to adapt electricity demand by encouraging consumers to shift usage during periods of excess or insufficient supply. This DSM unit offers high flexibility, allowing it to start or stop instantly, with ramping rates that can reach its maximum capacity at any given time. However, this flexibility incurs higher generation and start-up costs. 

The parameters ψ include stat-up costs, maximum rates for increasing and decreasing production, minimum and maximum power at which we can start and stop the unit, minimum time a unit must remain active or inactive after being turned on or off, and upper/lower generation limits. As said in [formulation]Section 2, these parameters are known and static over the time horizon considered. The parameters θ are the generating costs of the 9 units. Given the day-long horizon, these costs are assumed static but unknown, with a prior distribution p(θ) modeled as uniform. 

In this scenario, the prior distribution of the demand parameter δ is synthetically constructed to mimic realistic fluctuations in electricity consumption, following a sinusoidal pattern. The base demand is modulated to create peaks and troughs in the demand profile, to reflect the typical diurnal variations observed in real-world electricity consumption patterns. To introduce variability and simulate real-world uncertainties, Gaussian noise with zero-mean and standard deviation of 10% of the peak demand is added to the demand signal. 


Training and validation sets are generated with 2^16 simulations each, using the joint distribution p(G, θ, δ) = p(θ) p(δ)  p(G| θ, δ) to produce parameter-observation pairs (θ, (δ,G)). With these pairs, we apply NPE, as described in [SBI]Section 3, and compare the performance of two types of flows, namely, Masked Autoregressive Flow (MAF) <cit.> and Neural Spline Flow (NSF) <cit.>, for posterior estimation q_ϕ(θ|G, δ). Both models are composed of 3 transformations, each parametrized by a masked Multi-Layer Perceptron (MLP) with 3 hidden layers of size 256 and ReLU activation functions. The NPE method is trained using the Adam optimizer <cit.> with a batch size of 256 and a learning rate of 0.001 over 100 epochs. The best model is selected on the validation loss, with the learning curve shown in Appendix in Figure <ref>.





To assess the resulting posterior distribution, we first sample parameters θ^* and demand δ^* from their priors p(θ) and p(δ), generating a corresponding generation schedule G^*. Using Monte-Carlo sampling, we estimate the density of q_ϕ(θ| G^*, δ^*) and visualize the results through corner plots (Figure <ref>). These plots show the marginal and joint distributions of the sampled parameters, with the true parameter values θ^* overlaid on top. 

Next, we assess the consistency of the NPE posterior by calculating the expected coverage probability across various credible levels. In essence, we determine the probability that the true parameters sampled from p(θ, G, δ) lies within the smallest region of probability 1-α of the learned posterior q_ϕ(θ|G_i, δ_i). 

Formally, we compute the coverage probability  𝔼_p(θ, G, δ)[ 1{θ_i ∈Θ_q_ϕ(θ|G_i, δ_i) (1-α) }] where, Θ_q_ϕ(θ|G_i, δ_i) is the highest posterior density region of the posterior distribution <cit.>, defined as:


    Θ_q_ϕ(θ|G_i, δ_i)(1-α) =argmin_Ω{Ω | 𝔼 [ 1{θ∈Ω}] = 1-α}



To compute this expected coverage probability, we repeatedly sample from the joint distribution p(θ, δ, G) to obtain pairs (θ_i, (G_i, δ_i)). We then sample θ from the learned posterior distribution q_ϕ(θ| G, δ) for each simulated observation (G_i, δ_i) and determine the 1-α highest posterior density region. Well-calibrated posteriors should have an expected coverage probability close to the credibility level 1-α. If the expected coverage probability falls below 1-α, it suggests overconfident posteriors. If above, it indicates conservative posteriors. This comprehensive evaluation aids in assessing the reliability of the approximate posterior distributions. In our case, the coverage curve (Figure <ref>) is computed using the two trained flows and a test set of 2^12 pairs, and shows slight overconfidence. While it is important for the posterior distribution to accurately center around the true parameter values, a slight overconfidence in the distribution's width might not pose a significant issue in our context.

Additional assessment of the results is provided in [sec:add_ass]Appendix B, which further confirms the accuracy of the learned flow in capturing the true posterior distribution. Specifically, the assessment reveals that the posterior distribution is well-centered, as evidenced by the fact that only a few parameters sampled from this learned posterior distribution q_ϕ(θ| G, δ) generate a generation schedule that deviates significantly from the true one G^*.
 



§ CONCLUSION 



In this work, we tackled the UC subproblem of estimating unknown parameters using SBI, which provides an approximation of the posterior probability distribution p(θ| G, δ). This approach allows for quick inference while capturing parameter uncertainty. This posterior distribution provides a range of possible values for the unknown parameters rather than just a single estimate, enabling operators to account for uncertainties in their decision-making process.

Future research should address the overconfidence in posterior estimation, as discussed in Section <ref>. Possible solutions include ensembles methods which average predictions from multiple models to improve reliability <cit.>, and introducing regularization terms either to the loss function to encourage more balanced and conservative model <cit.> or to directly penalize overconfident coverage <cit.>. 


To increase the granularity of UC problems, resulting in hundreds of parameters, future work should focus on enhancing the function approximator, as current NPE methods are limited to handling tens of parameters. For instance, <cit.> introduces flow matching techniques to improve the scalability and computational efficiency of SBI. Additionally, active learning strategies are useful for dealing with high-dimensional parameter spaces and costly sampling processes. A method for selecting the most informative data points to optimize the calibration process has also been proposed <cit.>, focusing computational resources on areas with the greatest uncertainty to enhance the efficiency and accuracy of simulation-based inference in large-scale systems.

Finally, the next step is to apply these approaches over longer time horizons, such as two years, and incorporate renewable energy sources, which introduce additional uncertainty into the UC problem. This broader application will test the robustness and scalability of the methodology in reality.





§ ACKNOWLEDGMENTS


The authors would like to thank Engie, especially Alexandre Huynen for sharing expert knowledge about the problem. They also express gratitude to Arnaud Delaunoy for his valuable comments on this manuscript and to François Rozet for his help during the experimental setup. Adrien Bolland acknowledges the financial support from a research fellowship by the F.R.S.-FNRS.

plainnat







§ APPENDIX / SUPPLEMENTAL MATERIAL


 



§ ADDITIONAL ASSESSMENTS



To further assess the results from section [instance]4, we aim to conduct a quantitative analysis of the posterior predictive distribution p(G|G^*) which is the distribution of the generation schedules produced by sampling parameters from q_ϕ(θ| G^*, δ). The receipt to do that is  by sampling 2^12 parameters from the posterior q_ϕ(θ| G^*, δ) given the observed generation schedule G^*. This observed generation schedule is produced by sampling a parameter θ^* and a demand δ^* from their respective prior distributions p(θ) and p(δ), and generate, using the model, a generation schedule G^*. Then, when θ's are sampled from the posterior, they are passed one by one through the UC problem  f(ψ, θ,δ), where f is defined in[formulation]Section 2. Figure [Sanity_check_all]4 show the posterior predictive distributions p(G|G^*) for various quartiles [explain what it is] against the true generation output G^*. On the one hand, we see that for the power plants that need to be active, the 68.7% quantile is well constrained around the true generation schedule. On the other hand, when the plant should not start, the spread is wider for the 95.5% and 99.7% quartiles, resulting in a slight displacement of the median compared to the true observed generation schedule. In conclusion, the parameter distribution learned from NPE produces results that are consistent with the observed generation schedule. 




§ MATHEMATICAL FORMULATION







    min_Ξ     ∑_t ∈ T∑_j ∈ J( c_j(g_j(t)) + c_j^U y_j(t) )
    s.t.     ∑_j ∈ J g_j(t) = D(t),       ∀ t ∈ T
       ∑_j ∈ Jg_j(t) ≥ D(t) + R(t),       ∀ t ∈ T
        c_j(g_j(t)) ≥α_js g_j(t) + β_js,    s=1,...C_j,       ∀ j ∈ J
        v_j(t-1) - v_j(t) + y_j(t) - z_j(t) = 0,       ∀ j ∈ J, ∀ t ∈ T
        g_j(t) - g_j(t-1) ≤ R_j^U v_j(t-1) + S_j^U y_j(t)       ∀ j ∈ J, ∀ t ∈ T
        g_j(t-1) - g_j(t) ≤ R_j^D v_j(t) + S_j^D z_j(t)       ∀ j ∈ J, ∀ t ∈ T
       ∑_k=t-T_j^U+1, k ≥ 1^t y_j(k) ≤ v_j(t), ∀ t ∈ [ L_j +1 , ..., |T|],       ∀ j ∈ J 
        v_j(t) + ∑_k=t-T_j^D+1, k ≥ 1^t z_j(k) ≤ 1, ∀ t ∈ [ F_j +1 , ..., |T|],       ∀ j ∈ J 
       G_j v_j(t) ≤ g_j(t) ≤g_j(t) ≤G_j(t) v_j(t),       ∀ j ∈ J, ∀ t ∈ T
       g_j(t) ≤ g_j(t-1) + R_j^U v_j(t-1) + S_j^U y_j(t),       ∀ j ∈ J, ∀ t ∈ T
       g_j(t) ≤G_j[v_j(t) - z_j(t+1)] + z_j(t+1) S_j^D,       ∀ j ∈ J, ∀ t ∈ T
       where the optimization variables in set Ξ are  p_j(t), p_j(t), v_j(t), y_j(t),
       and  z_j(t), ∀ j ∈ J, ∀ t ∈ T.







