A framework for the assessment of optimal and cost-effective energy decarbonisation pathways of a UK-based healthcare facility 1

In light of the global energy and climate crises, integration of low-carbon technologies into energy systems is being considered to mitigate the high energy costs and carbon footprint. The wide range of available capacities, efficiencies, and investment costs of these technologies and their different possible operating schedules can unlock several pathways towards decarbonisation. This paper presents an optimisation framework for a public healthcare facility to determine the optimal operation schedule of the site's energy system. A detailed techno-economic analysis of low-carbon power generation, conversion, and energy storage technologies that can be incorporated into the system based on real historical data was carried out for different scenarios. The results reveal that a heat pump with a capacity of 1800 kW can replace gas boilers on-site to meet the heat demand while recovering the investment in 5 years and providing an operating and carbon cost saving of 22.47% compared to the base case. The analysis shows that a more electrified mode of operation is favoured during high gas prices, thus making electrical energy storage more attractive than thermal energy storage. While handling real data, the optimisation algorithm was sensitised to discriminate conventional energy supplies from clean energy sources by considering their carbon impact so that it minimises energy bills in a smart and eco-friendly way. The optimisation algorithm and the subsequent techno-economic analysis provide a comprehensive framework to decision-makers for facilitating energy investment decisions. The framework can be used based on the short and long term goals of the energy system, visualising the evolution of financial benefits over equipment lifetime, and understanding the environmental impacts of integrating renewable energy.


Introduction
Global warming and environmental pollution have become critical concerns for human livelihood.Adopting low-carbon technologies and integrating renewable energy sources (RES) are vital developments to mitigate these issues [1,2].However, meeting net-zero targets may require a reduction in the use of fossil fuels combined with an improvement in the management of energy conversion systems.In Europe, about 50% of the final energy consumption is used for daily heating activities and running a variety of industrial activities, which implies that heating accounts for over a third of greenhouse gas emissions [3].Thus, decarbonising heat (including space cooling) is critical for decarbonising the energy sector [4].
Coupling multiple energy vectors through an integrated energy system (IES) can significantly improve the security and reliability of energy supply [5][6][7][8][9].Clean heat can be provided by using sustainably sourced electricity, while the flexibility of heat supply and the integration of energy storage systems may facilitate demand-side management.In addition, an IES can incorporate different RESs into the energy network [2].Phasing out fossil fuel-based generation through the integration of RESs can in turn contribute to restrict global temperature rise below 2 • C as stipulated in the Paris Agreement [10].
Healthcare services account for approximately 5% of the UK's carbon emissions, with hospitals and healthcare buildings being the most prominent contributors [11].The healthcare sector thus has an important role to play in the effort to decarbonise the country's economy and mitigate the impacts of climate change.If no significant changes are made, carbon emissions from public health services are expected to increase by 50% in 2050 [11].In response to this, in 2022 the UK's National Health Service (NHS) became the first health system in the world to legally commit to achieve net-zero targets by 2040 [12].These ambitions can be supported by increasing the integration of RES (such as photovoltaic-thermal (PVT) systems), incorporating energy storage units, and adopting low-carbon technologies such as heat pumps (HPs) [13].
Considering the substantial impact of the health sector on carbon emissions and the UK's commitment to achieving net-zero targets, it becomes crucial to explore sustainable possibilities for reducing the environmental footprint of healthcare facilities.This research aims to assess the decarbonisation of a public healthcare facility in the UK by incorporating low-carbon technologies into its operation.
HPs have been recognised as key components to achieve decarbonisation of heat; i.e. reducing carbon emissions from systems supplying heat energy for various consumption purposes [14].They can offer much higher electrical efficiency for producing heat compared to electric heaters or boilers.For instance, ground source HPs have a coefficient of performance (COP) between 3 and 4 [14].According to the International Energy Agency, HPs offer the largest electrification opportunity in the building sector to meet heat demand by replacing fossil fuel boilers [15].At the same time, PVT systems are of interest towards decarbonising heat as they simultaneously convert sunlight into electricity and heat [16,17].In general, integration of RES such as solar or wind energy into energy systems may help mitigating challenges arising from sudden fossil fuel price surges and disruptions due to geopolitical conflicts [16], [18,19].
RES produce clean energy in an intermittent manner which depends upon climatic factors such as the availability of the solar or wind resource at different times of the day and in different seasons of the year.These intermittencies prevent a consistent and reliable energy supply, which may be further hindered by the consumer demand patterns.To mitigate such a gap in energy demand and supply, energy storage systems are deployed.Lucrative gains in terms of increased renewable energy intake and reduced fossil-fuel usage could be attained by using thermal energy storage (TES) [20] and electrical energy storage (EES) systems [21].
Efficient optimisation tools play an essential role in both the operation and planning of an IES.Integration of different energy vectors with technologies such as PVT systems, EES units, TES units, boilers, combined heat and power (CHP) units, and HPs provides flexibility and the opportunity to optimise the overall operation of the energy system while meeting energy demand.Different optimisation algorithms, such as genetic algorithms (GAs), particle swarm optimisation (PSO), and linear programming (LP) have been proposed in the literature to achieve this.The energy hub concept, a framework used to model an IES in a steadystate regime, was introduced in [5,6], and is often adopted to facilitate the use of these optimisation algorithms.
Relevant studies employing the energy hub methodology to develop optimisation algorithms are available in the literature.For instance, a steady-state power flow model considering multiple energy vectors based on the energy hub approach was presented in [8].Reference [22] addresses the challenges associated with the variability and uncertainty of RESs in an IES modelled using energy hubs.The paper offers valuable insights into developing optimal energy management strategies under stochastic conditions.The effective integration and coordination of multiple energy vectors in an IES formulated using energy hubs is studied in [23].The work considers the interdependencies between natural gas and electricity systems.Reference [24] provides a comprehensive overview of recent research efforts on the key methodologies, mathematical models, and optimisation algorithms used in energy hub modelling.

ACS
The success of a retrofitted energy system and the resulting cost savings significantly depend on the availability and quality of the adopted low-carbon technologies and can be enhanced by the integration of RES.The difference between the operating costs of a baseline case without any renewable technology integration and a case incorporating sustainable technology may result in a return on investment.Thus, conducting a techno-economic analysis is crucial, as it can help facility managers make informed decisions before a significant investment is incurred [25].For public healthcare facilities, such an analysis can help identify cost-effective measures to limit their environmental impact by reducing their carbon footprint.While several studies have examined the benefits of optimisation for retrofitted systems [26][27][28], the literature on the techno-economic analysis of sustainable possibilities for the healthcare sector is limited.In addition, studies assessing the integration of clean technologies to decarbonise an IES utilising real sourced data to achieve an optimal system operation are scarcely available.
This paper bridges the aforementioned research gap and presents a framework for achieving optimal and cost-effective energy decarbonisation pathways of a UK-based healthcare facility.Decarbonisation is achieved through the incorporation of low-carbon technologies into the facility to reduce its reliance on fossil fuel-based heat sources.The upgraded energy system is assessed by considering the installation of HPs, PVT systems, and energy storage devices in different combinations, leading to different operating scenarios.
An optimisation algorithm based on energy hub models was developed to determine the most cost-effective approach for meeting energy demand.This algorithm considers the retrofitted technologies and incorporates the cost of carbon emissions.Real data was used to evaluate the different scenarios and conduct a techno-economic analysis.
The results demonstrate the suitability of the optimisation algorithm for operation planning of the healthcare facility and highlight the benefits of integrating HPs within the IES.Furthermore, considering future challenges, such as reduced conventional fuel supply due to global netzero targets and ongoing fuel shortages, the findings and proposed framework offer valuable insights for decision-making in transitioning to low-carbon technologies within large-scale energy networks.

System description
The operation of the system under study is based on the electricity and heating demand profiles of Queen Elizabeth Hospital (QEH) King's Lynn, a public healthcare facility in Norfolk County, England, UK.The facility is connected to an electricity network and a gas supply network.The on-site IES considers two CHP units (one in stand-by) and four gas boilers (two in stand-by) to satisfy the electricity and heating demands [29].
Electricity can also be obtained from the available grid facility to meet the hospital's electricity demand.Fig. 1(a) shows an aerial view of QEH and Fig. 1(b) shows a high-level schematic of its IES.Only the regularly operating CHP unit (2000 kW output power) is considered in the schematic, and an equivalent gas boiler of combined capacity (taken as 3200 kW output power) represents the operational boilers.
The original system configuration was modified to incorporate sustainable energy technologies in line with the urgency to reduce greenhouse gas emissions [30].A PVT system, an HP, a TES unit, and an EES unit were considered as possible upgrades to the IES, as shown in Fig. 2. The schematics and key mathematical expressions for each scenario arising from the possible combinations of the considered technologies are presented in Appendix A.
Table 1 shows the total investment cost (TIC) of the retrofitting technologies considered in this paper.Their capacities were selected heuristically and informed by available references [31][32][33][34].

System modelling
The system under study was modelled using the energy hub methodology [6], which enables analysing the interactions between different energy vectors and can be used to assess the flexibility of the energy supply.
The objective of the study was to determine the optimal flows of electricity, gas, and heat at every hour to meet electricity and heat demand.To this end, an optimisation algorithm was developed (see Section 2.3 for further details), aiming to minimise the total operational cost of the system while considering the cost incurred due to CO 2 production.The algorithm determines the optimal gas and electricity intake at every hour considering cost and carbon emissions.Sixteen different scenarios were evaluated to assess the effect of each low-carbon technology shown in Fig. 2, with results shown later in the paper in Section 3.
Real data from QEH was used for the study, which includes hourly electricity and heat demands for the year 2020.The energy demand at every hour was averaged on a weekly basis and used as input for the optimisation algorithm, which calculated the optimal daily operating and CO 2 production costs.With these values, the annual costs were obtained to conduct a techno-economic analysis.
The current operating version of the IES in QEH was considered as the base case (termed Scenario 0), composed of a CHP unit and a gas boiler connected to the gas supply network (see Fig. 1).Electricity and gas can be drawn from the available grids to meet the energy demand.
Fig. 3 shows the daily price profiles for gas and electricity adopted in this paper based on energy prices available at the hospital site in 2020 and average market prices [35].
Fig. 4 shows the heat and electricity demand profiles for Week 1 of 2020.The demand profiles for the representative weeks of the year considered in this paper are presented in Appendix B.
The energy demand data from the healthcare facility reveal certain characteristics of the electrical and thermal loads.The electrical demand follows a typical pattern seen in commercial buildings, with a baseline load slightly exceeding 800 kW in all seasons (see Figs. B.1-B.4 in Appendix B).This high baseline load is expected due to the continuous operation of numerous equipment on-site.The winter electrical peak occurs earlier in the day and is approximately 100 kW higher than the summer peak.This could be attributed to the early activation and more extensive use of indoor lighting equipment in winter evenings due to fewer sunshine hours.
Regarding heating demand, noticeable changes are observed across  ).This could be mostly attributed to the reduction in the space heating needs in summer since the heat required for medical equipment sterilisation is likely to be comparable in different seasons.
The following assumptions for system modelling were considered (based on the data provided by QEH and information available in the literature): i.The system is considered to be in steady-state between two time periods.ii.There are no stand-by energy losses from system components.
iii.The gas-to-electricity conversion efficiency (η g/e CHP ) of the CHP unit is 43% and its gas-to-heat conversion efficiency (η g/h CHP ) is 45%.iv.The efficiency of the gas boiler (η GB ) is 81% [36].v.The charging and discharging efficiencies of the TES unit (η TES ) are 90% [6].vi.The charging efficiency of the EES unit (η ch EEE ) is 98% [37].vii.The discharging efficiency of the EES unit (η dis EEE ) is 96% [37].viii.The COP of the HP (η HP ) employed varies between 3 and 4 according to ambient temperature fluctuations, as detailed in [38,39].ix.For the PVT system, the area considered is the roof of the QEH, which is 240 m 2 , the electrical efficiency is 12%, and the thermal efficiency is 30% [40].x.Exporting surplus electricity from the IES back to the external grid is not provisioned in this case study.

Optimisation methodology
As shown in Fig. 1, the system under study takes in electricity and gas as inputs to supply the required electrical and heating demands.The energy system needs to judiciously select the electricity or gas intake to reduce energy costs and the production of CO 2 .The amounts of CO 2 due to electricity and gas consumption (m E CO2 and m G CO2 ) are given by [26]: where μ E CO2 is the CO 2 emission conversion factor for generated electricity and μ G CO2 for gas.μ G CO2 was assigned a value of 0.220 kg/kWh (i.e. for natural gas) [27].For the carbon intensity of electricity, a profile that varies hourly was used [41].P E ca and P G ca represent the quantities of electricity and gas consumption.The penalty cost of CO 2 production C CO2,pen was assumed as 80.64 £/ton [26].Therefore, the costs of CO 2 production associated with electricity and gas consumption (C E CO2 and C G CO2 ) are given by [26] The cost of P E ca and P G ca at every hour together with the cost incurred due to CO 2 production determine the total daily cost.Since the goal of the study was to minimise the daily operational cost of the system considering carbon emissions, the objective function is expressed as where C is the daily operational cost; C E grid,i and C G grid,i are the electricity and gas unit costs at hour i; P E grid,i and P G grid,i are the power inputs to the energy system from the electricity and gas networks at hour i; and C E CO2 and C G CO2 are the costs of CO 2 production associated with electricity and gas consumption defined in ( 3) and ( 4).
The objective function ( 5) is subject to the following equality constraints (representing the electrical power and heat balance equations): where P G CHP,i and P G GB,i are the power inputs to the CHP unit and the gas boiler from the gas grid; P Egrid HP,i and P Epv HP,i are the electricity inputs to the HP from the external electric grid and the PVT system; P H PV,i and P E PV,i are the heat and electricity outputs of the PVT system; P B ch,i and P B dis,i represent the charging and discharging powers of the EES unit; and P TES ch,i , and P TES dis,i represent the charging and discharging powers of the TES unit.As renewable technologies have been considered for possible integration into the IES, the use of energy storage units in tandem provides flexibility through load shifting since additional energy can be stored for later use during peak demand hours.Based on the dimensions of hot water tanks available in the market and considering the supply and return temperature of the IES [42], the capacity of the TES unit used in this paper was selected as 1000 kWh [43] (see Table 1).Its charging and discharging powers P TES ch,i and P TES dis,i per time period (i.e. 1 h) are constrained as [43].
In other words, the ramp rates for charging and discharging the TES unit are constrained to 1000 kW per hour.
The capacity of the adopted EES unit is 800 kWh [43,44] (see Table 1).Its charging and discharging powers P B ch,i and P B dis,i per time period (i.e. 1 h) are constrained between the following limits [43]: The previous equations imply the ramp rates for charging and discharging the EES unit are constrained to 200 kW per hour.
To ensure the energy levels in the energy storage units remain within the predefined maximum and minimum limits, the following constraints were imposed: where Δt is the hourly time period considered in the optimisation algorithm, L TES max and L TES min are the maximum and minimum capacities of the TES unit, and L EES max and L EES min represent the upper and lower limits of the EES unit's capacity.The minimum capacities were assigned values L TES min = 100 kWh and L EES min = 80 kWh to avoid a complete discharge of the units.In contrast, the maximum capacities L TES max and L EES max defined in Table 1 were parameterised in Section 3.5 to observe the effects of modified capacities on the economics of the IES.As the iterable "j" progresses from 1 to 24 in ( 12)-( 15), this ensures that the net energy charged to the energy storage unit minus the net energy discharged from the unit every given hour must be within its minimum and maximum capacities.Doing this exercise for all the hours keeps the energy levels within the prescribed bounds.
To ensure the energy stored in the TES and EES units at the end of the diurnal cycle remains the same as during the start of the diurnal cycle, the following equality constraints are included: Constraints ( 16) and ( 17) enable the cyclic operation of the energy storage units.
It is relevant to mention that the electricity and heating loads are not explicitly modelled.Instead, the operation of the system is optimised by adopting load profiles from timeseries data of the actual facility.The modelling approach can be adopted to optimise other energy systems by replacing the terms P E d,i , P H d,i in ( 6) and ( 7) with timeseries data of the specific facility or a detailed model of the loads when these are available.More details of this aspect are discussed in Appendix C.
Thermal characteristics of large-scale heating networks may play a relevant role in the optimisation of IESs [45].However, these are case specific and may change according to the size of the facilities, network architectures and heating provision, and storage technologies [46].These characteristics are not included in the optimisation methodology in order to maintain its general applicability and study the adoption of different technologies.
System optimisation was conducted for 16 different scenarios arising from the different combinations of the considered sustainable technologies, where an HP, a PVT system, a TES unit, and an EES unit have been incorporated into the baseline system under study.The active constraints for each specific scenario are detailed in Appendix A.
To provide confidence in the optimisation methodology, the test system shown in Fig. 5 consisting of an electrical transformer, a CHP unit, and a TES tank was optimised with the presented algorithm.The results were compared to those reported in [6].The optimal daily operational cost reported in the reference is 636 monetary units, while the cost obtained with the algorithm here presented is 627 monetary units.This good agreement in the results verifies the applicability of the algorithm presented in this paper.For additional information on the verification of the optimisation methodology, the interested reader is directed to Appendix D.
The marginal difference between the results is most likely due to the handling of energy storage units in the optimisation algorithms.While [6] considers the energy levels of the TES unit as decision variables and determines the power flows across the component from the changes in the stored energy levels, the optimisation algorithm in this paper considers the inward and outward power flows through all components in the energy hub as independent variables to be optimised irrespective of their nature (i.e.whether a converter, source, or energy storage unit).This way, all the system components are handled in a unified way.The energy levels in an energy storage unit are evaluated by aggregating its inward and outward power flows.

Economic analysis
To gain insights into the economic benefits that can be realised through low-carbon energy upgrades of the IES in QEH and to understand the cashflows associated with retrofit procurement and cost saving, a detailed techno-economic analysis was carried out.This starts with calculating the payback period (PP), which is the simplest method for assessing the effectiveness of an energy project [25].PP is defined as where TIC is the total investment cost and ACS stands for the annual cost savings.
The ACS due to integration of sustainable retrofits is the reduction in the recurrent outward cashflow in the future years.It needs to be weighed against the TIC, which is incurred up front.This is done by considering the time value of money and calculating the net present value (NPV) [28] using where k is the discount rate (which is assumed to be 5% [25]), t is the time of the cashflow, R t is net cashflow at time t, and N is the total number of time periods.This approach assumes that both the costs and benefits associated with the project will increase at the same rate over time [25].The impact of general inflation was not taken into consideration in this paper.
A more realistic parameter to evaluate the economic benefit of a project is the discounted payback period (DPP), which is an adjusted form of the simple PP that considers the time value of money and discounts projected cashflows.It represents the amount of time required to recoup the initial investment cost of a project, considering that the amount of money earned or the cost saved in the future is weighed less compared to the same amount at present.To determine the DPP for an energy retrofit project, the NPV in (19) must be set to zero [28]:

A note on the implementation of the optimisation methodology
In the literature, many optimisation studies utilise multi-objective optimisation techniques, often employing complex tools such as genetic algorithms (GAs) or the particle swarm optimisation (PSO) algorithm [26,27].These metaheuristic approaches require high computational resources to converge towards an optimal solution without using gradient information.The complexity and hence the demand for computational resource further increases with multiple objective functions to optimise.Gradient-based solvers, on the other hand, can converge to optimality much faster by identifying the search direction from the gradient information.In addition, the studies incorporating energy storage devices usually rely on the state of charge (SoC) of the storage unit, such as in [6].Instead, this paper presents a method that differs from the traditional multi-objective algorithms for optimisation.It utilises a single-objective function to simultaneously minimise operational and carbon emission costs.The optimisation problem formulated through the objective function ( 5) and the constraints ( 6)-( 17) is a nonlinear constrained problem.Its implementation was done in MATLAB 2021b using the fmincon function to solve it [47], which adopts the sequential quadratic programming (SQP) algorithm.This algorithm exhibits a fast convergence to optimal solutions and is thus highly efficient in terms of computational time.Moreover, the algorithm is known for its numerical stability, allowing it to achieve accurate results even for highly nonlinear optimisation problems [48,49].The SQP algorithm is briefly explained in Appendix E.

Results and discussion
The system investigated in this paper was evaluated for optimal power dispatch, with a suitable schematic for each of the different scenarios shown in Appendix A. A techno-economic analysis was conducted for each scenario, with a summary of the results presented in Table 2.In the table, a red shading means the named technology in the top heading was not considered for the scenario, while the green shading implies it was considered for upgrading the baseline IES (represented by Scenario 0, shown at the top of the table).The results were sorted from the scenario leading to a shortest DPP to the longest one.
The system configuration exhibiting the shortest DPP is Scenario 8, where the base system (Scenario 0) was upgraded with a PVT system only.These results are explained by the low investment cost of the PVT technology.In contrast, Scenario 3, which involves retrofitting both type of storage units to the base case, leads to the longest DPP.These results indicate that the IES would benefit more from renewable generation or energy conversion technologies rather than from energy storage solutions.This is due to the moderate demand-side management Fig. 5. Schematic of the IES used in [6].opportunities arising from mild fluctuations in the energy prices and demand.Fig. 6 shows the percentage annual savings in operational cost and carbon emissions achieved with each retrofitting scenario compared to the base scenario.This considers the price profiles for gas and electricity shown in Fig. 3.These data offer quantitative insights into the effectiveness of each retrofitted energy system in terms of cost reduction and environmental impact through reduced carbon emissions.Linking Fig. 6 with Table 2, it can be observed that all the scenarios that consider an HP result in substantial reduction in operational cost as well as carbon emissions compared to the other scenarios.Scenario 15, which considers all the retrofits, leads to the highest savings with respect to the base scenario.
Further details on the quantitative information shown in Fig. 6 is provided in Appendix G.
Three scenarios from Table 2 were selected for a more detailed analysis: Scenario 0 (base case without retrofits, denoted as Case 1), Scenario 4 (where an HP only is retrofitted into the IES, denoted as Case 2), and Scenario 15 (where all the available technologies are retrofitted into the IES, denoted as Case 3).Scenario 0 is important as it represents the 'business as usual' configuration and enables benchmarking the performance of the IES.Scenario 4 was selected to focus specifically on the effect of integrating an HP, as all the scenarios in Table 2 that reduce the operating cost below £700,000 have an HP in common.Scenario 15 was selected to study how maximising investment into the hospital could improve its operation.The other scenarios have not been examined in detail as they yield returns that are similar to any of the three scenarios selected for a detailed analysis.
A week during summer and a week during winter were selected to evaluate the effect of seasonality and hence a difference in energy demand on system performance.This further analysis aimed to assess the impact of the diverse technologies and how the system operation is improved during winter when the heat demand is high and the utilisation of gas boilers is reduced.Reducing gas consumption and the DPP indicates an economical option to decarbonise heat.The three cases are discussed in detail next.

Case 1 (Scenario 0)
The base case is analysed in more detail as it resembles the current energy system at QEH (see Fig. 1).Besides the available electricity network, only the CHP unit and the gas boiler are used to meet the electricity and heat demands.Fig. 7 shows the optimal power dispatch of the system.The optimisation algorithm suggests meeting the demand through low-cost gas only.It can be seen in Fig. 7(a) that the gas boiler dominates the gas consumption in Week 52 of the year (during winter).This is reflected by the blue trace, which represents the heat produced by the boiler.This trace appears above the orange trace (representing heat produced by the CHP unit) throughout the 24-h period, indicating a greater utilisation of the gas boiler than the CHP unit.During summer (Week 25), as shown in Fig. 7(b), the gas boiler is still employed to meet heat demand even if this is low.This is evidenced by the blue trace (boiler's heat output) lying below the orange trace (CHP unit's heat output) for almost all hours.However, there is significant use of the gas boiler for the first 16 h of the 24-h period.
As a result of relying on fossil fuel-based heat sources, Scenario 0 leads to the highest amount of annual carbon emissions and annual operating cost.

Case 2 (Scenario 4)
Scenario 4 was selected for further examination because it evidences Fig. 6.Operational, carbon emission, and total annual savings with respect to the base scenario considering the price profiles in Fig. 3. Fig. 8 illustrates the optimal power dispatch for this scenario.The optimisation algorithm recommends maximising the utilisation of the HP to meet the required heat demand.As shown in Fig. 8(a), for Week 52 of the year (winter), the HP takes advantage of its high efficiency to reduce the heat supply through the gas boiler compared to the base case.The reduction is evidenced by the blue trace in the figure when compared to the blue trace in Fig. 7(a).This leads to a decreased gas consumption and lower carbon emissions-which contributes to the decarbonisation of the energy system.Fig. 8(b) shows the optimal power flows in Week 25 of the year (summer), where the gas boiler remains idle during the diurnal cycle.This is indicated by the horizontal blue trace with values of 0. This emphasises the potential of the HP as a substitute for the high-carbon footprint gas boiler in the IES.For the last 8 h of the cycle, even the HP remains idle (see the magenta trace), because the relatively lower heat demand in summer can be met directly by the CHP unit while also meeting the electricity demand.This is represented by the orange trace.These results dictate the use of CHP unit throughout the entire cycle unlike the gas boiler and the HP.

Case 3 (Scenario 15)
In Scenario 15, all the available technologies are deployed.Although this scenario involves the highest capital investment, it yields the most favourable outcome in reducing annual operating and carbon emissions costs among all the cases considered.However, this system configuration does not exhibit the quickest recovery of investment.
By incorporating different low-carbon technologies, it can be seen in Fig. 9(a) that there is a significant reduction in the use of gas boilers during Week 52 (winter) compared to the base case shown in Fig. 7(a).This is evidenced by the reduced quantities in the blue trace in Fig. 9(a) compared to the blue trace in Fig. 7(a).Nevertheless, the utilisation of the gas boiler remains similar to the scenario where only the HP was added to the IES (Scenario 4, see Fig. 8(a)), as indicated by the similar pattern of the blue traces in the two figures.
The gas boiler is not operated during the diurnal cycle in Week 25 (summer), as evidenced by the horizontal blue trace with values of 0 shown in Fig. 9(b).This is due to the incorporation of other clean technologies into the IES alongside the HP to meet a lower heat demand in the summer and the production of heat by the CHP unit (orange trace) as it operates to meet the electricity demand (green trace).

Impact of surges in energy price
The impact of sudden changes in trade policies can be significant, causing considerable economic implications for consumers, businesses, and governments [18,19].One approach to assessing the effects of such unforeseen events is to examine different energy price profiles that reflect the new market conditions.For instance, doubling and quadrupling the gas price in Fig. 3 (shown in Fig. 10(a) as pricing scenario a), as shown in Figs.10(b) and 10(c) (i.e.pricing scenarios b and c), can provide insights into the potential consequences of sudden gas price surges.Investigating a scenario with both higher electricity and gas prices (pricing scenario d, Fig. 10(d)) could provide a further understanding of the potential challenges faced when energy security is affected.A discussion on the outcomes of the techno-economic analysis for the 16 different retrofit configurations considering the three different variations in price as depicted in Figs.10(b) to 10(d) is provided next, with further information available in Appendix F. Upon doubling the gas price and keeping the regular electricity price profile (pricing scenario b) the optimisation algorithm indicates that electricity and heat demands can be met economically by relying primarily on gas usage.Although small, a reduction in the cost of carbon emissions is achieved, which leads to lower DPP values for each retrofit configuration (see Table F.1 in Appendix F).However, by increasing the gas price to a value of £0.08 (i.e.quadrupling the regular price, pricing scenario c), the optimisation algorithm suggests reducing the usage of gas-based energy sources (Table F.2 in Appendix F).As observed, the cost of carbon emissions has decreased, leading to substantial annual savings.Consequently, incorporating low-carbon technologies has yielded significant cost benefits, enabling a lower DPP in most scenarios.
Upon an increase in both electricity and gas prices (pricing scenario d), gas and electricity consumption remain the same as they were during regular energy prices (pricing scenario a) shown in Fig. 10(a).For these price conditions, meeting energy demand relies majorly on utilising gas.However, the substantial increase in the unit prices of electricity and gas results in greater annual savings because each unit of energy saved has higher equivalent monetary value.This significantly reduces the DPP for each retrofit configuration (see Table F

.3 in Appendix F).
For further details on the sensitivity analysis just discussed, the interested reader is referred to Appendix F.
Fig. 11 provides quantitative insights into the cost-effectiveness of each scenario by depicting the total annual savings when the gas prices increase.This exercise has been done for when the gas prices are quadrupled (see Fig. 10(c)) as this means that the increased gas price of £0.08 is close to the off-peak electricity prices.As previously discussed for Fig. 6 and Table 2, when connecting Fig. 11    Appendix F, the scenarios considering an HP retrofit lead to significantly higher savings compared to the other scenarios.The highest savings in both operational cost and carbon emissions are obtained in Scenario 15, which considers all the retrofits.With the elevated gas price, every unit of energy recovered through retrofitting and scheduling becomes more economically valuable.Thus, higher percentage savings with respect to the base scenario are observed in Fig. 11 compared to those in Fig. 6.
Further details on the quantitative information shown in Fig. 11 is provided in Appendix G.

Economic impacts of different capacities of retrofitting technologies
In this section, the decision to incorporate a single sustainable technology into the baseline IES of QEH (i.e.Scenario 0) is examined by modifying the installed capacity of the technology.This exercise implies systematically varying the capacity of the considered retrofits from 10% to 300% to assess the implications of this integration.This analysis considers the lifetime of each device [50][51][52][53], along with the corresponding TIC, as summarised in Table 3. Fig. 12 compares the variations in NPV of the retrofitted HP throughout the equipment's lifetime when the capacities of the unit are 900 kW (100%) and 1800 kW (200%).The results suggest that the unit with a capacity of 1800 kW is preferable as it offers a higher NPV (£2,554,719, see red trace in the figure) until the end of its lifetime.As Fig. 11.Operational, carbon emission, and total savings with respect to the base scenario with quadruple gas price (as in Fig. 10(c)).mentioned in Section 2.4, the DPP for each unit is the point where the NPV becomes £0.Thus, the DPP is around 4 years for a 900 kW HP, which is consistent with the information presented in Table 2 (see Scenario 4).In contrast, for an 1800 kW HP, the DPP is slightly higher than 5 years.
The following observations are drawn from Fig. 12.The HP with a smaller capacity leads to a shorter return period of initial investment cost.This is indicated by the intercept of the blue curve with the abscissa axis.However, the rate of annual cost reduction from the technology until the end of its lifetime after the DPP is smaller, as shown by the ordinate value of the blue curve in year 20, when compared to the HP with a larger capacity.This is reflected by the orange curve, which intercepts the abscissa axis later than the blue curve does this, but eventually reaches a larger ordinate value in year 20 than the blue curve does.Increasing the capacity of the HP, however, increases the initial investment cost, as depicted by the lower starting point of the orange curve in year 0 compared to the blue curve.
Fig. 13(a) shows the variations in the DPP of the HP as its capacity varies from 10% to 300% of the original capacity considered in Table 1.The DPP increases as the HP capacity becomes larger due to the sharp rise in equipment cost.However, Fig. 13(b) shows that a capacity of 200% (an HP of 1800 kW) brings the highest overall benefit by balancing the initial investment return period and the rate of return until the end of the equipment lifetime.The cost saving for this HP capacity compared to the base case scenario with no retrofits is 22.47% (quantified as the annual savings divided by the total operating and carbon emissions cost of Scenario 0 in Table 2).This exercise was carried out for the other retrofitting technologies (i.e.PVT, TES, and EES) with corresponding results presented in Figs.14-16.From Figs. 14 to 16, as with the HP, the DPP for all the technologies increases when their capacity is increased, although at different rates.The PVT system shows the least rate of increment in the DPP with increasing capacity (see Fig. 14) while, in contrast, the EES unit exhibits the highest rate of increment (see Fig. 16).For the PVT system, this results in a continuous increase in the NPV at the end of the equipment's lifetime for all the capacities considered.However, it should be emphasised that the capacity of the PVT system is constrained by the roof space available to install solar panels on-site.For the system under study, a capacity beyond 100% of the PVT system is not feasible for the limited roof area of 240 m 2 .
For the fluctuations in the demand and price of energy in QEH, a TES unit of 25% capacity (250 kWh) and an EES unit of 50% capacity (400 kWh) will be the most beneficial, as shown in Fig. 15(b) and Fig. 16(b).The steep reduction in the NPV at the end of the lifetime for both storage units when the capacity is large indicates that the units do not further    increase the cost savings through demand-side management that is commensurate with the considerable rise of investment cost with energy storage capacity.
The optimal capacities of the retrofitting technologies determined from the analysis discussed above were adopted to re-execute Case 3 (Scenario 15), with corresponding results shown in Fig. 17 for a week in winter and a week in summer.By comparing Fig. 9(a) with Fig. 17(a), it can be seen that the heat output from the gas boiler reduces, while the heat output from the HP increases after the capacities of the retrofits were optimised.
The previous considerations lead to a lower total cost in the IES when this has been upgraded with optimally sized technologies.As shown in Fig. 18, the NPV increases to £1,967,332 from £1,315,151 in the original Scenario 15.Nevertheless, it is worth noting that the scenario with optimal capacities of the upgrading technologies implies a slightly longer DPP of 5 years (i.e. when the NPV is £0), in contrast to Scenario 15 with a DPP of 4.2 years.This shows the importance and impact of adequately sizing the retrofitting technologies to gain maximum economic as well as environmental benefits.

On the improvements achieved by optimally operating the existing system (base case)
To provide further insight on the benefits attainable by the presented optimisation methodology, the operation of the hospital's current energy system and the optimised base case were compared using existing energy consumption data from the system.To carry out this comparative exercise, the electricity and heating demands for a week in autumn as illustrated in Fig. 19 were considered in the evaluation.
Table 4 shows a comparison between the operational costs for the   non-optimised energy system considering the electricity and gas prices shown in Fig. 3 against the optimised scenario.The optimised base case reduces the overall energy consumption, which reflects in a cumulative decrease of 4.3% in the operational costs for the week in autumn.Fig. 20 shows graphically the information in Table 4, where the reduction in daily operating cost for the optimised system operation can be appreciated more clearly.

On the challenges for implementing a retrofitting solution in the hospital and extending the scope to other energy systems
The economic and environmental benefits of a retrofitted energy system can be achieved only after overcoming certain barriers.One major challenge is convincing management authorities about the value of reducing carbon emissions.The monetary worth of carbon footprint mitigation may not be evident, leading to difficulties in making the investment decisions required for sustainable retrofits.This could be circumvented by having strong policies in place complemented with financing and subsidies.
In the UK health sector, the NHS has already strong ambitions towards decarbonising their operations, as evidenced by their legal commitment to achieve net-zero emissions by 2040 [12].Although healthcare facilities were strained highly during the Covid-19 pandemic [54], thus limiting their ability to invest in capital-intensive sustainable retrofitting projects, these barriers are expected to be resolved as the economy recovers over the following years.Such a push towards decarbonisation is also prevalent in other industrial sectors and several other countries.However, it is important to continue raising awareness about the positive energy and environmental outcomes of sustainable technologies to facilitate a transition to a carbon neutral society.The findings of this study can contribute to that process.
Another challenge arises from the practical considerations for implementing any of the retrofitting scenarios investigated in this work.For example, installing large capacity HPs in a crowded hospital presents challenges due to space constraints and ventilation requirements.Besides, upgrading large piping networks and maintaining adequate operating temperatures could be additional challenges associated with this technology.PVT panels will require large space with minimal shading to effectively capture sunlight.Similarly, adequate space may not be available for a TES or EES unit near the source or load points to minimise losses during charging and discharging.The installation processes of the retrofits could disrupt critical healthcare operations, potentially impacting patient care and causing inconveniences.Although all these matters must be considered ahead of a practical deployment of an optimised retrofit configuration for QEH, a detailed assessment falls out of the scope of this paper.
The framework presented in this paper can be also adopted to upgrade traditional energy systems with significant thermal energy demand-possibly leading to results not too dissimilar from those here reported.Common examples are domestic systems for indoor space heating and hot water production in cold climates.These systems generally require to meet high thermal energy demand and may benefit by incorporating HPs and other renewable technologies.For example, installing rooftop photovoltaic (PV) panels in houses to generate electricity and to also run an HP may reduce the gas consumption for heating services.As described in [55], HPs can meet a high thermal demand with a reduced electricity input obtained from a PV system.The idea of integrating low-carbon and high-efficiency HPs has been advised by the UK Government, targeting the installation of 600,000 units per year by 2028 to decarbonise heating services [56].

Conclusions
This paper highlighted the importance of decarbonising public healthcare services in the UK to support the country's net-zero ambitions.The proposed framework for decarbonising the IES offers a costeffective approach by incorporating sustainable energy technologies and optimally scheduling their operations.

Table 4
Current operating cost of the hospital's IES compared to the optimised base case.The hospital carries a large potential to undergo decarbonisation by meeting its thermal energy demand through an HP (offering the highest cost savings of 22.47%) instead of using carbon-intensive gas boilers.While the incorporation of an HP could be regarded as the highest investment with a high return retrofit, a PVT system was found to be an alternative with quick and smaller returns (DPP of 2.6 years) if limited capital availability is a constraint.
Optimal capacities for the considered retrofitting technologies must be selected while aiming to meet the energy demand.This is to avoid investing in oversized retrofits when limited cost saving opportunity exists or to avoid marginal cost savings with undersized retrofits when further scope of cost saving exists.
The unit price variations of different energy vectors and changes in their hourly demands in the hospital did not justify investment in energy storage technologies.However, fuel prices do have important implications on the relative benefits of different retrofitting configurations.For example, EES and TES units offer similar DPPs under regular fuel prices.Nonetheless, fuel shortages and consequent gas price hikes can shift the IES to a more electrified mode of operation, where an EES unit can offer a substantially shorter DPP than a TES unit.
In the future, where the conventional fuel supply is likely to reduce due to global net-zero targets and continued fuel shortages, the reported findings and the presented framework can support an adequate decisionmaking while switching to renewables in large-scale energy networks.

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.

Appendix C. Adapting the optimisation framework to other energy systems
The approach described in this paper can be extended to other energy systems that heavily rely on traditional generation.For example, consider a power plant that uses two different CHP units (CHP1 and CHP2) to generate electricity and heat.CHP1 is operated with coal and CHP2 is operated with diesel.As long as one fuel does not outperform the other in fuel cost, carbon emissions, heat output per unit of fuel, and electricity output per unit of fuel, selecting an optimal mix of the two fuels considering heat and electricity demand profiles would be desirable.For this hypothetical case, the optimal mix of the two fuels is determined by formulating the objective function as: This appendix provides further details on the comparison between the optimisation method in [6] and the one presented in this paper to provide confidence in its adoption.The aim of this exercise was to minimise the operational costs of the system shown in Fig. 5   Notably, the optimisation approach developed for the present study yielded consistently lower energy consumption compared to the values presented in [6], resulting in further cost savings.Reference [6] reported an optimal daily operational cost of 636 monetary units, while the method presented in this paper achieved a reduced cost of 627 monetary units, representing a 1.4% reduction.Though these savings may seem modest initially, they can significantly accumulate over successive periods.
Although the optimisation method presented in this paper does not directly optimise the SoC of the TES tank as in [6], it however enables the calculation of the optimal charge and discharge power flows at every hour from which the energy levels can be derived.These are compared against the energy levels of the energy storage unit reported in [6], with results shown in Fig. D.3.There is a reasonably good agreement in the output from both algorithms-providing confidence in the optimisation method adopted for this paper.

Appendix E. SQP algorithm
SQP methods are gradient-based iterative algorithms and are considered highly effective techniques for nonlinear programming [48].Their numerical performance was evaluated in [57] and they have been widely used to solve practical optimisation problems.
Nonlinear optimisation problems are typically formulated with the objective of finding the optimal value of matrix X that minimises the objective function f(X) while satisfying specified equality and inequality constraints [58].Mathematically, this is expressed as: subject to the equality and inequality constraints The Lagrangian function of this problem, L(X, λ, μ), is expressed as where λ is a vector of multipliers for the equality constraints, μ is a vector of multipliers for the inequality constraints, and 'T' indicates the transpose operator.
The quadratic sub-problem is constructed by linearising the constraints.This is written as: where ∇ is the gradient operator and k is the iteration number.Solving (E.5)-(E.7)results in a solution vector d with multiplier vectors λ and μ, with d = X − X k , Δλ = λ − λ k , and Δμ = μ − μ k .This result creates a search direction for X and calculates the acceptable estimates for the Karush-Kuhn-Tucker (KKT) multipliers and H in (E.5).H is a positive definite Hessian matrix of the Lagrangian function (E.4), which is updated by the Broyden-Fletcher-Goldfarb-Shanno method.This in turn calculates the second derivatives of the objective function (E.1) and constraint functions (E.2) and (E.3).The solution converges when each element of d is smaller than a relative tolerance value δ and when the KKT conditions are satisfied.The procedure described is iterated until a final solution for X is obtained.
A flowchart describing the SQP algorithm is provided in

Appendix F. Sensitivity analysis with different energy price profiles
This appendix presents additional insights into the results of the sensitivity analysis conducted on the retrofitted IES using different energy price profiles to assess the system's performance.A specific emphasis was placed on evaluating the DPP for each retrofit configuration as a key economic metric to evaluate the financial viability of the IES.The three additional pricing scenarios shown in Fig. 10 were evaluated.
Tables F.1 to F.3 summarise the detailed results corresponding to the energy price conditions shown in Figs.10(b) to 10(d).A discussion highlighting relevant aspects on this matter is included in Section 3.4.

Table F.1
Cost and DPP for different retrofit configurations with doubled gas price and regular electricity price (pricing scenario b in Fig. 10).This appendix provides further details on the quantitative benefits offered by the different retrofitted scenarios and their impact on operational and carbon emission costs presented in Section 3. To assess the feasibility and economic viability of these scenarios, a techno-economic analysis for each scenario was conducted considering both initial investments and long-term benefits.Additionally, a comparative evaluation was performed against the base case to identify the most promising solutions for achieving sustainability goals.

Scenario TES EES
Quantitative details on the benefits of the retrofitted scenarios, based on the energy prices shown in Fig. 3, are presented in Table G.1.This table includes essential information such as operating annual savings, carbon annual emission savings, and corresponding percentages, illustrating the potential reductions achieved through the implementation of each scenario.Information from this table was used to produce the graphs in Fig. 6.
Additionally, Table G.2 summarises the benefits of the retrofitted scenarios with quadruple gas price as shown in Fig. 10(c).Information from this table was used to produce the graphs in Fig. 11.The comprehensive data in both Tables G.1 and G.2 enhance the understanding of the economic and environmental benefits of sustainable retrofitting initiatives.

Table G.1
Operating annual savings, carbon annual emission savings, and reduction percentages with the energy prices in Fig. 3

Fig. 2 .
Fig. 2. Schematic of the upgraded IES of QEH with sustainable technologies.Combination of the different technologies shown leads to the 16 scenarios investigated in Section 3.
D.A. Morales Sandoval et al. a significant reduction in annual operational and carbon emissions costs by incorporating an HP.

Fig. 10 .
Fig. 10.Pricing scenarios: a) regular energy prices; b) doubled gas price with regular electricity price; c) quadrupled gas price with regular electricity price; d) quadrupled gas price with doubled electricity price.

Fig. 14 .
Fig. 14.DPP and NPV of PVT systems with different capacities.

Fig. 15 .
Fig. 15.DPP and NPV of TES units with different capacities.

Fig. 18 .
Fig.18.NPV for Scenario 15 without and with optimal capacities of retrofits.

Fig. 19 .
Fig. 19.Hourly electricity and heat demand for a week in autumn.

Fig. 20 .
Fig. 20.Comparison of operational costs between the non-optimised and optimised IES at QEH.
Fig. D.1.(a) Electricity and heat demands.(b) Electricity and gas unit prices.

Fig. D. 2 .
Fig. D.2.Comparison of the results obtained with the presented optimisation approach with those obtained with the method in [6].(a) Optimal electricity inputs.(b) Optimal gas inputs.Throughout the simulation cycle, minor variations in energy consumption were observed for the two optimisation methods, as shown in Fig. D.2.Notably, the optimisation approach developed for the present study yielded consistently lower energy consumption compared to the values presented in[6], resulting in further cost savings.Reference[6] reported an optimal daily operational cost of 636 monetary units, while the method presented in this paper achieved a reduced cost of 627 monetary units, representing a 1.4% reduction.Though these savings may seem modest initially, they can significantly accumulate over successive periods.Although the optimisation method presented in this paper does not directly optimise the SoC of the TES tank as in[6], it however enables the calculation of the optimal charge and discharge power flows at every hour from which the energy levels can be derived.These are compared against the energy levels of the energy storage unit reported in[6], with results shown in Fig. D.3.There is a reasonably good agreement in the output from both algorithms-providing confidence in the optimisation method adopted for this paper.

Fig. D. 3 .
Fig. D.3.Comparison of the optimal energy storage contents.

Table 2
Different scenarios with retrofitting technologies.

Table 3
Lifetime and TIC for retrofitting technologies for 100% capacity.

Verification of the optimisation method
where, for hour i, η coal/e CHP1 and η coal/H CHP1 are the efficiencies of generating electricity and heat in the coal-powered CHP1, η diesel/e CHP2 and η diesel/H CHP2 are the efficiencies of generating electricity and heat in the diesel-powered CHP2, P coal CHP1,i is the amount of coal consumed in CHP1 and P diesel CHP2,i is the amount of diesel consumed in CHP2.Appendix D.

Table F . 2
Cost and DPP for different retrofit configurations with quadrupled gas price and regular electricity price (pricing scenario c in Fig.10)..A. Morales Sandoval et al.Cost and DPP for different retrofit configurations with quadrupled gas price and doubled electricity price (pricing scenario d in Fig.10). D