## 1 Introduction  
District heating (DH) systems play a crucial role in the decarbonisation of the energy sector. The improvement of DH systems through the use of heat pumps (HP) and renewable energy sources (RES) can lead to improved air quality and reduced dependence on fossil fuel imports. It is expected that the demand for accelerated decarbonisation and electrification of the energy sector will lead to an increased use of HPs. A comprehensive definition and classification of DH systems based on the technology used and the period of implementation can be found in the literature [1]. Existing DH systems that rely on fossil fuels need to be upgraded to fourth-generation DH systems, which are characterised by lower operating temperatures in the pipe network, enabling lower heat losses and higher efficiency of HP. [PERSON] et al. [2] conducted theoretical analysis on complete replacement of gas boilers with small-scale high-temperature HPs which operate with synthetic refrigerant R1234-ze. The assessment of six distinct scenarios indicated that replacement ensures environmental and economic benefits for residential-use scenarios. In an analysis on the transition from the third to the fourth generation of DH system, [PERSON] et al. [3] concluded that it is feasible to replace gas-fired boilers with commercially available medium-scale HPs utilising natural refrigerants. [PERSON] [4] theoretically evaluated three heating scenarios for a newly developed urban area in Estonia and concluded that low-temperature DH systems with large-scale HPs exhibited the lowest primary energy consumption and energy costs compared to high-temperature gas-boiler-based DH system. The integration of combined heat and power (CHP) units into DH systems represents a transformative approach to energy generation, offering substantial efficiency, economic, and environmental advantages over conventional gas-boiler-based systems. CHP is a well-established technology that simultaneously produces electricity and thermal energy using a range of technologies and fuel sources, most commonly natural gas or coal. The viability of the utilisation of CHP technology within existing DH systems has been a subject of investigation by numerous authors [2; 5; 6; 7; 8; 9; 10; 11]. These studies examined whether retaining existing CHP systems or replacing them with RES-based alternatives would be more feasible. [PERSON] et al. [12] found that a centralised DH system with CHP units is more advantageous than heating by decentralised gas boilers in London. In a recent study, [PERSON] et al. [6] found that DH systems employing gas boilers and CHP units sized for base load heating can be economically competitive compared to individual heating systems utilising HPs. [PERSON] et al. [7] determined that it is feasible to replace the outdated CHP unit with solar thermal collectors and absorption HPs in a large-scale DH system in Graz. [PERSON] et al. [8] analysed the decarbonisation of a large-scale coal-fired CHP-based DH system in Germany, highlighting solar energy, biomass, waste incineration, and large-scale HPs as promising technologies. Despite their environmental benefits, large HPs were found to be economically uncompetitive without regulatory changes, prompting recommendations to lower electricity prices for HP operations. The implementation of HP units within CHP-based DH systems plays a significant role in stabilising the electricity market, while it can also enhance energy efficiency and reduce environmental impact [5; 13; 14]. It can also improve system flexibility and reduce operational costs. In circumstances where electricity from RES is abundant and electricity prices are low, the utilisation of HPs becomes a priority. Conversely, when electricity from RES is insufficient and electricity prices are high, CHP units can operate profitably, generating both electricity and heat. Several studies have examined the integration of HPs into existing CHP-based DH systems. [PERSON] et al.