Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Abstract Renewable energy sources (RES) are an “indigenous” environmental option, economically competitive with conventional power generation where good wind and solar resources are available. Hybrid systems can help in improving the economic and environmental sustainability of renewable energy systems to fulfill the energy demand. The aim of this paper is to present a dynamic model able to integrate different RES and one storage device to feed a “Green” building for its thermal and electrical energy needs in a sustainable way. The system model is embedded in a dynamic decision model and is used to optimize a quite complex hybrid system connected to the grid which can exploit different renewable energy sources. A Model Predictive Control (MPC) is adopted to find the optimal solution. The optimization model has been applied to a case study where electric energy is also used to pump water for domestic use. Optimal results are reported for two main cases: the presence/absence of the energy storage system. <s> BIB001 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> We propose a generic mixed integer linear programming model to minimize the operating cost of a residential microgrid. We model supply and demand of both electrical and thermal energy as decision variables. The modeled microgrid is operated in grid-connected mode. It covers solar energy, distributed generators, energy storages, and loads, among them controllable load jobs released by home appliances and electric vehicles. We propose a model predictive control scheme to iteratively produce a control sequence for the studied microgrid. Our case study reveals the performance of minimum cost control by comparison with benchmark control policies. We consider three price scenarios in our analyses which include two market-based scenarios. Numerical results from our study indicate savings in annual operating cost between 3.1 and 7.6 percent. <s> BIB002 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> This paper considers heat and power production from micro Combined Heat and Power systems and heat storage in a network of households. The goal is to balance the local heat demand and supply in combination with balancing the power supply and demand in the network. The on-off decisions of the local generators are done completely distributed based on local information and information exchange with a few neighbors in the network. This is achieved by using an information sharing model with a distributed model predictive control method based on dual-decomposition and sub-gradient iterations. Because of the binary nature of the decisions, a mixed integer quadratic problem is solved at each agent. The approach is tested with simulation, using realistic heat and power demand patterns. We conclude that the distributed control approach is suitable for embedding the distributed generation at a household level. <s> BIB003 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Innovations in the residential sector are required to reduce environmental impacts, as the sector is a contributor to greenhouse gas emissions. The increasing demand for electricity and the emergence of smart grids have presented new opportunities for home energy management systems (HEMS) in demand response markets. HEMS are demand response tools that shift and curtail demand to improve the energy consumption and production profile of a dwelling on behalf of a consumer. HEMS usually create optimal consumption and productions schedules by considering multiple objectives such as energy costs, environmental concerns, load profiles and consumer comfort. The existing literature has presented several methods, such as mathematical optimization, model predictive control and heuristic control, for creating efficient operation schedules and for making good consumption and production decisions. However, the effectiveness of the methods in the existing literature can be difficult to compare due to diversity in modelling parameters, such as appliance models, timing parameters and objectives. The present chapter provides a comparative analysis of the literature on HEMS, with a focus on modelling approaches and their impact on HEMS operations and outcomes. In particular, we discuss a set of HEMS challenges such as forecast uncertainty, modelling device heterogeneity, multi-objective scheduling, computational limitations, timing considerations and modelling consumer well-being. The presented work is organized to allow a reader to understand and compare the important considerations, approaches, nomenclature and results in prominent and new literary works without delving deeply into each one. <s> BIB004 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Microgrids (MGs) are considered as a key solution for integrating renewable and distributed energy resources, combined heat and power (CHP) systems, as well as distributed energy-storage systems. This paper presents a stochastic programming framework for conducting optimal 24-h scheduling of CHP-based MGs consisting of wind turbine, fuel cell, boiler, a typical power-only unit, and energy storage devices. The objective of scheduling is to find the optimal set points of energy resources for profit maximization considering demand response programs and uncertainties. The impact of the wind speed, market, and MG load uncertainties on the MG scheduling problem is characterized through a stochastic programming formulation. This paper studies three cases to confirm the performance of the proposed model. The effect of CHP-based MG scheduling in the islanded and grid-connected modes, as well as the effectiveness of applying the proposed DR program is investigated in the case studies. <s> BIB005 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Providing a cost-efficient and reliable energy is one of the main issues in human societies of the 21st century. In response to this demand, new features of micro grid technology have provided huge potentials, specifically by the capability of having an interactive coordination between energy suppliers and consumers. Accordingly, this paper offers an improved model for achieving an optimal Demand Response programing. To solve the proposed multi-objective optimization problem, Artificial Bee Colony algorithm and quasi-static technique are utilized. The considered objectives in this paper are minimizing the overall cost of energy consumption and also improving the technical parameters of micro grid over a time horizon. This optimization is subject to several constraints such as satisfying the energy balance and the operating constraints of each energy supply sources. Manageable load or load as source is another enabling feature existing in smart energy networks, which is considered in this paper and its effect on cost reduction and reliability improvement is studied. Trying to examine the performance of the proposed Demand Response Programing in real conditions, the uncertainties are also analyzed by stochastic methods. The results show significant improvements which are obtained by applying just intelligent programming and management. <s> BIB006 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> In modern electric power grids, microgrids are utilized in order to improve electric power grids' technical, economical, and environmental performance. In other words, both operator and consumers benefit the gained improvements by microgrids. However, operators confront certain ordeals to plan and operate the specific microgrid. In this paper, Combined Heat and Power (CHP) units, renewable energy resources, auxiliary thermal units and Electric Vehicles (EVs) are taken into consideration as a specific microgrid in California in the United States. Also, stochastic price of gas and electricity is taken into account. Moreover, uncertainty of the output power associated with non-dispatchable units like wind power plants as well as stochastic availability of the EVs adds to the complexity of the problem. The proposed approach plans to minimize total cost associated with the utilities as well as to minimize released emissions into the environment. Hence, the mentioned problem is a Multi-objective Linear Programming (MIP) which is solved using GAMS software. Finally, it has been showed that obtained solution is robust against uncertain parameters since there is just insignificant difference between solutions under this condition compared to condition that stochastic parameters are not modeled. <s> BIB007 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> The concept of smart grid SG has been introduced to improve the operation of the power systems. In modern structures of power systems, different reasons prompt researchers to suggest integrated analysis of multi-carrier energy systems. Considering synergy effects of the couplings between different energy carriers and utilising intelligent technologies for monitoring and controlling of energy flow may change energy system management in the future. In this paper, we propose a new solution which is entitled ‘smart energy hub’ SEH that models a multi-carrier energy system in a SG. SEH solutions allow homeowners to manage their energy consumption to reduce their electricity and gas bill. We present this concept for a residential customer by an ‘energy management system’ which uses reinforcement learning algorithm and Monte Carlo estimation method for finding a near optimal solution. The simulation results show that by using this concept and then applying the algorithm for a residential customer, running costs are reduced up to 40% while keeping the household owner's desired comfort levels. <s> BIB008 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Aggregating groups of loads and generators at the same location with centralized control is known as the concept of microgrids. However, if those flexible producers and consumers do not have the ability to balance the variability and uncertainty of RES (renewable energy sources) production within them, from the system perspective they are seen as a source of imbalances and potential problems in maintaining the equilibrium of production and consumption. The papers main goal is to quantify the ability of microgrid components to provide flexibility. This flexibility is analysed from two perspectives, defining two operating principles of each microgrid: independently from the distribution grid and connected, interacting and responding to signals from the upstream system. Following on this, the paper presents two relevant cases. <s> BIB009 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Abstract A model predictive control (MPC) based coordinated operation framework for a grid-connected residential microgrid with considering forecast errors is presented in this paper. This residential microgrid composes renewable energy resources (e.g., wind and solar), distributed generators (e.g., CHP), energy storages (e.g., battery bank and water tank), electrical vehicle, and smart loads (e.g. HVAC and washing machine). A novel mixed integer linear programming (MILP) problem is optimized at each decision time, on the basis of the short-term forecasts of renewable energy resources generation, load demand, and electricity price. This MILP problem is integrated into a MPC framework to reduce the negative impacts of forecast errors. Case study which considers forecast uncertainties is implemented for evaluating the performance of the proposed method and the traditional method is used. Besides, peak power price mechanism which is used to smooth the power exchanged with external grid is also considered. Moreover, a further sensitivity analysis is realized in order to discuss the impacts of energy storage units on the microgrid operation. Simulation results show that the proposed method is economic and flexible. <s> BIB010 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> In this study we present a Model Predictive Control (MPC) approach to Energy Management Systems (EMSs) for multiple residential microgrids. The EMS is responsible for optimally scheduling end-user smart appliances, heating systems and local generation devices at the residential level, based on end-user preferences, weather-dependent generation and demand forecasts, electric pricing, technical and operative constraints. The core of the proposed framework is a mixed integer linear programming (MILP) model aiming at minimizing the overall costs of each residential microgrid. At each time step, the computed optimal decision is adjusted according to the actual values of weather-dependent local generation and heating requirements; then, corrective actions and their corresponding costs are accounted for in order to cope with imbalances. At the next time step, the optimization problem is re-computed based on updated forecasts and initial conditions. The proposed method is evaluated in a virtual testing environment that integrates accurate simulators of the energy systems forming the residential microgrids, including electric and thermal generation units, energy storage devices and flexible loads. The testing environment also emulates real-word network medium conditions on standard network interfaces. Numerical results show the feasibility and the effectiveness of the proposed approach. <s> BIB011 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> In a multi-energy system, there are different types of dependencies among the energy carriers. Internal dependencies refer to possible changes in the energy source in the presence of energy converters and storage and are managed by the system operator through the control strategies applied to the equipment. External dependencies are due to the choice of the energy supply according to customer preferences, when alternative solutions are available. This paper introduces a new model of the external dependencies within a multi-generation representation based on energy hubs. The external dependencies are addressed through a stochastic model, in order to take into account the possible uncertainty in the customers' decisions. This model is then used to introduce carrier-based demand response, in which the user participates in demand response programmes aimed at promoting the shifting among different energy sources by preserving the service provided to the end users. The results obtained from the new model in deterministic and stochastic cases indicate the appropriateness and usefulness of the proposed approach. <s> BIB012 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> This paper presents a probabilistic Unit Commitment (UC) model for optimal scheduling of wind power, load forecasts and controllability of vehicles in a microgrid using a stochastic programming framework. The microgrid is made up of microturbines, wind turbine, boiler, Plug-in Electric Vehicles (PEVs), thermal storage and battery storage. The proposed model will help the power grid operators with optimal day- ahead planning even with variable operating conditions in respect of load forecasts, controllability of vehicles and wind generation. A set of valid scenarios is assigned for the uncertainties of wind sources, load and PEVs and objective function in the form of expected value. The objective function is to maximize the expected total profit of the UC schedule for the set of scenarios from the viewpoint of microgrid management. The probabilistic unit commitment optimizes the objective function using Particle Swarm Optimization (PSO) algorithm. In order to verify the effectiveness of the stochastic modelling and make a comparison with a simple deterministic one, a typical microgrid is used as a case study. The results can be used to evaluate the effect of integration of PEVs on the economic operation of the microgrid. The results also confirm the necessity to consider the key uncertainties of the microgrid; otherwise the results could overly misrepresent the real world operation of the system. <s> BIB013 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> This work describes an implementation of an office and/or personal smart grid for environmentally friendly buildings. These can be equipped with a local energy source (e.g., photovoltaic panels or combined heat-power units), energy storage devices (batteries, electric hot water boilers, heating, and ventilation systems including air conditioning), a building energy management system with sensors (e.g., providing the room temperatures), and household appliances acting as actuators (in general, split into groups of schedulable and non-schedulable ones). The idea behind this work has been to develop an automatic control system which would optimally decide for the end customer when to buy, sell, or store electric energy with the objective to minimize his total costs. At the same time, it fulfills all constraints in terms of the limits on power allowed to be taken from the grid. For the user, besides the optimal scheduling of household appliances and selling energy to the grid whenever it becomes profitable, the developed prototype gives also the opportunity to monitor the local generation, storage, and consumption in real time. On the other side, the electric utility can produce a real-time pricing signal which reflects daily peaks in consumption. Making such a price signal available for this building energy management system will lead to a decrease of power consumption from the grid. In this project, a model predictive control approach to the energy optimization problem in a building has been proposed. Different scenarios have been run and the results are discussed here. <s> BIB014 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Abstract Of the total electricity-generating capacity in the United States, 20% is dedicated to meet peak loads. Strategies to mitigate volatility in energy consumption have the potential to reduce the need for this surplus capacity. Here we investigate the potential for residential consumers to lower community-level peak demand through home energy management systems. We focus on the combination of air-conditioning use with the operation of time-shiftable appliances in the southern U.S. A centralized model predictive control (MPC) scheme minimizes peak air-conditioning (A/C) energy use by altering the thermostat set-points in individual homes. We simultaneously schedule the operation of time-shiftable appliances to further reduce the community peak load. The scheduling problem is formulated as a mixed-integer linear program (MILP) aimed at minimizing peak load under constraints that reflect the start times and allowed delays of individual appliances (e.g. dishwashers, washing machines, dryers) in each house. Using sample data collected from residential homes and consumer survey data located in Austin, TX, USA we show that the proposed integrated control and scheduling approach can minimize the peak load for the neighborhood by leveraging the physical differences and individual preferences between houses. On average, our framework is able to reduce the daily peak load for the group of houses by 25.5% (18.2 kW) when compared with the load for individually controlled thermostat settings and appliance start times. <s> BIB015 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Abstract Residential fuel cell based combined heat and power (FC-CHP) systems have been commercialized and are penetrating the marketed in Japan. In order to utilize FC-CHP systems efficiently, operational strategies are required. Energy interchange among consumers improves efficiency by allowing flexible operation of equipment. An energy management system (EMS), which is installed at the consumer dwelling, can integrate the control and management of energy equipment by using an optimized planning approach that incorporates the energy interchange and can operates equipment whilst adjusting to real conditions. An EMS has been developed, which achieves optimal operation of FC-CHP systems with energy interchange between dwellings in a residential area. Case studies were performed to evaluate the EMS model by using evaluation indices including energy costs, CO2 emissions, and primary energy consumption. The results showed that 1) energy management and energy interchange were effective and contributed to cost reductions, CO2 mitigation, and reduction of primary energy consumption and 2) the developed EMS model achieved optimal operations. <s> BIB016 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Pre-packaged cogeneration systems are popular as lead supply in distributed and isolated energy systems aimed at empowering remote off-grid communities and in supporting eco-villages in nature reserves. Energy cooperatives and independent power producers deploy cogeneration systems in community shared microgrid configurations as building blocks in smart localised multi-carrier energy grids. Small-scale renewable energy and distributed energy resources in the energy mix of multi-carrier combined heat and power microgrids call for the development of intelligent control automation solutions. This paper describes a multi-objective optimization solution where hierarchical digital microgrid control is integrated into solar powered micro-cogeneration. The control solution includes an integrated cost-competitive economic and environmental optimization algorithm customized around the needs of small off-grid isolated village settlements. A secondary stage optimization loop functions as a storage capacity decision support system, to alert the community when operating costs can be reduced through an investment into increased storage capacity for the village microgrid. This cost-aware control optimization algorithm is tested in a rural village microgrid by using parametric computer simulation models of a hybrid residential solar cogeneration system. Digital simulation experiments evaluate the operational plans and operational cost performances of energy management for different storage scenarios at an isolated remote rural location in Africa. <s> BIB017 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Renewable energy resources are often known as cost-effective and lucrative resources and have been widely developed due to environmental-economic issues. Renewable energy utilization even in small scale (e.g., microgrid networks) has attracted significant attention. Energy management in microgrid can be carried out based on the generating side management or demand side management. In this paper, portable renewable energy resource are modeled and included in microgrid energy management as a demand response option. Utilizing such resources could supply the load when microgrid cannot serve the demand. This paper addresses energy management and scheduling in microgrid including thermal and electrical loads, renewable energy sources (solar and wind), CHP, conventional energy sources (boiler and micro turbine), energy storage systems (thermal and electrical ones), and portable renewable energy resource (PRER). Operational cost of microgrid and air pollution are considered as objective functions. Uncertainties related to the parameters are incorporated to make a stochastic programming. The proposed problem is expressed as a constrained, multi-objective, linear, and mixed-integer programing. Augmented Epsilon-constraint method is used to solve the problem. Final results and calculations are achieved using GAMS24.1.3/CPLEX12.5.1. Simulation results demonstrate the viability and effectiveness of the proposed method in microgrid energy management. <s> BIB018 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Abstract Demand Side Management (DSM) provides ancillary service to the electric grid by modifying customers electricity demand. Demand Response (DR) and Demand Flexibility (DF) programs from buildings are well-adopted ancillary services to reduce the peak demand in grids by altering the power consumption strategy. Heating, Ventilation and Air-Conditioning (HVAC) systems are one of the largest energy demands in commercial buildings. In addition, HVAC systems are flexible to provide DR service to the grid. In this study, two common configuration topologies of building integration with Energy Storage Systems (ESS) and renewables are considered. A real-time optimization framework based on Model Predictive Control (MPC) is designed to control the power flow from the grid, solar Photovoltaic (PV) panels, and ESS to a commercial building with HVAC systems. The MPC framework uses the inherent thermal mass storage of the building and the ESS as a means to provide DR. Deterministic and probabilistic analysis are studied to investigate the effectiveness of the proposed framework on Building-to-Grid (B2G) systems. Our deterministic results show that the proposed optimization and control framework for B2G systems can significantly reduce the maximum load ramp-rate of the electric grid to prevent duck-curve problems associated with increase in solar PV penetration into the grid. Based on probabilistic results, even under prediction uncertainties, electricity cost saving and ramp-rate reduction is achievable. The results show that this DR service does not affect the building indoor climate in a way noticeable to humans and its effect on the operational building costs is reduced. The B2G simulation testbed in this paper is based on the experimental data obtained from an office building, PV panels, and battery packs integrated with a three-phase unbalanced distribution test feeder. A Monte-Carlo simulation is carried out to account for uncertainties of the proposed method. Both deterministic and stochastic analyses show the effectiveness of the proposed predictive power flow control to decrease the building operation electricity costs and load ramp-rates. <s> BIB019 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Microgrids are subsystems of the distribution grid operating as a single controllable system either connected or isolated from the grid. In this paper, a novel cooperative model predictive control (MPC) framework is proposed for urban districts comprising multiple microgrids sharing certain distributed energy resources (DERs). The operation of the microgrids, along with the shared DER, are coordinated such that the available flexibility sources are optimised and a common goal is achieved, e.g., minimizing energy exchanged with the distribution grid and the overall energy costs. Each microgrid is equipped with an MPC-based energy management system, responsible for optimally controlling flexible loads, heating systems, and local generation devices based on end-user preferences, weather-dependent generation and demand forecasts, energy prices, and technical and operational constraints. The proposed coordination algorithm is distributed and guarantees constraints satisfaction, cooperation among microgrids and fairness in the use of the shared resources, while addressing the issue of scalability of energy management in an urban district. Furthermore, the proposed framework guarantees an agreed cost saving to each microgrid. The described method is implemented and evaluated in a virtual testing environment that integrates accurate simulators of the microgrids. Numerical experiments show the feasibility, the computational benefits, and the effectiveness of the proposed approach. <s> BIB020 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> In this paper, an optimal probabilistic scheduling model of energy hubs operations is presented. The scheduling of energy hub determines the energy carriers to be purchased as input and converted or stored, in order to meet the energy requests, while minimizing the total hub's cost. However, as many other engineering endeavors, future operating criteria of energy hubs could not be forecasted with certainty. Load and price uncertainties are the most unclear parameters that hub operators deal with. In this regard, this paper proposes a 2 $m$ + 1 point estimation probabilistic scheduling scheme for energy hubs with multiple energy inputs and outputs. One of the applicable tools of energy hubs to have an efficient participation in the liberalized power market with volatile prices is demand response programs (DRPs). While there is plenty of experience in investigating the effect of DRP, it is electricity DRP that receives increasing attention by research and industry. Therefore, the proposed DRP investigates the effect of both responsive thermal and electric loads in reducing the total cost and participation of different facilities in supplying multiple loads. The proposed model envisages the most technical constraints of converters and storages. Several test systems have been investigated in order to confirm the effectiveness of the proposed model. The results verify the capability of the proposed model in covering the energy hub time-varying output demands as well as the economic advantages of implementing the suggested strategy. In addition, the results are compared with 2 $m$ point estimate method and Monte Carlo simulation. <s> BIB021 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Abstract This paper proposes a new optimization model for Smart Home Management Systems (SHMS) in order to increase the profits of Load Serve Entities (LSEs) and customers from technical and financial points of view. In the recent decades, performing Demand Response (DR) is one of the most efficient ways to improve the performance of power distribution systems in terms of power loss, and investment costs. The LSEs can implements some strategies like offering incentives to customers to change their consumption pattern with the aim of reducing power loss, improving asset management and increasing the profits. On the other hand, the end users can participate in DR programs to decrease electricity bills and earn monetary incentives from LSEs proportionate to their contributions to the energy loss reduction. In this paper, Distribution Locational Marginal Price (DLMP) instead of time-based pricing mechanism is applied to bill the customers. In the proposed strategy, the energy bill of customers and power loss of the system are simultaneously decreased. For dealing with uncertainties, stochastic variables computation module is designed which generates several scenarios by Monte Carlo simulation at each hour. The operation of household resources and appliances are optimized through a Mixed Integer Linear Programming (MILP), which has a two-stage stochastic model. The results explicitly show benefits of the proposed stochastic model since it provides accuracy in scheduling and decreases the operation cost. Besides, the superiority of DLMP and the proposed method over existing pricing mechanism is demonstrated. <s> BIB022 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> Due to the 2012 change in the renewable energy act the feed-in tariffs, and therefore the number of newly installed photovoltaic systems decreased dramatically in Germany. Particularly in the residential sector as the biggest market new business ideas for photovoltaic systems were developed. Hence a photovoltaic and combined heat-and-power system, which provides not only electricity but also heat. This complex system requires flexible control strategies. A new combined control algorithm is proposed that in contrast to the standard strategies can operate even under incorrect weather and load forecasts without creating discomfort. Furthermore is it applicable for cloud-based solutions. In this paper a high-level model predictive control based on a mixed integer linear programming problem is combined with an additional low-level, rule-based controller. The low-level control compares the set-points of the optimization with the actual values and corrects the set-points according to each system component until the next optimization takes place. The results show that a hybrid system can be successfully controlled by a combined control approach. In case of a cloud-based application the need for an optimization can be reduced by a factor of four without diminishing comfort or facing much higher operational costs. It has also been shown that the combined control algorithm can be used as an energy management of microgrids. <s> BIB023 </s> Energy management for user’s thermal and power needs: A survey <s> Dealing with uncertainties <s> There is increasing interest in multi-energy communities, which could become important sources of demand response flexibility, especially when equipped with storage. Their location on distribution networks mean their exploitation to solve local capacity congestions may be particularly valuable, whilst their ability to partake in energy/reserve markets can improve their business cases. However, maximizing this flexibility potential by providing multiple services that are subject to uncertain calls is a challenging modeling task. To address this, we present a stochastic energy/reserve mixed integer linear program for a community energy system with consideration of local network constraints. By covering all the relevant energy vectors, the multi-energy formulation allows comprehensive modeling of different flexibility options, namely, multi-energy storage, energy vector substitution, end-service curtailment, and power factor manipulation. A key feature of the approach is its robustness against any reserve call, ensuring that occupant thermal comfort cannot be degraded beyond agreed limits in the event of a call. The approach is demonstrated through a case study that illustrates how the different flexibility options can be used to integrate more electric heat pumps into a capacity constrained smart district that is managed as a community energy system, while maximizing its revenues from multiple markets/services. <s> BIB024
Renewable production and end-user's demand forecasts are never fully accurate, and uncertainties can significantly affect the results. A Stochastic Optimization approach considers that the decision made at a given time is not affected by information about uncertain data available at a later time period in the planning horizon BIB004 . At each time step, the future values of uncertain parameters are estimated considering different PDFs (e.g., BIB005 BIB021 BIB006 BIB018  BIB022 BIB012 . This time evolving system can be represented through a probabilistic scenario tree; the starting node of the problem is the ''root'' and, by following branches, different stages are reached until the final nodes, called ''leaves''. Each path from the root to a leaf is a possible scenario  and has a probability of occurrence. Alternatively, tens of possible scenarios are generated by combining previously selected different profiles for uncertain parameters, such as energy prices, weather conditions, power demands, and renewable generation (e.g., BIB024 BIB013 BIB007 . Among all scenarios, those with the highest probability are selected via reduction techniques and used for running the optimization problem. The user behavior is modeled as a Markov chain in BIB008 , showing periodic, daily and weekly patterns. Model Predictive Control (MPC) is based on the idea of approximating a long-horizon optimal control problem by a shorthorizon one. At each time step, the algorithm estimates the future behavior of the system based on current forecasts, and finds an optimal state based on the prediction. Next, new forecasts are available, and the procedure is repeated. In other words, the original optimization problem addresses the forecast uncertainties by sequentially making short-term decision, based on new short-term forecasts. MPC is applied in several works to minimize the impact of uncertainties on the optimal scheduling problem. Such uncertainties can affect wind speed forecasts BIB009 , solar BIB014 BIB010 and wind production BIB010 , load demand BIB010 , and electricity prices BIB010 . In BIB001 , BIB002 and BIB019 , RES production, electricity prices, and/or weather conditions are derived from historical data and are available without uncertainties to the EMS at short notice, e.g. with a 7.5-h BIB002 or 6-h (Razmara et al., 2017) prediction horizon (Kriett and BIB002 . Similarly, air conditioning consumptions are forecasted every 12 h in BIB015 , and the MPC system adjusts the thermostat accordingly. In BIB016 and BIB017 , the EMS optimally schedules the available DERs for the next day, according to an accurate forecast. Then, it receives real-time data of the energy consumptions and, consequently, it has to revise the planned operational scheduling. In BIB023 , forecasted PV generation and demand time series are available every 6 h. A MPC optimizes the components operation every 10 min, while a low-level controller adjusts their set-points according to real-time data with 1 min resolution. The authors of BIB023 proposes also an alternative control mode, where the MPC does not repeat the optimization every 10 min, but only if the low-level controller detects a too high offset between actual and predicted values or if the end of the 6-h prediction horizon is reached. A distributed MPC is applied to a network of households in BIB003 , with the aim of scheduling the operation of CHP systems and heat storage devices in real-time. The resolution of the data and the proposed algorithm are, indeed, one minute, while the prediction horizon of the MPC is five minutes. In BIB011 and BIB020 , the daily operation of DERs and flexible loads is the result of an iterative optimization process which is repeated every 10 min, when new informations on prices, weather conditions, and renewable generation are available.