원시데이터 수집 시스템
선정목록으로

Coupled thermo-electrical dispatch strategy with AI forecasting for optimal sizing of grid-connected hybrid renewable energy systems

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Fadi Kahwash — School of Computing, Engineering and Built Environment, Edinburgh Napier University, 10 Colinton Road, Edinburgh, EH10 5DT, UK
  2. Basel Barakat — School of Computer Science, University of Sunderland, Sir Tom Cowie Campus, St Peters Way, Sunderland, SR6 0DD, UK
  3. Alireza Maheri — School of Engineering, University of Aberdeen, King’s College, Aberdeen, AB24 3UE, UK|||School of Engineering, University of Aberdeen, King's College, Aberdeen, AB24 3UE, UK
DOI
10.1016/j.enconman.2023.117460
저널
Energy Conversion and Management
발행년도
2023
발행기관
Elsevier BV
피인용수
35
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.enconman.2023.117460
토픽
Hybrid Renewable Energy Systems
OpenAlex ID
W4385774374

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

초록이 없습니다.

본문 107,131자

본문 펼치기
[Energy Conversion and Management 293 (2023) 117460](https://doi.org/10.1016/j.enconman.2023.117460) Contents lists available at [ScienceDirect](https://www.elsevier.com/locate/enconman) # Energy Conversion and Management journal homepage: [www.elsevier.com/locate/enconman](http://www.elsevier.com/locate/enconman) ## Coupled thermo-electrical dispatch strategy with AI forecasting for optimal sizing of grid-connected hybrid renewable energy systems F. Kahwash <sup>a,∗</sup>, B. Barakat <sup>b</sup>, A. Maheri <sup>c</sup> a _School_ _of_ _Computing,_ _Engineering_ _and_ _Built_ _Environment,_ _Edinburgh_ _Napier_ _University,_ _10_ _Colinton_ _Road,_ _Edinburgh,_ _EH10_ _5DT,_ _UK_ b _School_ _of_ _Computer_ _Science,_ _University_ _of_ _Sunderland,_ _Sir_ _Tom_ _Cowie_ _Campus,_ _St_ _Peters_ _Way,_ _Sunderland,_ _SR6_ _0DD,_ _UK_ c _School_ _of_ _Engineering,_ _University_ _of_ _Aberdeen,_ _King’s_ _College,_ _Aberdeen,_ _AB24_ _3UE,_ _UK_ A R T I C L E I N F O _Keywords:_ Grid-connected Hybrid renewable energy system Clean heat Supervised machine learning Time series forecasting Multi-energy systems 1. Introduction A B S T R A C T In multi-energy systems the full utilisation of the generated energy is a challenge. Integrating heat and electricity supply at the system level design could provide an opportunity to address this challenge. In this paper we introduce and examine two coupled thermal-electrical dispatch strategies for grid-connected hybrid multi-energy systems supplying electrical and thermal demand loads. The dispatch strategy employs forecasting of energy resources and demand loads to prioritise supplying the thermal load in times of renewable surplus. Four forecasting algorithms, namely, baseline forecast, Facebook Prophet (FBP), Neural Prophet (NP), and Long Short-Term Memory model (LSTM) are implemented and used to generate annual forecast data for solar irradiance, wind speed, and thermal and electrical demand loads. To integrate forecast data within the dispatch strategy, new parameters are proposed to quantify the expected available energy within the forecast time horizon. A building complex for the Department of Education in the UK is used for conducting a system design case study. A genetic algorithm-based multi-objective optimisation with the levelised costs of electricity and heat as two objectives is conducted. The results show that the proposed dispatch algorithm produces systems with reduced levelised costs compared to the base case of using utility gas and electricity. Forecasting is particularly useful in reducing cost of heat, as it can prioritise supplying the thermal load in times of renewable surplus. LSTM proved to be the most accurate forecasting algorithm for this case, where the data has strong seasonality and trends. The main contribution of this work is to propose and demonstrate the effectiveness of tightly coupling thermo-electrical dispatch algorithms of HRES from the design stage, and how to effectively integrate forecast data within such algorithms. direct emissions from all public sector buildings by 75% by 2037, investing GBP1.425B in public sector decarbonisation schemes [4]. The cost of renewable electricity generation continues to fall globally. When put in perspective, the decline has been steep over a short period of time. For example, between 2010 and 2021, the global weighted average of levelised cost of electricity for PV fell by 88%, for onshore wind fell by 68% and for offshore wind by 60% [1]. The progress was mainly due to economies of scale, improved capacity factors, and increased competitiveness. On the other hand, the decarbonisation of heat has been advancing at a slower rate than that of electricity, mainly due to slow developments in new technologies and insufficient policy support worldwide [2]. Given that heat (residential and industrial) is the largest portion of the total energy demand of developed economies (roughly half of the energy consumption in the EU [3]), many governments started supporting the transition to clean heating systems. For example, the UK government pledged to reduce ∗ Corresponding author. _E-mail_ _address:_ [f.kahwash@napier.ac.uk](mailto:f.kahwash@napier.ac.uk) (F. Kahwash). Opportunities to tackle the challenge of providing clean energy (electricity, heating/cooling, transport) could be realised by integrating the currently separate energy carriers for electricity, heating, and transport. These systems are called multi-energy systems (MES) [5] or multi-carrier energy systems (MCES) [3]. One of the main aspects of MES is distributed multi generation (DMG) whereby multiple energy vectors are combined to provide several end-products for a spatially defined region (i.e., a building, a district or a region) [6]. Energy systems with multiple generators, including renewables, storage and/or backup have traditionally been termed Hybrid Renewable Energy Systems (HRES) [7]. HRES usually supplied electricity; heating was either not considered or considered as a by-product of the system. However, in the context of increased renewable electricity generation, a promising approach is to integrate different carriers [3]. In [https://doi.org/10.1016/j.enconman.2023.117460](https://doi.org/10.1016/j.enconman.2023.117460) Received 31 March 2023; Received in revised form 23 July 2023; Accepted 24 July 2023 Available online 11 August 2023 0196-8904/© 2023 The Author(s). Published by Elsevier Ltd. [This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-](http://creativecommons.org/licenses/by-nc-nd/4.0/) [nc-nd/4.0/).](http://creativecommons.org/licenses/by-nc-nd/4.0/) _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ the context of electricity-heat integration, there are several hybrid heating technologies that are proposed, such as heat pump and boiler and natural gas boilers equipped with water storage tanks that have electric heating elements and sometimes with variable speed feed pumps [3]. In all these examples, electrification of heat is the overarching theme. The control logic ensuring the balance of supply and demand within MES is called dispatch strategy or energy management strategy. A well designed dispatch strategy is vital, especially when variable renewables are included in the system. In the context of grid-connected HRES, the performance of the system is critically linked to the energy pricing structure. Variable tariffs have been shown to be beneficial for the adoption of HRES by improving the capacity factors and economic value of HRES. In this context, Zhang and Tang [8] proposed two power management strategies of grid-connected PV system with battery storage. The strategies are developed to work with ‘time of use’ tariff and ‘step’ tariff within the Chinese market. times and levels of energy storage as opposed to export back to the grid are controlled to achieve maximum economic gain for the household. Bigger returns were observed when grid prices were higher. Liu et al. [9] developed an innovative MES for high-rise buildings in congested coastal cities (Hong Kong as a case study). The model includes a high-penetration renewables grid coupled with pumped hydro storage in the building and hydrogen production fuelling hydrogen taxis outside the building. They performed multi-objective optimisation to find the optimal size of the pumped hydro storage system. A novel Time of Use (ToU) tariff structure is proposed and studied along an existing flat rate tariff structure. The use of pumped hydro storage was found to improve self-consumption by 12% and reduce energy bills by around 24%. Different concepts were proposed for MES for residential energy application. Zhao et al. [10] proposed a household multi-energy system using electric-gas heating and cooking appliances and other domestic electric loads. The renewable energy comes from rooftop PV panels. They developed energy management strategies with the aid of Markov chains and a deep reinforcement learning algorithm. The objective was to minimise the cost of energy of the household. The load scheduling algorithm was made up of fixed loads, power-shiftable loads such as space heating and cooling, and time-shiftable loads such as washing machines. Niveditha et al. [11] studied grid-connected HRES of netzero energy buildings with added objective of minimisation of the total energy transfer between the grid and the building. This applies to imports and exports to reduce the burden on the grid and maximised the self-sufficiency of the building. Studies with larger end-user, such as a district MES were also proposed. Tostado et al. [12] presented a multi-energy micro-grid model that combines electricity, hydrogen, and natural gas as energy carriers. The interfaces between the different carriers include electrical energy storage, gas to electricity converter (e.g. a turbine), electricity to gas converter (e.g. alkaline electrolysis) and electricity to hydrogen (e.g. electrolyser). The multi-energy microgrid also contains provision for electrical vehicles charging. The energy management system was tested on loading cases in the summer and winter. Combined Heat and Power (CHP) is probably the oldest MES concept. For example, Thompson et al. [13] studied the feasibility of installing different configurations of renewable-biomass-storage to supply rural community in Canada. Biomass was found to be most economical, given that the study was in 2009 and renewable technology prices were significantly higher than the present. More recently, Ma et al. [14] explored different HRES-CHP combinations for grid-connected systems that supply residential districts in seven Chinese cities. PV-microturbine systems were deemed to be more feasible in most locations with occasional backup from the grid. Similarly, Shah et al. [15] used HOMER software to study the performance of PV+ storage +CHP +boiler in three regions of the USA (hot, mild, and cold). The system was off-grid supplying residential load. High renewable penetration was achieved in all three locations. However, the coupling between thermal and electrical loads was not considered. Given the many possible MES configurations and the complexity of the interaction between supply and demand of different technologies, arriving at the optimal size in a given situation is a challenging task. Evolutionary algorithms and linear programming remain a popular choice. Gabrielli et al. [16] studied a multi-energy system with seasonal thermal storage to supply electricity and heat to a region in Switzerland. The system was grid-connected to gas and electrical networks and included several storage and conversion technologies such as gas turbines, fuel cells, and power-to-gas. The work focused on proposing an optimisation framework that is accurate and computationally efficient. They achieved this by proposing a two novel Mixed Integer Linear programming models. It was found that the proposed system reduced cost and emissions and that it was more suited to high penetration renewable scenarios. He et al. [17] proposed a system with wind and PV panels and thermal storage of molten salt that is charged by electric heater and discharged by driving steam Rankine cycle. Heat is also supplied from the storage. for the multi-objective optimisation, they used NSGA-III combined with principal component analysis and technique for order preference by similarity to an ideal solution to evaluate and select a solution. The system was able to cover most of electricity and heat load, except occasionally in the night. Furthermore, the system had better economic and environmental performance than traditional power system. Shen et al. [18] studied optimal sizing of electrical and thermal energy storage within a multi-energy system supplying a small community. The grid-connected multi-energy system consisted of PV panels, a gas turbine, and a CHP unit. To coordinate the sizing and operation of the system, they proposed a two-stage stochastic programming model. It was found that addition of storage improves the performance of the energy system, and that the thermal inertia of the heat network provides more flexibility of the system and the balancing between supply and demand. Balancing the supply and demand can be challenging as they might have a significantly different patterns. For example, the pattern of demand in commercial building will be stirred by the working hours and holidays. Machine Learning (ML) algorithms can help in analysing the various patterns and forecast demand and supply [19]. For ML algorithms, to accurately forecast the future, it requires a dataset that has a large number of precise measurements. .3 The dataset would be used by the ML to model the data and ‘learn’ the different patterns. Afterwords, the learned patterns can be used to predict the future measurements. The pattern of generated energy from renewable resources, depend on the source of the energy. Predicting the energy generated by wind turbines can be achieved by forecasting the wind speed (as shown in Section 2, which had been studied in several publications using a wide range of methodologies such as support vector machines in [20], deep neural networks [21], and recurrent neural network (RNN) [22]. Similar approaches had been proposed been used to forecast the solar irradiance [23,24]. A wide range of algorithms had been proposed in the literature to forecast the electrical and thermal demands, such as econometric and time series models, neural networks and fuzzy logic [25]. The importance of forecasting the supply and demand is easy to see when integrating it to the energy systems as shown in the work of Zhang et al. [26], artificial neural networks was used to forecast solar irradiance, wind speed and ambient temperature. The forecasting data was used for optimal sizing of a stand-alone solar wind hydrogen HRES. The objective was to minimise the Total life cycle cost of the system. It was found that the use of forecasting data combined with the evolutionary search algorithm improved the sizing algorithm and resulted in systems with smaller Total Life Span Cost (TLSC) while maintaining the Loss Power Supply Probability (LPSP) at low levels. Recently, Kahwash et al. [27] applied AI-enabled forecasting with multi-objective optimisation in sizing Grid-connected HRES in the context of healthcare facilities in the UK. The study found that PVgrid systems were most economically feasible given the relatively high _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ prices of battery storage. The cost competitiveness of different solutions were mapped for five years and provided a basis to choose larger PV systems than would be justified based on optimising in the present. However, the study focused on electrical load only. Pascual et al. [28] proposed an energy management system for residential microgrid supplying renewable electricity and heat. The proposed system achieved lower costs by reduction of the battery sizes required to balance the grid-connected system. The proposed energy management system seeks to balance the electrical grid by utilising batteries, thermal storage, and forecasting. However, the algorithm is uncoupled since it calculates the electrical balance first and then the thermal balance. The configuration is (PV + WT + Bat) with thermal storage (with immersion heater) and solar water heater. The coupling of the thermo-electrical system was done through thermal storage and battery. As was shown in this introduction and in previous work by the authors [27], hybrid heating arrangements (excess renewable + boiler) are effective in reducing the overall cost of energy and emissions of the heating loads. However, the heating energy dispatch strategy was not coupled with the electrical energy management strategy; leading to large amount of renewable electricity to be dumped or higher usage of boiler. The aim of this paper is to reduce the overall cost of energy for consumers by introducing a strongly coupled grid-connected HRES to supply electricity and heat. This aim will be achieved by (i) developing a coupled thermo-electrical energy dispatch strategy that is capable of managing a complex HRES with grid connections while reducing the levelised cost of energy. (ii) Incorporation of generation and consumption forecasting by means of machine learning into the coupled dispatch strategy. The rest of the paper is organised as follows. Section 2 presents the methodology of power and cost calculations of the HRES, followed by the proposed coupled dispatch strategy algorithms and multi-objective optimisation problem formulation using Genetic Algorithm. In order to investigate the effect of foretasting, two versions of the dispatch strategy, namely with and without forecasting are explained. The consumption and generation data are then presented along with the various machine learning algorithms used in producing the forecasting data. Section 3 begins by showing the forecasting data and discusses the accuracy of the different machine learning algorithms used. Then, the optimum solutions for the two novel dispatch strategies are presented and compared in detail. The effect of cardinal parameters on the results is discussed, including the forecasting horizon and the energy cost. In Section 4, concluding remarks, critique of the results and future research directions are presented. 2. Methods _2.1._ _HRES_ _system_ _architecture_ The proposed thermo-electrical HRES consists of renewable generators (wind turbine and PV), storage (battery bank and thermal storage tank) and fossil fuel back up generators (CHP and boiler). Fig. 1 shows a schematic of the proposed system architecture. PV and battery bank are connected on the DC side, while the wind turbine and CHP are connected on the AC side. DC and AC bus are connected through bidirectional converter. The system can import and export electricity to the grid with the same capacity. The thermal system has three sources, namely, heat from CHP that passes to the thermal system through a heat exchanger, the excess electricity which provides thermal energy through an electrical heating element, a boiler that will cover the thermal load in times of scarcity of other sources. _2.2._ _Power_ _modelling_ _2.2.1._ _Wind_ _turbine_ The wind power output is calculated from tabulated data of the form _???_ = _?_ ( _?ℎ??_ ). The values are normalised with respect to the rated power. The power output is calculated by linear interpolation of the normalised power curve, then multiplying by the rated capacity of the wind turbine. This approach is accurate for modelling different sizes of small wind turbines typically used in HRES. The wind velocity at hub height is calculated from the logarithmic law of wind shear [29]. _2.2.2._ _PV_ _panels_ The power output of the PV panels can be calculated from the following equation [30] _???_ = _?????_ _???_ (1 + _??_ ( _??_ - _??,???_ )) (1) where, _???_ [m <sup>2</sup> ] is the surface area of the PV panels, _??_ [W/m <sup>2</sup> ] is the global irradiance incident on the plane of the PV panel, _???_ is the system efficiency; _??_ [%∕ _?_ <sup>◦</sup> ] is the panels’ temperature deration coefficient; _??_ is the temperature of the cell surface and _??,???_ is the temperature of the cell surface at Standard Test Conditions (STC). The last term in Eq. (1) takes into account the effect of ambient temperature on the efficiency of the panels by introducing efficiency correction term proportional to the difference in cell surface temperature between the standard test conditions and the prevailing cell temperature onsite. The model assumes that Maximum Power Point Tracking is included, so as to obtain maximum output at each irradiance level. _2.2.3._ _Battery_ _bank_ In this study, we consider single-node storage model to calculate the battery’s State of Charge (SoC) as follows [31,32] _???_ ( _?_ ) = _???_ ( _?_ - _??_ )(1 − _?_ ) + <sup><u>(</u></sup> <sup>_<u>?</u>_</sup> <sup><u>−</u></sup> <sup>_<u>?</u>_</sup> <sup><u>) ×</u></sup> <sup>_<u>??</u>_</sup> _????????????_ _????_ (2) where, _?_ is the internal self-discharge rate of the battery; _??_ is the interval at which measurements are taken. In this work, _??_ = 1 h unless otherwise stated. The term ( _?_ - _?_ ) _??_ is the net energy flow into the battery bank during one hour. The term _????,???_ = _????????????_ is the nominal capacity of the battery bank and _????_ is the round-trip efficiency of the battery. At each timestep in calculating the battery’s SoC, two quantities are needed, namely, the extractable power from the battery _????,?_ and the power required to fill up the battery _????,?_ . They are calculated as follows: _????,?_ = <sup>(</sup> _??????_ - _????_ - _??_ _????,?_ = <sup>(</sup> _????_ - _??_ - _??????_ ) _????,???_ (3) ) _????,???_ (4) _2.2.4._ _Grid_ _power_ In this work, the system can interact with the grid in a bi-directional manner. Electricity is imported from the grid to provide the balance of energy, when all system generators are unable to cover the load. In times of high generation and low demand, excess electricity can be exported back to the grid. Exports and imports are capped at the same level. This is assumed to be equal to the maximum electrical demand onsite. This is a reasonable assumption given that grid circuit breakers are sized to fulfil the entire electrical demand in the absence of all other sources. Transmission losses for imports and exports are neglected. _2.2.5._ _CHP_ _unit_ A Natural gas CHP unit is used in the system to provide electricity in times of low renewable generation and heat through waste heat recovery. Usually, heat can be recovered from engine coolant cycle, engine lubrication cycle, and exhaust flue. Overall efficiency of such systems is often in excess of 80% [33]. The electrical power output of _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 1. Schematic of system architecture. the CHP can be calculated using the Heaviside step function as follows: _??ℎ?_ ( _?_ ) = <sup>[</sup> _??ℎ?,?_ ( _???_ ( _?_ ) − _??ℎ?,?_ ) × _???_ ( _?_ )( _??ℎ?,?_ - _???_ ( _?_ )) <sup>]</sup> _???_ ( _?_ )( _???_ ( _?_ )) (5) where, _??ℎ?,?_ is the nominal electrical capacity of the CHP unit. Fuel consumption and thermal output were calculated following the procedure in [7]. _2.2.6._ _Boiler_ A boiler is used to supply the thermal load in the absence of electrical heating or storage. The boiler is assumed to run on natural gas, which is the most common type in areas with existing gas networks. The efficiency of the boiler is considered to be constant in this study and used to calculate the power of the boiler as follows [34] _??_ = <sup>_??ℎ_</sup> <sup>(</sup> <sup>_?_</sup> <sup>)</sup> _??_ (6) coefficient for the tank walls, and the tank is assumed to be cylindrical with a length equal to the diameter. _2.3._ _Coupled_ _thermo-electrical_ _dispatch_ _strategies_ In this section, the novel energy dispatch strategies are presented. At the beginning, several variables are proposed to enable the effective utilisation of the forecasting data into the strategies. Then the algorithms are described. _2.3.1._ _Expected_ _utilisation_ _ratios_ Assuming that the controller implementing the dispatch strategy has access to forecast data of renewable generation and demand up to _?_ number of hours ahead. The window of time at which the forecast data are available to the controller is called the _the_ _forecasting_ _horizon_ . Consequently, we propose a variable called _expected electrical utilisation_ _ratio_ . At each time step of the calculation, it can be estimated as: (9) where, _??ℎ_ is the thermal load and _??_ is the efficiency of the boiler. Fuel consumption is calculated as follows: _?????_ = <sup>3600 ×</sup> <sup>_??_</sup> (7) _???_ where, _???_ is the lower heating value of the fuel. _2.2.7._ _Thermal_ _storage_ _tank_ The thermal storage is a cylindrical water-based tank. To calculate the energy balance, a single-node, fully mixed model is adopted. The tank runs between two predefined setpoints (in this study 45 <sup>◦</sup> C and 75 <sup>◦</sup> C) [35]. The temperature of the tank is calculated according to the following formula: ∑ _?_ _̂_ _??_ = _?_ = _?_ +1 _̂_ <sup>_??,?_</sup> <sup>+</sup> <sup>_??,?_</sup> _̂_ ~~∑~~ _?_ _?_ = _?_ +1 _̂_ <sup>_???,?_</sup> _<u>??</u>_ _???_ ( _?_ ) = _???_ ( _?_ - _??_ ) + _?????_ ( _???_ - _?????_ - _?????_ ) (8) where, _?_ is the current time of calculations; _?_ is the forecasting horizon in hours; _̂ ??_ is the forecasted renewable generation within the specified horizon; _??,?_ is the extractable power from the battery at the current time; and _?_ = _?_ + 1, which means that the forecast data start one hour ahead of the current timestep. At each point in time, the value of _?_ will help determine the priorities of the algorithm. In the case where _?>_ 1+TOL, the forecasted available energy will surpass the forecast demand over the chosen horizon. In this case, less priority will be given to charging the battery and more priority will be given to fulfilling thermal loads. TOL is a small positive number used to account for uncertainty in the forecast results. Similarly for the thermal load, we define _expected_ _thermal_ _utilisation_ _ratio_ as: where, _???_ (K) is the average temperature in the tank, _???_ (kg) is the mass of water in the tank, _??_ (J/kg-K) is the heat capacity of the water, _???_ is the input heat into the tank (from CHP, or excess electricity), _?????_ is the heat loss from the walls of the tank and _?????_ is the thermal load served. Losses are calculated based on an average heat transfer <sup>(</sup> <sup>_̂??,?_</sup> <sup>−</sup> <sup>_̂ ???,?_</sup> <sup>)</sup> <sup>_,_</sup> <sup>0</sup> + _??,?_ ~~∑~~ _?_ ) max (∑ _?_ _?_ = _?_ +1 <sup>(</sup> <sup>_̂??,?_</sup> <sup>−</sup> <sup>_̂ ???,?_</sup> <sup>)</sup> <sup>_,_</sup> <sup>0</sup> (10) _??_ = _?_ = _?_ +1 _̂_ <sup>_??ℎ,?_</sup> _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Table 1 <u>Subscripts</u> <u>used</u> <u>in</u> <u>DiStr1</u> <u>and</u> <u>DiStr2</u> <u>algorithms.</u> _Subscript_ _Meaning_ _Subscript_ _Meaning_ _??_ available (existing - minimum) _?_ full (max - existing) _??_ storage tank _???_ export _????_ dumped energy _?_ battery ↑ charging ↓ discharging _??_ Boiler _??_ critical where, _??,?_ is the extractable thermal energy from the storage tank, and _??ℎ,?_ is the forecast thermal demand. The first term in the numerator is the forecasted net surplus in renewable generation after fulfilling electrical load. Whenever this quantity is positive, the surplus is diverted to fulfil the thermal loads. The max function is used to exclude the negative values, in which case there is no electrical surplus available for thermal demand. In the case where _?>_ 1 + TOL, the forecasted available energy will surpass the forecast demand over the chosen horizon. In this case, less priority will be given to charging the tank and more priority will be given to charging the battery. When the demand is very small or zero, _?_ → ∞, in this case, a large value is enforced to prevent the existence of ∞ in the calculations. This does not affect the operation of the algorithm, given that any value beyond 1 + TOL will trigger the same response (i.e., reduced priority). Finally, it is worth noting that non-renewable thermal sources (e.g. boiler and CHP) are not included in Eq. (10). This is mainly due to their dispatchability. _2.3.2._ _Storage_ _level_ _indicators_ Storage level indicators are proposed here to quantify the urgency of charging one of the two storage technologies. The _electrical_ _storage_ _level_ _indicator_ _?????_ is a set level where _??????_ ≤ _?????_ ≤ _??????_ In this study, _??????_ = 0 _._ 3 and _??????_ = 1. When the battery’s _???_ falls below the value of _?????_, charging the battery becomes a priority when a surplus generation exists. Similarly, the _thermal_ _storage_ _level_ _indicator_ _???_ where _????_ ≤ _???_ ≤ _????_ In this study, _????_ = 45 <sup>◦</sup> C and _????_ = 75 <sup>◦</sup> C. When the temperature of the water in the tank falls below the value of this parameter, charging the tank becomes a priority when there is extra electrical/thermal power. In this study, the critical level is set as average of the minimum and maximum values for the battery and tank. _2.3.3._ _Renewable_ _surplus_ _generation_ To simplify the energy balance calculations, we define the following variables: _?ℎ?_ ( _?_ ) = _??_ ( _?_ ) − _???_ ( _?_ ) − _??ℎ_ ( _?_ ) (11) _??_ ( _?_ ) = _??_ ( _?_ ) − _???_ ( _?_ ) (12) When _?ℎ?_ _>_ 0, it means there is a renewable generation surplus over the combined electrical and thermal demand (complete surplus). When _??_ _>_ 0, this indicate surplus of renewable generation over electrical demand only (partial surplus). _?ℎ?_ is a subset of _??_ (if _?ℎ?_ _>_ 0 then _??_ _>_ 0 but not vice versa). _2.3.4._ _DiStr1:_ _Coupled_ _thermo-electrical_ _dispatch_ _strategy_ The coupled dispatch strategy without forecast is shown graphically in Fig. 2. In general, the symbol _?_ refers to electrical supply, and _?_ to thermal supply. Electrical and thermal loads are indicated by _???,_ _??ℎ_, respectively. The use of ( _?_ ) indicates calculations over timesteps (i.e. every one hour in this study). Subscript used in Figs. 2,3, are shown in Table 1. At each timestep, initial quantities are calculated, such as renewable power and available energy stored in the battery bank and thermal storage tank. The controller then checks if there is total surplus ( _?ℎ?_ _>_ 0), partial surplus ( _??_ _>_ 0) or a deficit ( _??_ ≤ 0). In the times of surplus energy, priority is given to the battery, then to the storage tank and then to exporting back to the grid. When there is a deficit and there is enough capacity in the storage, it will be used. If the electrical deficit is large, the CHP is switched on. If the thermal deficit is large, the boiler is switched on. When CHP is switched on, heat supply from it will be prioritised to charge the tank. However, the CHP will not be switched on in case of thermal deficit alone, since in general, the efficiency of the boiler is higher than CHP. As can be seen, there is strong coupling between the electrical and thermal systems since the controller will take decisions after considering the state of both sub-systems in how to optimally balance the supply and demand. _2.3.5._ _DiStr2:_ _thermo-electrical_ _dispatch_ _strategy_ _with_ _supply_ _and_ _demand_ _forecasting_ The graphical representation of DiStr2 is shown in Fig. 3 and in Appendix A. Similarly to DiStr1, the controller starts by calculating current state variables, including expected utilisation ratios (see Section 2.3.1), and storage level indicators (see Section 2.3.2). In case of complete surplus, there are two final states: (i) priority for thermal storage charging, or (ii) priority for battery charging. The former is triggered when _?_ is large, _?_ is small and _???_ _<_ _???_ . The latter is triggered in all other situations. If surplus power remains after fully charging the battery and tank, excess will be exported. If there is further excess, it will be dumped. In case of partial surplus, electrical load is covered as a priority. If there is expected surplus, the combined partial surplus and tank will be used to cover the thermal load; otherwise, the boiler will be switched on to cover the thermal deficit. In case of deficit, the priorities are similar to DiStr1, except in cases where CHP is switched on and there is expected electrical deficit, then the CHP is run as maximum capacity to charge the battery. CHP run with better efficiency at higher loads. In case of thermal deficit only, the boiler is switched on. _2.4._ _Cost_ _modelling_ To estimate the economic viability of the HRES, the system cost are estimated. The cost components considered in this study are: (i) Capital, (ii) Fixed Operation and Maintenance, (iii) Variable Operation and Maintenance, (iv) replacement, and (v) salvage costs. Over the life of the project, all cost components are combined to give the Total Life System Cost (TLSC) and then the annualised system cost _????,???_ . The calculations followed the procedure in [7]. In the current coupled system, the levelised cost of energy has two components, the levelised cost of electricity (LCE) and levelised cost of heat (LCH). The annualised cost for electrical components _????,?_ is calculated separately and the heat from the CHP is treated as revenue. LCE is calculated as follows [34,36]: _???_ = _????,?_ - _?ℎ_ × _?_ <sup>′</sup> _<u>?ℎ</u>_ _???_ - _????_ (13) The second term in the numerator is the avoided cost of heating by utilising heat from the electrical side of the system. Heat is treated as a by-product. The denominator represents the total served electrical energy (total load - unmet load). _?ℎ_ [ $∕kWh] is the cost of producing one kWh of heat using the boiler [34] _?ℎ_ = _?????_ × 3600 (14) _??_ × _???_ where, _??_ is the boiler efficiency. The LCH can be calculated in a similar way by using the annualised cost of the thermal equipment and treating the electricity produced by the CHP as revenue to be deducted as follows [7] _???_ = _????,?ℎ_ - _??_ × _?_ <sup>′</sup> _<u>??</u>_ _??ℎ_ - _???ℎ_ (15) _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 2. Flowchart of the coupled dispatch algorithm without forecast (DiStr1). Fig. 3. Simplified flowchart of the coupled dispatch algorithm with forecasting (DiStr2), details of the three main decision branches are shown in Appendix A. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Table 2 <u>Cost</u> <u>parameters</u> <u>used</u> <u>in</u> <u>the</u> <u>optimisation</u> <u>simulations.</u> _Component_ _Capital_ _cost_ _(CC)_ _Installation_ _(IC)_ _Var_ _O_ _&M_ _Fixed_ _O&M_ _Replacement_ _Nominal_ _life_ _Wind_ _turbine_ 0.85 ($∕ _????_ ) [1] 0.75 x CC 0 0.002 ($∕kWh) (CC+IC) 25 years _PV_ _Panels_ 50 ($∕m <sup>2</sup> ) [1] 2 x CC 0 2 ($∕m <sup>2</sup> ) (CC+IC) 25 years _Battery_ _bank_ 350 ($∕kWh)[38] 0.5 x CC 0 0.01 x CC (CC+IC) 15 years or 3000 cycles _Grid_ 0 0 0.35($∕kWh) 0 0 25 years [37] 0.065($∕kWh) [39] _CHP_ 0.75 ($∕ _????_ ) [40] 1.0 x CC 0.1 ($∕m <sup>3</sup> ) [37] 0.02 ($∕hr) (CC+IC) 15000 h _Boiler_ 0.2 ($∕ _????_ ) [7] 0.2 x CC 0.1 ($∕m <sup>3</sup> ) [37] 0.002 x CC (CC+IC) 10 years _Therm._ _storage_ 2 ($∕kg _?_ ) [7] 0.2 x CC 0 0.01 x CC (CC+IC) 25 years In this case, _??_ is the cost of importing from the grid, which is avoided by switching the CHP on. _?_ <sup>′</sup> _??_ <sup>is the total avoided electrical imports from</sup> the grid. _2.4.1._ _Parameters_ _of_ _cost_ _modelling_ Accurate cost parameters are crucial for accurate optimisation. The parameters used in cost modelling are presented in Table 2. High prices for grid imports and natural gas are currently prevailing in the UK [37] and are expected to rise further in the near future. The life of battery bank is determined by nominal life (in years) or by throughput (in cycles), i.e. the total energy that cycled through the battery. The dispatched energy to and from the battery bank is monitored and the replacement is calculated based on the minimum of either the nominal life or the throughput. _2.5._ _Multi-objective_ _optimisation_ The sizing of the HRES is formulated as a multi-objective optimisation problem. It is solved using the genetic algorithm (GA) coded in MATLAB R2018a. The code utilises the built-in GA optimiser, which uses a controlled, elitist genetic algorithm. It favours individuals with greater fitness and individuals who can help increase the diversity of the population, even if they have a lower fitness value [41]. Using the built-in GA optimiser also enables using the parallel computing capabilities of MATLAB, which significantly reduces the computation time. LCE (Eq. (13)) and LCH (Eq. (15)) are chosen as the two objectives of the optimisation. Given the coupled nature of these two objectives, it is expected that a negative correlation exists. The larger the electrical side of the system will result in more renewable and CHP heat and this in turn means higher LCE and lower LCH. There are six design variables, representing the main system components sizes as follows: ? = { _???,???,_ _???,_ _????,_ _??ℎ?,?,_ _???,_ _??_ } The search space’s lower bound _⃗_ ? <sup>_?_</sup> = ? . This allows the optimiser to eliminate any component that is not effective. The upper bound for each component is calculated as follows: Table 3 <u>Main</u> <u>parameters</u> <u>for</u> <u>GA.</u> _GA_ _parameters_ _Value_ _GA_ _parameters_ _Value_ Objectives [LCE, LCH] Max number of generations 800 Population size 400 Convergence criteria 1 × 10 <sup>−5</sup> Constraints tolerance 1 × 10 <sup>−5</sup> Pareto fraction 0.5 Crossover fraction 0.8 Max number of stalled generations 140 Variables lower bounds ? <sup>_?_</sup> Variables upper bounds ? <sup>_?_</sup> optimisation. The solution converged when the average change in the Pareto solution was less than 1 × 10 <sup>−5</sup> (convergence criteria) over 140 generations (maximum number of stalled generations). Given the large search space, the population size and maximum number of generation was chosen to be high to ensure convergence. These parameters were chosen after extensive numerical experiments to find the right balance between accuracy and computational time. The optimisation problem can then be formulated as follows: { min } _???_ ( ? _⃗_ ) _,_ _???_ ( ? _⃗_ ) S.T. ∑ _?_ _?_ _???_ ≤ _?????_ (17) { ? <sup>_?_</sup> = _???._ max( _???_ ) _,_ 1000 where, <sup>∑</sup> _?_ <sup>_?_</sup> <sup>_???_</sup> <sup>is</sup> <sup>the</sup> <sup>total</sup> <sup>(thermal</sup> <sup>and</sup> <sup>electrical)</sup> <sup>blackout</sup> <sup>hours</sup> <sup>in</sup> the year. _2.6._ _Forecasting_ _algorithms_ _2.6.1._ _Forecasting_ _pipeline_ To calculate the values of _?_ and _?_, the forecast of supply and demand must be accurate. The forecast in achieved by the pipeline shown in Fig. 4. The first step is i. data collection in which it is critical to collect an accurate data from the site. The collected data should have measurements for both the demand (electrical and gas) and the supply (wind speed and solar irradiance). The datasets also must have a common periods in which they have readings (especially if the data were collected from various sources), and this common duration must be ‘long’ enough to train the forecasting models. _2.6.2._ _Data_ _collection_ _case_ _study:_ _Department_ _for_ _education_ _building_ _in_ _Darlington,_ _UK_ To validate the proposed methodology we have applied the dispatch strategy on a building of the UK’s department for education in Darlington, UK. The building is no longer in use. It was chosen due to the availability of long term, half hourly Electrical and thermal consumption data between 2011 and 2015 [42]. The building is located at (54.523, −1.552). It has a central heating system for domestic hot water and space heating and is fully air conditioned. The building hosted around 400 employees that had access to the building between the morning and night and no usual access during weekends. The hourly values of irradiance and wind speed is taken from the online database PVGIS for the same location [43]. The readings are logged in the Radiation database: PVGIS-SARAH database. The set has reading from 1st of January 2011 until 31st of December 2015. It ∑24 _?_ =1 _???,?_ _????,???_ 8 _???._ max( _???_ ) _,_ _????_ 1000 _,_ _??ℎ?_ max( _???_ ) _,_ 1000 (16) } _???_ ∑24 _?_ =1 _??ℎ,?_ _???,???_ , <sup>_??_</sup> <sup>max(</sup> <sup>_??ℎ_</sup> <sup>)</sup> 1000 The various _?_ parameters are reserve factors between 1.1 and 2. They are used to expand the search space, which allows exploring different architectures (e.g. a system with very large wind turbine could be beneficial for the thermal side). The PV upper bound equation is multiplied by 8, which represent the conversion factor between area and nominal power of the PV panels (8 m <sup>2</sup> ≈1 kW). The division over 1000 indicates that the step size s is 1 kW rather than 1 W. The upper bound for storage is calculated based on autonomy days, which is taken = 2 in this study. Table 3 shows the main parameters used in the _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 4. Forecasting main steps. four parameters: G(i) Global incident irradiance (Wh/m <sup>2</sup> ), _????_, the elevation angle (deg), T2 m: the air temperature at 2 m height ( <sup>◦</sup> C) and WS10 m: wind speed at 10 m height (m/s). _2.6.3._ _Pre-processing_ To ensure that the collected datasets are suitable to the learn from, we must ‘clean’ the data. This is done by formatting the data and joining various tables (if necessary) to form a well-structured dataset. The energy loads datasets and the supply data have different time scales, thus we have converted the loads data which has half-hourly readings to hourly readings as the supply only has hourly one. Then we defined the training period to be starting from 1st of April 2011 until 31st of December 2012. While the testing dataset is between the 1st of January 2013 until the 31st of December 2013. These periods where chosen as they are common in both datasets. The common period is 1005 days in total thus 24 121 h (or data points). Afterwards, the dataset will be split into training set and testing set, where training period starts from 1st of April 2011 until 31st of December 2012. While the testing dataset is between the 1st of January 2013 until the 31st of December 2013. Thus the training set is approximately 65% of the data and the test set is 35%. It is worth mentioning that the length of the sets are determined by the required forecasting horizon for the optimisation, as shown in the next sections. To optimise the learning, it is important to make sure the training dataset are standardised, which can be achieved using the standard scalar [44], as follows: _?_ ( _?_ ) = <sup><u>(</u></sup> <sup>_<u>?</u>_</sup> <sup><u>(</u></sup> <sup>_<u>?</u>_</sup> <sup><u>) −</u></sup> <sup>_̄ ?_</sup> <sup><u>)</u></sup> ; (18) _?_ where _̃_ _?_ ( _?_ ) is the normalised value, _?_ ( _?_ ) is the recorded value, _̄_ _?_ is the mean value, and _?_ is the standard deviation value. If the dataset has outliers, it is critical to eliminate them, which can be done using the Winsorization technique [45]. The Winsorization technique replaces the highest and lowest _?_ % of the data by the 100 − _?_ % the data. The _?_ value can be determined by analysing the datasets, usually it is between 0% and 10%. _2.6.4._ _The_ _models_ _training_ We have implemented four forecasting algorithms, i.e., Baseline forecast, Facebook Prophet (FBP) [46], Neural Prophet (NP) [47], and Long Short-Term Memory model (LSTM) [48]. The baseline model uses reading from the past year, thus assuming that there would not be a significant difference between the years. The FBP uses a time series model with three main model components: trend, seasonality, and holidays as follows [46], _????_ ( _?_ ) = _?_ ( _?_ ) + _?_ ( _?_ ) + _ℎ_ ( _?_ ) + _?_ (19) where _?_ ( _?_ ) is the forecast value at time _?_, _?_ ( _?_ ) is the trend function that models the non-periodic changes, _?_ ( _?_ ) is the seasonality function where _̂_ _??_ refers to the _?_ th forecasted value (hour in this case), knowing that _??_ {1 _,_ 2 _,_ … _, ?_ }, where _?_ is the number of forecasted values in the that models the periodic changes, _ℎ_ ( _?_ ) represents the holidays, and _?_ represent the error. Neural Prophet (NP) is an extension for the FBP which incorporate deep learning algorithms and the FBP model to improve the forecasting accuracy [47]. Its forecasted value is obtained by _???_ ( _?_ ) = _?_ ( _?_ ) + _?_ ( _?_ ) + _?_ ( _?_ ) + _?_ ( _?_ ) + _?_ ( _?_ ) (20) where _?_ ( _?_ ) is the Trend at time _?_, _?_ ( _?_ ) is the Seasonal effects at time _?_, _?_ ( _?_ ) is the Event and holiday effects at time _?_, _?_ ( _?_ ) is the Regression effects at time t for future-known exogenous variables, _?_ ( _?_ ) is the Autoregression effects at time _?_ based on past observations, and _?_ ( _?_ ) is the Regression effects at time _?_ for lagged observations of exogenous variables. In our implantation of FBP and NP, we adapted the parameters depending on the used dataset. For example the public holidays and weekends would only affect the forecasting for the electric and thermal loads. The LSTM is an artificial neural network that has feedback connections [48]. It is one of the most used architectures for recurrent neural network (RNN) that can process not only single data points (such as images), but also entire sequences of data (such as time-series, speech or video) [49]. The connection weights and biases in the network change once per episode of training, and the activation patterns in the network change once per time-step. The used LSTM network has a single input feature and a single output. The input layer a sequence layer followed up by an Keras LSTM layer [50]. Then a dense layer. The solver is adaptive moment estimation (Adam), that was trained for 20 epochs. To optimise the number of neurons used, we conducted a grid search, whose results are shown in Table C.7. _2.6.5._ _Post-processing,_ After generating the forecasted values, we have applied a postprocessing step, in which we have inverted the standardisation done on the pre-processing step, and replaced any negative value with a zero. This step helps to increase the accuracy of the forecasting as the data should not include negative values. _2.6.6._ _Evaluating_ _the_ _accuracy;_ The accuracy of the forecasted values were evaluated using widely used metrics, i.e., the determination coefficient (R <sup>2</sup> ), Mean Absolute Error (MAE), Root Mean Square Error (RMSE) and normalised RMSE (nRMSE). The R <sup>2</sup> is calculated as follows: _?_ <sup>2</sup> = 1 − ∑ _?_ _<u>?</u>_ <u>=1</u> <sup>(</sup> <sup>_̂??_</sup> <sup>−</sup> <sup>_??_</sup> <sup>)2</sup> ~~∑~~ _?_ _?_ (21) _?_ =1 <sup>(</sup> <sup>_̄?_</sup> <sup>−</sup> <sup>_??_</sup> <sup>)2</sup> _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 5. Solar irradiance and wind speed values between 01/04/2011 and 01/01/2014 (a) Global irradiance Power (wh/m <sup>2</sup> ) and (b) Total Wind Speed at 10 m (m/s). Fig. 6. Electrical and Gas consumption between 01/04/2011 and 01/01/2014 (a) Electricity Consumption (b) Gas Consumption. future (forecast horizon). The measured value is _??_ . The mean measured ∑ _?_ value _̄_ _?_ is calculated by _̄_ _?_ = _?_ <sup><u>1</u></sup> _?_ <sup>_??_</sup> <sup>.</sup> The forecast error indicates the difference between the forecasted values and the measured ones, are evaluated using the MAE and the RMSE, that is calculated using: ∑ _?_ _̄_ _̄_ _?_ _???_ = <sup><u>1</u></sup> _?_ ∑ _?_ _?_ =1 | _̂??_ - _??_ | (22) Table 4 <u>Descriptive</u> <u>statistics</u> <u>for</u> <u>the</u> <u>used</u> <u>datasets</u> <u>after</u> <u>removing</u> <u>the</u> <u>outliers.</u> Solar Wind Gas Electricity Mean 126.14 4.45 173.92 145.33 Std 214.82 2.26 301.78 92.92 Min 0 0.03 0 0 Q25% 0 2.69 0 79.3 Q50% 0 4.07 0 97.6 Q75% 158.02 5.9 204.1 225 Max 849.48 10.37 1114.15 354.3 Count 24121 24121 24121 24121 Initially we stared the analysis by pre-processing the datasets, as the electrical and heating demands data where half-hourly reading, we added them to have hourly reading similar to the supply datasets. The solar irradiance and total wind speed are shown in Fig. 5, and the electrical and heating demands are presented in Fig. 6. As observed in Figs. 5,6, there is significant outliers in the datasets (especially the electrical demand) which might have occurred because of a high intensity loads. Thus in we have applied an outlier filter on the datasets to reduce the affect of this outliers on the forecasting. The outliers were removed using Winsorization technique to replace the top 2% of the data with the value of the data at the 98th percentile [45]. Removing the outliers can help the forecasting algorithms to obtain accurate results; hence, the training dataset would be more constant and representative of the datasets. Table 4 presents the descriptive statistics of the data after removing the outliers. The datasets have different patterns; for example, if we consider the supply data, the global irradiance value is approximately zero after sunset; on the other hand, it varies during the daytime, while the wind speed varies most of the time. The average wind speed is 4.923 m/s and _????_ = √ _?_ =1 √ √ √ <sup><u>1</u></sup> _?_ ∑ _?_ ( _̂??_ - _??_ ) <sup>2</sup> (23) _?_ =1 The RMSE is a commonly used performance metric, as it shows the absolute error value and highlights the large errors while minimising the small ones. As we have different dataset with different scales it is insightful to have an error metric that can be used for the comparison, thus we are using the normalised RMSE ( _?????_ ), which shows the error normalised by the interquartile range ( _???_ ) as follows: _?????_ = <sup>_<u>????</u>_</sup> (24) _???_ where _???_ = _?_ 3 − _?_ 1 _?_ 3 and _?_ 1 refers to the third and first quarterlies. 3. Results _3.1._ _Exploratory_ _data_ _analysis_ The used data consist of four sets, two representing the energy sources, i.e., global solar irradiance and wind speed, the other two sets represent the energy consumption, i.e., electrical and heating demands. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 7. Gas and electrical demand per hour (a) gas consumption per hour (kW) and (b) electricity consumption per hour (kW). Fig. 8. Gas and electrical demand per day (a) gas Consumption per hour (kW) and (b) electricity consumption per hour (kW). Fig. 9. Monthly energy consumption (a) gas consumption per hour (kW) and (b) electricity consumption per hour (kW). Fig. 10. Solar irradiance and wind speed values per hour (a) global irradiance (wh/m <sup>2</sup> ) and (b) wind speed at 10 m (m/s). _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 11. Solar irradiance and wind speed values per month (a) global irradiance power (w/m <sup>2</sup> ) and (b) total wind speed at 10 m (m/s). maximum value of 16.28 m/s. Furthermore the mean and median of the Solar and Gas data significantly differ, which indicates that the data is skewed and not normally distributed (The histograms of the datasets are presented in Appendix B). Consequently the forecasting algorithms must be suited to non normally distributed data. Given the nature of the building, it starts to be heated around 7:00am just before office workers start their working day. The heating load continues to decrease throughout the day as shown in Fig. 7-a. This is probably caused by the heating from office activities, including the presence of large number of employees and visitors with computers, printers and other office equipment. The electrical consumption coincides with the usual working hours in offices, where the demand is highest between 8:00 and 18:00 as shown in Fig. 7-b. Thermal and electrical loads are affected by work days. As shown in Fig. 8-a, the thermal load is minimised in the weekend. While Mondays have the highest thermal consumption, therefore the in-building temperature would be at its lowest point after the building has not been heated on the weekend. The electric load is usually lower during the week; however, since the electric load is generated by devices (such as PCs) that might be kept working over the weekend, it is not significant as in the heating load, as shown in Fig. 8-b. Heating load observe strong seasonality as shown in Fig. 9-a. Where highest demand is in January reaching maximum of around 90kWhth. The daily pattern is similar across the seasons with a spike in the morning. While the electrical load has a similar pattern through the months with a slight increase in winter as shown in Fig. 9-b. This could be caused by the reduced natural lighting. To assess the big picture and understand the loads pattern, we combined the data shown in Figs. 7 and 9. Strong seasonality is evident in the thermal load with minimum consumption in July and maximum in January. Electrical load showed the same seasonality trend with significantly reduced magnitude. This could be explained by the increased need for lighting in the winter. The energy supply data patterns different than the generation one, as it not affected the working hours and holidays. The global irradiance is affected by sunrise and set, as shown in Fig. 10-a, thus most of the power is generated between 7 AM and 5 PM. While the wind power is not as significantly affected by the sun rise and set, but nevertheless we can still observe the slight increase in it toward midday, as shown in Fig. 10-b. The irradiance and wind power are affected by the seasons, as in the summer months the number of daylight hours are much larger than in the winter hours, as shown in Fig. 11-a. On the other hand, the wind speed increases in the winter months as shown in Fig. 11-b. To understand the relation between the different datasets, we have conducted Pearson correlation analysis [51]. The analysis results presented in Fig. 12, shows the correlation between different datasets. For example, the positive correlation between the global irradiance and the Fig. 12. Correlation heat-map for all the used features from the datasets. Table 5 Comparison of forecasting algorithms, showing the coefficient of determination _?_ <sup>2</sup> for <u>the</u> <u>forecast</u> <u>horizon.</u> Dataset Baseline Baseline’ FBP FBP’ NP NP’ LSTM Gas 0.10 0.16 0.33 0.29 0.26 0.15 0.84 Electric −2.60 −0.13 −5.64 −0.07 −0.89 −1.33 0.97 Wind −0.73 −0.70 −0.58 −0.74 −0.11 −0.06 0.99 Solar 0.09 0.12 0.45 0.45 −0.86 −0.74 0.77 sun height (G(i) and _????_ ), also we can see the negative colouration between the gas usage and the temperature (Gas and T2 m). _3.2._ _Forecasting_ _results_ Initially we conducted a comparative study for the forecasting algorithms with and without eliminating the outliers to find the most accurate forecast. The results for Baseline’, FBP’, and NP’, refers to applying the algorithms to the datasets after eliminating the outliers. The _?_ <sup>2</sup> results are summarised at Table 5. The LSTM has the highest accuracy in most cases. As can be observed, the _?_ <sup>2</sup> performance for the wind is considerably higher than the other data, as its distribution is close to the normal distribution. The significant outliers in the electric load (shown in Fig. 6) affected the forecasting performance, which explains the difference in the FBP and FBP’ performance. The forecasting error evaluated using the MAE, RMSE, and nRMSE is shown in Figs. 13–15. As shown in Table 5, and Figs. 13, 14, and 15, the LSTM has the most accurate forecasting. As it is a RNN which is ideal for sequential data, and in our case, its short and long term memory is particularly _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Table 6 <u>Best</u> <u>solution</u> <u>for</u> <u>each</u> <u>dispatch</u> <u>strategy</u> <u>from</u> <u>Pareto</u> <u>front.</u> DiStr _???_ _???_ _????_ _??ℎ?_ _???_ _??_ ( - ) (kW) (m <sup>2</sup> ) (- ) (kW) (ton) (kW) 1 345 2878 103 81 24.5 1719 2 395 3869 129 105 14.3 1685 Fig. 13. Forecasting accuracy evaluated using the Mean Absolute Error (MAE). Fig. 14. Forecasting accuracy evaluated using the Root Mean Squared Error (RMSE). Fig. 15. Forecasting accuracy evaluated using the normalised Root Mean Squared Error (nRMSE). useful as the data has strong seasonality and trends. Consequently we used LSTM to forecast the resources and demand, and use the generated data in DiStr2 dispatch strategy. _3.3._ _Optimised_ _solutions_ _comparison_ The forecasted data presented in Section 3.2 are used in DiStr2 algorithm (see Section 2.3.5). The optimisation is carried out using DiStr1 and DiStr2 as per Section 2.5 and the results are shown in Fig. 16. The DiStr2 is generally producing better results, especially with respect to LCH. The spread of the front is larger for DiStr1 than DiStr2. This might be explained by the fact that closer integration of the thermal and electrical side in DiStr2 is causing LCE and LCH to be less conflicting than in the case of DiStr1. The horizontal and vertical lines represent the base case scenario when there is no HRES; i.e., electricity from the grid only and heating using a gas boiler. It is clear that most of the solutions are superior to the base case for both electricity and heat. It is also worth noting that the LCH falls below the zero line, where is it expected that the system will generate revenue based on the heating subsystem. This is a consequence of Eq. (15), where the generated electricity revenue from the CHP system is subtracted from the cost of heating. When the CHP generation is high, the system is theoretically generating profits. Another important metric to evaluate the solutions is TLSC. This parameter will show the overall cost of the system regardless of the energy produced. The Pareto solutions shown in Fig. 16 were ranked based on TLSC and the minimum solutions are highlighted in black, representing ‘best’ solution for each DiStr. The configuration of the two ‘best’ solutions is shown in Table 6. DiStr2 solution contains larger renewable generation and battery storage, while the DiStr1 solution contains larger thermal storage and boiler. This indicates that the DiStr2 solution has a higher proportion of clean heat than the DiStr1 solution. Fig. 17 shows the boxplots for LCE (left) and LCH (right) for Pareto solutions as a function of the dispatch strategy. For LCE, the median for DiStr1 is 0.548$/kWh and for DiStr2 is 0.166$/kWh. 32.5% of the solutions of DiStr1 fall below the grid cost, whereas 100% of the solutions of DiStr1 fall well below the grid cost. As for LCH, The median drops from −0.0173$/kWh to −0.0318$/kWh for DiStr1 and DiStr2, respectively. In both cases, 100% of the solutions are below the base case of using gas boiler only. The savings in gas consumption and the revenues from electrical generation of CHP contribute to the cost reduction of heat generation. Fig. 18 shows the effect of dispatch strategy on the optimum system size of each component. Some of the notable differences can be summarised as follows: - DiStr2 produced systems with smaller batteries and larger storage tanks. - Renewable generation components were generally higher in DiStr2 than DiStr1. - Increased reliance on CHP in DiStr2 causes increased revenues and therefore reduction in LCH. - Both systems relied on large boilers that can serve more than 90% of the maximum thermal load. This is attributed to the large spike in demand in the early morning, making a large boiler the best choice. To study the difference between the ‘best’ solutions shown in Table 6, we show the electrical and thermal generation share differences in Fig. 19. On the electrical side, most of the generation is local with about 13% and 7% imported from the grid for DiStr1 and DiStr2, respectively. CHP contributed 32% and 28% for DiStr1 and DiStr2, respectively. Given the relatively low operating cost of the CHP using natural gas, it is an attractive solution for a case with large thermal load like our case study. Battery storage contribution was small with 1.5% and 6.3% for DiStr1 and DiStr2, respectively. This could be attributed to the fact that excess electrical production has multiple uses, such as export back to the grid or be used in the thermal system. Given that the two optimum systems have slightly different component sizes, it is expected that the contribution of each technology would be different. For example, DiStr2 resulted in larger renewables and that is reflected in the larger share in both electrical and thermal demands. On the other hand, majority of the thermal load was covered by the boiler (around 64% in both cases). For both solutions, the boiler has enough capacity to cover the entire thermal load for _>_ 90% of the time throughout the year. The nature of the thermal load, with large demand in the early morning hours and then no demand in the night favours the highly dispatchable gas boiler. Renewables contributed 9% and 12% respectively. CHP contributed around 18% in both cases, whereas, storage contributed 10% and 6% for DiStr1 and DiStr2, respectively. The similarity is explained by going back to Fig. 16. It is clear that the two ‘best’ solutions have similar LCH but different LCE. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 16. Pareto front for the two dispatch strategies. The vertical line is the cost of electricity imported from the grid, the horizontal line is the cost of heating using gas boiler only. The two lines represent the ‘base case’ scenario. The blacked circle and triangle show the ‘best’ solution of each Pareto front. DiStr1 solutions extend to around _???_ = 1, but were omitted for better clarity. Fig. 17. Boxplot for LCE and LCH as a function of the dispatch strategy. The central red mark indicates the median bounded by a box showing the 25th and 75th percentiles. The whiskers extend to the most extreme data points not considered outliers. The horizontal black dashed lines indicate the ‘‘business as usual’’ scenario, where grid/gas are used exclusively. Fig. 18. Boxplot showing the spread nominal size of each component as a function of the dispatch strategy. Values are taken from the Pareto solutions shown in Figure 6. DiStr2 returns smaller battery bank size, larger tank and larger CHP size. This reflects increased ranking of thermal storage and increased revenues from the thermal system which favours larger CHP units. _3.4._ _Performance_ _comparison_ _of_ _dispatch_ _strategies_ To compare the behaviour of the proposed dispatch strategies, an hourly data comparison on sample dates is done. The dates are chosen to highlight the difference between the two dispatch strategies, namely by choosing time with high renewable generation. In other situations, the two strategies behave similarly. Figs. 20 and 21 show the electrical energy balance during the same 2-day period in January, for DiStr1 and DiStr2, respectively. The main difference between the two algorithms is in the charging priority during _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 19. Generation share relative to the total load of (a) electrical and (b) thermal systems for the best two systems shown in Table 6 as a function of the dispatch strategy. times of renewable energy surplus. DiStr1 always prioritises charging of the battery and then the thermal storage (note the green bars between hours 5 and 11 in Fig. 20). Conversely, in DiStr2, when the algorithm is expecting surplus renewable generation, it will divert the excess electricity towards the thermal side by fulfilling the load directly and then charging the tank (note the light blue bars between hours 5 and 17 in Fig. 21). When there is expected deficit (Hours 24 to 28 in Fig. 21), DiStr2 charges the batteries. The behaviour of the thermal system at the same interval under DiStr1 and DiStr2 is shown in Figs. 22 and 23, respectively. The main difference shown is that renewable contribution is larger for DiStr2 than DiStr1 (note the difference in hours 3 to 12). This is the period when DiStr2 expected surplus electrical generation, so it kept the battery at minimum and diverted the excess energy to partially fulfil the large, coexisting thermal load. Another difference is noted between hours 24 and 26. DiStr1 diverted more surplus to the thermal side than DiStr2. This is caused by the prediction by DiStr2 of deficit on the electrical side, and therefore prioritising of battery charging at that particular time. It should be noted that in the majority of the time, DiStr1 and DiStr2 will behave in a similar way; the difference is most obvious in times of large surplus followed by sustained deficit. _3.5._ _Performance_ _of_ _the_ _GA_ _optimiser_ Establishing the robustness of the optimiser is an important step to ensure accurate results. Ideally, exhaustive search should be carried out to check where the GA solutions are located within the entire search space. However, in our case, the search space is prohibitively large. This is a result of the system being in the order of 10 MWh/day. The upper bound of the search space is set at [ 751 _,_ 6002 _,_ 8470 _,_ 413 _,_ 2583 _,_ 1787 ] and the lower bound is zero for all components. Given increments of 1 applied to each of the components, there will be 7 _._ 2781×10 <sup>19</sup> solutions in the search space. This is clearly infeasible to solve exhaustively. Alternatively, we chose to repeat the optimisation multiple times and examine the variations in the obtained solutions. For each dispatch strategy, 10 repetitions were made. A curve fit is constructed and is shown in Fig. 24 with coefficients with 95% confidence bounds. The goodness-of-fit measures are for DiStr1, _?_ <sup>2</sup> = 0 _._ 9968 _,_ _????_ = 0 _._ 0007515 and for DiStr2 _?_ <sup>2</sup> = 0 _._ 9933 _,_ _????_ = 0 _._ 002359. DiStr1 was generally better fit than DiStr2, mostly in the top left region where most of the solutions show an infliction point (change in direction of curvature). This is shown in the values of RMSE, where DiStr2 is larger by one order of magnitude than DiStr1. This shows that the setting chosen for the GA are suitable and gives better confidence in the results. _3.6._ _Effect_ _of_ _forecasting_ _horizon_ _on_ _DiStr2_ _solutions_ The forecast horizon _?_ is a critical parameter affecting the performance of DiStr2. To understand its effects, the optimisation is run using [DiStr21 4 7and10 varied13 16 the19 horizon22]. The samein theoptimisationset: _?_ parame-∈ ters mentioned in Table 3 are maintained for these simulations. Fig. 25 shows the main effects plots of LCE and LCH as a function of the forecasting horizon. The total Pareto solutions are used in constructing each point (200 solutions each point). There is a clear inverse relationship between the two measures, which supports the notion that the two costs are conflicting in a coupled system. The suitable horizon was chosen _?_ = 13, giving a compromise between computational efficiency and accuracy. Larger horizon values will increase the computational runtime due to the averaging of more points at each iteration of the simulation (refer to Eqs. (9),(10)). Fig. 26 shows the effect of the forecasting horizon length on the values of _?_ . The top figure shows the balance between renewable supply (in black) and demand (in green). The dashed lines show the forecasted values and the solid lines show the actual values. The bottom figure shows the corresponding values of _?_ at the same time interval for _?_ = [1 _,_ 7 _,_ 13 _,_ 19] hours. The other hours are omitted for clarity of the plot, however, the same analysis still hold. It can be seen that longer horizon values causes _?_ to dampen and shift ahead of the actual surplus and deficit, as per the direction of the black arrow on the Figure. This is expected as _?_ is a summation, so larger horizons will contain both surplus and deficit therefore dampening it around _??ℎ??_ . Smaller horizon are more accurate (for example, compare the actual surplus in sub- Fig. 26-a during hours 34–42 with the values of _?_ at _?_ = 1 in sub- Fig. 26-b). However, as will be shown later, better prediction accuracy does not necessarily lead to better management of the surplus. The effect of the forecast horizon on the storage technologies in the system (batteries and tank) is shown in Fig. 27. In sub Fig. 27-a, the total energy stored in batteries and thermal tank is plotted against the forecast horizon. Generally, the electrical energy is decreased and thermal energy increased with increased forecast horizon. This is in line with the findings from Fig. 26, in which longer horizons produce ‘smoothed’ _?_ that spread the expected surplus over a longer period of time. This in turn, will cause more energy to be diverted to the thermal side, since the surplus forecast will reduce the priority of battery charging. In sub Fig. 27-b, the effect of the horizon on the frequency of empty storage is shown. As the horizon increases, the number of hours where the battery is flat increases from around 1100 h to 1600 h, while the thermal tank at minimum temperature will reduce in frequency from 290 h to around 230 h. This trend is broadly in _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 20. DiStr1 electrical energy balance (top) and corresponding battery’s SoC (bottom) on 25–26 Jan. The system component size vector is [556 _,_ 3449 _,_ 1635 _,_ 110 _,_ 1830 _,_ 2429]. The forecasting horizon is 13 h. This figure should be compared with Fig. 21. Fig. 21. DiStr2 electrical energy balance (top), corresponding battery’s SoC (middle) and the values of the electrical utilisation factor ( _?_ ) for the same system and parameters, and over the same period as in Fig. 20. As long as ( _?_ ) is in the green region, fulfilling thermal demand is prioritised over charging the battery. Compare the SoC between the two figures. agreement with the change in dispatched energy with the length of the horizon. Fig. 28, shows the effect of the forecasting horizon on the battery charging decision. One day with surplus renewables is chosen to highlight the differences. Sub Figs. 28-b-c show that shorter horizons will produce more accurate prediction of the onset of deficit. Longer horizons causes premature prediction of deficit and leading to the battery charging priority to go up at the expense of the tank. _3.7._ _Effect_ _of_ _electricity_ _and_ _gas_ _prices_ _on_ _the_ _optimised_ _solutions_ Finally, we study the effect of electricity import price ( _???_ ) and gas price ( _????_ ) on the optimum solutions of the system. In both cases, the price level is changed separately and the GA optimisation is run. _???_ is studied at four levels, while _????_ is studied at five levels. The price of electricity imports is changed within the set: _???_ = [ 0 _._ 15 _,_ 0 _._ 25 _,_ 0 _._ 35 _,_ 0 _._ 45 ]. The base level of 0 _._ 35 $∕kWh is the current prevailing price in the UK [37]. The lower two levels are reflective of historical electricity prices that were prevailing in the last two decades [52]. The highest level represent expected rise in electricity price based on long term trends [27]. The price of natural gas imports is changed within the set: _????_ = [ 0 _._ 06 _,_ 0 _._ 1 _,_ 0 _._ 14 _,_ 0 _._ 18 _,_ 0 _._ 22 ]. The base level that was used in all previous simulations is (0 _._ 1 $∕kWh). The lowest value was chosen to correspond to the gas price in the period 2014–2020, when low and stable prices prevailed. The higher values are chosen to anticipate more volatile markets with price hikes [52]. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 22. DiStr1 thermal energy balance (top) and corresponding tanks temperature (bottom) on 25–26 Jan. The dashed lines are the maximum and minimum tank temperature. The system component size vector is [556 _,_ 3449 _,_ 1635 _,_ 110 _,_ 1830 _,_ 2429]. The forecasting horizon is 13 h. This figure should be compared with Fig. 23. Fig. 23. DiStr2 thermal energy balance (top) and corresponding tanks temperature (bottom) on 25–26 Jan. The dashed lines are the maximum and minimum tank temperature. The system component size vector is [556 _,_ 3449 _,_ 1635 _,_ 110 _,_ 1830 _,_ 2429]. The effect of _???_ is summarised in sub Fig. 29-a. Average LCE increased around 3 times, while LCH reduced from 0.05 to −0.07 $∕kWh. The imports from the grid directly affects the electrical side, however, at higher prices, the optimum system configuration returns larger CHP units, which generates revenue causing the LCH to drop. The effect of _????_ is summarised in sub Fig. 29-b. LCE and LCH increase with increased gas price. The LCE increase stabilises at high _????_, while LCH keeps on rising. This alters the optimal configuration by reducing the CHP and boiler sizes as shown in Fig. 30). The effect of gas price on average system sizes is shown in Fig. 30. Generally, higher gas price resulted in lower component size for CHP and renewables. The drop in CHP size is expected as it becomes less competitive technology with increased gas price. The decrease in renewables could be explained by the increased imports from the grid and decreased exports. Higher prices of gas are making importing from the grid more attractive. In the case of higher gas prices, this is expected to affect the price of electricity imports from the grid. However, in this section we assumed the price of electricity imports to be fixed. At the highest price level, the size of the boiler is significantly reduced. It is compensated by an increase in renewable generation and thermal storage. Fig. 31 shows the effect of electricity prices on the average size of the components. A strong negative correlation is noticed for wind turbine and PV array sizes. This could be related to the smaller difference between imports and exports at the lower electricity costs. Given that the export price was kept constant at 0 _._ 065 $∕kWh, there is an incentive to export large quantities of electricity back to the grid, when the difference between the import and exports is small. This effect becomes negligible when the import price becomes significantly higher. On the other hand, positive correlation exist between the cost of electricity and storage size (both electrical and thermal), and also with the CHP capacity. Higher electricity price creates incentive to minimise imports from the grid by storing the excess renewable energy and producing local power using the CHP, with the relatively cheaper natural gas. Fig. 32 shows the interaction with the grid (imports and exports) as a function of _???_ and _????_ . In Sub- Fig. 32-a, both components drop in _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 24. GA Optimiser performance for DiStr1 and DiStr2 showing the best fit line, a two-term power fit. Ten repetitions for each Dispatch strategy. The _?_ <sup>2</sup> value is above 0.99 in both cases. Fig. 25. Main effects for LCE (left axis) and LCH (right axis) as a function of the forecasting horizon, note the different scales. The black line indicate the chosen horizon value. There is clear conflict between LCE and LCH. Given that LCE is larger in absolute values, it was given larger weight in the choice of the horizon. tandem with increased price level. The reduction of imports is directly related to the increased price. On the other hand, the reduction of the exports is somewhat surprising, given the expectation of increased renewable and local generation. By comparing with Fig. 31, the sizes of renewable generation is reduced with increased imports and at the same time the size of electrical and thermal storage in the system is increased. This indicate that higher grid import prices, coupled with unfavourable export rates (0 _._ 065 $∕kWh) will push the system to act as a stand-alone system by minimising interaction with the grid. The increased cost of storage is offset by reduction in renewable generators size. The effect of _????_ on imports and exports is shown in Sub- Fig. 32b. Increased gas prices will make the imports from the grid more favourable, and will therefore reduce local generation and push the exports down. Finally, the effect of _???_ and _????_ on local fuel consumption (CHP and boiler) is and is shown in Fig. 33. As _???_ increases the boiler consumption decreases and the CHP consumption increases. This is agreement with decrease in boiler and increase in CHP unit nominal capacity, as shown in Fig. 31. In addition, the increase in CHP generation will be used in covering the thermal load and therefore reducing the need for boiler. As for _????_, the ratio of CHP consumption to boiler is around 4 to 6. This indicates that the CHP consumption is the dominant component. The total consumption peaks at 0.14 and then drops at 0.18 and 0 _._ 22 $∕m <sup>3</sup> despite sharp increase in the consumption of the boiler. 4. Final remarks and conclusion In this work, we studied grid-connected HRES supplying heat and electricity to a large commercial building. We developed two dispatch strategies, a coupled thermo-electrical (DiStr1) and a coupled thermoelectrical with forecasting of generation and demand data (DiStr2). A case study of a governmental building in the UK is chosen, in which long term electrical and thermal consumption data are openly available. We produced forecasting data for electrical and thermal loads, in addition to solar and wind resources. We compared the accuracy of four forecasting algorithms i.e, Baseline, FBP, NP, and LSTM. The most accurate forecasting data were used in the dispatch strategy DiStr2. We carried out extensive multi-objective optimisation simulations with LCE and LCH as objectives; including sensitivity analysis of the most important parameters on the results (forecasting horizon, gas price, and electricity price). We found that in general, DiStr2 produced cheaper systems, especially in terms of LCH. LSTM algorithm produced the most _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 26. (a) Actual and forecast generation (black) and consumption (green) for a sample two-day period in February and (b) the corresponding values of _?_ at different horizon lengths. Values below _??ℎ??_ indicate expected renewable generation deficit. Longer horizons dampen and shift _?_ values ahead of the actual surplus/deficit as per the direction of the black arrow. Fig. 27. Effect of forecast horizon on (a) the total energy stored in battery (blue) and tank (red) and (b) the annual number of hours of minimal charge of battery (blue) and tank (red). Longer horizons tend to decrease the forecast deficit and therefore reduce the battery charging priority. This is shown in the downward trend of the battery energy in subfigure (a) and in the increased frequency of flat battery in subfigure (b). accurate forecasting among all the studied algorithms. Forecasting horizon, price of gas and price of electricity imports have strong influence on the results. Given the low cost of renewable generation, the system is feasible in most of the studied levels. However, the studied parameters will have a big impact on the component sizes of optimum system in each case. The contribution of this work can be categorised in two domains: (i) energy management of HRES and (ii) AI-enabled forecasting of generation and consumption data. In the energy management domain, two novel and tightly coupled dispatch strategies were developed and implemented. Excess electrical renewable energy was treated as a source of electricity and heat at the same time. Generation and demand _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 28. Effect of forecast horizon on battery charging during high renewable generation. Subfigure (a) shows the actual and forecast supply vs demand. Subfigure (b) shows the battery charging with DiStr2 at different forecasting horizons and subfigure (c) shows the values of _?_ corresponding to the forecasting horizon values in (b). The arrows show when the deficit is expected in each case. The system under study is shown in Table 6 for ‘DiStr2’. Longer horizon predict the deficit earlier leading to increase in the battery charging priority over the storage tank. Fig. 29. Main effects plots for LCE and LCH as a function of (a) the electricity imports price and (b) the gas price.. forecasting are integrated into the optimiser. Furthermore, the proposal of theoretical parameters of expected utilisation factors improved the integration of forecasting data in energy management algorithms. As was shown in Fig. 16, levelised cost of electricity and heat were in general reduced (especially heat), confirming the effectiveness of this approach. In the AI domain, the work stands out by conducting comparative study using four forecasting algorithms. Furthermore, both generations (solar and wind) and consumption (electrical and thermal) were forecasted using all four algorithms. To the best knowledge of the authors, this has not yet attempted in the context of HRES. The detailed analysis of prediction errors provided valuable insights into the strengths and weaknesses of each algorithm. Given the specific nature of each datatype, this contribution will help future studies in choosing the most appropriate forecasting method for renewable generation and energy demand datasets of commercial applications. The conflict between the optimisation objectives (LCE and LCH) stems from the one-way coupling of generation (electrical-to-thermal), whereby increased on-site electricity generation will increase LCE and decrease LCH. The opposite is not true; the boiler can only provide thermal energy and the CHP is governed by the electrical deficit, not the thermal one. The chosen load profile of a commercial office complex was a deliberate choice, given that such buildings usually have a dedicated equipment room, a large roof space, and potentially surrounding empty space (e.g. a green space or car parking area). This enables the installation of the proposed HRES. However, the proposed dispatch algorithms are general and would apply to different applications where electricity and heat are needed (e.g. residential or industrial). The same system can also be easily adapted to stand-alone systems by eliminating the grid connection and including reliability of power supply as a constraint on the system design. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 30. Main effects plot for component sizes as a function of gas prices.. Fig. 31. Main effects plot for component sizes as a function of electricity prices. Fig. 32. Main effects plots of electricity imports and exports as a function of (a) electricity import prices and (b) gas import price. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Fig. 33. Main effects plots for the fuel consumption in the boiler and the CHP units as a function of (a) electricity price and (b) gas price. The complexity of the dispatch algorithm drops exponentially by reducing the number of decision variables, i.e. the number of generators and storage equipment. In our case study, the optimiser did not eliminate any of the components (despite having the built-in capability to do so), indicating that all technologies have positively contributed to the performance of the system. The complexity of the system should be considered as a limiting factor, especially when it comes to implementing the proposed dispatch strategies in real-time controller (a future research effort for the authors). The results presented in the earlier sections allow us to conclude the following observations: - The two proposed dispatch strategies achieved the aim of the paper by reducing the cost of energy to the consumer. By integrating electricity and heat at the system design level, significant reduction is achieved by exploiting the complementarity of the two sides of the system. - Data forecasting improved the results by reducing the overall cost of energy and especially on the thermal side. The forecasted data allowed the dispatch strategy (DiStr2) to divert the excess generation in the best way according to the anticipated levels of generation and demand. However, the accuracy of the forecasting is highly dependent on the quality and length of the datasets. - The proposed system allowed for revenues to be realised through exports back to the grid and by offsetting imports from the electrical and gas grids. - Sensitivity analysis of electricity and gas prices shows that large fluctuations in energy prices lead to a high uncertainty about the benefits of the proposed system. However, such system is still justified on the grounds of ‘future-proofing’ the energy supply to the consumer. If energy prices continue to increase, local generation will be cheaper. Conversely, if the energy prices stabilised or are reduced, this will create incentive to export back to the grid. The latter could be easily achieved by up-ranking the priority of the exports at the expense of local consumption. Finally, planned tax on carbon and target emissions in many countries point to the feasibility of investing in low carbon local generation. - The introduction of forecasting lead to a significant reduction in the spread of Pareto solutions. This is potentially significant because it indicates that the conflict between LCE and LCH is reduced. In future work, combined levelised cost of energy (LCOE) could be used and the problem converted into single-objective optimisation. - The interaction of the forecast horizon with the optimiser is of complex nature and need to be better understood. However, halfdiurnal and diurnal intervals seem to provide the best results. This is inline with the consumption patterns at the chosen site. - The increased complexity of the system is a weakness, but might be unavoidable as the complexity of energy systems is increasing. Finally, we propose some directions for future research as follows: - Testing the forecasting accuracy at other case studies (datasets) to generalise the finding that LSTM provided the most accurate predictions. - Improving the expected utilisation parameters. The proposed pa rameters, _?_ and _?_ could be made more meaningful by adding weights to the forecast values over the horizon _?_ . The weight of the first forecast data-point should be higher than the weight of data-points many hours in the future. - Modifying DiStr1 and DiStr2 to stand-alone HRES. - Developing real-time controller that achieves the function of DiStr1 and DiStr2. - Adding environmental or other considerations to the study, for example, optimise for LCOE and CO2 emissions. - Improving the accuracy of the modelling approach by introducing uncertainties and longer term forecasting. - Investigating the corollary of our research question: given a spe cific HRES architecture, what would be the optimal dispatch strategy if the situation changed over time (e.g. increased loads, change in climate conditions, equipment downtime). - Previous studies (e.g. [9]) showed that a well-designed tariff structures such as Time of Use (ToU) would decrease the cost of energy to consumers. However, we did not include this aspect in our model, since it is within the grid regulator’s scope and not up to the end user to decide. CRediT authorship contribution statement F. Kahwash: Conceptualization, Formal analysis, Investigation, Methodology, Validation, Software, Visualization, Writing - original draft, Writing - review & editing. B. Barakat: Data curation, Conceptualization, Methodology, Software, Visualization, Writing - original draft, Writing - review & editing. A. Maheri: Conceptualization, Methodology, Validation, Writing - original draft, Writing - review & editing. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Data availability Data will be made available on request. Acknowledgements This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors. _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Appendix A. Detailed DiStr2 algorithm _A.1._ _Complete_ _surplus_ _A.2._ _Partial_ _surplus_ _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ _A.3._ _Deficit_ _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ Appendix B. Data-sets histograms The histograms of the datasets are show in Figs. B.34 and B.35. Fig. B.34. Typical meteorological year solar irradiance and wind resources Histogram with 10 bins each, at site, i.e., Lat: 54.536, Long: −1.599 [43] (a) Solar irradiance and (b) Wind speed. Fig. B.35. Demand datasets histogram with 10 bins each (a) Gas Consumption (b) Electricity Consumption. Appendix C. LSTM optimisation Table C.7 <u>LSTM</u> <u>optimisation.</u> Number of neurons Gas 1 5 10 20 50 100 150 200 250 R2 0.823 0.825 0.836 0.829 0.830 0.818 0.778 0.799 0.801 MAE 0.164 0.169 0.177 0.185 0.175 0.241 0.287 0.241 0.239 RMSE 0.421 0.420 0.406 0.414 0.413 0.428 0.473 0.450 0.447 nRMSE 0.814 0.811 0.785 0.800 0.798 0.826 0.914 0.869 0.865 Elec 1 5 10 20 50 100 150 200 250 R2 0.956 0.933 0.924 0.922 0.917 0.911 0.911 −79.301 0.907 MAE 0.133 0.169 0.179 0.183 0.190 0.191 0.221 8.438 0.204 RMSE 0.198 0.244 0.260 0.263 0.271 0.281 0.281 8.443 0.288 nRMSE 0.129 0.159 0.170 0.172 0.177 0.184 0.184 5.513 0.188 Wind 1 5 10 20 50 100 150 200 250 R2 0.986 0.987 0.987 0.987 0.987 0.987 0.987 0.986 0.804 MAE 0.073 0.067 0.070 0.069 0.069 0.068 0.068 0.068 0.419 RMSE 0.121 0.116 0.117 0.117 0.117 0.117 0.114 0.119 0.450 nRMSE 0.086 0.082 0.083 0.083 0.083 0.083 0.081 0.084 0.319 Sun 1 5 10 20 50 100 150 200 250 R2 0.719 −19.301 0.717 0.442 −106.512 −118.679 0.738 0.736 0.723 MAE 0.249 4.331 0.257 0.608 10.024 10.577 0.256 0.267 0.274 RMSE 0.513 4.361 0.515 0.723 10.037 10.589 0.495 0.497 0.509 nRMSE 0.817 6.945 0.820 1.151 15.981 16.861 0.788 0.792 0.811 _F._ _Kahwash_ _et_ _al._ _Energy Conversion and Management 293 (2023) 117460_ References [1] IRENA. Renewable power [generation](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb1) costs in 2021. Abu Dhabi, UAE: International [Renewable](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb1) Energy Agency; 2022. [2] Renewables 2021 global status [report.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb2) REN21 secretariat, 2021. [3] O’Malley MJ, Anwar MB, Heinen S, Kober T, McCalley J, McPherson M, et al. Multicarrier energy systems: shaping our energy future. Proc IEEE 2020;108(9):1437–56. [http://dx.doi.org/10.1109/JPROC.2020.2992251.](http://dx.doi.org/10.1109/JPROC.2020.2992251) [4] Net zero strategy: Build back greener. UK Parliament reports, 2021, URL [www.](http://www.gov.uk/official-documents) [gov.uk/official-documents.](http://www.gov.uk/official-documents) [5] Azizi A, Karimi H, Jadid S. Daily [operation](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb5) of multi-energy systems based on stochastic optimization considering [prediction](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb5) of renewable energy generation. IET Renew [Power](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb5) Gener 2021. [6] Mancarella P. MES (multi-energy [systems):](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb6) An overview of concepts and evaluation models. [Energy](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb6) 2014;65:1–17. [7] Kahwash F, Maheri A, Mahkamov K. Integration and optimisation of high penetration Hybrid Renewable Energy Systems for fulfilling electrical and thermal demand for off-grid communities. Energy Convers Manage 2021;236:114035. [http://dx.doi.org/10.1016/j.enconman.2021.114035.](http://dx.doi.org/10.1016/j.enconman.2021.114035) [8] Zhang S, Tang Y. Optimal schedule of [grid-connected](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb8) residential PV generation systems with battery storages under [time-of-use](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb8) and step tariffs. J Energy Storage [2019;23:175–82.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb8) [9] Liu J, Zhou Y, Yang H, Wu H. [Net-zero](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb9) energy management and optimization of commercial building sectors with [hybrid](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb9) renewable energy systems integrated with energy storage of pumped [hydro](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb9) and hydrogen taxis. Appl Energy [2022;321:119312.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb9) [10] Zhao L, Yang T, Li W, Zomaya AY. [Deep](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb10) reinforcement learning-based joint load scheduling for household [multi-energy](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb10) system. Appl Energy 2022;119346. [11] Niveditha N, Singaravel MR. Optimal [sizing](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb11) of hybrid PV–wind–battery storage system for net zero energy buildings to reduce grid burden. Appl Energy [2022;324:119713.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb11) [12] Tostado-Véliz M, Arévalo P, Jurado F. [A](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb12) comprehensive electrical-gas-hydrogen microgrid model for energy [management](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb12) applications. Energy Convers Manage [2021;228:113726.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb12) [13] Thompson S, Duggirala B. The [feasibility](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb13) of renewable energies at an off-grid community in Canada. Renew [Sustain](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb13) Energy Rev 2009;13(9):2740–5. [14] Ma W, Xue X, Liu G, Zhou R. [Techno-economic](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb14) evaluation of a community-based hybrid renewable energy system [considering](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb14) site-specific nature. Energy Convers Manage [2018;171:1737–48.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb14) [15] Shah KK, Mundada AS, Pearce JM. [Performance](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb15) of US hybrid distributed energy systems: Solar photovoltaic, battery [and](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb15) combined heat and power. Energy Convers Manage 2015;105:71–80. [16] Gabrielli P, Gazzani M, Martelli E, [Mazzotti](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb16) M. Optimal design of multi-energy systems with seasonal storage. Appl Energy 2018;219:408–24. [17] He Y, Guo S, Zhou J, Wu F, Huang J, [Pei](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb17) H. The many-objective optimal design of renewable energy [cogeneration](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb17) system. Energy 2021;121244. [18] Shen X, Luo Z, Xiong J, Liu H, Lv X, Tan T, et al. Optimal hybrid energy storage system planning of community multi-energy system based on two-stage stochastic programming. IEEE Access 2021;9:61035–47. [http://dx.doi.org/10.](http://dx.doi.org/10.1109/ACCESS.2021.3074151) [1109/ACCESS.2021.3074151.](http://dx.doi.org/10.1109/ACCESS.2021.3074151) [19] Hong T, Pinson P, Wang Y, Weron R, Yang D, Zareipour H. Energy forecasting: A review and outlook. IEEE Open Access J Power Energy 2020;7:376–88. [http:](http://dx.doi.org/10.1109/OAJPE.2020.3029979) [//dx.doi.org/10.1109/OAJPE.2020.3029979.](http://dx.doi.org/10.1109/OAJPE.2020.3029979) [20] Mohandes MA, Halawani TO, Rehman [S,](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb20) Hussain AA. Support vector machines for wind speed prediction. [Renew](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb20) Energy 2004;29(6):939–47. [21] Wang Y, Zou R, Liu F, Zhang L, Liu Q. A review of wind speed and wind power forecasting with deep neural networks. Appl Energy 2021;304:117766. [http://dx.doi.org/10.1016/j.apenergy.2021.117766.](http://dx.doi.org/10.1016/j.apenergy.2021.117766) [22] Shahid F, Zameer A, Muneeb M. A novel genetic LSTM model for wind power forecast. Energy 2021;223:120069. [http://dx.doi.org/10.1016/](http://dx.doi.org/10.1016/j.energy.2021.120069) [j.energy.2021.120069,](http://dx.doi.org/10.1016/j.energy.2021.120069) URL [https://www.sciencedirect.com/science/article/pii/](https://www.sciencedirect.com/science/article/pii/S0360544221003182) [S0360544221003182.](https://www.sciencedirect.com/science/article/pii/S0360544221003182) [23] Bendiek P, Taha A, Abbasi QH, [Barakat](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb23) B. Solar irradiance forecasting using a data-driven algorithm and contextual [optimisation.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb23) Appl Sci 2021;12(1):134. [24] Fouilloy A, Voyant C, Notton G, Motte F, Paoli C, Nivet M-L, et al. Solar irra diation prediction with machine learning: Forecasting models selection method depending on weather variability. Energy 2018;165:620–9. [http://dx.doi.org/10.](http://dx.doi.org/10.1016/j.energy.2018.09.116) [1016/j.energy.2018.09.116, URL https://www.sciencedirect.com/science/article/](http://dx.doi.org/10.1016/j.energy.2018.09.116) [pii/S0360544218318802.](https://www.sciencedirect.com/science/article/pii/S0360544218318802) [25] Ghalehkhondabi I, Ardjmand E, [Weckman](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb25) GR, Young WA. An overview of energy demand forecasting methods [published](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb25) in 2005–2015. Energy Syst [2017;8(2):411–47.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb25) [26] Zhang W, Maleki A, Rosen MA, Liu J. [Sizing](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb26) a stand-alone solar-wind-hydrogen energy system using weather [forecasting](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb26) and a hybrid search optimization algorithm. Energy Convers Manage 2019;180:609–21. [27] Kahwash F, Barakat B, Taha A, Abbasi [QH,](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb27) Imran MA. Optimising power supply sustainability using a grid-connected [hybrid](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb27) renewable energy system-an NHS hospital case [study.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb27) Energies 2021. [28] Pascual J, Arcos-Aviles D, Ursúa A, Sanchis P, Marroyo L. Energy man agement for an electro-thermal [renewable–based](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb28) residential microgrid with energy balance forecasting and [demand](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb28) side management. Appl Energy [2021;295:117062.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb28) [29] Maheri A. Multi-objective design [optimisation](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb29) of standalone hybrid wind-PV diesel systems under [uncertainties.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb29) Renew Energy 2014;66:650–61. [30] Bhandari B, Lee K-T, Lee G-Y, Cho [Y-M,](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb30) Ahn S-H. Optimization of hybrid renewable energy power systems: A [review.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb30) Int J Precis Eng Manuf-Green Technol [2015;2(1):99–112.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb30) [31] Bajpai P, Dash V. Hybrid [renewable](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb31) energy systems for power generation in stand-alone applications: A review. Renew Sustain Energy Rev [2012;16(5):2926–39.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb31) [32] Wang R, Xiong J, He M-f, Gao L, [Wang](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb32) L. Multi-objective optimal design of hybrid renewable energy system [under](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb32) multiple scenarios. Renew Energy [2020;151:226–37.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb32) [33] Rosen MA, Koohi-Fayegh S. [Cogeneration](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb33) and district energy systems: modelling, analysis and [optimization,](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb33) vol. 2. IET; 2016. [34] HOMER Energy. HOMER pro [user](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb34) manual. HOMER Energy; 2021. [35] Duffie JA, Beckman WA. Solar [engineering](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb35) of thermal processes. John Wiley & Sons; 2013. [36] Alberici S, et al. Subsidies and costs of [EU](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb36) energy (Annex 4–5). Berlin, Germany: [Ecofys;](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb36) 2014. [37] Bolton P, Stewart I. Domestic energy prices. UK, House of commons li brary; 2022, URL [https://researchbriefings.files.parliament.uk/documents/CBP-](https://researchbriefings.files.parliament.uk/documents/CBP-9491/CBP-9491.pdf) [9491/CBP-9491.pdf.](https://researchbriefings.files.parliament.uk/documents/CBP-9491/CBP-9491.pdf) [38] Cole W, Frazier AW, Augustine C. [Cost](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb38) projections for utility-scale battery [storage: 2021 update. Tech. rep., Golden, CO (United States): National Renewable](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb38) Energy [Lab.(NREL);](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb38) 2021. [39] Jackman J. The smart export guarantee 2022: How much can you earn? Eco Experts 2022. URL [https://www.theecoexperts.co.uk/solar-panels/smart-export-](https://www.theecoexperts.co.uk/solar-panels/smart-export-guarantee) [guarantee.](https://www.theecoexperts.co.uk/solar-panels/smart-export-guarantee) [40] Olympios AV, Pantaleo AM, Sapin P, [Markides](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb40) CN. On the value of combined heat and power (CHP) systems and [heat](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb40) pumps in centralised and distributed heating systems: Lessons from [multi-fidelity](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb40) modelling approaches. Appl Energy [2020;274:115261.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb40) [41] MATLAB. Version 9.4.0.813654 [(R2018a).](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb41) Natick, Massachusetts: The Math Works [Inc.;](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb41) 2018. [42] Department for Education. Transparency data, department for education: real [time energy data. 2015, https://www.gov.uk/government/publications/greening-](https://www.gov.uk/government/publications/greening-government-and-transparency-commitments-real-time-energy-data) [government-and-transparency-commitments-real-time-energy-data.](https://www.gov.uk/government/publications/greening-government-and-transparency-commitments-real-time-energy-data) [43] Photovolataic geographical information system (PVGIS). 2021, URL [https://ec.](https://ec.europa.eu/jrc/en/pvgis) [europa.eu/jrc/en/pvgis.](https://ec.europa.eu/jrc/en/pvgis) [44] sklearn.preprocessing.StandardScaler - scikit-learn 1.1.2 documentation. 2022, URL [https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html) [StandardScaler.html.](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html) (Accessed 09 December 2022). [45] scipy.stats.mstats.winsorize - SciPy v1.8.1 manual. URL [https://docs.scipy.org/](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.winsorize.html) [doc/scipy/reference/generated/scipy.stats.mstats.winsorize.html.](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mstats.winsorize.html) [Accessed 07 May 2022]. [46] Taylor SJ, Letham B. Forecasting at [scale.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb46) Amer Statist 2018;72(1):37–45. [47] Triebe O, Hewamalage H, Pilyugina P, Laptev N, Bergmeir C, Rajagopal R. Neuralprophet: Explainable forecasting at scale. 2021, arXiv preprint [arXiv:](http://arxiv.org/abs/2111.15397) [2111.15397.](http://arxiv.org/abs/2111.15397) [48] Chollet F. Deep learning with [Python.](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb48) Simon and Schuster; 2021. [49] Yu Y, Si X, Hu C, Zhang J. A review [of](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb49) recurrent neural networks: LSTM cells and network architectures. [Neural](http://refhub.elsevier.com/S0196-8904%0x2823%0x2900806-3/sb49) Comput 2019;31(7):1235–70. [50] Chollet F. Keras LSTM layer. 2022, URL [https://keras.io/api/layers/recurrent_](https://keras.io/api/layers/recurrent_layers/lstm/) [layers/lstm/.](https://keras.io/api/layers/recurrent_layers/lstm/) [Accessed 09 December 2022]. [51] Jebli I, Belouadha F-Z, Kabbaj MI, Tilioua A. Prediction of solar energy guided by pearson correlation using machine learning. Energy 2021;224:120109. [http://](http://dx.doi.org/10.1016/j.energy.2021.120109) [dx.doi.org/10.1016/j.energy.2021.120109,](http://dx.doi.org/10.1016/j.energy.2021.120109) URL [https://www.sciencedirect.com/](https://www.sciencedirect.com/science/article/pii/S0360544221003583) [science/article/pii/S0360544221003583.](https://www.sciencedirect.com/science/article/pii/S0360544221003583) [52] Department for Business, Energy & Industrial Strategy. Energy prices non domestic usage. Tech. rep., gov.uk; 2021, [https://www.gov.uk/government/](https://www.gov.uk/government/statistical-data-sets/gas-and-electricity-prices-in-the-non-domestic-sector) [statistical-data-sets/gas-and-electricity-prices-in-the-non-domestic-sector.](https://www.gov.uk/government/statistical-data-sets/gas-and-electricity-prices-in-the-non-domestic-sector)

섹션 본문 113문단 · 69,076자

(제목 없음)

1A B S T R A C TIn multi-energy systems the full utilisation of the generated energy is a challenge. Integrating heat and electricity supply at the system level design could provide an opportunity to address this challenge. In this paper we introduce and examine two coupled thermal-electrical dispatch strategies for grid-connected hybrid multi-energy systems supplying electrical and thermal demand loads. The dispatch strategy employs forecasting of energy resources and demand loads to prioritise supplying the thermal load in times of renewable surplus. Four forecasting algorithms, namely, baseline forecast, Facebook Prophet (FBP), Neural Prophet (NP), and Long Short-Term Memory model (LSTM) are implemented and used to generate annual forecast data for solar irradiance, wind speed, and thermal and electrical demand loads. To integrate forecast data within the dispatch strategy, new parameters are proposed to quantify the expected available energy within the forecast time horizon. A building complex for the Department of Education in the UK is used for conducting a system design case study. A genetic algorithm-based multi-objective optimisation with the levelised costs of electricity and heat as two objectives is conducted. The results show that the proposed dispatch algorithm produces systems with reduced levelised costs compared to the base case of using utility gas and electricity. Forecasting is particularly useful in reducing cost of heat, as it can prioritise supplying the thermal load in times of renewable surplus. LSTM proved to be the most accurate forecasting algorithm for this case, where the data has strong seasonality and trends. The main contribution of this work is to propose and demonstrate the effectiveness of tightly coupling thermo-electrical dispatch algorithms of HRES from the design stage, and how to effectively integrate forecast data within such algorithms. (F. Kahwash). direct emissions from all public sector buildings by 75% by 2037, investing GBP1.425B in public sector decarbonisation schemes[4].Opportunities to tackle the challenge of providing clean energy (electricity, heating/cooling, transport) could be realised by integrating the currently separate energy carriers for electricity, heating, and transport. These systems are called multi-energy systems (MES)[5]or multi-carrier energy systems (MCES)[3]. One of the main aspects of MES is distributed multi generation (DMG) whereby multiple energy vectors are combined to provide several end-products for a spatially defined region (i.e., a building, a district or a region)[6].Energy systems with multiple generators, including renewables, storage and/or backup have traditionally been termed Hybrid Renewable Energy Systems (HRES)[7]. HRES usually supplied electricity; heating was either not considered or considered as a by-product of the system. However, in the context of increased renewable electricity generation, a promising approach is to integrate different carriers[3]. In

Introduction

2The cost of renewable electricity generation continues to fall globally. When put in perspective, the decline has been steep over a short period of time. For example, between 2010 and 2021, the global weighted average of levelised cost of electricity for PV fell by 88%, for onshore wind fell by 68% and for offshore wind by 60% [1]. The progress was mainly due to economies of scale, improved capacity factors, and increased competitiveness. On the other hand, the decarbonisation of heat has been advancing at a slower rate than that of electricity, mainly due to slow developments in new technologies and insufficient policy support worldwide [2]. Given that heat (residential and industrial) is the largest portion of the total energy demand of developed economies (roughly half of the energy consumption in the EU [3]), many governments started supporting the transition to clean heating systems. For example, the UK government pledged to reduce the context of electricity-heat integration, there are several hybrid heating technologies that are proposed, such as heat pump and boiler and natural gas boilers equipped with water storage tanks that have electric heating elements and sometimes with variable speed feed pumps [3]. In all these examples, electrification of heat is the overarching theme.

3The control logic ensuring the balance of supply and demand within MES is called dispatch strategy or energy management strategy. A well designed dispatch strategy is vital, especially when variable renewables are included in the system. In the context of grid-connected HRES, the performance of the system is critically linked to the energy pricing structure. Variable tariffs have been shown to be beneficial for the adoption of HRES by improving the capacity factors and economic value of HRES. In this context, Zhang and Tang [8] proposed two power management strategies of grid-connected PV system with battery storage. The strategies are developed to work with 'time of use' tariff and 'step' tariff within the Chinese market. times and levels of energy storage as opposed to export back to the grid are controlled to achieve maximum economic gain for the household. Bigger returns were observed when grid prices were higher. Liu et al. [9] developed an innovative MES for high-rise buildings in congested coastal cities (Hong Kong as a case study). The model includes a high-penetration renewables grid coupled with pumped hydro storage in the building and hydrogen production fuelling hydrogen taxis outside the building. They performed multi-objective optimisation to find the optimal size of the pumped hydro storage system. A novel Time of Use (ToU) tariff structure is proposed and studied along an existing flat rate tariff structure. The use of pumped hydro storage was found to improve self-consumption by 12% and reduce energy bills by around 24%.

4Different concepts were proposed for MES for residential energy application. Zhao et al. [10] proposed a household multi-energy system using electric-gas heating and cooking appliances and other domestic electric loads. The renewable energy comes from rooftop PV panels. They developed energy management strategies with the aid of Markov chains and a deep reinforcement learning algorithm. The objective was to minimise the cost of energy of the household. The load scheduling algorithm was made up of fixed loads, power-shiftable loads such as space heating and cooling, and time-shiftable loads such as washing machines. Niveditha et al. [11] studied grid-connected HRES of netzero energy buildings with added objective of minimisation of the total energy transfer between the grid and the building. This applies to imports and exports to reduce the burden on the grid and maximised the self-sufficiency of the building.

5Studies with larger end-user, such as a district MES were also proposed. Tostado et al. [12] presented a multi-energy micro-grid model that combines electricity, hydrogen, and natural gas as energy carriers. The interfaces between the different carriers include electrical energy storage, gas to electricity converter (e.g. a turbine), electricity to gas converter (e.g. alkaline electrolysis) and electricity to hydrogen (e.g. electrolyser). The multi-energy microgrid also contains provision for electrical vehicles charging. The energy management system was tested on loading cases in the summer and winter.

6Combined Heat and Power (CHP) is probably the oldest MES concept. For example, Thompson et al. [13] studied the feasibility of installing different configurations of renewable-biomass-storage to supply rural community in Canada. Biomass was found to be most economical, given that the study was in 2009 and renewable technology prices were significantly higher than the present. More recently, Ma et al. [14] explored different HRES-CHP combinations for grid-connected systems that supply residential districts in seven Chinese cities. PV-microturbine systems were deemed to be more feasible in most locations with occasional backup from the grid. Similarly, Shah et al. [15] used HOMER software to study the performance of PV+ storage +CHP +boiler in three regions of the USA (hot, mild, and cold). The system was off-grid supplying residential load. High renewable penetration was achieved in all three locations. However, the coupling between thermal and electrical loads was not considered.

7Given the many possible MES configurations and the complexity of the interaction between supply and demand of different technologies, arriving at the optimal size in a given situation is a challenging task. Evolutionary algorithms and linear programming remain a popular choice. Gabrielli et al. [16] studied a multi-energy system with seasonal thermal storage to supply electricity and heat to a region in Switzerland. The system was grid-connected to gas and electrical networks and included several storage and conversion technologies such as gas turbines, fuel cells, and power-to-gas. The work focused on proposing an optimisation framework that is accurate and computationally efficient. They achieved this by proposing a two novel Mixed Integer Linear programming models. It was found that the proposed system reduced cost and emissions and that it was more suited to high penetration renewable scenarios. He et al. [17] proposed a system with wind and PV panels and thermal storage of molten salt that is charged by electric heater and discharged by driving steam Rankine cycle. Heat is also supplied from the storage. for the multi-objective optimisation, they used NSGA-III combined with principal component analysis and technique for order preference by similarity to an ideal solution to evaluate and select a solution. The system was able to cover most of electricity and heat load, except occasionally in the night. Furthermore, the system had better economic and environmental performance than traditional power system. Shen et al. [18] studied optimal sizing of electrical and thermal energy storage within a multi-energy system supplying a small community. The grid-connected multi-energy system consisted of PV panels, a gas turbine, and a CHP unit. To coordinate the sizing and operation of the system, they proposed a two-stage stochastic programming model. It was found that addition of storage improves the performance of the energy system, and that the thermal inertia of the heat network provides more flexibility of the system and the balancing between supply and demand.

8Balancing the supply and demand can be challenging as they might have a significantly different patterns. For example, the pattern of demand in commercial building will be stirred by the working hours and holidays. Machine Learning (ML) algorithms can help in analysing the various patterns and forecast demand and supply [19]. For ML algorithms, to accurately forecast the future, it requires a dataset that has a large number of precise measurements. .3 The dataset would be used by the ML to model the data and 'learn' the different patterns. Afterwords, the learned patterns can be used to predict the future measurements.

9The pattern of generated energy from renewable resources, depend on the source of the energy. Predicting the energy generated by wind turbines can be achieved by forecasting the wind speed (as shown in Section 2, which had been studied in several publications using a wide range of methodologies such as support vector machines in [20], deep neural networks [21], and recurrent neural network (RNN) [22]. Similar approaches had been proposed been used to forecast the solar irradiance [23,24]. A wide range of algorithms had been proposed in the literature to forecast the electrical and thermal demands, such as econometric and time series models, neural networks and fuzzy logic [25].

10The importance of forecasting the supply and demand is easy to see when integrating it to the energy systems as shown in the work of Zhang et al. [26], artificial neural networks was used to forecast solar irradiance, wind speed and ambient temperature. The forecasting data was used for optimal sizing of a stand-alone solar wind hydrogen HRES. The objective was to minimise the Total life cycle cost of the system. It was found that the use of forecasting data combined with the evolutionary search algorithm improved the sizing algorithm and resulted in systems with smaller Total Life Span Cost (TLSC) while maintaining the Loss Power Supply Probability (LPSP) at low levels. Recently, Kahwash et al. [27] applied AI-enabled forecasting with multi-objective optimisation in sizing Grid-connected HRES in the context of healthcare facilities in the UK. The study found that PVgrid systems were most economically feasible given the relatively high prices of battery storage. The cost competitiveness of different solutions were mapped for five years and provided a basis to choose larger PV systems than would be justified based on optimising in the present. However, the study focused on electrical load only. Pascual et al. [28] proposed an energy management system for residential microgrid supplying renewable electricity and heat. The proposed system achieved lower costs by reduction of the battery sizes required to balance the grid-connected system. The proposed energy management system seeks to balance the electrical grid by utilising batteries, thermal storage, and forecasting. However, the algorithm is uncoupled since it calculates the electrical balance first and then the thermal balance. The configuration is (PV + WT + Bat) with thermal storage (with immersion heater) and solar water heater. The coupling of the thermo-electrical system was done through thermal storage and battery.

11As was shown in this introduction and in previous work by the authors [27], hybrid heating arrangements (excess renewable + boiler) are effective in reducing the overall cost of energy and emissions of the heating loads. However, the heating energy dispatch strategy was not coupled with the electrical energy management strategy; leading to large amount of renewable electricity to be dumped or higher usage of boiler.

12The aim of this paper is to reduce the overall cost of energy for consumers by introducing a strongly coupled grid-connected HRES to supply electricity and heat. This aim will be achieved by (i) developing a coupled thermo-electrical energy dispatch strategy that is capable of managing a complex HRES with grid connections while reducing the levelised cost of energy. (ii) Incorporation of generation and consumption forecasting by means of machine learning into the coupled dispatch strategy.

13The rest of the paper is organised as follows. Section 2 presents the methodology of power and cost calculations of the HRES, followed by the proposed coupled dispatch strategy algorithms and multi-objective optimisation problem formulation using Genetic Algorithm. In order to investigate the effect of foretasting, two versions of the dispatch strategy, namely with and without forecasting are explained. The consumption and generation data are then presented along with the various machine learning algorithms used in producing the forecasting data. Section 3 begins by showing the forecasting data and discusses the accuracy of the different machine learning algorithms used. Then, the optimum solutions for the two novel dispatch strategies are presented and compared in detail. The effect of cardinal parameters on the results is discussed, including the forecasting horizon and the energy cost. In Section 4, concluding remarks, critique of the results and future research directions are presented.

HRES system architecture

14The proposed thermo-electrical HRES consists of renewable generators (wind turbine and PV), storage (battery bank and thermal storage tank) and fossil fuel back up generators (CHP and boiler). Fig. 1 shows a schematic of the proposed system architecture. PV and battery bank are connected on the DC side, while the wind turbine and CHP are connected on the AC side. DC and AC bus are connected through bidirectional converter. The system can import and export electricity to the grid with the same capacity. The thermal system has three sources, namely, heat from CHP that passes to the thermal system through a heat exchanger, the excess electricity which provides thermal energy through an electrical heating element, a boiler that will cover the thermal load in times of scarcity of other sources.

Wind turbine

15The wind power output is calculated from tabulated data of the form = ( ℎ ). The values are normalised with respect to the rated power. The power output is calculated by linear interpolation of the normalised power curve, then multiplying by the rated capacity of the wind turbine. This approach is accurate for modelling different sizes of small wind turbines typically used in HRES. The wind velocity at hub height is calculated from the logarithmic law of wind shear [29].

PV panels

16The power output of the PV panels can be calculated from the following equation [30] =

17(

18where, [m 2 ] is the surface area of the PV panels, [W/m 2 ] is the global irradiance incident on the plane of the PV panel, is the system efficiency; [%∕ • ] is the panels' temperature deration coefficient;

19is the temperature of the cell surface and , is the temperature of the cell surface at Standard Test Conditions (STC). The last term in Eq. (1) takes into account the effect of ambient temperature on the efficiency of the panels by introducing efficiency correction term proportional to the difference in cell surface temperature between the standard test conditions and the prevailing cell temperature onsite. The model assumes that Maximum Power Point Tracking is included, so as to obtain maximum output at each irradiance level.

Battery bank

20In this study, we consider single-node storage model to calculate the battery's State of Charge (SoC) as follows [31,32]

21where, is the internal self-discharge rate of the battery; is the interval at which measurements are taken. In this work, = 1 h unless otherwise stated. The term ( − ) is the net energy flow into the battery bank during one hour. The term , = is the nominal capacity of the battery bank and is the round-trip efficiency of the battery.

22At each timestep in calculating the battery's SoC, two quantities are needed, namely, the extractable power from the battery , and the power required to fill up the battery , . They are calculated as follows:

Grid power

23In this work, the system can interact with the grid in a bi-directional manner. Electricity is imported from the grid to provide the balance of energy, when all system generators are unable to cover the load. In times of high generation and low demand, excess electricity can be exported back to the grid. Exports and imports are capped at the same level. This is assumed to be equal to the maximum electrical demand onsite. This is a reasonable assumption given that grid circuit breakers are sized to fulfil the entire electrical demand in the absence of all other sources. Transmission losses for imports and exports are neglected.

CHP unit

24A Natural gas CHP unit is used in the system to provide electricity in times of low renewable generation and heat through waste heat recovery. Usually, heat can be recovered from engine coolant cycle, engine lubrication cycle, and exhaust flue. Overall efficiency of such systems is often in excess of 80% [33]. The electrical power output of the CHP can be calculated using the Heaviside step function as follows:

25where, ℎ , is the nominal electrical capacity of the CHP unit. Fuel consumption and thermal output were calculated following the procedure in [7].

Boiler

26A boiler is used to supply the thermal load in the absence of electrical heating or storage. The boiler is assumed to run on natural gas, which is the most common type in areas with existing gas networks. The efficiency of the boiler is considered to be constant in this study and used to calculate the power of the boiler as follows [34] = ℎ ( ) (6) where, ℎ is the thermal load and is the efficiency of the boiler. Fuel consumption is calculated as follows:

27where, is the lower heating value of the fuel.

Thermal storage tank

28The thermal storage is a cylindrical water-based tank. To calculate the energy balance, a single-node, fully mixed model is adopted. The tank runs between two predefined setpoints (in this study 45 • C and 75 • C) [35]. The temperature of the tank is calculated according to the following formula:

29where, (K) is the average temperature in the tank, (kg) is the mass of water in the tank, (J/kg-K) is the heat capacity of the water, is the input heat into the tank (from CHP, or excess electricity), is the heat loss from the walls of the tank and is the thermal load served. Losses are calculated based on an average heat transfer coefficient for the tank walls, and the tank is assumed to be cylindrical with a length equal to the diameter.

Coupled thermo-electrical dispatch strategies

30In this section, the novel energy dispatch strategies are presented. At the beginning, several variables are proposed to enable the effective utilisation of the forecasting data into the strategies. Then the algorithms are described.

Expected utilisation ratios

31Assuming that the controller implementing the dispatch strategy has access to forecast data of renewable generation and demand up to number of hours ahead. The window of time at which the forecast data are available to the controller is called the the forecasting horizon. Consequently, we propose a variable called expected electrical utilisation ratio. At each time step of the calculation, it can be estimated as:

32where, is the current time of calculations; is the forecasting horizon in hours;̂is the forecasted renewable generation within the specified horizon; , is the extractable power from the battery at the current time; and = + 1, which means that the forecast data start one hour ahead of the current timestep. At each point in time, the value of will help determine the priorities of the algorithm. In the case where > 1+TOL, the forecasted available energy will surpass the forecast demand over the chosen horizon. In this case, less priority will be given to charging the battery and more priority will be given to fulfilling thermal loads. TOL is a small positive number used to account for uncertainty in the forecast results.

33Similarly for the thermal load, we define expected thermal utilisation ratio as:

34F. Kahwash et al. where, , is the extractable thermal energy from the storage tank, and ℎ, is the forecast thermal demand. The first term in the numerator is the forecasted net surplus in renewable generation after fulfilling electrical load. Whenever this quantity is positive, the surplus is diverted to fulfil the thermal loads. The max function is used to exclude the negative values, in which case there is no electrical surplus available for thermal demand. In the case where > 1 + TOL, the forecasted available energy will surpass the forecast demand over the chosen horizon. In this case, less priority will be given to charging the tank and more priority will be given to charging the battery. When the demand is very small or zero, → ∞, in this case, a large value is enforced to prevent the existence of ∞ in the calculations. This does not affect the operation of the algorithm, given that any value beyond 1 + TOL will trigger the same response (i.e., reduced priority). Finally, it is worth noting that non-renewable thermal sources (e.g. boiler and CHP) are not included in Eq. (10). This is mainly due to their dispatchability.

Storage level indicators

35Storage level indicators are proposed here to quantify the urgency of charging one of the two storage technologies. The electrical storage level indicator is a set level where ≤ ≤ In this study, = 0.3 and = 1. When the battery's falls below the value of , charging the battery becomes a priority when a surplus generation exists. Similarly, the thermal storage level indicator where ≤ ≤ In this study, = 45 • C and = 75 • C. When the temperature of the water in the tank falls below the value of this parameter, charging the tank becomes a priority when there is extra electrical/thermal power. In this study, the critical level is set as average of the minimum and maximum values for the battery and tank.

Renewable surplus generation

36To simplify the energy balance calculations, we define the following variables:

37When ℎ > 0, it means there is a renewable generation surplus over the combined electrical and thermal demand (complete surplus). When > 0, this indicate surplus of renewable generation over electrical demand only (partial surplus). ℎ is a subset of (if ℎ > 0 then > 0 but not vice versa).

DiStr1: Coupled thermo-electrical dispatch strategy

38The coupled dispatch strategy without forecast is shown graphically in Fig. 2. In general, the symbol refers to electrical supply, and to thermal supply. Electrical and thermal loads are indicated by , ℎ , respectively. The use of ( ) indicates calculations over timesteps (i.e. every one hour in this study). Subscript used in Figs. 2,3, are shown in Table 1.

39At each timestep, initial quantities are calculated, such as renewable power and available energy stored in the battery bank and thermal storage tank. The controller then checks if there is total surplus ( ℎ > 0), partial surplus ( > 0) or a deficit ( ≤ 0). In the times of surplus energy, priority is given to the battery, then to the storage tank and then to exporting back to the grid. When there is a deficit and there is enough capacity in the storage, it will be used. If the electrical deficit is large, the CHP is switched on. If the thermal deficit is large, the boiler is switched on. When CHP is switched on, heat supply from it will be prioritised to charge the tank. However, the CHP will not be switched on in case of thermal deficit alone, since in general, the efficiency of the boiler is higher than CHP.

40As can be seen, there is strong coupling between the electrical and thermal systems since the controller will take decisions after considering the state of both sub-systems in how to optimally balance the supply and demand.

DiStr2: thermo-electrical dispatch strategy with supply and demand forecasting

41The graphical representation of DiStr2 is shown in Fig. 3 and in Appendix A. Similarly to DiStr1, the controller starts by calculating current state variables, including expected utilisation ratios (see Section 2.3.1), and storage level indicators (see Section 2.3.2). In case of complete surplus, there are two final states: (i) priority for thermal storage charging, or (ii) priority for battery charging. The former is triggered when is large, is small and < . The latter is triggered in all other situations. If surplus power remains after fully charging the battery and tank, excess will be exported. If there is further excess, it will be dumped.

42In case of partial surplus, electrical load is covered as a priority. If there is expected surplus, the combined partial surplus and tank will be used to cover the thermal load; otherwise, the boiler will be switched on to cover the thermal deficit.

43In case of deficit, the priorities are similar to DiStr1, except in cases where CHP is switched on and there is expected electrical deficit, then the CHP is run as maximum capacity to charge the battery. CHP run with better efficiency at higher loads. In case of thermal deficit only, the boiler is switched on.

Cost modelling

44To estimate the economic viability of the HRES, the system cost are estimated. The cost components considered in this study are: (i) Capital, (ii) Fixed Operation and Maintenance, (iii) Variable Operation and Maintenance, (iv) replacement, and (v) salvage costs. Over the life of the project, all cost components are combined to give the Total Life System Cost (TLSC) and then the annualised system cost , . The calculations followed the procedure in [7].

45In the current coupled system, the levelised cost of energy has two components, the levelised cost of electricity (LCE) and levelised cost of heat (LCH). The annualised cost for electrical components , is calculated separately and the heat from the CHP is treated as revenue. LCE is calculated as follows [34,36]:

46The second term in the numerator is the avoided cost of heating by utilising heat from the electrical side of the system. Heat is treated as a by-product. The denominator represents the total served electrical energy (total load -unmet load). ℎ [ $∕kWh] is the cost of producing one kWh of heat using the boiler [34]

47where, is the boiler efficiency. The LCH can be calculated in a similar way by using the annualised cost of the thermal equipment and treating the electricity produced by the CHP as revenue to be deducted as follows [7] In this case, is the cost of importing from the grid, which is avoided by switching the CHP on. ′ is the total avoided electrical imports from the grid.

Parameters of cost modelling

48Accurate cost parameters are crucial for accurate optimisation. The parameters used in cost modelling are presented in Table 2. High prices for grid imports and natural gas are currently prevailing in the UK [37] and are expected to rise further in the near future. The life of battery bank is determined by nominal life (in years) or by throughput (in cycles), i.e. the total energy that cycled through the battery. The dispatched energy to and from the battery bank is monitored and the replacement is calculated based on the minimum of either the nominal life or the throughput.

Multi-objective optimisation

49The sizing of the HRES is formulated as a multi-objective optimisation problem. It is solved using the genetic algorithm (GA) coded in MATLAB R2018a. The code utilises the built-in GA optimiser, which uses a controlled, elitist genetic algorithm. It favours individuals with greater fitness and individuals who can help increase the diversity of the population, even if they have a lower fitness value [41]. Using the built-in GA optimiser also enables using the parallel computing capabilities of MATLAB, which significantly reduces the computation time.

50LCE (Eq. (13)) and LCH (Eq. (15)) are chosen as the two objectives of the optimisation. Given the coupled nature of these two objectives, it is expected that a negative correlation exists. The larger the electrical side of the system will result in more renewable and CHP heat and this in turn means higher LCE and lower LCH. There are six design variables, representing the main system components sizes as follows:

51The search space's lower bound ⃗ = . This allows the optimiser to eliminate any component that is not effective. The upper bound for each component is calculated as follows:

52The various parameters are reserve factors between 1.1 and 2. They are used to expand the search space, which allows exploring different architectures (e.g. a system with very large wind turbine could be beneficial for the thermal side). The PV upper bound equation is multiplied by 8, which represent the conversion factor between area and nominal power of the PV panels (8 m 2 ≈ 1 kW). The division over 1000 indicates that the step size s is 1 kW rather than 1 W. The upper bound for storage is calculated based on autonomy days, which is taken = 2 in this study. Table 3 shows the main parameters used in the optimisation. The solution converged when the average change in the Pareto solution was less than 1 × 10 −5 (convergence criteria) over 140 generations (maximum number of stalled generations). Given the large search space, the population size and maximum number of generation was chosen to be high to ensure convergence. These parameters were chosen after extensive numerical experiments to find the right balance between accuracy and computational time.

53The optimisation problem can then be formulated as follows:

54where, ∑ is the total (thermal and electrical) blackout hours in the year.

Forecasting algorithms 2.6.1. Forecasting pipeline

55To calculate the values of and , the forecast of supply and demand must be accurate. The forecast in achieved by the pipeline shown in Fig. 4. The first step is i. data collection in which it is critical to collect an accurate data from the site. The collected data should have measurements for both the demand (electrical and gas) and the supply (wind speed and solar irradiance). The datasets also must have a common periods in which they have readings (especially if the data were collected from various sources), and this common duration must be 'long' enough to train the forecasting models.

Data collection case study: Department for education building in Darlington, UK

56To validate the proposed methodology we have applied the dispatch strategy on a building of the UK's department for education in Darlington, UK. The building is no longer in use. It was chosen due to the availability of long term, half hourly Electrical and thermal consumption data between 2011 and 2015 [42]. The building is located at (54.523, −1.552). It has a central heating system for domestic hot water and space heating and is fully air conditioned. The building hosted around 400 employees that had access to the building between the morning and night and no usual access during weekends.

57The hourly values of irradiance and wind speed is taken from the online database PVGIS for the same location [43]. The readings are logged in the Radiation database: PVGIS-SARAH database. The set has reading from 1st of January 2011 until 31st of December 2015. It

Pre-processing

58To ensure that the collected datasets are suitable to the learn from, we must 'clean' the data. This is done by formatting the data and joining various tables (if necessary) to form a well-structured dataset. The energy loads datasets and the supply data have different time scales, thus we have converted the loads data which has half-hourly readings to hourly readings as the supply only has hourly one. Then we defined the training period to be starting from 1st of April 2011 until 31st of December 2012. While the testing dataset is between the 1st of January 2013 until the 31st of December 2013. These periods where chosen as they are common in both datasets. The common period is 1005 days in total thus 24 121 h (or data points). Afterwards, the dataset will be split into training set and testing set, where training period starts from 1st of April 2011 until 31st of December 2012. While the testing dataset is between the 1st of January 2013 until the 31st of December 2013. Thus the training set is approximately 65% of the data and the test set is 35%. It is worth mentioning that the length of the sets are determined by the required forecasting horizon for the optimisation, as shown in the next sections.

59To optimise the learning, it is important to make sure the training dataset are standardised, which can be achieved using the standard scalar [44], as follows:

60wherẽ( ) is the normalised value, ( ) is the recorded value,̄is the mean value, and is the standard deviation value. If the dataset has outliers, it is critical to eliminate them, which can be done using the Winsorization technique [45]. The Winsorization technique replaces the highest and lowest % of the data by the 100 − % the data. The value can be determined by analysing the datasets, usually it is between 0% and 10%.

The models training

61We have implemented four forecasting algorithms, i.e., Baseline forecast, Facebook Prophet (FBP) [46], Neural Prophet (NP) [47], and Long Short-Term Memory model (LSTM) [48]. The baseline model uses reading from the past year, thus assuming that there would not be a significant difference between the years. The FBP uses a time series model with three main model components: trend, seasonality, and holidays as follows [46],

62where ( ) is the forecast value at time , ( ) is the trend function that models the non-periodic changes, ( ) is the seasonality function that models the periodic changes, ℎ( ) represents the holidays, and represent the error. Neural Prophet (NP) is an extension for the FBP which incorporate deep learning algorithms and the FBP model to improve the forecasting accuracy [47]. Its forecasted value is obtained bŷ

63where ( ) is the Trend at time , ( ) is the Seasonal effects at time , ( ) is the Event and holiday effects at time , ( ) is the Regression effects at time t for future-known exogenous variables, ( ) is the Autoregression effects at time based on past observations, and ( ) is the Regression effects at time for lagged observations of exogenous variables. In our implantation of FBP and NP, we adapted the parameters depending on the used dataset. For example the public holidays and weekends would only affect the forecasting for the electric and thermal loads.

64The LSTM is an artificial neural network that has feedback connections [48]. It is one of the most used architectures for recurrent neural network (RNN) that can process not only single data points (such as images), but also entire sequences of data (such as time-series, speech or video) [49]. The connection weights and biases in the network change once per episode of training, and the activation patterns in the network change once per time-step.

65The used LSTM network has a single input feature and a single output. The input layer a sequence layer followed up by an Keras LSTM layer [50]. Then a dense layer. The solver is adaptive moment estimation (Adam), that was trained for 20 epochs. To optimise the number of neurons used, we conducted a grid search, whose results are shown in Table C.7.

Post-processing,

66After generating the forecasted values, we have applied a postprocessing step, in which we have inverted the standardisation done on the pre-processing step, and replaced any negative value with a zero. This step helps to increase the accuracy of the forecasting as the data should not include negative values.

Evaluating the accuracy;

67The accuracy of the forecasted values were evaluated using widely used metrics, i.e., the determination coefficient (R 2 ), Mean Absolute Error (MAE), Root Mean Square Error (RMSE) and normalised RMSE (nRMSE). The R 2 is calculated as follows: future (forecast horizon). The measured value is . The mean measured valuēis calculated bȳ= 1 ∑ . The forecast error indicates the difference between the forecasted values and the measured ones, are evaluated using the MAE and the RMSE, that is calculated using:

68The RMSE is a commonly used performance metric, as it shows the absolute error value and highlights the large errors while minimising the small ones. As we have different dataset with different scales it is insightful to have an error metric that can be used for the comparison, thus we are using the normalised RMSE ( ), which shows the error normalised by the interquartile range ( ) as follows:

69=

70where = 3 − 1 3 and 1 refers to the third and first quarterlies.

Exploratory data analysis

71The used data consist of four sets, two representing the energy sources, i.e., global solar irradiance and wind speed, the other two sets represent the energy consumption, i.e., electrical and heating demands. Initially we stared the analysis by pre-processing the datasets, as the electrical and heating demands data where half-hourly reading, we added them to have hourly reading similar to the supply datasets. The solar irradiance and total wind speed are shown in Fig. 5, and the electrical and heating demands are presented in Fig. 6.

72As observed in Figs. 5,6, there is significant outliers in the datasets (especially the electrical demand) which might have occurred because of a high intensity loads. Thus in we have applied an outlier filter on the datasets to reduce the affect of this outliers on the forecasting. The outliers were removed using Winsorization technique to replace the top 2% of the data with the value of the data at the 98th percentile [45]. Removing the outliers can help the forecasting algorithms to obtain accurate results; hence, the training dataset would be more constant and representative of the datasets. Table 4 presents the descriptive statistics of the data after removing the outliers.

73The datasets have different patterns; for example, if we consider the supply data, the global irradiance value is approximately zero after sunset; on the other hand, it varies during the daytime, while the wind speed varies most of the time. The average wind speed is 4.923 m/s and maximum value of 16.28 m/s. Furthermore the mean and median of the Solar and Gas data significantly differ, which indicates that the data is skewed and not normally distributed (The histograms of the datasets are presented in Appendix B). Consequently the forecasting algorithms must be suited to non normally distributed data.

74Given the nature of the building, it starts to be heated around 7:00am just before office workers start their working day. The heating load continues to decrease throughout the day as shown in Fig. 7-a. This is probably caused by the heating from office activities, including the presence of large number of employees and visitors with computers, printers and other office equipment. The electrical consumption coincides with the usual working hours in offices, where the demand is highest between 8:00 and 18:00 as shown in Fig. 7

75Thermal and electrical loads are affected by work days. As shown in Fig. 8-a, the thermal load is minimised in the weekend. While Mondays have the highest thermal consumption, therefore the in-building temperature would be at its lowest point after the building has not been heated on the weekend. The electric load is usually lower during the week; however, since the electric load is generated by devices (such as PCs) that might be kept working over the weekend, it is not significant as in the heating load, as shown in Fig. 8

76Heating load observe strong seasonality as shown in Fig. 9-a. Where highest demand is in January reaching maximum of around 90kWhth. The daily pattern is similar across the seasons with a spike in the morning. While the electrical load has a similar pattern through the months with a slight increase in winter as shown in Fig. 9-b. This could be caused by the reduced natural lighting.

77To assess the big picture and understand the loads pattern, we combined the data shown in Figs. 7 and 9. Strong seasonality is evident in the thermal load with minimum consumption in July and maximum in January. Electrical load showed the same seasonality trend with significantly reduced magnitude. This could be explained by the increased need for lighting in the winter.

78The energy supply data patterns different than the generation one, as it not affected the working hours and holidays. The global irradiance is affected by sunrise and set, as shown in Fig. 10-a, thus most of the power is generated between 7 AM and 5 PM. While the wind power is not as significantly affected by the sun rise and set, but nevertheless we can still observe the slight increase in it toward midday, as shown in Fig. 10

79The irradiance and wind power are affected by the seasons, as in the summer months the number of daylight hours are much larger than in the winter hours, as shown in Fig. 11-a. On the other hand, the wind speed increases in the winter months as shown in Fig. 11

80To understand the relation between the different datasets, we have conducted Pearson correlation analysis [51]. The analysis results presented in Fig. 12, shows the correlation between different datasets. For example, the positive correlation between the global irradiance and the sun height (G(i) and ), also we can see the negative colouration between the gas usage and the temperature (Gas and T2 m).

Forecasting results

81Initially we conducted a comparative study for the forecasting algorithms with and without eliminating the outliers to find the most accurate forecast. The results for Baseline', FBP', and NP', refers to applying the algorithms to the datasets after eliminating the outliers. The 2 results are summarised at Table 5. The LSTM has the highest accuracy in most cases. As can be observed, the 2 performance for the wind is considerably higher than the other data, as its distribution is close to the normal distribution. The significant outliers in the electric load (shown in Fig. 6) affected the forecasting performance, which explains the difference in the FBP and FBP' performance. The forecasting error evaluated using the MAE, RMSE, and nRMSE is shown in Figs. 13-15. As shown in Table 5, and Figs. 13, 14, and 15, the LSTM has the most accurate forecasting. As it is a RNN which is ideal for sequential data, and in our case, its short and long term memory is particularly useful as the data has strong seasonality and trends. Consequently we used LSTM to forecast the resources and demand, and use the generated data in DiStr2 dispatch strategy.

Optimised solutions comparison

82The forecasted data presented in Section 3.2 are used in DiStr2 algorithm (see Section 2.3.5). The optimisation is carried out using DiStr1 and DiStr2 as per Section 2.5 and the results are shown in Fig. 16. The DiStr2 is generally producing better results, especially with respect to LCH. The spread of the front is larger for DiStr1 than DiStr2. This might be explained by the fact that closer integration of the thermal and electrical side in DiStr2 is causing LCE and LCH to be less conflicting than in the case of DiStr1. The horizontal and vertical lines represent the base case scenario when there is no HRES; i.e., electricity from the grid only and heating using a gas boiler. It is clear that most of the solutions are superior to the base case for both electricity and heat. It is also worth noting that the LCH falls below the zero line, where is it expected that the system will generate revenue based on the heating subsystem. This is a consequence of Eq. (15), where the generated electricity revenue from the CHP system is subtracted from the cost of heating. When the CHP generation is high, the system is theoretically generating profits.

83Another important metric to evaluate the solutions is TLSC. This parameter will show the overall cost of the system regardless of the Fig. 16 were ranked based on TLSC and the minimum solutions are highlighted in black, representing 'best' solution for each DiStr. The configuration of the two 'best' solutions is shown in Table 6. DiStr2 solution contains larger renewable generation and battery storage, while the DiStr1 solution contains larger thermal storage and boiler. This indicates that the DiStr2 solution has a higher proportion of clean heat than the DiStr1 solution. Fig. 17 shows the boxplots for LCE (left) and LCH (right) for Pareto solutions as a function of the dispatch strategy. For LCE, the median for DiStr1 is 0.548$/kWh and for DiStr2 is 0.166$/kWh. 32.5% of the solutions of DiStr1 fall below the grid cost, whereas 100% of the solutions of DiStr1 fall well below the grid cost. As for LCH, The median drops from −0.0173$/kWh to −0.0318$/kWh for DiStr1 and DiStr2, respectively. In both cases, 100% of the solutions are below the base case of using gas boiler only. The savings in gas consumption and the revenues from electrical generation of CHP contribute to the cost reduction of heat generation. Fig. 18 shows the effect of dispatch strategy on the optimum system size of each component. Some of the notable differences can be summarised as follows:

84• DiStr2 produced systems with smaller batteries and larger storage tanks. • Renewable generation components were generally higher in DiStr2 than DiStr1. • Increased reliance on CHP in DiStr2 causes increased revenues and therefore reduction in LCH. • Both systems relied on large boilers that can serve more than 90% of the maximum thermal load. This is attributed to the large spike in demand in the early morning, making a large boiler the best choice.

85To study the difference between the 'best' solutions shown in Table 6, we show the electrical and thermal generation share differences in Fig. 19. On the electrical side, most of the generation is local with about 13% and 7% imported from the grid for DiStr1 and DiStr2, respectively. CHP contributed 32% and 28% for DiStr1 and DiStr2, respectively. Given the relatively low operating cost of the CHP using natural gas, it is an attractive solution for a case with large thermal load like our case study. Battery storage contribution was small with 1.5% and 6.3% for DiStr1 and DiStr2, respectively. This could be attributed to the fact that excess electrical production has multiple uses, such as export back to the grid or be used in the thermal system. Given that the two optimum systems have slightly different component sizes, it is expected that the contribution of each technology would be different. For example, DiStr2 resulted in larger renewables and that is reflected in the larger share in both electrical and thermal demands.

86On the other hand, majority of the thermal load was covered by the boiler (around 64% in both cases). For both solutions, the boiler has enough capacity to cover the entire thermal load for > 90% of the time throughout the year. The nature of the thermal load, with large demand in the early morning hours and then no demand in the night favours the highly dispatchable gas boiler. Renewables contributed 9% and 12% respectively. CHP contributed around 18% in both cases, whereas, storage contributed 10% and 6% for DiStr1 and DiStr2, respectively. The similarity is explained by going back to Fig. 16. It is clear that the two 'best' solutions have similar LCH but different LCE. Figure 6. DiStr2 returns smaller battery bank size, larger tank and larger CHP size. This reflects increased ranking of thermal storage and increased revenues from the thermal system which favours larger CHP units.

Performance comparison of dispatch strategies

87To compare the behaviour of the proposed dispatch strategies, an hourly data comparison on sample dates is done. The dates are chosen to highlight the difference between the two dispatch strategies, namely by choosing time with high renewable generation. In other situations, the two strategies behave similarly.

88Figs. 20 and 21 show the electrical energy balance during the same 2-day period in January, for DiStr1 and DiStr2, respectively. The main difference between the two algorithms is in the charging priority during F. Kahwash et al. Fig. 19. Generation share relative to the total load of (a) electrical and (b) thermal systems for the best two systems shown in Table 6 as a function of the dispatch strategy.

89times of renewable energy surplus. DiStr1 always prioritises charging of the battery and then the thermal storage (note the green bars between hours 5 and 11 in Fig. 20). Conversely, in DiStr2, when the algorithm is expecting surplus renewable generation, it will divert the excess electricity towards the thermal side by fulfilling the load directly and then charging the tank (note the light blue bars between hours 5 and 17 in Fig. 21). When there is expected deficit (Hours 24 to 28 in Fig. 21), DiStr2 charges the batteries.

90The behaviour of the thermal system at the same interval under DiStr1 and DiStr2 is shown in Figs. 22 and 23, respectively. The main difference shown is that renewable contribution is larger for DiStr2 than DiStr1 (note the difference in hours 3 to 12). This is the period when DiStr2 expected surplus electrical generation, so it kept the battery at minimum and diverted the excess energy to partially fulfil the large, coexisting thermal load. Another difference is noted between hours 24 and 26. DiStr1 diverted more surplus to the thermal side than DiStr2. This is caused by the prediction by DiStr2 of deficit on the electrical side, and therefore prioritising of battery charging at that particular time. It should be noted that in the majority of the time, DiStr1 and DiStr2 will behave in a similar way; the difference is most obvious in times of large surplus followed by sustained deficit.

Performance of the GA optimiser

91Establishing the robustness of the optimiser is an important step to ensure accurate results. Ideally, exhaustive search should be carried out to check where the GA solutions are located within the entire search space. However, in our case, the search space is prohibitively large. This is a result of the system being in the order of 10 MWh/day. The upper bound of the search space is set at [ 751, 6002, 8470, 413, 2583, 1787 ] and the lower bound is zero for all components. Given increments of 1 applied to each of the components, there will be 7.2781 × 10 19 solutions in the search space. This is clearly infeasible to solve exhaustively.

92Alternatively, we chose to repeat the optimisation multiple times and examine the variations in the obtained solutions. For each dispatch strategy, 10 repetitions were made. A curve fit is constructed and is shown in Fig. 24 with coefficients with 95% confidence bounds.

93The goodness-of-fit measures are for DiStr1, 2 = 0.9968, = 0.0007515 and for DiStr2 2 = 0.9933, = 0.002359. DiStr1 was generally better fit than DiStr2, mostly in the top left region where most of the solutions show an infliction point (change in direction of curvature). This is shown in the values of RMSE, where DiStr2 is larger by one order of magnitude than DiStr1. This shows that the setting chosen for the GA are suitable and gives better confidence in the results.

Effect of forecasting horizon on DiStr2 solutions

94The forecast horizon is a critical parameter affecting the performance of DiStr2. To understand its effects, the optimisation is run using DiStr2 and varied the horizon in the set: ∈ [ 1 4 7 10 13 16 19 22 ]

95. The same optimisation parameters mentioned in Table 3 are maintained for these simulations. Fig. 25 shows the main effects plots of LCE and LCH as a function of the forecasting horizon. The total Pareto solutions are used in constructing each point (200 solutions each point). There is a clear inverse relationship between the two measures, which supports the notion that the two costs are conflicting in a coupled system. The suitable horizon was chosen = 13, giving a compromise between computational efficiency and accuracy. Larger horizon values will increase the computational runtime due to the averaging of more points at each iteration of the simulation (refer to Eqs. (9),(10)). = [1,7,13,19] hours. The other hours are omitted for clarity of the plot, however, the same analysis still hold.

96It can be seen that longer horizon values causes to dampen and shift ahead of the actual surplus and deficit, as per the direction of the black arrow on the Figure. This is expected as is a summation, so larger horizons will contain both surplus and deficit therefore dampening it around ℎ . Smaller horizon are more accurate (for example, compare the actual surplus in sub- Fig. 26-a during hours 34-42 with the values of at = 1 in sub- Fig. 26-b). However, as will be shown later, better prediction accuracy does not necessarily lead to better management of the surplus.

97The effect of the forecast horizon on the storage technologies in the system (batteries and tank) is shown in Fig. 27. In sub Fig. 27-a, the total energy stored in batteries and thermal tank is plotted against the forecast horizon. Generally, the electrical energy is decreased and thermal energy increased with increased forecast horizon. This is in line with the findings from Fig. 26, in which longer horizons produce 'smoothed' that spread the expected surplus over a longer period of time. This in turn, will cause more energy to be diverted to the thermal side, since the surplus forecast will reduce the priority of battery charging. In sub Fig. 27-b, the effect of the horizon on the frequency of empty storage is shown. As the horizon increases, the number of hours where the battery is flat increases from around 1100 h to 1600 h, while the thermal tank at minimum temperature will reduce in frequency from 290 h to around 230 h. This trend is broadly in agreement with the change in dispatched energy with the length of the horizon. Fig. 28, shows the effect of the forecasting horizon on the battery charging decision. One day with surplus renewables is chosen to highlight the differences. Sub Figs. 28-b-c show that shorter horizons will produce more accurate prediction of the onset of deficit. Longer horizons causes premature prediction of deficit and leading to the battery charging priority to go up at the expense of the tank.

Effect of electricity and gas prices on the optimised solutions

98Finally, we study the effect of electricity import price ( ) and gas price ( ) on the optimum solutions of the system. In both cases, the price level is changed separately and the GA optimisation is run. is studied at four levels, while is studied at five levels.

99The price of electricity imports is changed within the set: = [ 0. 15, 0.25, 0.35, 0.45 ]. The base level of 0.35 $∕kWh is the current prevailing price in the UK [37]. The lower two levels are reflective of historical electricity prices that were prevailing in the last two decades [52]. The highest level represent expected rise in electricity price based on long term trends [27].

100The price of natural gas imports is changed within the set: = [ 0.06, 0.1, 0.14, 0.18, 0.22 ]. The base level that was used in all previous simulations is (0.1 $∕kWh). The lowest value was chosen to correspond to the gas price in the period 2014-2020, when low and stable prices prevailed. The higher values are chosen to anticipate more volatile markets with price hikes [52]. The effect of is summarised in sub Fig. 29-a. Average LCE increased around 3 times, while LCH reduced from 0.05 to −0.07 $∕kWh. The imports from the grid directly affects the electrical side, however, at higher prices, the optimum system configuration returns larger CHP units, which generates revenue causing the LCH to drop. The effect of is summarised in sub Fig. 29-b. LCE and LCH increase with increased gas price. The LCE increase stabilises at high , while LCH keeps on rising. This alters the optimal configuration by reducing the CHP and boiler sizes as shown in Fig. 30).

101The effect of gas price on average system sizes is shown in Fig. 30. Generally, higher gas price resulted in lower component size for CHP and renewables. The drop in CHP size is expected as it becomes less competitive technology with increased gas price. The decrease in renewables could be explained by the increased imports from the grid and decreased exports. Higher prices of gas are making importing from the grid more attractive. In the case of higher gas prices, this is expected to affect the price of electricity imports from the grid. However, in this section we assumed the price of electricity imports to be fixed. At the highest price level, the size of the boiler is significantly reduced. It is compensated by an increase in renewable generation and thermal storage. Fig. 31 shows the effect of electricity prices on the average size of the components. A strong negative correlation is noticed for wind turbine and PV array sizes. This could be related to the smaller difference between imports and exports at the lower electricity costs. Given that the export price was kept constant at 0.065 $∕kWh, there is an incentive to export large quantities of electricity back to the grid, when the difference between the import and exports is small. This effect becomes negligible when the import price becomes significantly higher. On the other hand, positive correlation exist between the cost of electricity and storage size (both electrical and thermal), and also with the CHP capacity. Higher electricity price creates incentive to minimise imports from the grid by storing the excess renewable energy and producing local power using the CHP, with the relatively cheaper natural gas. tandem with increased price level. The reduction of imports is directly related to the increased price. On the other hand, the reduction of the exports is somewhat surprising, given the expectation of increased renewable and local generation. By comparing with Fig. 31, the sizes of renewable generation is reduced with increased imports and at the same time the size of electrical and thermal storage in the system is increased. This indicate that higher grid import prices, coupled with unfavourable export rates (0.065 $∕kWh) will push the system to act as a stand-alone system by minimising interaction with the grid. The increased cost of storage is offset by reduction in renewable generators size. The effect of on imports and exports is shown in Sub- Fig. 32b. Increased gas prices will make the imports from the grid more favourable, and will therefore reduce local generation and push the exports down.

102Finally, the effect of and on local fuel consumption (CHP and boiler) is and is shown in Fig. 33. As increases the boiler consumption decreases and the CHP consumption increases. This is agreement with decrease in boiler and increase in CHP unit nominal capacity, as shown in Fig. 31. In addition, the increase in CHP generation will be used in covering the thermal load and therefore reducing the need for boiler. As for , the ratio of CHP consumption to boiler is around 4 to 6. This indicates that the CHP consumption is the dominant component. The total consumption peaks at 0.14 and then drops at 0.18 and 0.22 $∕m 3 despite sharp increase in the consumption of the boiler.

Final remarks and conclusion

103In this work, we studied grid-connected HRES supplying heat and electricity to a large commercial building. We developed two dispatch strategies, a coupled thermo-electrical (DiStr1) and a coupled thermoelectrical with forecasting of generation and demand data (DiStr2). A case study of a governmental building in the UK is chosen, in which long term electrical and thermal consumption data are openly available. We produced forecasting data for electrical and thermal loads, in addition to solar and wind resources. We compared the accuracy of four forecasting algorithms i.e, Baseline, FBP, NP, and LSTM. The most accurate forecasting data were used in the dispatch strategy DiStr2. We carried out extensive multi-objective optimisation simulations with LCE and LCH as objectives; including sensitivity analysis of the most important parameters on the results (forecasting horizon, gas price, and electricity price). We found that in general, DiStr2 produced cheaper systems, especially in terms of LCH. LSTM algorithm produced the most accurate forecasting among all the studied algorithms. Forecasting horizon, price of gas and price of electricity imports have strong influence on the results. Given the low cost of renewable generation, the system is feasible in most of the studied levels. However, the studied parameters will have a big impact on the component sizes of optimum system in each case.

104The contribution of this work can be categorised in two domains: (i) energy management of HRES and (ii) AI-enabled forecasting of generation and consumption data. In the energy management domain, two novel and tightly coupled dispatch strategies were developed and implemented. Excess electrical renewable energy was treated as a source of electricity and heat at the same time. Generation and demand Table 6 for 'DiStr2'. Longer horizon predict the deficit earlier leading to increase in the battery charging priority over the storage tank. forecasting are integrated into the optimiser. Furthermore, the proposal of theoretical parameters of expected utilisation factors improved the integration of forecasting data in energy management algorithms. As was shown in Fig. 16, levelised cost of electricity and heat were in general reduced (especially heat), confirming the effectiveness of this approach. In the AI domain, the work stands out by conducting comparative study using four forecasting algorithms. Furthermore, both generations (solar and wind) and consumption (electrical and thermal) were forecasted using all four algorithms. To the best knowledge of the authors, this has not yet attempted in the context of HRES. The detailed analysis of prediction errors provided valuable insights into the strengths and weaknesses of each algorithm. Given the specific nature of each datatype, this contribution will help future studies in choosing the most appropriate forecasting method for renewable generation and energy demand datasets of commercial applications.

105The conflict between the optimisation objectives (LCE and LCH) stems from the one-way coupling of generation (electrical-to-thermal), whereby increased on-site electricity generation will increase LCE and decrease LCH. The opposite is not true; the boiler can only provide thermal energy and the CHP is governed by the electrical deficit, not the thermal one. The chosen load profile of a commercial office complex was a deliberate choice, given that such buildings usually have a dedicated equipment room, a large roof space, and potentially surrounding empty space (e.g. a green space or car parking area). This enables the installation of the proposed HRES. However, the proposed dispatch algorithms are general and would apply to different applications where electricity and heat are needed (e.g. residential or industrial). The same system can also be easily adapted to stand-alone systems by eliminating the grid connection and including reliability of power supply as a constraint on the system design. The complexity of the dispatch algorithm drops exponentially by reducing the number of decision variables, i.e. the number of generators and storage equipment. In our case study, the optimiser did not eliminate any of the components (despite having the built-in capability to do so), indicating that all technologies have positively contributed to the performance of the system. The complexity of the system should be considered as a limiting factor, especially when it comes to implementing the proposed dispatch strategies in real-time controller (a future research effort for the authors).

106The results presented in the earlier sections allow us to conclude the following observations:

107• The two proposed dispatch strategies achieved the aim of the paper by reducing the cost of energy to the consumer. By integrating electricity and heat at the system design level, significant reduction is achieved by exploiting the complementarity of the two sides of the system. • Data forecasting improved the results by reducing the overall cost of energy and especially on the thermal side. The forecasted data allowed the dispatch strategy (DiStr2) to divert the excess generation in the best way according to the anticipated levels of generation and demand. However, the accuracy of the forecasting is highly dependent on the quality and length of the datasets. • The proposed system allowed for revenues to be realised through exports back to the grid and by offsetting imports from the electrical and gas grids. • Sensitivity analysis of electricity and gas prices shows that large fluctuations in energy prices lead to a high uncertainty about the benefits of the proposed system. However, such system is still justified on the grounds of 'future-proofing' the energy supply to the consumer. If energy prices continue to increase, local generation will be cheaper. Conversely, if the energy prices stabilised or are reduced, this will create incentive to export back to the grid. The latter could be easily achieved by up-ranking the priority of the exports at the expense of local consumption. Finally, planned tax on carbon and target emissions in many countries point to the feasibility of investing in low carbon local generation. • The introduction of forecasting lead to a significant reduction in the spread of Pareto solutions. This is potentially significant because it indicates that the conflict between LCE and LCH is reduced. In future work, combined levelised cost of energy (LCOE) could be used and the problem converted into single-objective optimisation. • The interaction of the forecast horizon with the optimiser is of complex nature and need to be better understood. However, halfdiurnal and diurnal intervals seem to provide the best results. This is inline with the consumption patterns at the chosen site. • The increased complexity of the system is a weakness, but might be unavoidable as the complexity of energy systems is increasing.

108Finally, we propose some directions for future research as follows:

109-Testing the forecasting accuracy at other case studies (datasets) to generalise the finding that LSTM provided the most accurate predictions. -Improving the expected utilisation parameters. The proposed parameters, and could be made more meaningful by adding weights to the forecast values over the horizon . The weight of the first forecast data-point should be higher than the weight of data-points many hours in the future.

110-Modifying DiStr1 and DiStr2 to stand-alone HRES.

111-Developing real-time controller that achieves the function of DiStr1 and DiStr2. -Adding environmental or other considerations to the study, for example, optimise for LCOE and CO 2 emissions. -Improving the accuracy of the modelling approach by introducing uncertainties and longer term forecasting. -Investigating the corollary of our research question: given a specific HRES architecture, what would be the optimal dispatch strategy if the situation changed over time (e.g. increased loads, change in climate conditions, equipment downtime). -Previous studies (e.g. [9]) showed that a well-designed tariff structures such as Time of Use (ToU) would decrease the cost of energy to consumers. However, we did not include this aspect in our model, since it is within the grid regulator's scope and not up to the end user to decide.

Declaration of competing interest

112The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Data availability

113Data will be made available on request.

참고문헌 36건

  1. Performance of U.S. hybrid distributed energy systems: Solar photovoltaic, battery and combined heat and power Energy Conversion and Management · Elsevier BV · 2015 10.1016/j.enconman.2015.07.048
  2. MES (multi-energy systems): An overview of concepts and evaluation models Energy · Elsevier BV · 2013 10.1016/j.energy.2013.10.041
  3. Optimization of hybrid renewable energy power systems: A review International Journal of Precision Engineering and Manufacturing-Green Technology · Springer Science+Business Media · 2015 10.1007/s40684-015-0013-z
  4. Multi-objective design optimisation of standalone hybrid wind-PV-diesel systems under uncertainties Renewable Energy · Elsevier BV · 2014 10.1016/j.renene.2014.01.009
  5. Hybrid renewable energy systems for power generation in stand-alone applications: A review Renewable and Sustainable Energy Reviews · Elsevier BV · 2012 10.1016/j.rser.2012.02.009
  6. Support vector machines for wind speed prediction Renewable Energy · Elsevier BV · 2004 10.1016/j.renene.2003.11.009
  7. The feasibility of renewable energies at an off-grid community in Canada Renewable and Sustainable Energy Reviews · Elsevier BV · 2009 10.1016/j.rser.2009.06.027
  8. An overview of energy demand forecasting methods published in 2005–2015 Energy Systems · Springer Science+Business Media · 2016 10.1007/s12667-016-0203-y
  9. Solar Engineering of Thermal Processes 2013 10.1002/9781118671603
  10. Forecasting at Scale The American Statistician · Taylor & Francis · 2017 10.1080/00031305.2017.1380080
  11. Optimal design of multi-energy systems with seasonal storage Applied Energy · Elsevier BV · 2017 10.1016/j.apenergy.2017.07.142
  12. Techno-economic evaluation of a community-based hybrid renewable energy system considering site-specific nature Energy Conversion and Management · Elsevier BV · 2018 10.1016/j.enconman.2018.06.109
  13. Solar irradiation prediction with machine learning: Forecasting models selection method depending on weather variability Energy · Elsevier BV · 2018 10.1016/j.energy.2018.09.116
  14. Sizing a stand-alone solar-wind-hydrogen energy system using weather forecasting and a hybrid search optimization algorithm Energy Conversion and Management · Elsevier BV · 2018 10.1016/j.enconman.2018.08.102
  15. Optimal schedule of grid-connected residential PV generation systems with battery storages under time-of-use and step tariffs Journal of Energy Storage · Elsevier BV · 2019 10.1016/j.est.2019.01.030
  16. A Review of Recurrent Neural Networks: LSTM Cells and Network Architectures Neural Computation · The MIT Press · 2019 10.1162/neco_a_01199
  17. Multi-objective optimal design of hybrid renewable energy system under multiple scenarios Renewable Energy · Elsevier BV · 2019 10.1016/j.renene.2019.11.015
  18. Energy Forecasting: A Review and Outlook IEEE Open Access Journal of Power and Energy · Institute of Electrical and Electronics Engineers · 2020 10.1109/oajpe.2020.3029979
  19. Multicarrier Energy Systems: Shaping Our Energy Future Proceedings of the IEEE · Institute of Electrical and Electronics Engineers · 2020 10.1109/jproc.2020.2992251
  20. On the value of combined heat and power (CHP) systems and heat pumps in centralised and distributed heating systems: Lessons from multi-fidelity modelling approaches Applied Energy · Elsevier BV · 2020 10.1016/j.apenergy.2020.115261
  21. A comprehensive electrical-gas-hydrogen Microgrid model for energy management applications Energy Conversion and Management · Elsevier BV · 2020 10.1016/j.enconman.2020.113726
  22. A novel genetic LSTM model for wind power forecast Energy · Elsevier BV · 2021 10.1016/j.energy.2021.120069
  23. Prediction of solar energy guided by pearson correlation using machine learning Energy · Elsevier BV · 2021 10.1016/j.energy.2021.120109
  24. Integration and optimisation of high-penetration Hybrid Renewable Energy Systems for fulfilling electrical and thermal demand for off-grid communities Energy Conversion and Management · Elsevier BV · 2021 10.1016/j.enconman.2021.114035
  25. Optimal Hybrid Energy Storage System Planning of Community Multi-Energy System Based on Two-Stage Stochastic Programming IEEE Access · Institute of Electrical and Electronics Engineers · 2021 10.1109/access.2021.3074151
  26. Energy management for an electro-thermal renewable–based residential microgrid with energy balance forecasting and demand side management Applied Energy · Elsevier BV · 2021 10.1016/j.apenergy.2021.117062
  27. Cost Projections for Utility-Scale Battery Storage: 2021 Update 2021 10.2172/1786976
  28. The many-objective optimal design of renewable energy cogeneration system Energy · Elsevier BV · 2021 10.1016/j.energy.2021.121244
  29. A review of wind speed and wind power forecasting with deep neural networks Applied Energy · Elsevier BV · 2021 10.1016/j.apenergy.2021.117766
  30. Daily operation of multi‐energy systems based on stochastic optimization considering prediction of renewable energy generation IET Renewable Power Generation · Institution of Engineering and Technology · 2021 10.1049/rpg2.12292
  31. Optimising Electrical Power Supply Sustainability Using a Grid-Connected Hybrid Renewable Energy System—An NHS Hospital Case Study Energies · Multidisciplinary Digital Publishing Institute · 2021 10.3390/en14217084
  32. Solar Irradiance Forecasting Using a Data-Driven Algorithm and Contextual Optimisation Applied Sciences · Multidisciplinary Digital Publishing Institute · 2021 10.3390/app12010134
  33. Net-zero energy management and optimization of commercial building sectors with hybrid renewable energy systems integrated with energy storage of pumped hydro and hydrogen taxis Applied Energy · Elsevier BV · 2022 10.1016/j.apenergy.2022.119312
  34. Deep reinforcement learning-based joint load scheduling for household multi-energy system Applied Energy · Elsevier BV · 2022 10.1016/j.apenergy.2022.119346
  35. NeuralProphet: Explainable Forecasting at Scale arXiv (Cornell University) · Cornell University · 2021 10.48550/arxiv.2111.15397
  36. Optimal sizing of hybrid PV–Wind–Battery storage system for Net Zero Energy Buildings to reduce grid burden Applied Energy · Elsevier BV · 2022 10.1016/j.apenergy.2022.119713