Economic Dispatch of CHP Units through District Heating Network’s Demand-Side Management

Optimisation of heat and electrical load distribution, where the objective function is the maximum efficiency of the CHP unit for a given load range, can be done considering the limitations of electrical power and the heat load. Simulating a real CHP unit with a district heating network shows that demand-side management can improve the overall economic efficiency of the CHP plant and increase the unit’s operating range in the electricity spot market. Economic dispatch makes it possible to determine a reasonable additional increase in the electric power of the CHP unit, and to optimise the supply temperature and mass flow of the district heating network. The results obtained and the analysis performed indicate that the proposed methodology provides logical results and can be used to calculate the efficiency indicators of the cogeneration of electrical and thermal energy. The problem of optimising the operating mode of the CHP unit was solved, which allows us to determine the optimal additional increase in the unit’s electrical load at a given heat load of consumers, which on average increases the CHP unit’s efficiency up to an additional 1.5%.


Introduction
In today's European district heating networks, about three-quarters of the total heat supply is provided by CHP units. Since the beginning of 2013, the Estonian electricity market has been fully open to all electricity consumers and is run by Nord Pool. Electricity generated simultaneously with heat can be sold on the spot markets. Due to the increase in the variance of the price of electricity, it is important for the profitability of the CHP unit to produce electricity when the price is high. Of course, the demand for thermal energy will never be fully synchronised with the demand for electricity [1].
The traditional goals of economic dispatch of CHP units are minimising operation cost and maximising profits [2]. Optimisation of heat and electrical load distribution, where the objective function is the maximum efficiency of the CHP unit for a given load range, can be done considering the fact that electrical power is limited by the heat load. The main problem of CHPs is that their operation is highly dependent on the heat load, which makes them rather inflexible or reduces the overall efficiency during periods of insufficient heat load (condensing turbine [3]).
The combined heat and power economic dispatch problem is formulated as an optimization problem [4]. A practical economic dispatch problem should include minimum and maximum limits for power and heat generation of CHP unit, which makes searching for the optimal dispatching a challenging problem [5]. The optimal economic dispatch for various types of CHP plants was analysed in [6]. In [7], the flexibility of CHP and thermal energy storage was explored using a two-stage optimal dispatch, considering the day-ahead heat market and real-time wind power balancing. There are also some studies The benefits of heat consumption forecasts include the identification of demand response actions and peak power demand [24]. Demand-side management is the costeffective management of complex DH systems that must include the rationalisation of the operations of all components involved in heat production and distribution [25]. Demandside management uses demand process data related to production status, heat distribution, and weather forecasts to manage production and heat distribution, and tools that allow for the dynamic calculation of control parameters that help achieve maximum efficiency while ensuring adequate heat supply [26].
Demand-side management allows multivariate calculations to determine the expected CHP indicators for the forecast period based on the outdoor temperature and the range of possible deviation. A special role is currently played by short-term forecasting for one day for the participation of power units in the formation of the electric schedule based on the results of open market trading. Taking into account the obtained heat load forecast, it is possible to choose the optimal hourly loads and submit the most favourable price offers.
Thus, there is a need for justification and an adequate mathematical relationship describing the process of changing the heat load depending on several parameters that have a direct impact on the change. The results of the study will make it possible to create the most effective and cost-efficient technical solutions to optimise the operating modes of thermal power units.
Demand-side data were used to identify and validate the heat demand model. This model can be used to replace the simplified average heat load approach to predict the potential electrical load to create an offer for the wholesale electricity market.
The optimisation algorithm performs the following actions: -Analysis of entered data to ensure that it adheres to existing restrictions; -Selection of power modes from the database that satisfy the given loads and consider the imposed external constraints; -Optimization of the distribution of heat and electrical loads of each mode as a function of many variables with linear constraints, such as inequalities and balance equations for the electrical and heat loads of the CHP unit. Thus, the model uses regression analysis of the empirical dependence of the thermal energy demand on the outdoor air temperature to predict the thermal energy demand with a high degree of accuracy of approximation of the actual demand measurement results. Demand-side management with consumer input also minimises the risk of data errors, while forecasting can reduce potential losses from production efficiency, calculate future consumption demand for each user, and determine total demand.
The study develops in four sections. After introducing and highlighting aspects of the literature in Section 1, Section 2 of the article provides the materials and methods, an overview of the methodology for economic dispatch modelling through demand-side management. Section 3 presents the discussion and Section 4 presents the study results of the model validation using the example of Narva's district heating network and the fossil-fuelled Balti Power Plant CHP unit that provides heat to the DH network. The conclusions are presented in Section 5.

Problem Formulation
One of the problems in heat sales management is the inability to estimate the future supply for each customer [33]. Since thermal energy cannot be supplied in a volume that exceeds the real demand for it, the surplus must be minimised at the sales planning stage. This can be done by using an automatic system for calculating demand, which includes individual heat meters and a tool for predicting heat demand [29]. With the help of forecasting, an objective assessment of the current state of control over the sale of heat becomes possible [26]. The main task of the forecasting tool is to calculate individual demand for each customer based on their recorded demand data from the database [34].
The proposed model based on thermal energy demand-side data is dynamic and uses a database of remotely transmitted hourly heat demand data. This makes it possible to use a model instead of statistical data during planning. In this case, obtained data will be based on regression dependences on the values of the current regime parameters of demand, depending on the outside air temperature. By summing the demand data of all customers and taking into account the losses determined via the balance method as the difference between production and demand for thermal energy for the predicted outdoor temperature, we can predict the heat demand for each hour.
The main advantage of this model when solving the forecasting problem compared to models based on information for the past period is that the resulting model can take into account previously unknown information about district heating networks. This information includes changes in heating networks, their reconstruction, the transition to new conditions of demand, and the emergence of new installations among consumers during the predicted period. Taking account of these changes leads to a decrease in the forecast error. Demand-side management data are measured at thermal substations with an automatic download of historical data for each substation. Based on these data, we can obtain a consumption profile for each facility, depending on the outdoor temperature.
Solving the problem of predicting the heat demand of objects will help to determine the amount of heat that will be consumed in the coming periods of time. Each object has a static characteristic that describes its thermal load. This characteristic is static in the sense that it cannot be changed quickly. Therefore, it is very informative for various types of heat demand analysis.
Mathematically, this characteristic is described by the functional dependence: Q = f (T outdoor ), where Q is the amount of thermal energy consumed (MWh) and T outdoor is the outdoor air temperature ( • C), allowing us to find a straight line as close as possible to the data points from the heat metering unit. With a high degree of approximation accuracy, it is possible to use a linear function to solve the forecasting problem. To construct and analyse this dependence, one should use the instantaneous demand data from the remote reading system of heat meters.

Demand-Side Management
The demand-side data for each substation was measured and collected by smart meters every hour for the entire distribution network (730 buildings), which is shown in Figure 1. An automatic system evaluates data outside a meaningful range and fills them in via interpolation. The automatic evaluation of the curve characteristics of all consumers is used to simplify the hourly evolution of the next day's thermal request to easily predict the thermal request.
Outdoor temperature and heat demand are measured every hour for each substation. Examples of this dependence for three selected substations using data collected during the 2020/2021 heating season (October-April) are shown in Figure 2.
As can be seen from the above diagram, this dependence is nearly linear. An important area of application of this model is the solution of forecasting problems. To predict the generation and consumption of thermal energy and heat losses for a short-term period of 24 h, the first task is to understand the variability of each consumer. To do this, we must calculate the demand-side of hourly demand for each consumer via a histogram, an example of which is shown in Figure 2. The y-axis in the graph represents the various hourly demand points and the x-axis represents the outdoor temperature. Based on the consumption data, we have linear characteristics for each object of thermal energy demand. The second task is to understand the influence of the outdoor air temperature on the heat demand of each consumer.  The final step of the algorithm for the next day's daily profiles is to extract the daily demand hours that occur regardless of the outdoor air temperature. To do this, we use the periodic autoregressive algorithm for time series data from a fragment of an hourly demand time series for all consumers over a period of several days. We are only given the total hourly demand, but the purpose of the algorithm is to determine, for each hour, which load does not depend on temperature and which additional load is temperature related.
The demand-side management approach considered in this paper has x users and y heat sources as the research objects, and the set of all users is represented as X = (1 … x). The number of heat sources Y is denoted by numbers 1 … y. The relationship between the heat produced by heat source y and its users is represented as f(y) = (y1 … yx), where f(yx) indicates that the heat is supplied to user x over time T. If the heat loss in the system is not taken into account, then the heat supplied to user x by the heat source is equal to the heat dissipated by user x (see Equation (1)).   The final step of the algorithm for the next day's daily profiles is to extract the daily demand hours that occur regardless of the outdoor air temperature. To do this, we use the periodic autoregressive algorithm for time series data from a fragment of an hourly demand time series for all consumers over a period of several days. We are only given the total hourly demand, but the purpose of the algorithm is to determine, for each hour, which load does not depend on temperature and which additional load is temperature related.
The demand-side management approach considered in this paper has x users and y heat sources as the research objects, and the set of all users is represented as X = (1 . . . x). The number of heat sources Y is denoted by numbers 1 . . . y. The relationship between the heat produced by heat source y and its users is represented as f (y) = (y 1 . . . y x ), where f (y x ) indicates that the heat is supplied to user x over time T. If the heat loss in the system is not taken into account, then the heat supplied to user x by the heat source is equal to the heat dissipated by user x (see Equation (1)).
where t 1x and t 2x are the supply and return temperatures of user x ( • C). m x is the flow rate of user x (kg/h); c is the water mass/specific heat of water mass (4.19 kJ/(kg· • C)) The heat supplied by heat source y is where t 1y and t 2y are the water supply and return temperatures of heat source y ( • C). m y is the circulating flow rate of heat source y (kg/h). The demand-side data collection system allows us to identify the optimal set of user heating system turn-on times, which is necessary to assess the expected thermal profile of each building. Temperature sensors collect temperature data at the inlet and outlet of heat exchangers, and mass flow meters measure the current mass flow rate. These data can be used to estimate the change in heat demand for a monitored consumer at different outdoor air temperatures. This way, it is possible to estimate the consumer's heat load profile for different outdoor air temperature levels.
It is always necessary to satisfy the heat demand, even if the electrical load and the heat load of the CHP unit are interrelated. A typical profile of the average load for a CHP unit before the application of the model and after optimisation with more accurate consumption data is shown in Figure 3. where t 1x and t 2x are the supply and return temperatures of user x (°C). m x is the flow rate of user x (kg/h); c is the water mass/specific heat of water mass (4.19 kJ/(kg⋅°C)) The heat supplied by heat source y is where t1y and t2y are the water supply and return temperatures of heat source y (°C). my is the circulating flow rate of heat source y (kg/h). The demand-side data collection system allows us to identify the optimal set of user heating system turn-on times, which is necessary to assess the expected thermal profile of each building. Temperature sensors collect temperature data at the inlet and outlet of heat exchangers, and mass flow meters measure the current mass flow rate. These data can be used to estimate the change in heat demand for a monitored consumer at different outdoor air temperatures. This way, it is possible to estimate the consumer's heat load profile for different outdoor air temperature levels.
It is always necessary to satisfy the heat demand, even if the electrical load and the heat load of the CHP unit are interrelated. A typical profile of the average load for a CHP unit before the application of the model and after optimisation with more accurate consumption data is shown in Figure 3. Based on the assessment of all possible combinations of electrical and thermal loads, it is possible to find the general optimum for each mode of operation of the unit. It is necessary to minimize the consumption of primary energy of the CHP or its overall efficiency at the given electrical and thermal loads of the unit for more accurate planning. Economic Dispatch is applied at each settlement hour by optimizing the distribution of heat and electrical loads based on heat demand-side data.

Combined Heat and Power Generation
The model used in this article was based on the CHP plant and district heating network in the city of Narva (in north-eastern Estonia). The district heating company supplies heat to about 60,000 residents. Narva's district heating network is 78 km long and connected to 730 buildings. Heat is generated at the Balti Power Plant (CHP unit), which consists of two circulating fluidized bed boilers, including one reheat and steam turbine,  Based on the assessment of all possible combinations of electrical and thermal loads, it is possible to find the general optimum for each mode of operation of the unit. It is necessary to minimize the consumption of primary energy of the CHP or its overall efficiency at the given electrical and thermal loads of the unit for more accurate planning. Economic Dispatch is applied at each settlement hour by optimizing the distribution of heat and electrical loads based on heat demand-side data.

Combined Heat and Power Generation
The model used in this article was based on the CHP plant and district heating network in the city of Narva (in north-eastern Estonia). The district heating company supplies heat to about 60,000 residents. Narva's district heating network is 78 km long and connected to 730 buildings. Heat is generated at the Balti Power Plant (CHP unit), which consists of two circulating fluidized bed boilers, including one reheat and steam turbine, which is a three-casing reheat condensing impulse reheat turbine with uncontrolled extraction for seven stages of feedwater heating. The fuel used in the Balti Power plant is local fossil fuel oil shale mixed with wood chips [35]. The DH circulating water is heated in a district heater using steam from the crossover pipes between the intermediate-pressure and low-pressure parts of the turbine. Extra steam from the hot reheat steam line is supplied to the peak load and the auxiliary steam is supplied to an external auxiliary steam header. The maximum DH load of the facility is 160 MW and the maximum water outlet temperature is 130 • C. The DH inlet water temperature ranges from 40 • C to 60 • C. The annual heat demand in Narva is about 450 GWh. The unit's annual electricity production is approximately 1300 GWh. The main inputs for these analyses are electricity and heat production and process efficiency as per the data available.
The efficiency characteristic of a CHP unit depends not only on the electrical load, but also on the amount of heat supplied. The electrical efficiency dependence on the electrical load of the CHP unit for different heat loads is shown in Figure 4. which is a three-casing reheat condensing impulse reheat turbine with uncontrolled extraction for seven stages of feedwater heating. The fuel used in the Balti Power plant is local fossil fuel oil shale mixed with wood chips [35]. The DH circulating water is heated in a district heater using steam from the crossover pipes between the intermediate-pressure and low-pressure parts of the turbine. Extra steam from the hot reheat steam line is supplied to the peak load and the auxiliary steam is supplied to an external auxiliary steam header. The maximum DH load of the facility is 160 MW and the maximum water outlet temperature is 130 °C. The DH inlet water temperature ranges from 40 °C to 60 °C. The annual heat demand in Narva is about 450 GWh. The unit's annual electricity production is approximately 1300 GWh. The main inputs for these analyses are electricity and heat production and process efficiency as per the data available.
The efficiency characteristic of a CHP unit depends not only on the electrical load, but also on the amount of heat supplied. The electrical efficiency dependence on the electrical load of the CHP unit for different heat loads is shown in Figure 4. 1-2-CHP operating at 100% heat load; 3-4-CHP operating without heat extraction; 3-1-limitation on the minimum electrical load to ensure the parameters of heat supply; 2-4-limitation on the maximum electrical load to ensure the amount of heat supply. It can be seen that electrical efficiency is increased when the heat load becomes larger. When the heat load is maximum, the electrical load is lower (150 MWnet). The maximum electrical load (190 MWnet) is possible when there is no heat load, but in this case, electrical efficiency is the lowest. The mathematical optimisation model of a CHP establishes the dependence of primary energy consumption Bi on the value of heat (Hi) and electrical (Ei) loads when operating according to an electrical schedule: Bi = f (Ei). When operating on a heating schedule, the electric power depends on the heat load, so the objective function takes the form of Bi = f (Ei, Hi). Shortterm optimisation has a horizon of one day, discreteness Δi = 1 (one hour), and timestamps i.
In accordance with the above methodology, we can determine the energy efficiency of a CHP plant based on the demand-side management algorithm of a heating network. The algorithm is shown in Figure 5. Based on the consumption data, we then determine   1-2-CHP operating at 100% heat load; 3-4-CHP operating without heat extraction; 3-1-limitation on the minimum electrical load to ensure the parameters of heat supply; 2-4-limitation on the maximum electrical load to ensure the amount of heat supply. It can be seen that electrical efficiency is increased when the heat load becomes larger. When the heat load is maximum, the electrical load is lower (150 MW net ). The maximum electrical load (190 MW net ) is possible when there is no heat load, but in this case, electrical efficiency is the lowest. The mathematical optimisation model of a CHP establishes the dependence of primary energy consumption B i on the value of heat (H i ) and electrical (E i ) loads when operating according to an electrical schedule: B i = f (E i ). When operating on a heating schedule, the electric power depends on the heat load, so the objective function takes the form of B i = f (E i , H i ). Short-term optimisation has a horizon of one day, discreteness ∆i = 1 (one hour), and timestamps i.
In accordance with the above methodology, we can determine the energy efficiency of a CHP plant based on the demand-side management algorithm of a heating network. The algorithm is shown in Figure 5. Based on the consumption data, we then determine the electrical loads. We then input the data on the current distribution of the generation of heat and electrical loads. Based on the loaded data of the current operating mode of the CHP, we can calculate the efficiency of heat and electricity generation.  The data from the graphs of the electrical and thermal loads of the CHP plant is entered into the model and the efficiency is calculated in the case there is a transition to a new electricity supply mode in accordance with the provision of heating network modes. The optimal operating mode of the power unit and effective redistribution of loads are determined, and, if necessary, further data are gathered on the optimised operating mode of the heating network, which is then used to calculate and select the optimal mode of the future load. The introduction of the structure for optimising energy production at CHP plants will ensure competent and correct decision-making by the CHP personnel concerning technical, economic, and organisational aspects related to the efficient management of heat and electrical equipment.
Let us consider the unit's consumption of primary energy B, since primary energy is converted into electrical energy E and into thermal energy of a different potential: B = B (E, H), where the increment in the primary energy consumption per unit associated with the change in the unit load can be represented as Then, add the total differential (3) in  The data from the graphs of the electrical and thermal loads of the CHP plant is entered into the model and the efficiency is calculated in the case there is a transition to a new electricity supply mode in accordance with the provision of heating network modes. The optimal operating mode of the power unit and effective redistribution of loads are determined, and, if necessary, further data are gathered on the optimised operating mode of the heating network, which is then used to calculate and select the optimal mode of the future load. The introduction of the structure for optimising energy production at CHP plants will ensure competent and correct decision-making by the CHP personnel concerning technical, economic, and organisational aspects related to the efficient management of heat and electrical equipment.
Let us consider the unit's consumption of primary energy B, since primary energy is converted into electrical energy E and into thermal energy of a different potential: B = B (E, H), where the increment in the primary energy consumption per unit associated with the change in the unit load can be represented as Then, add the total differential (3) in Physically, the coefficient p represents the response of the power unit in terms of primary energy consumption to a change in heat supply to consumers while maintaining the electrical load, and the coefficient υ characterises the relative efficiency of heat supply to consumers compared to the supply of electricity. Let us find the coefficient υ, considering the two variants of the transient process in the system at E i , H i , and B i in the initial state, and E i , H ji in the final state as a sequence of two transitions: II. Changing the electrical power to the initial E i .
Let us analyse a direct relationship between electric and thermal power and the use of primary energy: where Q f is the calorific value of the primary energy (fuel).
In the first variant of the transient process (I), the utilisation factor of the primary energy of the power unit changes to a value of η ii in accordance with the change in E i and H i after the transition to the load H ji .
where H i is the thermal power in the initial mode with electric power E i and the efficiency value η i , H ji is the thermal power in the current Economic Dispatch mode, and B i is the primary energy consumption for the initial operating mode. The result of this optimisation is represented by an objective function that establishes the dependence of efficiency on both heat and electrical loads when operating according to the electrical schedule. When operating on a heating schedule, the electrical power depends on the heat load. The criterion for the optimality of one of the options of the distribution of unit loads at a given value and parameters of the heat supplied is the minimisation of the fuel component considered as the maximum efficiency. The coefficient υ in Equation (8) reflects the efficiency of energy-to-electricity conversion in the CHP unit for a specific change in heat load based on Economic Dispatch.
From Equations (7) and (8) we get: where ∆H i = H ji − H i . Additionally, let us consider the relationship between the parameters: where b is a constant characteristic of a given power unit that does not depend on E, H, or υ.
In the second variant of the transient process (II), the electric power E i + (H i − H ji )·υ is restored to the initial value E i by changing the primary energy consumption from B i to B ji .
As a result of transformations of Equations (9) and (10), we get a ratio for determining the change in efficiency Equation (11), i.e., primary energy consumption ∆B at ∆H i and E = const: The average value of the coefficient p = ∂B ∂H i , where E i = const for an arbitrary range of heat loads, can be represented as: The coefficient p in Equation (12) corresponds to the new state of heat supply, which led to an increase in ∆H i .
In the initial mode (before the application of Economic Dispatch), the electrical E i and thermal H i power correspond to the initial value of the operating efficiency, and when switching to a new load from Equation (3), we get: Let us determine the coefficient p using the parameters of the initial mode and Equation (13) for this mode: The coefficient p is determined by two ratios, Equations (14) and (12), describing the transition process from the original mode to the Economic Dispatch mode: The above method for determining the unit's consumption of primary energy B makes it possible to change the practical approach to using the efficiency characteristics of CHPs in managing the equipment operating modes and, using the Bji parameter, create a simplified characteristic with qualitative information on the efficiency of the planned heat and electricity generation modes at the CHP.

Economic Dispatch
Economic Dispatch is a nonlinear optimisation problem with several constraints. The objective function is to minimise the total primary energy consumption with constraints, or in other words, to maximise the overall efficiency. The consumption characteristic curve is a functional dependence of the hourly consumption of primary energy on electric power for various heat loads. We must also consider the minimum and maximum limits for electrical loads as constraints that are determined by technical conditions for different heat loads.
From a mathematical point of view, the problem of Economic Dispatch can be formulated concisely. That is, the objective function, B, must be equal to the overall energy efficiency to supply the indicated heat and electrical load.
The main demand characteristic for a unit on the market is the relationship between primary energy consumption B i and electrical and thermal power E i ; H i is a characteristic of consumption or efficiency. The objective function of the problem of short-term optimisation of the CHP operation has the optimisation horizon n = 24 (one day), discreteness ∆i = 1 (one hour), and time stamps i. Essentially, the dispatch problem can be formulated as an optimisation problem with a quadratic objective function and linear constraints. The challenge is to find the heat and power generation for each hour so that the objective function defined by the equation is a quadratic polynomial: where α i , β i , and γ i are constant regression equations for hour i. Generation output should be placed between the maximum and minimum limits according to heat production. The corresponding inequality constraints for each generator are.
where, E i,min and E i,max are the minimum and maximum power output limits of electrical capacity (MW). In order to establish the necessary conditions for the extreme value of the objective function, add the constraint function to the objective function after the constraint function has been multiplied by an undetermined multiplier.
Various methods are used both individually and in combination to optimise power dispatch. These methods include the Lagrange method, the lambda(λ) iteration method, the first-and second-order gradient methods, coefficients of sharing, linear programming, neural networks, and fuzzy algorithms. This model is based on the Lagrange method because it offers an accurate, reliable, and conclusive solution. Compared to other methods, the convergence rate for this model is acceptable. All of this makes it a suitable choice for solving the problems of Economic Dispatch.
The above constrained optimisation problem is converted into an unconstrained optimisation problem. The Lagrange multiplier is used when a function is minimised (or maximised) with a side condition in the form of equality constraints. In this method, the Lagrangian function is formed by adding equality constraints to the objective function using the appropriate Lagrangian multipliers. Using this method, the augmented function is defined as: Thus, the Lagrange multiplier λ is the cost of one extra MW with an optimal solution. The necessary conditions for the extreme value of the objective function are obtained when we take the first derivative of the Lagrangian function with respect to each of the independent variables and set the derivatives to zero. Now, this Lagrangian function needs to be minimised without any constraints.
To find the minimum, the function with the constraint in the form of Equation (17) is differentiated with respect to all variables (n + 1), and then its derivatives are equated to zero. The minimum of this unconstrained function is at the point where the partials of the function to its variables are equal to zero: The first condition given therefore, the mathematically obtained condition for economic dispatch is: or The linearized characteristic of the power unit is a straight-line segment in a twodimensional regime space for various heat loads. The minimum and maximum electric power, E min and E max , (the beginning and end of the straight-line segment), set the power unit control range. The linear functions of electrical efficiency are shown graphically in Figure 6. Thus, the necessary condition for the existence of the maximum efficiency operating condition for the CHP unit is that the incremental cost rates for the entire capacity must be equal to some undetermined value λ. Of course, to this necessary condition, we must add the constraint equation, according to which the sum of the power outputs must be equal to the power required by the load.
The expression + 2 is the incremental production efficiency of hour i. When solving economic dispatch, the incremental production efficiency of each hour is equal to the Lagrangian parameter λ. The most economical option is to operate at equal incremental production costs, which can be found as follows: These inequalities indicate that any capacity with an incremental cost higher than λ is inefficient and should operate at the lowest level of capacity.
On the other hand, for each heat load, it is necessary to calculate the incremental costs at the maximum and minimum output for the heat load. Then, set λmin to the smallest value among the incremental costs at unit Emin values, and then set λmax to the largest value among the incremental costs at unit Emax values. If λ = λmin, then the lambda search algorithm is E = Emin, and if λ = λmax, then the lambda search algorithm is E = Emax.
If the value λ is less than the incremental cost at Emin, then just set the unit output to Emin, and if the value λ is greater than the incremental cost at Emax, then set the generator output to Emax. Otherwise, calculate the E value for the unit from the incremental cost function. A simple procedure to allow the unit to generate B(E) consists of adjusting λ from λmin to λmax in specified increments, where: At each increment, calculate the total primary energy consumption and the total power output for all heat loads. These points represent the points on the B(E) curve or efficiency curve. The incremental cost is the cost of one additional MW per hour. This Thus, the necessary condition for the existence of the maximum efficiency operating condition for the CHP unit is that the incremental cost rates for the entire capacity must be equal to some undetermined value λ. Of course, to this necessary condition, we must add the constraint equation, according to which the sum of the power outputs must be equal to the power required by the load.
The expression β i + 2γ i B i is the incremental production efficiency of hour i. When solving economic dispatch, the incremental production efficiency of each hour is equal to the Lagrangian parameter λ;. The most economical option is to operate at equal incremental production costs, which can be found as follows: These inequalities indicate that any capacity with an incremental cost higher than λ is inefficient and should operate at the lowest level of capacity.
On the other hand, for each heat load, it is necessary to calculate the incremental costs at the maximum and minimum output for the heat load. Then, set λ min to the smallest value among the incremental costs at unit E min values, and then set λ max to the largest value among the incremental costs at unit E max values. If λ = λ min, then the lambda search algorithm is E = E min , and if λ = λ max, then the lambda search algorithm is E = E max .
If the value λ is less than the incremental cost at E min , then just set the unit output to E min , and if the value λ is greater than the incremental cost at E max , then set the generator output to E max . Otherwise, calculate the E value for the unit from the incremental cost function. A simple procedure to allow the unit to generate B(E) consists of adjusting λ from λ min to λ max in specified increments, where: At each increment, calculate the total primary energy consumption and the total power output for all heat loads. These points represent the points on the B(E) curve or efficiency curve. The incremental cost is the cost of one additional MW per hour. This equality means that the best distribution is achieved in the case of an increase in the primary energy consumption dB i with an increase in power dE i . Expression (25) determines the order of distribution of heat and electrical loads at the CHP. Thus, the order of priority of electric power is determined by the principle of equality of relative gains; if equality is unattainable, then we use the order of increasing relative gains.

Discussion
The district heating network and CHP plant considered in this analysis were based on an actual district heating network located in Narva, Estonia [23] and the Balti Power Plant CHP unit that supplies heat to the Narva DH network. The CHP unit with an extractioncondensing turbine at the Balti Power Plant produces heat and electricity [28]. Figure 7 shows the actual average relationship between thermal and electrical power for the CHP of Narva city during the past five years. This relationship is used for further calculations. As can be seen from the figure, in the operating range of powers, this dependence can be approximated by a linear function with sufficiently high accuracy.  The actual operating data of the CHP unit in September-November 2020 at the minimal thermal loads of 30-70 MW confirm the statistical and calculated characteristics of the unit. The calculations in this paper are based on these data and are shown in Figure 8. equality means that the best distribution is achieved in the case of an increase in the primary energy consumption Bi with an increase in power Ei. Expression (25) determines the order of distribution of heat and electrical loads at the CHP. Thus, the order of priority of electric power is determined by the principle of equality of relative gains; if equality is unattainable, then we use the order of increasing relative gains.

Discussion
The district heating network and CHP plant considered in this analysis were based on an actual district heating network located in Narva, Estonia [23] and the Balti Power Plant CHP unit that supplies heat to the Narva DH network. The CHP unit with an extraction-condensing turbine at the Balti Power Plant produces heat and electricity [28]. Figure 7 shows the actual average relationship between thermal and electrical power for the CHP of Narva city during the past five years. This relationship is used for further calculations. As can be seen from the figure, in the operating range of powers, this dependence can be approximated by a linear function with sufficiently high accuracy. The actual operating data of the CHP unit in September-November 2020 at the minimal thermal loads of 30-70 MW confirm the statistical and calculated characteristics of the unit. The calculations in this paper are based on these data and are shown in Figure 8. The overall efficiency of a CHP unit refers to the sum of electricity production and useful heat output divided by the amount of fuel used to generate heat in the cogeneration process. The total production efficiency for the scheduled period is the sum of electricity and heat efficiency. In general, the problem of overall efficiency is given as follows: (1) Maximising the overall operating efficiency of the CHP unit: where η overall is the overall efficiency of the CHP unit; ηE i is the efficiency of electricity production of the CHP unit at hour i; ηH i is heat production efficiency of the CHP unit at hour i; n is the total number of hours. Let us note the key feature of the cogeneration technology for the generation of electrical and thermal energy, namely the fact that in this case, the physical meaning has a general (overall) efficiency. (η overall )-the use of the fuel's primary energy. The value of the overall efficiency depends on the share of the types of energy generated during cogeneration in their total dimension. The values within which the value (η overall ) can vary depending on the operating mode of the cogeneration plant. Typical limiting modes include (a) the mode with minimum heat production and maximum electricity generation, with efficiency at the minimum value (η min ) and (b) the mode with minimum electricity generation and maximum heat production, with efficiency at the maximum value (η max ).
The qualitative dependence of the change in overall efficiency on the change in heat load is shown in Figure 9. The overall efficiency of a CHP unit refers to the sum of electricity production and useful heat output divided by the amount of fuel used to generate heat in the cogeneration process. The total production efficiency for the scheduled period is the sum of electricity and heat efficiency. In general, the problem of overall efficiency is given as follows: (1) Maximising the overall operating efficiency of the CHP unit: where ηoverall is the overall efficiency of the CHP unit; ηEi is the efficiency of electricity production of the CHP unit at hour i; ηHi is heat production efficiency of the CHP unit at hour i; n is the total number of hours. Let us note the key feature of the cogeneration technology for the generation of electrical and thermal energy, namely the fact that in this case, the physical meaning has a general (overall) efficiency. (ηoverall)-the use of the fuel's primary energy. The value of the overall efficiency depends on the share of the types of energy generated during cogeneration in their total dimension. The values within which the value (ηoverall) can vary depending on the operating mode of the cogeneration plant. Typical limiting modes include (a) the mode with minimum heat production and maximum electricity generation, with efficiency at the minimum value (ηmin) and (b) the mode with minimum electricity generation and maximum heat production, with efficiency at the maximum value (ηmax).
The qualitative dependence of the change in overall efficiency on the change in heat load is shown in Figure 9. Hourly system balance. The total heat generation must be equal to the heat load demand, HD, at all hours.
(2) Heat demand balance constraint: where H i is the heat load demand at hour i.
(3) The minimum and maximum rated capacities of the unit must not be violated: where E i, min and E i, max are the minimum and maximum electricity capacity according to heat demand. The efficiency curve of a conventional heating unit can be approximated by a quadratic function. A CHP unit has a convex cost function for both power and heat. The bi-objective economic dispatch problem is converted into a single optimisation problem by introducing the maximum overall efficiency as follows: -Electricity production efficiency per hour at maximum power output is determined as -Heat production efficiency per hour at demand supply is determined as The operating efficiency determined by the above quadratic Equation (32) is obtained by approximating the power in MW. The incremental efficiency is then calculated as

Comparison at the Minimum Heat Load of the Heating Network
In the first stage of calculations, the optimisation criterion is the maximum generation of electrical power in terms of heat consumption. Based on statistical data, a regression model has been built, reflecting the dependence of the efficiency of power generation and the overall efficiency of the CHP unit with a minimum heat load of 40 MW ( Figure 10).
where Hi is the heat load demand at hour i.
(3) The minimum and maximum rated capacities of the unit must not be violated: where Ei, min and Ei, max are the minimum and maximum electricity capacity according to heat demand. The efficiency curve of a conventional heating unit can be approximated by a quadratic function. A CHP unit has a convex cost function for both power and heat. The biobjective economic dispatch problem is converted into a single optimisation problem by introducing the maximum overall efficiency as follows: -Electricity production efficiency per hour at maximum power output is determined as -Heat production efficiency per hour at demand supply is determined as The operating efficiency determined by the above quadratic Equation (32) is obtained by approximating the power in MW. The incremental efficiency is then calculated as

Comparison at the Minimum Heat Load of the Heating Network
In the first stage of calculations, the optimisation criterion is the maximum generation of electrical power in terms of heat consumption. Based on statistical data, a regression model has been built, reflecting the dependence of the efficiency of power generation and the overall efficiency of the CHP unit with a minimum heat load of 40 MW ( Figure 10). The CHP unit is loaded more optimally, which increases the efficiency of electricity up to 0.5%, and the overall efficiency of the unit up to an additional 1.0% with a heat  84 88 92 97 101 106 110 114 119 123 128 132 136 141 145 150 154 158 163 167 172 176 180 185 189 Efficiency, η % Electrical capacity, MW η overall Qth=40 MW before optimisation η overall Qth=40 MW after optimisation η el Qth=40 MW before optimisation η el Qth=40 MW after optimisation The CHP unit is loaded more optimally, which increases the efficiency of electricity up to 0.5%, and the overall efficiency of the unit up to an additional 1.0% with a heat supply of 40 MW. A statistical relationship was found between the efficiency of electricity generation by CHPs and a fixed minimum supply of heat. By differentiating this function, we can find the characteristic of the relative increase in efficiency, which will be about 1%.

Comparison at the Maximum and Average Heat Load of the Heating Network
Based on statistical data, a regression model has been built that reflects the dependence of the efficiency of power generation and the overall efficiency of the CHP unit with an average heat load of about 90 MW, and a maximum heat load of 130 MW. A similar calculation based on statistical data was used to build a regression model that reflects the dependence of the efficiency of power generation and the overall efficiency of the CHP unit with a heat load of 90 MW and 130 MW ( Figure 11). supply of 40 MW. A statistical relationship was found between the efficiency of electricity generation by CHPs and a fixed minimum supply of heat. By differentiating this function, we can find the characteristic of the relative increase in efficiency, which will be about 1%.

Comparison at the Maximum and Average Heat Load of the Heating Network
Based on statistical data, a regression model has been built that reflects the dependence of the efficiency of power generation and the overall efficiency of the CHP unit with an average heat load of about 90 MW, and a maximum heat load of 130 MW. A similar calculation based on statistical data was used to build a regression model that reflects the dependence of the efficiency of power generation and the overall efficiency of the CHP unit with a heat load of 90 MW and 130 MW ( Figure 11). One can observe that with a clear reflection of the heat load, based on the demand data, the CHP unit is loaded more optimally, which increases the efficiency of power generation by about 0.7%, and the overall efficiency of the unit up to an additional 1.5% with a heat supply of 90 MW. It should be noted that heat release was recorded to depict the dependency, which greatly simplified the construction and search for a statistical model, and as a result, it was possible to find a sufficiently high-quality characteristic showing that with a clear reflection of the heat load, based on the demand data, the CHP unit is loaded more optimally, which increases the efficiency of electricity by up to 1.0%, and the overall efficiency of the unit up to an additional 2.0% with a heat supply of 130 MW.

Summary
From the viewpoint of power unit loading in the wholesale market, this optimisation can be interpreted in such a way that the power unit loading is advisable as long as the relative increase in the cost of electricity generation at the power plant is lower than the market price at which the additional generation is sold, and only then the power plant obtains the maximum economic effect from operating in the wholesale market. A similar effect can be achieved if the price offer on the market matches the relative increase in production efficiency.
Thus, an error in heat supply forecast can lead either to an unreasonably high load of the power plant and sales at a price below the relative increase in the cost of fuel equivalent consumption, or to underutilisation of capacities and a decrease in electricity sales.  One can observe that with a clear reflection of the heat load, based on the demand data, the CHP unit is loaded more optimally, which increases the efficiency of power generation by about 0.7%, and the overall efficiency of the unit up to an additional 1.5% with a heat supply of 90 MW. It should be noted that heat release was recorded to depict the dependency, which greatly simplified the construction and search for a statistical model, and as a result, it was possible to find a sufficiently high-quality characteristic showing that with a clear reflection of the heat load, based on the demand data, the CHP unit is loaded more optimally, which increases the efficiency of electricity by up to 1.0%, and the overall efficiency of the unit up to an additional 2.0% with a heat supply of 130 MW.

Summary
From the viewpoint of power unit loading in the wholesale market, this optimisation can be interpreted in such a way that the power unit loading is advisable as long as the relative increase in the cost of electricity generation at the power plant is lower than the market price at which the additional generation is sold, and only then the power plant obtains the maximum economic effect from operating in the wholesale market. A similar effect can be achieved if the price offer on the market matches the relative increase in production efficiency.
Thus, an error in heat supply forecast can lead either to an unreasonably high load of the power plant and sales at a price below the relative increase in the cost of fuel equivalent consumption, or to underutilisation of capacities and a decrease in electricity sales.
However, in most cases, statistical data do not allow for obtaining probabilistic models of characteristics and influencing factors; therefore, the most realistic is the use of heat demand-side management.
At the same time, under conditions of uncertainty, predicting these characteristics is a rather difficult task, which can lead to lost profits when operating on the open electricity market. In particular, the heat supply mode significantly affects the characteristics of the CHP unit.

Summary Model Validation
When distributing the CHP unit load using heat demand-side management, optimisation tasks were formulated, namely the minimisation of primary energy consumption and maximisation of the total useful electrical load of the CHP unit at a given electrical load of the unit and at a given heat load of consumers.
A method based on DH demand data was proposed to optimise the operation of a cogeneration plant and to determine the energy savings of the primary fuel and/or an increase in the efficiency during the cogeneration of electric and thermal energy compared to the traditional method.
The methodology is based on an analytical expression that determines the dependence of the consumption of thermal energy of the primary fuel for the production of electrical and thermal energy during the cogeneration process, taking into account the corresponding efficiency values.
The use of the proposed method was illustrated by an example that shows that the maximum effect of primary energy savings during the cogeneration of electrical and thermal energy under the assumed design conditions is about 2%, compared to the energy consumption of primary fuel for the production of the same amount of electrical energy and thermal energy using the traditional production planning method.
The results obtained and the analysis performed indicate that the proposed methodology provides logical results and can be used to calculate the efficiency indicators of the cogeneration of electrical and thermal energy.

Summary Calculation Results
The analysis of the calculation results showed that with more optimal planning of a portion of the load at the CHP, the primary energy savings for the heating period due to the difference in the efficiency of the supply will be about 10,000 MWh per year. In addition, fuel savings for the heating season will reach around 18,000 tons of CO 2 per year. The results obtained can be used to increase the effect of energy saving measures and to optimise the operation of the CHP system.
Simulating a real CHP unit with a district heating network shows that demand-side management can improve the overall economic efficiency of the CHP plant and increase the unit's operating range.
As a result, the problem of optimising the operating mode of the CHP unit was solved, which allows us to determine the optimal additional increase in the unit's electrical load at a given heat load of consumers, which, on average, increases the CHP unit's efficiency up to an additional 1.5%.

Summary Study Result
The practical value of the work is experimental calculations on the data of the CHP unit of the Balti Power Plant-showed the practical suitability of the developed tools. The results obtained served as effective information support and can be used to substantiate the distribution of heat and electric energy at CHPs.
In conclusion, it should be noted that the format of this research did not permit a discussion of all the problems of CHP units that arise when operating in the wholesale electricity market, for example, the issue of forced generation at minimum loads, the problem of accounting for the need to turn on peak hot water boilers to ensure electrical generation, and so on. However, these problems should be the subject of a separate discussion and solutions.
Funding: This research received no external funding.

Institutional Review Board Statement: Not applicable.
Data Availability Statement: Data was obtained from Narva Soojusvõrk AS and are available from the authors with the permission of Narva Soojusvõrk AS.

Conflicts of Interest:
The authors declare no conflict of interest.