scieee AI-readable full text Open interactive document viewer

Energy resource scheduling in a smart microgrid neighbourhood

Auladell León, Paloma

Abstract

This project consists of the case study of a smart microgrid district in a spanish town. The smart energy microgrid district consists of several households and a public use building (school) that includes renewable energy sources (photovoltaic), li-ion batteries for electric energy storage, domestic hot water heaters acting as thermal energy storage, a pool for balancing energy consumptions and supplies, and the connection to the electric grid. The problem has been modelled as a non-linear mathematical programming model that is linearly approximated using special ordered sets of type 2. The linear approximation is solved using Gurobi optimization software providing close-to-the-optimum solutions within an interval of 15 minutes that allows near real time operation of the smart energy district. The obtained results allow to advance within the net zero energy neighbourhood concept in all the evaluated scenarios within a daily horizon, and a positive energy balance in wider horizons. Even if these results are obtained in part due to the magnificent insolation conditions of this particular town, they allow to justify that the appropriate use of renewable energy resources, energy storage systems together with balancing mechanism at district level (as the pool in our case study) may lead to nearly net zero energy neighbourhood in other geographical locations too.

Full text

Equation Chapter 1 Section 1 Trabajo de Fin de Máster Máster Universitario en Organización Industrial y Gestión de Empresas Energy resource scheduling in a smart microgrid neighbourhood Autor: Paloma Auladell León Tutor: Luis Onieva Giménez Dpto. Organización Industrial y Gestión de Empresas II Escuela Técnica Superior de Ingeniería Universidad de Sevilla Sevilla, 2019 ii Trabajo de Fin de Máster Máster Universitario en Organización Industrial y Gestión de Empresas Energy resource scheduling in a smart microgrid neighbourhood Autor: Paloma Auladell León Tutor: Luis Onieva Giménez Catedrático Dpto. de Organización Industrial y Gestión de Empresas II Escuela Técnica Superior de Ingeniería Universidad de Sevilla Sevilla, 2019 iv Proyecto Fin de Máster: Energy resource scheduling in a smart microgrid neighbourhood Autor: Paloma Auladell León Tutor: Luis Onieva Giménez El tribunal nombrado para juzgar el Proyecto arriba indicado, compuesto por los siguientes miembros: Presidente: Vocales: Secretario: Acuerdan otorgarle la calificación de: Sevilla, 2019 El Secretario del Tribunal vi Contents List of figures 3 List of fables 5 Acknowledgements 7 Abstract 9 1 Scope 11 2 Introduction 13 3 Literature review 15 4 Description of the problem 23 5 Technical considerations 25 5.1 Domestic hot water heater operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2 Battery operation and degradation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6 The model 29 6.1 Thenon-linearmodel......................................... 29 6.1.1 Model............................................. 32 6.2 The linearized model using special ordered sets of type 2 . . . . . . . . . . . . . . . . . . . . . 35 6.2.1 Linearizedmodel....................................... 36 7 Experimentation 39 7.1 Casestudyresearchdata....................................... 39 7.2 Results................................................. 44 8 Conclusions 55 1 Appendix I 57 Appendix II 59 2 List of Figures 1 Conceptual microgrid architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2 Energyflowdiagram......................................... 24 3 Degradation.............................................. 27 4 Energy demand in the district during the year . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5 Aggregate energy demand for the school . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6 Total energy demand in each household in each scenario . . . . . . . . . . . . . . . . . . . . . 42 7 Purchase and selling prices from the electric grid . . . . . . . . . . . . . . . . . . . . . . . . . 43 8 Demand supply at the households and the school for scenarios 1, 3 and 5 . . . . . . . . . . . 46 9 Use of the photovoltaic energy production at an average household and the school for scenarios 1,3and5............................................... 48 10 Battery charge and discharge at an average household . . . . . . . . . . . . . . . . . . . . . . 49 11 Battery charge and discharge at an average household . . . . . . . . . . . . . . . . . . . . . . 50 12 Temperature evolution of the DHWH at an average household . . . . . . . . . . . . . . . . . . 51 13 Origin of DHWH energy at an average household . . . . . . . . . . . . . . . . . . . . . . . . 52 14 Use of grid energy at an average household . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 15 Use of pool energy at an average household . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3 10 11 1 Scope The main goal of the present project is the description of a holistic non-linear mathematical programming model for the scheduling of the energy sources of a neighbourhood, which includes a group of households and a school. Previous studies addressed the need to review current generation and operation strategies in order to thrive towards wider and more comprehensive concepts like energy systems. Studies have also researched the paradigm of zero energy buildings (ZEBs), concluding that the concept still needs a consistent definition and standarization. They have also looked into the reliability and flexibility of buildings sustained by renewable energy sources, and ways to guarantee their energy supply. They have pointed out the necessity to develop operating patterns for energy storage devices in order to prevent their lifetime from shortening at an early stage. Moreover, these studies address the need to assess the economical viability of these solutions, for which a correct design and sizing of the energy resources is required. Despite the recent efforts, the current evolution towards the smart district or neighbourhood microgrid concept requires additional research efforts. Even more, the concept is now evolving to a wider scope by the consideration of (nearly) net zero energy neighbourhoods (NZEN) in which several buildings (including households, buildings of public use such as schools, hospitals, and commercial centres amongst others) constitute a neighbourhood with an energy consumption near to zero by compensating the consumptions and generation among them and considering the day (or week) horizon to achieve a net zero (L´opez, et al. 2015). It is in this context where the present work lies. The main points of this project are: (i) the consideration of a smart energy microgrid district with several households and public use buildings that include renewable energy sources (photovoltaic), li-ion batteries for electric energy storage, domestic hot water heaters acting as thermal energy storage, a pool for balancing energy consumptions and supplies, and the possible use of the electric grid in order to apply innovative schemes to save energy in conjunction with exploiting natural energy resources in pursuit of ultimate sustainability and reliability at district level; (ii) the introduction of a holistic non-linear mathematical programming model that considers the modelling of the battery degradation and the operation of domestic hot water heaters; and (iii) the solution of such model by implementing its linearization using special ordered sets of type 2 that allows to reach near-optimal solutions of the linear model in near-real time (less than a slot of 15 minutes) and its application to a real case study (a district in a spanish town). The solution obtained guarantees the optimal operating pattern of the storage devices, ensuring that the minimum replacements are carried out within the lifespan of the energy system and the installation is cost effective. The rest of the project follows with an introduction in section 2, a summary of the state of the art in Section 3; the description of the problem in Section 4; the specific details associated to the technical considerations of the li-ion battery degradation model and the energy storage model in the domestic hot water heaters in Section 5; the non-linear mathematical programming model that defines the problem in terms able to be optimized and its corresponding linearization by using special ordered sets of type 2 in Section 6; the 12 1 SCOPE experimental results for the spanish town case study in Section 7. Finally, the conclusions are presented in the last section and an appendix providing the theoretical details of the special ordered sets of type 2 linearization is also included. 13 2 Introduction Nowadays, energy efficiency is a political priority of increasing attention, together with the increasing concern on the climate change, the reduction of fossil fuel consumption and the efficient use of the energy. Currently, in the European Union, 28 countries consume around 3,400 TWh of electricity and 2,600,000 TJ of heat per year, as noted by Eurostat (http://ec.europa.eu/eurostat). In addition, the concept of energy efficiency emerged as a cornerstone is intimately linked to most of the concepts that currently receive attention in terms of energy such as the use of clean energies, the security in the use of the energy, the economic and social impacts due to the raise of the energy prices, and the concern for climate change. At the same time, increasing energy efficiency allows increasing competitiveness of the companies, while promoting the welfare of consumers. Moreover, regarding the previously mentioned 3,400 TWh of EU consumed electricity, nearly 25% corresponds to the residential sector. During the last 20 years, total energy consumption in households increased by 35% as a result of a large number of factors, including the increase in population and the number of occupied dwellings, changes in the size of the dwelling, the existence of more electrical appliances, and the increase of wealth. On the other hand, the consumption of such dwellings is not produced at the same time and can follow different profiles that can also be compensated with other consumptions at buildings of public use that are produced at different hours. Consequently, holistic approaches considering the optimization of the energy network operation as a whole at the level of district or neighbourhoods will lead to improvements in terms of energy efficiency, leading to the concept of smart energy microgrids. In addition, the energy generation in renewable energy resources such as wind and solar are an important component of such smart microgrids, although the inherent intermittency and variability of such resources complicates microgrid operations. Therefore one of the major elements is the interconnection of renewable generation and how that generation is managed in order to meet the demand. Also, the progressive improvement of the performance and efficiency in electric batteries allows their consideration as another distributed energy resource. Demand response techniques for demand and supply balancing are a matter of interest in current studies. At the moment customers have few ways of getting information about the state of the grid, and therefore cannot react adjusting their energy use to maximize efficiency. The main goals of demand response techniques is to achieve a reduction of peak load and the ability to control consumption depending to generation. This means that there could be a way for end-use appliances to know and react when renewable energy is available or when there is a shortage of electric supply. 14 2 INTRODUCTION 15 3 Literature review In the following section a literature review of the issue under study is presented. The topics covered include the concept of smart energy grids and its evolution to the wider concept of smart energy systems and the integration of renewable energy sources within the current energy supply system and how to ensure its sustainability. The literature also addresses the lack of consensus regarding the definition and standarization of the concept of ZEBs and ways to assess its correct operation and propose methodologies for this purpose. However, in order to be cost effective and guarantee benefits for the environment, energy systems that include distributed and renewable energy sources need to be operated and sized in an optimal manner. To achieve this, several optimization strategies are also presented in the scientific literature. In this line, several authors show that the existing energy infrastructures and also generation and operation strategies need to be reviewed and encompassed to the new concept of smart energy network going beyond the limitations of distributed generation. This means that the paradigm of smart grid needs to evolve to the new concept of smart energy network or smart energy systems, not only integrating energy sources into the electric network, but also including management, operation and communication into it. In particular, Lund et al. (2012) address the challenge of large-scale integration of renewable energy sources into already existing energy systems. Within these, fluctuating and intermittent renewable energy production must be coordinated with the rest of the energy system in order to meet the electricity demand and guarantee stability and reliability. Especially with regard to electricity production, facing this challenge is essential since electricity systems depend on an exact balance between demand and supply at any time. Electricity smart grids would act in cooperation with other sectors such as heat supply, transportation and energy conservation. This article states that the operation and regulation of flexible combined heat and power (CHP) plants would be an efficient way of facilitating the large-scale integration of renewable energy power since they would ensure voltage and frequency stability of the electricity supply. It also explains the necessity to focus on the design of energy systems with a high capability of utilising intermittent renewable energy sources. They present a case study to compare several systems depending on this capability, finally concluding that the performance of a small CHP plant equipped with CHP units, heat storage and electric boilers can provide valuable grid stabilisation at very low additional investment and operating expenses. Mathiesen et al. (2015) outline how to integrate renewable energy sources into energy grids using the smart energy system approach and addresses the lack of knowledge in the previous literature about how to do so. The way to achieve this is by focusing on merging all the sectors involved and incorporating energy storage devices to ensure the flexibility and reliability lacking in these fluctuating energy sources. The main goal is to discuss the possible integration of smart electricity, smart thermal and smart gas grids to enable 100% renewable energy. For the same purpose, the smart energy system should be managed not only from the supply side but also from the consumption side. This work presents the development, design, analysis and results of a 100% renewable energy system which consists of wind power, photovoltaics (PV), wave power and run-of-river hydro power to assess its impact in terms of economic growth and health benefits. If this methodology is carried out, energies like biomass would only be used at a sustainable level. 16 3 LITERATURE REVIEW Mathiesen et al. (2011) present the design and results of a 100% renewable energy system. The results reveal how implementing energy savings, renewable energy and more efficient conversion technologies can have a positive socio-economic effect. It also assesses and quantifies the potential environmental benefit in climate change mitigation that a transition to 100% renewable could bring. In conclusion, the results indicate the possibility for continued economic growth while implementing climate mitigation strategies. Tan et al. (2012) give a thorough insight of the progression of microgrid-oriented energy storage technologies. It provides the state of the art in the area of applications, principles, interfaces , control strategies and new emerging research line. It highlights the importance of energy storage systems (EESs) as power buffers in microgrid. The concept of smart energy network will contribute to progress towards the concept of net zero energy buildings (ZEB) that has attracted the attention in the last years. The previous scientific literature provides an useful insight towards the actions required for developing building assessment methodologies in order to achieve the envisioned smart cities in Europe, all in terms of design for the environment and building practices, renewable energy sources, technical building systems and intelligent energy management (Kylili et al., 2015). In the same line, as Scognamiglio et al. 2014 identify, there are some commonly documented limitations of the current research and development that may be considered the drivers for future NZEB growth, such as a lack of an universally agreed definition and its consequent difficulty for establishing strategies for achieving it and inconsistent energy efficiency standards. The most important definitions for ZEB are: •Net zero site energy use •Net zero source energy use •Net zero energy emissions •Net zero cost •Off-grid •Energy-plusA To summarize, a NZEB can be broadly defined as a building with characteristics such as equal energy generation to usage, significantly reduced energy demands and energy costs equalling zero or net zero green house gas emissions. The common denominator for the different possible Net ZEB definitions in the presented framework is the balance between weighted demand and supply. The balance may be calculated in different ways, depending on the quantities that are of interest and available. A review of past scientific literature indicated that buildings can make the transition to ZEBs by reducing their energy consumption by at least two-thirds compared to their current energy consumption. This article concludes that ZEBs will make a significant contribution to smart cities on the energy efficiency, energy conservation and renewable energy generation aspects. Innovative methodologies that promote a holistic approach, incorporating a 17 combination of technologies and solutions of real time energy management, lifecycle and social considerations, and progressive economic feasibility considerations should be adopted. Adopting these kind of methodologies will contribute more effectively and quicker than excepted to the achievement of the target for the transition to smart European cities. However, it also refers to the controversy arised due to the possible unsustainability of ZEBs on topics such as Life Cycle Assessment (LCA), rebound effect and social, as well as climate change considerations, all of which require further efforts for their research and development. This is because most of the studies carried out take into consideration only the energy during the use phase of the building, however, there is a considerable amount of energy embodied in the construction materials that has been hardly given attention to or taken into account in literature. Because of this issue, the article also points out the necessity to consider the further development of the current ZEB concept in order to achive a more comprehensive one that not only considers the energy consumption of the use phase of the buildings in its definition and that provides a consistent energy efficiency criteria. Pikas et al. (2014) point out the lack of previous studies focused on cost optimality of technical solutions. Instead, they mostly focus on energy efficiency issues. Sartori et al. (2012) present a framework for setting ZEB definitions. Possible indicators are presented and the concept of grid interaction flexibility is introduced as a desirable target in the building energy design. Evaluation of the criteria and selection of the related options becomes a methodology for elaborating Net ZEB definitions in a systematic, comprehensive and consistent way. This can create the basis for legislations and action plans to effectively achieve the political targets. Wells et al. (2018) follow the previous research lines presenting a potential contribution of the ZEB principle towards achieving smart cities in Europe and provides guidelines for the design of building assessment methodologies. The analysis undertaken concluded that the concept of ZEB will contribute to smart cities in aspects such as energy efficiency and energy conversion. Their conclusion agree with the previous literature: some aspects regarding life cycle should be assessed and solid methodologies should be designed and adopted in order to ensure a rapid achievement of the transition to smart cities. Even though the expected high insertion of distributed micro-generation facilities based on renewable energy can help reduce the environmental footprint of buildings and households, the complexity of managing effectively the electric grid grows dramatically under these conditions. Future districts or neighbourhoods should include the energy planning for communities as a key aspect to achieve more efficient energy networks. Energy saving issues and growing environment protection awareness has intensified the interest for Distributed Energy Systems. They are expected to increase largely the efficiency of energy supply and to fix some of the addressed environmental problems. Di Somma et al. (2016) propose a multi-objective optimization problem to reduce both the energy costs and environmental impacts of the operation strategy of a distributed energy system. The Pareto front includes the best possible trade-offs that can be obtained between the costs and environmental objectives. The problem is solved by minimizing a weighted sum of 18 3 LITERATURE REVIEW the total energy costs and CO2emissions. The results of the study prove that an optimized operation of the distributed energy system decreases energy costs and emissions when compared to conventional energy supply systems. In this line, demand side management (DSM) is expected to contribute significantly to attain the NZEN concept as well. DSM refers to mechanisms that encourage consumers to adapt their energy use depending on the daily period to shifting of energy consumption from peak to non-peak hours. DSM enables consumers to control their energy profile to reap economic benefits. It also aids energy providers to reduce the peak average ratio (PAR) by leveraging the flexibility of distributed energy resources (DERs) and renewableenergy resources (RESs) to supplement grid power, thereby avoiding the use of expensive peak-power plants. The literature outlines the lack of previous research studies in the role of consumers in the paradigm of zero emission strategies (Throne-Holst et al. 2007). Gelazanskas and Gamage (2014) focus on the changes at the user side that could contribute to the renewal of the electricity grid. It proposes a method that would enable user side load control. This would potentially balance demand side with supply side more effectively and reduce peak demand to make the whole system more efficient. The proposed optimisation algorithm intends to shape the final load curve as close as possible to the desired load curve. The restriction of this strategy is compliance in the number of shiftable loads in the system, which users are willing to use at a different time, where user behaviour is estimated using statistical data. Customers will have the most flexibility and choice controlling their load pattern. Only customer and his willingness to pay certain price at different times define individual load shape. A good strategy commonly found in the literature is to set price based incentives and stablish a two-way communication. Fern´andez et al. (2018) present a game-theoretic DSM framework for a neighbourhood area to provide cost savings for the consumer and reduce the PAR for the neighbourhood, while maintaining an optimal comfort level for the consumer and satisfying consumption constraints. The proposed DSM framework utilizes the flexibility of distributed energy resources and renewable energy sources to allow neighbours to share excess energy production and avoid demand peaks. It leverages the flexibility of distributed energy resources in order to avoid the use of expensive peak power plants. To prove this, the article proposes a comparison of algorithms applied to scenarios in which neighbours share information about their consumption habits and scenarios in which they don’t, in order for the system to be scheduled to satisfy their demands with an optimal cost, proving that PAR is reduced in those scenarios where users are willing to share information. Indeed, the concept of net zero previously mentioned energy turns critical in small inland contexts. It is the case of the standalone microgrid case presented at Zhao et al. (2013), that proposed a genetic algorithm to solve a multi-objective optimization problem aiming to minimize the power generation cost and to maximize the useful life of lead–acid batteries. The optimization model includes battery life loss cost, operation and maintenance cost, fuel cost, and environmental cost is established to obtain a set of optimal parameters of operation strategy. The NSGA-II algorithm was used to find solutions for the multi-objective problem and two typical scenarios where used: abundance and shortage of renewable sources. In a similar context, the comparison of such energy management systems of standalone and grid-connected microgrids was also 19 considered by Jiang et al. (2013), where a double layer coordinated control approach for optimization of grid connected and standalone microgrids is developed. This approach prioritizes reliable power supply instead of economic benefit, so that it maximizes satisfaction rate of load with minimum operation cost in stand-alone mode. These two layers are the schedule layer and the dispatch layer. The schedule layer obtains an economic operation scheme based on forecasting data, while the dispatch layer provides power of controllable units based on real-time data. Errors between the forecasting and real-time data are resolved through coordination control of the two layers by reserving adequate active power in the schedule layer, then allocating that reserve in the dispatch layer to deal with the indeterminacy of uncontrollable units. As previously mentioned, the efficient management and operation of smart microgrids is receiving increasing attention in the scientific literature. In this line, Risbeck et al. (2017) presented a mixed-integer linear programming model for real-time cost optimization of building heating, ventilation, and air conditioning equipment. The model considers chillers, chilled water pumps, boilers, hot water pumps, heat-recovery chillers and storage systems. This framework accounts for time-varying utility prices, demand charges, occupant comfort constraints, and on/off equipment dwell times. The overall problem is as follows: given forecasts of hourly utility prices, ambient conditions and building occupancy, decide how to operate the HVAC system at lowest economic cost via decisions such as what the temperature profile of each zone should be, when the energy storage should charge or discharge, weather each equipment is running or not at a certain time interval and how much chilled and hot water is being produced. Also, in the context of a commercial building microgrid, Wang et al. (2016) proposed a mixed integer programming model considering solar generation, and several forms of electric storage (stationary battery energy management system and gridable electric vehicle integration). At the same scale level, Cort´es et al (2018) proposed a non-linear model to optimize the operating costs of electricity and and heating in buildings considering distributed energy generation and storage. This paper deals with the optimization of the operating costs of electricity and heating networks in building with distributed energy generation and electric storage. The aim of the article is to obtain the optimal configuration of energy supply from the energy sources. The problem is solved via linear optimization and by the use of metaheuristics. This paper addresses and demonstrates very well how soft computing techniques such as genetic algorithms can deal with large real-life problems requiring a quasi-real-time response when traditional and mathematical approaches or even commercial software could not be able to manage. This article makes a great contribution to the scientific literature by the application of genetic algorithms to deal with a distributed energy generation network with storage capabilities, which hadn’t been considered in the literature previously. Bordin et al. (2017) present a linear programming model for a system that includes batteries and solar photovoltaic energy. Its major contribution is the methodology to model the battery degradation using a linear approximation. They propose sensitivity analyses to investigate how degradation costs and different operational patterns relate to each other. The objective is to show the combinations of battery costs and performance that makes the system more economic. Their analyses shows that lead acid batteries become viable when their degradation cost per kWh drops below a certain percentage bellow the current diesel cost, which would be the energy alternative, highlighting the importance of the operating pattern chosen to meet 26 5 TECHNICAL CONSIDERATIONS ˙ d DHW H(t) = Cp·˙mt·(Tout −Tin) (2) ˙ Wel(t) = Pel ·u(t), u(t)∈ {0,1}(3) In equation (2) Cpis the thermal capacity of water, Tout is the hot water draw temperature and Tin is the inlet temperature, and ˙mtis the mass flow rate at the inlet (kg/s). In equation (3), Pel is the electrical power of the resistive element of the DHWH, and u(t) is a binary switch function controlling the resistive heating element that is represented as a step function which takes values between 0 and 1. The last term of the right hand side of equation (1) represents the energy losses across insulation. It is calculated as the difference between the external temperature and the average inner temperature of the tank. Approximating the partial derivative using finite differences, the energy balance can be written as (4). ρ·Vi·Cp ·(T(t)−T(t−1)) = ˙ Wel(t)·∆t−˙ d DHW H(t)·∆t−UA ·(T(t)−T ext)·∆t(4) 5.2 Battery operation and degradation. Despite the increasing research and technical work in batteries ad energy storage systems, the extension of the usage of batteries has been limited due to the high investment costs that they require and due to its high dependency on the operating conditions. In fact, a good knowledge of the effect of these aspects is essential for determining the viability of its implementation. Weitzel et al. (2018) review the existing literature related to this topic, and concludes that although there are many studies that integrate battery degradation models into optimization microgrid problems, such studies do not reflect the battery ageing adequately due to several reasons: (i) a non-appropriate simplification of the system, (ii) the lack of consideration on how such degradation affects the microgrid operation, or (iii) because they do not avoid an excessive usage in adverse operating conditions. Another problem found in the literature, according to Bordin et al. (2017), lies in the fact that many models use the operating conditions as input parameters and not as optimisation variables, so they do not reflect the trade-off between degradation costs and energy purchasing costs from the grid. According to Sarasketa-Zabala et al. (2016), the models developed in the literature cannot always be extrapolated to other operating conditions. Battery ageing is usually associated to deep discharges (Guena et al., 2006) or to keeping the battery charge at too high or too low levels (Ju et al., 2018). In the literature it is not common to find mathematical models reflecting the effects of these conditions, it is more usual to find results of experimental tests allowing to fit an approximate curve based on them. Weitzel et al. (2018) propose a mixed integer linear programming model with the aim of solving the scheduling 5.2 Battery operation and degradation. 27 (a) Time-dependent degradation percentage (b) Degradation percentage per ampere hour throughput Figure 3: Degradation problem of a hybrid microgrid and minimizing its operating costs. The study considers the costs associated to the ageing of batteries based on previous literature, which was one of the most significant contributions of the paper. The proposed approach is based on the parametric ageing model described in Sarasketa-Zabala et al. (2016). The article intends to develop a degradation model that can be applied to diverse operating profiles, and tries to find a balance between the accuracy of the model and the experimentation computational effort. The ageing model differentiates between time-dependent and usage-dependent components, which are combined to obtain the total degradation cost as a percentage of the initial battery investment expenditure. This model assumes the hypothesis that the degradation effect is only due to the operation conditions at that moment without taking into consideration the previous state and history of the battery degradation. The time-dependent factor links the ageing of the battery with the storage of energy at high levels or high temperatures. According to equation (5) the percentage of battery lifetime loss is obtained based on the state of charge (SOC) and the temperature at a certain time interval, ∆t. The state of charge is obtained as the ratio between the stored energy at the battery and its full capacity. εcal,t =A·exp(α·SOCt)·exp(−β·T−1) 20%  1 γ·∆t(5) Where SOC is the state of charge, T the operating temperature, assumed to be constant and equal to 25oC and α,β,Aand zare fitting parameters. Figure 3.a shows a graphical representation of this behaviour. The value for these parameters can be found in Appendix I. Regarding battery ageing due to usage, this model is based on the idea that the battery is degraded per each flowed energy unit (ampere hour throughput), since the batteries can be charged and discharged just a certain number of times until they reach their end-of-life, which is usually considered when the battery loses a 20% of its initial capacity. So, the percentage of lifetime loss is obtained as a function of the maximum 28 5 TECHNICAL CONSIDERATIONS depth of discharge and the total energy throughput, measured in ampere-hour. εcyc,t =f(T, CR, DOD, SOC) 20%  1 z·∆Ah (6) Where Tis the operating temperature of the battery, SOC is the state of charge of the battery, DOD is the depth of discharge and CR is the current rate, which is assumed to be constant and equal to 1. For rates of charge in such order of magnitude, the temperature effect can be removed. Therefore, f(T, CR, DOD, SOC) can be expressed as equation (7), being αiand βjfitting parameters.Figure 3.b shows a graphical representation of this behaviour. The value for these parameters can be found in Appendix I. f(CR, DOD) = B·(α1+α2·DOD +α3·DOD0.5+α4·ln(DOD)) ·(β1·CR2+β2·CR +β3) (7) The lifetime loss degradation has a non-linear expression. However, it can be linearized using special ordered sets of type 2. The procedure is detailed in Appendix II and is used to construct the linearized model that is presented in the next section. 29 6 The model This section presents the non-linear mathematical programming model associated to the problem and its corresponding linearization when using special ordered sets of type 2 (see Appendix II). 6.1 The non-linear model First, the notation of the model is introduced and then the constraints and the objective function are described. So, indices, data and parameters and variables are described next. 30 6 THE MODEL Table 1: Table of Notation: Indices and parameters Indices i,Index for each household and school (SC) t,Index for each time interval Parameters N,Number of households and the school T,Number of time intervals Dit ,Household energy demand during the time interval tfor lighting, appliances and heating, ventilation and air conditioning (HVAC) (kWh) PV prodit ,Forecasted energy to be supplied by the photovoltaic energy source of household iin time interval t. (kWh) b costi,Purchase price of the battery in household i(e) cgrid−,Excess energy selling price (e/kWh) cgrid+,t ,Grid energy purchase price in time interval t(e/kWh) Vi,Volume of the DHWH tank in household i(liters) d DHW Hit ,Hot water demand in household iin time interval t(kWh) Textt,Ambient temperature in time interval t(oC) Tmax ,Maximum design temperature of each DHWH tank (oC) Tmin ,Minimum design temperature of each DHWH tank (oC) U,Overall heat transfer coefficient across insulation area(kW/(m2K)) A,Surface area of the DHWH tank (m2) Cp ,Thermal capacity of water (kWh/(kg·K) ρ,Density of water (kg/l) Pmaxi,Maximum electric power of the resistive heating element of the DHWH in household i(kW) P d maxi,Maximum discharge power of the battery in household i(kW) P c maxi,Maximum charge power of the battery in household i(kW) volt n ,Nominal working voltage of each battery (kV) b capacity ,Capacity of the battery in household i(kWh) ηb,Square root of the round trip efficiency (adim.) σ,Self discharge rate of each battery (adim.) UB ,Upper bound A, α, β, T, γ ,Fitting parameters for the time-dependent ageing function B, CR, z, β1, β2, β3,Fitting parameters for the usage-dependent ageing function α1, α2, α3, α4 6.1 The non-linear model 31 Table 2: Table of Notation: Variables grid instit ,Grid energy supplied to the electrical installation of household iin time interval t (kWh) grid bit ,Grid enery used flowed to the battery in household iin time interval t(kWh) grid DHWHit ,Grid energy flowed to the DHWH in household iin time interval t(kWh) PV instit ,Photovoltaic electricity production flowed to the appliances in household iin time interval t(kWh) PV bit ,Photovoltaic electricity production flowed to the battery in household iin time interval t(kWh) PV DHW Hit ,Photovoltaic electricity production flowed to the DHWH in household iin time interval t(kWh) pool instit ,Pool energy flowed to the appliances in household iin time interval t(kWh) pool bit ,Pool energy flowed to the battery in household iin time interval t(kWh) pool DHW Hit ,Pool energy flowed to the DHWH in household iin time interval t(kWh) pool gridt,Pool energy sold to the grid in time interval t(kWh) exc poolit ,Excess energy in household itime interval tflowed to the pool (kWh) Tit ,Temperature of the water stored in the DHWH tank in household iin time interval t(oC) Tsit ,Equilibrium temperature of the water stored in the DHWH tank of household iin time interval t(oC) Peit ,Electric power of the resistive heating element of household iin a time interval t(kW) binstit ,Demand for electrical energy of the appliances in household iserved by its own battery in a time interval t(kWh) b DHW Hit ,Energy demanded by the DHWH system in household iserved by the battery in a time interval t(kWh) SOCit ,State of charge of the battery in household iat a time interval t. It is calculated as a ratio of the stored energy (kWh) to the battery capacity (kWh) P cit ,Electrical power for charging the battery in household iin a time interval t(kW) P dit ,Electrical power for discharging the battery in household iin a time interval t(kW) DODi,Daily maximum depth of discharge of the battery in household i(kW) Ah totali,Total energy cycled through the battery in household i(Ah) SOCMINi,Minimum state of charge of the battery in household i(kWh) SOCMAXi,Maximum state of charge of the battery in household i(kWh) ρ maxit ,   1,If the maximum state of charge of the battery in household i happens in time interval t. 0,otherwise ρ minit ,   1,If the minimum state of charge of the battery in household i happens in time interval t. 0,otherwise ε cali,t(SOCit),Percentage of lifeloss that the battery faces due to staying at a certain SOCit during a time interval t ε cyci(DODi,∆Ahi),Percentage of lifeloss due to all the energy throughput in the day at a certain depth of discharge. 32 6 THE MODEL 6.1.1 Model max T X t=1 pool gridt·cgrid−− N X i=1 (ε cyci(DODi,∆Ahi) + T X t=1 ε cali,t(SOCit)) ·b costi − T X t=1 N X i=1 (grid instit +grid DHWHit +grid bit)·cgrid+,t (8) s.t. Dit +exc poolit =b instit +grid instit +P V instit +pool instit,∀i∀t, (9) PV prodit =P V instit +PV DHW Hit +P V bit,∀i∀t, (10) N X i=1 exc poolit = N X i=1 (pool bit +pool instit +pool DHW Hit) + pool gridt,∀t, (11) ρ·Vi·Cp ·(Tit −Tit−1) = P eit ·∆t−d DHW Hit −UA ·(T sit −T extt)·∆t, ∀i\ {SC},∀t, (12) Peit ·∆t=b DHW Hit +grid DHWHit +PV DHW Hit +pool DHWHit,∀i\ {SC},∀t, (13) Peit ≤Pmaxi,∀i\ {SC},∀t, (14) Tsit =Tit +Tit−1 2,∀i\ {SC},∀t, (15) Tmin ≤Tit ≤Tmax, ∀i\ {SC},∀t, (16) SOCit =SOCit−1·(1 −σ)−1 ηb ·P dit ·∆t b capacityi +ηb·P cit ·∆t b capacityi ∀i∀t, (17) 0≤SOCit ≤1,∀i∀t, (18) P cit ·∆t=grid bit +P V bit +pool bit ∀i∀t, (19) Pdit ·∆t=b instit +b DHW Hit,∀i∀t, (20) P dit ≤P d max, ∀i∀t, (21) P cit ≤P c max, ∀i∀t, (22) DODi=SOCMAXi−SOCMINi,∀i, (23) SOCMINi≤SOCit ≤SOCMINi+UB ·(1 −ρ minit),∀i∀t, (24) SOCMAXi−UB ·(1 −ρ maxit)≤SOCit ≤SOCMAXi,∀i∀t, (25) T X t=0 ρ minit = 1,∀i, (26) T X t=0 ρ maxit = 1,∀i, (27) ∆Ah totali= T X t=1 (1 ηb·P dit +ηb·P cit)·∆t volt n ,∀i, (28) ε cali,t(SOCit)=(A·exp(α·SOCit)·exp(−β·T−1) 0.2)1/γ ·∆t, ∀i∀t, (29) ε cyci(DODi,∆Ah totali) = (f(CR, DODi) 0.2)1/z ·∆Ah totali,∀i, (30) 6.1 The non-linear model 33 f(CR, DODi) = B·[α1+α2·DODi+α3·DOD0.5 i+ +α4·ln(DODi)] ·[β1·CR2+β2·CR +β3],(31) ρ minit{0,1} ρ maxit{0,1} grid instit, grid bit, grid DHW Hit ≥0∀i∀t PV instit, P V bit, PV DHW Hit ≥0∀i∀t pool instit, pool bit, pool DHWHit, pool gridt, exc poolit ≥0∀i∀t Tit, T sit, P eit ≥0∀i∀t b instit, b DHWHit ≥0∀i∀t SOCit, P cit, P dit, DODi≥0∀i∀t Ah totali, SOCMINi, SOCMAXi, ε cali,t(SOCit), ε cyci(DODi,∆Ahi)≥0∀i∀t The objective function of the model and the different constraints are described next. (8) Objective function: The first term corresponds to the energy sold to the grid in every time interval t by its selling price. The second term corresponds to the sum of the degradation cost of each battery.The ageing effects are separated into two components: ε calit, which is the percentage of lifeloss due to staying at certain state of charge (SOCit) during a time interval t, and ε cyci, which is the percentage of lifeloss for every energy throughput unit, both measured in ampere hours, at a certain depth of discharge (DODit). The third term corresponds to the cost of energy that is required from the electric grid multiplied by the grid energy purchase price. (9) Balance equation of household iin each time interval t. Every energy source in each household can provide energy to meet its own electricity demand or to be flowed to the pool. (10) The photovoltaic energy production in household iin each time interval tis used to meet its own energy demand or flowed to the battery or DHWH. (11) The total energy excess can be flowed back to any household in that exact time interval or sold to the grid. (12) The rate of change of internal energy of the DHWH is given by the sum of the energy input,the hot water consumption and the losses to the environment across the insulation area. This model is detailed in the technical considerations’ section. (13) The electrical power input of the DHWH in household iduring a time interval is fed from the battery, 34 6 THE MODEL photovoltaic system, grid or pool. (14) The electrical power of the DHWH in household iin time interval tmust be lower than the maximum design value. (15) The equilibrium temperature of the water in the DHWH in household iin time interval tis the average value of the temperature at the beginning and at the end of the time interval. (16) The temperature of the DHWH must be between the minimum and maximum design values. (17) The state of charge (SOCit) of the battery in household iat the end of the time interval tis the state of charge in the former time interval, considering self-discharge losses minus the energy drawn from the battery and the energy supplied to the battery considering conversion losses for these processes. In this manner, only a percentage of the energy drawn from the battery will be use to meet the energy demands of the household and to heat up the DHWH, and only a percentage of the energy supplied to the battery will indeed charge it. Efficiencies are assumed constant over time. (18) The state of charge of each battery must be between 0% and 100% in every time interval. (19) The electrical power for charging the battery in household iduring a time interval tcomes from either the grid energy, photovoltaic cells or pool. (20) The electrical power for discharging the battery in household iduring a time interval tis the amount of energy discharged from the battery used to meet the energy demands of household ior flowed to the DHWH. (21-22) Both the charge and discharge power of each battery must be lower than a maximum design value. (23) The maximum depth of discharge of the battery in household iis the maximum state of charge of all the time intervals minus the minimum state of charge of all the time intervals. (24) If the state of charge of the battery in household iduring a certain time interval t(SOCit) is the minimum state of charge in the whole period, then SOCMINiwill be equal to SOCit and ρ minit will be equal to 1. (25) If the state of charge of the battery in household iduring a certain time interval t(SOCit) is the maximum state of charge in the whole period, then SOCMAXiwill be equal to SOCit and ρ maxit will be equal to 1. (26) Since ρ minit determines whether the battery in household ireaches its minimum state of charge in time interval t,ρ minit can be non-zero for only one time interval for each household. (27) Since ρ maxit determines whether the battery in household ireaches its maximum state of charge in time interval t, ρ maxit can be non-zero for only one time interval for each household. (28) The total energy cycled through the battery in household imeasured in Ampere hour is equal to the energy charged and discharged from the battery in every time interval tdivided by the nominal voltage 6.2 The linearized model using special ordered sets of type 2 35 (29) Percertange of lifeloss of the battery in household iin time interval tdue to its state of charge. (30-31) Percentage of lifeloss of the battery in household iper energy unit throughput. 6.2 The linearized model using special ordered sets of type 2 The restrictions that model the degradation behaviour of the batteries include non-linearities that need to be transformed in order to be solved using an optimization program. To construct the linearized model, the additional notation in table 3 and 4 table needs to be introduced (see indices, parameters and variables). In the linearized model, the fitting parameters for the ageing function are excluded, and the following parameters required by the special ordered sets of type 2 are added. The variables associated with the percentage of the battery lifetime loss, εcali,t(SOCit) and ε cyci(DODi,∆Ahi) are substituted by the ones that appear in table 4: Table 3: Table of Notation: Indices and parameters for the linearized model Indices s,Index for each SOC breakpoint in the linearization d,Index for each DOD breakpoint in the linearization a,Index for each Ah breakpoint in the linearization Parameters nSOC ,Number of breakpoints across the range of values of SOC nDOD ,Number of breakpoints across the range of values of DOD nAh ,Number of breakpoints across the range of values of Ah total SOCs,S-th breakpoint in the range of values of SOC DODd,D-th breakpoint in the range of values of DOD Aha,A-th breakpoint in the range of values of Ah ε cals,Value of function ε cal for each breakpoint in vector SOCs ε cyca,d ,Value of function ε cyc for each breakpoint in vectors SOCsand Aha 42 7 EXPERIMENTATION (a) (b) (c) (d) (e) Figure 6: Total energy demand in each household in each scenario 7.1 Case study research data 43 Figure 7: Purchase and selling prices from the electric grid 44 7 EXPERIMENTATION 7.2 Results Experimentation was undertaken in an Intel(R) Core (TM) i1-4500 CPU @1.8GHz 2.39GHz RAM 8GB platform. We used Gurobi optimization software version 8.1.0 to solve the linearized model. First, we present the results obtained for each scenario in terms of total energy purchased by the district to the grid, total energy sold to the grid, the total cost (which includes the energy purchase price in each time slot, the energy selling price and the degradation cost of the battery due to the two different factors), the solving time required by Gurobi optimizer software and the gap provided by the optimization software. See table 5. Table 5: Global obtained results for each scenario day Scenario Total sold energy Total purchased energy Cost (profit) Time Gap Day 139 488.41 kWh 65.45 kWh (13.96 e) 620.46 s optimum Day 162 431.77 kWh 108.70 kWh (2.5 e) 900 s 0.3547% Day 196 0 kWh 386.79 kWh 60.5 e900s 0.185% Day 224 207.97 kWh 191.041 kWh 23.9 e900s 0.0234% Day 292 230.47 kWh 112.40 kWh 9.07 e900s 0.0742% Table 5 shows that a very closed to the optimum result was obtained for all the scenarios (even scenario 1 provided the optimum of the linearized model). We selected 900 seconds (15 minutes) to stop the optimization process of the solver, since this is the time slot we stated to take the optimal decisions of the system (a 15- minute slot to state a near real time control system). Note that a rolling horizon scheme is considered allowing to update the input data information periodically. Given this type of rolling horizon the calculations are made for a full day of time intervals ahead. The decisions are taken only for the first period of 15 minutes, since for the next ones the calculations will be carried out again with a full horizon of 96 periods of 15 minutes ahead, and the process will continue on such continuous basis. The consideration of one day horizon (96 periods of 15 minutes) allows reliable photovoltaic energy production forecasting and enough computational capability for the optimizer to provide near-real-time solutions. In those cases, in which the optimum could not be guaranteed, a very tight gap was provided by the optimizer. It demonstrates that the optimizer can manage the operation of the system in near real time. Table 6 provides the results for a monthly scenario. It can be viewed how for every month the amount of energy purchased to the grid is lower than the energy sold to the grid. The difference between the obtained costs and profits is due to the difference between the purchase and selling prices. A (limited) profit was obtained only for months 4 and 5, which are those months with a greater difference between the sold energy and the purchased energy. Regarding the computation of the Gurobi optimizer software, we used as stop criterion a tolerance equal to 0.007. This value provides the computational time and the gap that are shown in the table. The gaps provided by the optimizer show solutions very near to the optimum of the linearized model. The computational time is provided just at the level of informing about the computational effort since the optimizer is not going to work with a so long horizon ever. Being the day a more appropriate 7.2 Results 45 horizon. Table 6: Global obtained results for monthly scenarios Month Total sold energy Total purchased energy Cost (profit) Time Gap 1 5616.87 kWh 3863.01 kWh 468.79e1951.01s 0.76% 2 7613.46 kWh 3938.34 kWh 269.97 e12510.32 s 0.6% 3 8768.47 kWh 3605.84 kWh 130.01 e12395.17s 0.36% 4 10578.40 kWh 2667.90 kWh (67.82) e14545.21s 0.75% 5 11158.02 kWh 2776.76 kWh (74.12) e39449.83s 0.20% 6 10821.18 kWh 4390.34 kWh 257.89 e7007.85s 0.23% 7 9292.65 kWh 5275.23 kWh 498.11 e3124.62s 0.75% 8 8755.19 kWh 6094.28 kWh 667.49 e3045.84s 0.65% 9 7117.69 kWh 5926.7 kWh 716.73 e2995.78s 0.474% 10 6713.74 kWh 4001.69 kWh 402.08 e7989.66s 0.53% 11 5530.53 kWh 4102.35 kWh 459.7 e4501.2s 0.58% 12 4607.84 kWh 4075.11 kWh 469.96 e15133.70s 0.53% Next figure 8 shows the energy sources used for the lighting, appliances and HVAC for the average values of the households and the school. The figure depicts how the households use the grid energy in the night, while they take the energy form the photovoltaic cells during the day and the energy stored at the batteries during the last periods of the afternoon. The energy is sold to the grid in the evening. The pool compensates the energy excess from some households with the lack of energy in others, particularly during the first and last periods of photovoltaic production and during the periods of battery energy usage. The figure shows the results for the following scenarios: Day 139, Day 196 and Day 292 that are considered as the most representative. 46 7 EXPERIMENTATION (a) (b) (c) (d) (e) (f) Figure 8: Demand supply at the households and the school for scenarios 1, 3 and 5 7.2 Results 47 Figure 9 represents the use of photovoltaic energy during the day of each scenario. Photovoltaic energy is used for lighting, appliances, HVAC, DHWH preheating and battery charging. The latter frequently in the last periods of photovoltaic production. The gap between the bars and the production curve shows the amount of energy exported to the pool, whether it is to be sold or to be flowed back into a different household. Graphics are depicted also for scenarios 1 (Day 139), 3 (Day 196) and 5 (Day 292) and they are shown for the average value of the households and the school. The generic behaviour of the batteries is shown in figure 10. These graphics show the charge and discharge power of the battery in an average household through the day of each scenario. Figure 11 shows the state of charge of the batteries in each time interval. Generally, batteries are discharged during the last few hours, when there is no more photovoltaic production and the peak-time tariff for grid energy is applied and are charged during the first hours of the afternoon. This is because batteries are best charged closer to the time of discharge because of the self-discharge they suffer. In scenario 3 (Day 196), where demand is significantly higher than the photovoltaic production, batteries are charged during the peaks of solar production, when there’s excess energy. Results are shown for an average household. In addition, the thermal storage at the DHWH is depicted in figure 12. DHWH are generally switched on at the minimum power to maintain the temperature at their required minimum bound. Around midday, when there is an excess of photovoltaic energy, they are switched on to their maximum power in order to preheat the tank, so the temperature stays between its upper and lower design temperature specifications. The temperature decreases until midnight, when it reaches its minimum temperature and therefore the DHWH is again switched on using grid energy at off-peak tariff. Picture 13 shows the origin of the energy used for heating the tank. It can be observed how in most scenarios the tank is preheated using excess photovoltaic energy around midday and how it uses grid energy in peak hours in order for the temperature to stay within its bounds. On day 196, grid energy at off-peak tariff is use to preheat the tank in order require the least energy during peak hours. Results are shown for an average household. The use of the grid is depicted in figure 14. Grid energy is generally used during night time for lighting, appliances and the HVAC and for keeping the DHWH in its bounds. It is rarely used for battery charging except in the scenario of day 196, when it is charged using grid energy if off-time tariff and used in peak times. Results are shown for an average household. Finally, figure 15 shows the use of the energy that is sent to the pool and that is not sold to the grid. 48 7 EXPERIMENTATION (a) (b) (c) (d) (e) (f) Figure 9: Use of the photovoltaic energy production at an average household and the school for scenarios 1, 3 and 5 7.2 Results 49 (a) (b) (c) (d) (e) Figure 10: Battery charge and discharge at an average household 50 7 EXPERIMENTATION (a) (b) (c) (d) (e) Figure 11: Battery charge and discharge at an average household 7.2 Results 51 (a) (b) (c) (d) (e) Figure 12: Temperature evolution of the DHWH at an average household 58 8 CONCLUSIONS 59 Appendix II: Special ordered sets of type 2: linear approximation of non linear functions. As can be viewed from equations (22-24) in section 4.1.1, the percentage of lifetime loss follows a non linear type dependence of the depth of discharge (DODi) and state of charge (SOCit). This appendix details the procedure to linearize these functions using special ordered sets in order to approximate a linear optimization model of the problem. First, the function is discretized in a certain number of segments depending on the desired accuracy, and the points describing theses fragments are stored in a table. The operating conditions lying between these points are obtained as a linear combination of the two adjacent points. Two types of special ordered set can be distinguished: the so-called SOS1 and the SOS2. According to the former, only one element in the set can be non-zero; according to the latter, a maximum of two adjacent elements can be non-zero. This way, depending on the value taken by these element, a tabled value of the function or the interpolation of two consecutive values will be selected. For example, if the range of values of the state of charge (SOC) are discretized in a 10% step, then the percentage of lifeloss associated with a SOC of 35% will be obtained by interpolating the tabled valued for the degradation function for a SOC of 30% and 40%. The implementation of this kind of variables in a linear programming model is easy by specifying them as SOS1 or SOS2 and the solver software models them using auxiliary binary variables. SOS2 approximation in one dimension Asuming fis a continuous function, and using the set of breakpoints {xi, i = 1, .., N}, the piecewise linear approximation of fcan be obtained as follows (41): ˜ f(x) = N X i=1 λi·f(xi),(41) where (λi)1≤i≤Nis a set of positive weighting factors. The independent variable must also be expressed as a function of λi(42): x= N X i=1 λi·xi,(42) Additionally, condition (43) is added to state that the sum of all the weights amount 1. 60 8 CONCLUSIONS N X i=1 λi= 1,(43) SOS2 approximation in two dimensions Assuming fis a continuous function of two variables xey. The linear piecewise linear approximation can be expressed as follows (44): ˜ f(x, y) = Nx X i=1 Ny X j=1 Ωij ·f(xi, yj),(44) Where Ωij is the set of weighting factors, Nxis the number of breakpoints of x,Nyis the number of breakpoints of y, and the indices iand jrefer to the i-th and j-th breakpoints. Following the same way as in one dimension, the independent variables are expressed as follows (45-46). x= Nx X i=1 Ny X j=1 Ωij ·xi,(45) y= Nx X i=1 Ny X j=1 Ωij ·yj,(46) Additionally, condition (47) is added to state that the sum of all the weights amount 1. Nx X i=1 Ny X j=1 Ωij = 1,(47) And defining two special ordered sets φiand ψias follows (48-49). φi= Ny X i=1 Ωij,∀i(48) ψj= Nx X j=1 Ωij,∀j(49) 61 References AlAjmi, A., Abou-Ziyan, H. & Ghoneim, A. (2016). Achieving annual and monthly net-zero energy of existing building in hot climate. Applied Energy, 165 ,511–521. Bordin, C., Anuta, H. O., Crossland, A., Gutierrez, I. L., Dent, C. J., & Vigo, D. (2017). A linear programming approach for battery degradation analysis and optimization in offgrid power systems with solar energy integration. Renewable Energy, 101, 417-430. Cort´es, P., Mu˜nuzuri, J., Berrocal-de-O, M. & Dom´ınguez, I. (2018). Genetic algorithms to optimize the operating costs of electricity and heating networks in buildings considering distributed energy generation and storage. Computers & Operations Research, 96, 157-172. Di Sommaa, M. ,Yanb, B, Biancoa, N., Graditic, G., Luhb, P.B., Mongibelloc, L. & Naso., V. (2015). Operation optimization of a distributed energy system considering energy costs and exergy efficiency. Energy Conversion and Management 103, 739-751. Di Sommaa, M. ,Yanb, B, Biancoa, N., Graditic, G., Luhb, P.B., Mongibelloc, L., Naso., V. (2016). Multiobjective operation optimization of a Distributed EnergySystem for a large-scale utility customer. Applied Thermal Engineering 101, 752-761. Fernandez, E., Hossain, M. J., & Nizami, M. S. H. (2018). Game-theoretic approach to demand-side energy management for a smart neighbourhood in Sydney incorporating renewable resources. Applied energy, 232, 245-257. Gelazanskas, L., & Gamage, K. A. (2014). Demand side management in smart grid: A review and proposals for future direction. Sustainable Cities and Society, 11, 22-30. Grover-Silva, E., Heleno, M., Mashayekh, S., Cardoso, G., Girard, R., & Kariniotakis, G. (2018). A stochastic optimal power flow for scheduling flexible resources in microgrids operation. Applied energy, 229, 201-208. Guena, T., & Leblanc, P. (2006, September). How depth of discharge affects the cycle life of lithium-metal- polymer batteries. In INTELEC 06-Twenty-Eighth International Telecommunications Energy Conference (pp. 1-8). IEEE. Fatima Harkoussa, Farouk Fardouna, Pascal Henry Biwolec (2018), Multi-objective optimization methodology for net zero energy buildings, Journal of Building Engineering, 16, 57-71. Jiang, Q., Xue, M., & Geng, G. (2013). Energy management of microgrid in grid-connected and stand-alone modes. IEEE transactions on power systems, 28(3), 3380-3389. Ju, C., Wang, P., Goel, L., & Xu, Y. (2018). A two-layer energy management system for microgrids with hybrid energy storage considering degradation costs. IEEE Transactions on Smart Grid, 9(6), 6047-6057. Karunathilake, H., Perera, P., Ruparathna, R., Hewage, K., & Sadiq, R. (2018). Renewable energy integra- 62 8 CONCLUSIONS tion into community energy systems: A case study of new urban residential development. Journal of Cleaner Production, 173, 292-307. Kepplinger, P., Huber, G., & Petrasch, J. (2015). Autonomous optimal control for demand side management with resistive domestic hot water heaters using linear optimization. Energy and Buildings, 100, 50-55. Kylili, A., & Fokaides, P. A. (2015). European smart cities: The role of zero energy buildings. Sustainable Cities and Society, 15, 86-95. L´opez, G., Custodio, V., Moreno, J. I., Sikora, M., Moura, P., & Fern´andez, N. (2015). Modeling Smart Grid neighborhoods with the ENERsip ontology. Computers in Industry, 70, 168-182. Lund, H., Andersen, A. N., Østergaard, P. A., Mathiesen, B. V., & Connolly, D. (2012). From electricity smart grids to smart energy systems–a market operation based approach and understanding. Energy, 42(1), 96-102. Mathiesen, B. V., Lund, H., & Karlsson, K. (2011). 100% Renewable energy systems, climate mitigation and economic growth. Applied energy, 88(2), 488-501. Mathiesen, B. V., Lund, H., Connolly, D., Wenzel, H., Østergaard, P. A., M¨oller, B., Nielsen, S., Ridjan, I., Karnøe, P., Sperling, K. & Hvelplund, F. K. (2015). Smart Energy Systems for coherent 100% renewable energy and transport solutions. Applied Energy, 145, 139-154. Palma-Behnke, R., Benavides, C., Lanas, F., Severino, B., Reyes, L., Llanos, J. & S´aez, D. (2013). A microgrid energy management system based on the rolling horizon strategy. IEEE TRANSACTIONS ON SMART GRID, VOL. 4, NO. 2 E. Pikas, M.Thalfeldt, J.Kurnitski (2014). Cost optimal and nearly zero energy building solutions for office buildings. Energy and Buildings 74, 30–42. Risbeck, M. J., Maravelias, C. T., Rawlings, J. B., & Turney, R. D. (2017). A mixed-integer linear programming model for real-time cost optimization of building heating, ventilation, and air conditioning equipment. Energy and Buildings, 142, 220-235. Sarasketa-Zabala, E., Martinez-Laserna, E., Berecibar, M., Gandiaga, I., Rodriguez-Martinez, L. M., & Villarreal, I. (2016). Realistic lifetime prediction approach for Li-ion batteries. Applied energy, 162, 839- 852. Scognamiglio, A., Adinolfi, G., Graditi, G., & Saretta, E. (2014). Photovoltaics in net zero energy buildings and clusters: Enabling the smart city operation. Energy Procedia, 61, 1171-1174. Tan, X., Li, Q., Wang,H. (2012). Advances and trends of energy storage technology in Microgrid. Electrical Power and Energy Systems, 44, 179-191. Throne-Holst, H., Stø, E., & Strandbakken, P. (2007). The role of consumption and consumers in zero 63 emission strategies. Journal of cleaner production, 15(13-14), 1328-1336. Weitzel, T., Schneider, M., Glock, C. H., L¨ober, F., & Rinderknecht, S. (2018). Operating a storageaugmented hybrid microgrid considering battery aging costs. Journal of Cleaner Production, 188, 638-654. Wells, L., Rismanchi, B., & Aye, L. (2018). A review of Net Zero Energy Buildings with reflections on the Australian context. Energy and Buildings, 158, 616-628. Zakariazadeh, A., Jadid, S., & Siano, P. (2014). Smart microgrid energy and reserve scheduling with demand response using stochastic optimization. International Journal of Electrical Power & Energy Systems, 63, 523- 533. Zhao, B., Zhang, X., Chen, J., Wang, C., & Guo, L. (2013). Operation optimization of standalone microgrids considering lifetime characteristics of battery energy storage system. IEEE transactions on sustainable energy, 4(4), 934-943.