Calculation and Analysis of the Interval Power Flow for Distributed Energy System Based on Afﬁne Algorithm

: Due to the coupling of different energy systems, optimization of different energy com-plementarities, and the realization of the highest overall energy utilization rate and environmental friendliness of the energy system, distributed energy system has become an important way to build a clean and low-carbon energy system. However, the complex topological structure of the system and too many coupling devices bring more uncertain factors to the system which the calculation of the interval power ﬂow of distributed energy system becomes the key problem to be solved urgently. Afﬁne power ﬂow calculation is considered as an important solution to solve uncertain steady power ﬂow problems. In this paper, the distributed energy system coupled with cold, heat, and electricity is taken as the research object, the inﬂuence of different uncertain factors such as photovoltaic and wind power output is comprehensively considered, and afﬁne algorithm is adopted to calculate the system power ﬂow of the distributed energy system under high and low load conditions. The results show that the system has larger operating space, more stable bus voltage and more ﬂexible pipeline ﬂow under low load condition than under high load condition. The calculation results of the interval power ﬂow of distributed energy systems can provide theoretical basis and data support for the stability analysis and optimal operation of distributed energy systems.


Introduction
In recent years, under the dual pressure of limited fossil energy reserves and increasingly serious environmental pollution, the institutional contradiction between extensive energy utilization mode and environmental protection has become increasingly prominent [1][2][3]. In order to improve the quality and efficiency of energy utilization, it has become an inevitable trend to comprehensively transform from the traditional energy generation and supply system to the distributed energy system covering sources, networks, charges, storage and other links [4,5], involving electricity, gas, heat, cold, and other forms of energy [6][7][8][9][10].
The gradual access of distributed renewable energy in distributed energy system leads to the increase of uncertain factors in power system and thermal system [11][12][13], when the system power injection fluctuates within a certain range, flow distribution may be radical changes, such as the reverse reactive power of the grid leads to the node voltage exceeded, reverse flow of heat grid pipe, and so on. Therefore, it is necessary to use the uncertain analysis method to describe the coupling characteristics and power flow distribution of the electro-thermal interconnection system, and then analyze the interaction and risk assessment among the electro-thermal systems.
The calculation methods of uncertain power flow [14,15] are mainly divided into random power flow, fuzzy power flow, and interval power flow according to the modeling method of uncertain quantity. Among them, interval power flow needs the least uncertain quantitative information, only need to know the upper/lower bound of an uncertain quantity. However, random power flow and fuzzy power flow need to obtain the uncertain probability density function and membership density function respectively, which are often difficult to determine in practice. In the uncertain power flow solution, reference [16] considering the uncertain of electricity and heat load fluctuation, an interval power flow calculation method based on linear optimization for multi-energy complementary distributed energy systems with power-thermal interconnection is proposed, the iterative initial value is obtained by variable substitution, and the upper/lower limit of each state variable is calculated by the optimization method, at the same time introduced a concept of load uncertain budget, which can effectively overcome the conservatism of the interval tidal current, to quantitatively evaluate the influence of uncertain factors on the operation state of system. Reference [17] for solving the problem of electric power company daily scheduling transaction made a considerable effort, in the face of system requirements, the reserve requirements and future purchases of uncertain factors, such as the price of the fuzzy mixed integer programming problem, a symmetric method, and Lagrangian relaxation technique based on fuzzy optimization are proposed, and an algorithm based on fuzzy optimization is developed, which can generate robust scheduling and trading decisions to offset uncertainties. Affine algorithm, as a calculation method of interval power flow [18], is widely used because its method is easy to implement and requires few uncertain input conditions. In reference [15], in order to calculate uncertain power flow and optimal power flow problems, mathematical programming problems under uncertain conditions were equivalent to deterministic problems and a unified framework based on affine algorithm was proposed, which greatly reduced the difficulty of solving the problem.
The fragile distribution network is also vulnerable to the interference of uncertain factors, resulting in the reduction of power quality. Reference [19] uses affine algorithm to calculate the power flow changes before and after the three-phase network of the power system, so as to quantitatively calculate the influence of the power fluctuation of different interference sources on the power quality index. However, although affine mathematics can express the relationship between the uncertain variables by using noise source marks, the introduction of affine polynomials undoubtedly increases the dimension of the problem. In order to reduce the number of noise variables of injected power in affine form, reference [20] proposed a new two-step asynchronous power flow algorithm approximated by sine and cosine functions to solve the transmission and distribution network coupling problem. This method in single phase and three phase are conservative, with good approximation effect, high efficiency, less data exchange capacity, and good effectiveness. Faced with the problem of uncertain output of distributed energy system, the paper [21] adopts the same kind of noise element combination and complex affine algorithm, which reduces the iteration times of noise element in the affine calculation process and improves the calculation efficiency and precision of the system. However, another solution is presented in the literature [22]. This algorithm is based on the current and actual load, renewable energy power level and available reserve to calculate the affine noise symbol value obtained by affine algorithm unit commitment, thus reducing the overall calculation difficulty. The efficient and convenient system regulation mode of power system and the stable and flexible output characteristics of thermal system make the combination of the two become a trend. Paper [23] analyzes the coupling energy flow analysis of power system and thermal system and studies the energy flow output variation of power system and thermal system under the influence of uncertain factors in the system. At the same time, in order to reduce the unnecessary noise items added in the affine calculation process, the backward/forward sweep in the literature [24] is also a good method. However, in the field of distributed energy system, the research of calculating the interval power flow by affine algorithm is still in its infancy.
In this paper, affine algorithm is introduced into distributed energy system, and the influence of photovoltaic, wind power output, and other uncertain factors is comprehensively considered. Affine algorithm is used to calculate the system power flow of distributed energy system under high and low load conditions.

Topology of Distributed Energy Systems
The topology of the distributed energy system proposed is shown in Figure 1, which is mainly composed of the following four parts: IEEE power system of 33 nodes [25], double loop thermodynamic system, and cold-heat-electricity coupling link of 9-node ring network. For the current is not complete and unified cold energy transmission system, so the cold will force the system output force load directly connected to cold-heat-electricity coupling links to ensure that the distributed energy system can supply the cold.

Power System Modeling
In terms of power system modeling in steady-state model, in order to reduce the threephase unbalanced power system caused by the rotating motor vibration heat and voltage imbalance caused by generator capacity utilization decline a series of problems, in this paper, the three-phase equilibrium problem of power transmission system is realized by means of commutation, so the influence of three-phase imbalance on power flow calculation can be ignored [26]. In this power system, there are a total of 33 nodes, among which node 0 is the equilibrium node, and the other nodes are PV nodes and PQ nodes. The power equation of the nodes of the power system, the voltage and phase angle of the nodes is as follows: In the equation: P grid_i,j refers to the gird active power of node i,j (kW); Q grid_i,j refers to the grid reactive power of node i,j (kvar); P gen_i,j and Q gen_i,j are respectively active and reactive power sent by the upper power generator on node i,j (kW, kvar); P load_i,j and Q load_i,j are respectively active and reactive power of the load on node i,j (kW, kvar); V grid_i and V grid_j are respectively grid voltage of node i(kV) and node j(kV); G grid_ij and B grid_ij are respectively real part and imaginary part of the admittance Y grid_ij between node i and node j; θ grid_ij refers to the phase angle difference between node i and node j (i,j = 0, 1, 2,..., 32).

Thermal System Modeling
Thermal system connects the heat source and the user through double loops of the water supply pipeline and the return water pipeline. The solution model can be divided into two parts, hydraulic model and thermal model. This is described below.

Hydraulic Modelling
The hydrothermal model of the thermal pipe network is a direct expression of the energy flow of the thermal network, taking into account the relationship between its network topology and node distribution, the energy flow Equation (5): In the equation, R refers to node-pipeline incidence matrix of the thermal power system; L refers to water mass flow rate (kg/s) of the pipeline; L q refers to injection water mass flow rate (kg/s) of node q, q ∈ [1, 9].
The flow of water in the heat-network pipe is caused by the squeeze of the pressure wall and its resistance loss is related to the resistance coefficient of the pipe and the change of unit length pressure. In a closed loop, the head pressure loss conforms to the conservation law, and its level is zero. This relationship as follows: In the equation, H refers to the loop-pipeline incidence matrix of the thermal power system; h f refers to head loss (m), which can be expressed with Equation (7): In the equation, K f refers to pipeline resistance coefficient.
Thermal Modelling The thermal system injecting heat energy into each thermal node, it could be obtaining the water supply temperature T s flows into the thermal network, with the pipeline transmission or generates heat loss with pipeline flow, so that the heat energy is recovered at the return water temperature T o , and the Equation (8) for its thermal power utilization indicates: In the equation, φ refers to thermal power (W) consumed by the thermal load; K c refers to specific heat (J/(kg × K)) of water.
Considering the loss of thermal energy pipeline, it is transport in the pipeline affected by the parameters of pipeline initial node temperature, pipeline pressure parameter, external environment temperature, pipe length, pipe end temperature, and so on, the loss of heat energy changes exponentially, and the relationship between them is: In the equation, T start and T end are, respectively, the temperature ( • C) when water flows into and leaves from the pipeline; T env refers to external environment temperature ( • C); λ refers to heat transfer coefficient (W/(m × K)) of pipeline unit length; l refers to pipeline length (m).
At the junction points of multiple pipelines, the product of their flow and temperature is maintained, as shown in Equation (10): In the equation, T out refers to water outlet pipeline temperature ( • C); L out refers to water outlet pipeline mass flow rate (kg/s); T in refers to inlet water pipeline temperature ( • C); L in refers to inlet water pipeline mass flow rate (kg/s).

Modeling of Cooling Systems
The models of the cooling system and the thermal system are only different in temperature parameters, and the rest are similar. They can also be described from Equations (5) to (10). It will not be described here in order to streamline.

Modeling of Coupling Link
The coupling link takes external electric energy, thermal energy and cooling energy as the input end, and adjust the power of electric energy, cooling energy, and thermal energy through internal cogeneration of heat and power, heat pump, electric boiler, absorption refrigerator, electric refrigerator, and power cooling and supply equipment to influence each other. The surplus energy can be converted to each other so as to realize the advantage of energy utilization maximization of distributed energy system.

Combined Heat and Power (CHP)
Ordinary generator works and produces the necessary electric energy, some of the remaining energy of its raw chemical energy has to be wasted in the form of heat. As a new type of energy equipment for coupling generator and thermal power unit, combined heat and power is widely known for its ability to fully utilize the chemical energy in natural gas. In its description, constant electric heat ratio is often used to measure its superior performance: In the equation, P CHP refers to electric power (MW) of combined heat and power (CHP) output; φ CHP refers to output thermal powder (MW); K CHP refers to the parameter of electric heat ratio.

Heat Pump (HP)
As a good heat energy conversion device, heat pump can realize the transfer of heat energy from high temperature object to low temperature object. The low-grade energy in heat energy is greatly utilized and the heat energy efficiency is greatly improved. Its formula can be expressed as follows: In the equation, P HP refers to electric power (MW) consumed by the heat pump; φ HP refers to thermal powder (MW) produced by the heat pump; K HP refers to heat energy efficiency.

Electric Boiler (EB)
As a traditional electric energy and heat energy conversion equipment, electric boiler can supplement the short-time heat energy by consuming part of the electric energy. Its output state is closely related to the electric-heat coefficient. The specific relationship is shown in Equation (13): In the equation, P EB refers to the electric power (MW) consumed by the electric boiler; φ EB refers to thermal powder (MW) obtained through transformation; K EB refers to the electric-heat coefficient.

Absorption Chiller (AC)
The absorption chiller completes the heating and refrigeration cycle through the absorption-generator work. The binary solution is used as the working medium. When the working medium has a low boiling point, the absorption refrigerator uses the evaporation mode as the refrigerating machine. When the boiling point of the working medium is high, the absorbent of the absorption chiller reacts to absorb heat, and the refrigeration mode starts. The refrigeration relationship is expressed as follows: In the equation, φ AC refers to the input of waste heat (MW); O AC refers to the output cooling capacity (MW); K AC refers to refrigeration coefficient during actual operation; K AC,0 refers to rated refrigeration coefficient; β AC refers to load rate during refrigeration; a, b, and c refer to refrigeration coefficient constants.

Electric Chiller (EC)
Considering that short-term cooling energy supply may be insufficient in the coupling system, the system needs the electric chiller to work to make up for the lack of cooling energy, which the motor consumes electric energy to drive the compressor to do work to generate cooling energy. The working relationship of the electric refrigerator can be expressed as follows: In the equation, P EC refers to electric power (MW) consumed by the electric chiller; O EC refers to the cooling power (MW) obtained through transformation; K EC refers to the refrigeration coefficient of electric chiller.

Power and Cooling Supply
The utilization of middle-low grade heat energy has always been a hot topic in thermodynamic research. The appearance of power and cooling supply equipment makes it possible for low-grade heat energy to be converted into electrical energy and cooling energy. The relation between electrical energy and cooling energy output can be expressed as follows: In the equation φ CP refers to thermal powder (MW) absorbed by the power and cooling joint supply device; P CP refers to electric power (MW) output by the power and cooling joint supply device; O CP refers to the output cooling power (MW); K CP,C refers to the power coefficient of the power and cooling supply equipment; K CP,C refers to the cooling coefficient of the power and cooling supply equipment.

Interval Power Flow Calculation Based on Affine Algorithm
Uncertain power flow calculation is based on the certain power flow calculation to consider the impact of uncertain factors on system operation, such as intermittent energy output fluctuation, load fluctuation, equipment failure, market environment uncertain, and so on. Its basic idea the distribution characteristics of uncertain factors are modeled, and then through a certain algorithm to calculate the unknown parameters in the system of distribution characteristics, thus extending the deterministic calculation results of "points" for "face" that is obtained the scope of system state parameters or distribution characteristics under the uncertain factors. According to the modeling method of uncertain quantity, the calculation method of uncertain power flow can be divided into random power flow, fuzzy power flow, and interval power flow. Among them, interval power flow needs the least uncertain quantitative information, it only needs to know the upper/lower bound of the uncertain quantitative.

Interval Power Flow Calculation Method
The idea of interval power flow calculation of distributed energy system is derived from the interval power flow calculation of power system. Because only uncertain upper/lower boundaries are required, its modeling is easy and formal. Unified modeling of deterministic power flow Equation of distributed energy system is as follows: where, F (·) is the energy flow equation; ξ is the state variable of a distributed energy system; V and θ are the voltage amplitude and phase of the power system respectively; p is node pressure of natural gas system; L, T start , and T end , respectively, are mass flow rate, starting temperature, and ending temperature of heat (cold) system branches; y is the load of distributed energy system, the expression is where, P and Q are respectively active and reactive loads of the power system; f is the load of natural gas system; φ is the heat (cold) system load. The variables in Equation (17) are described by interval numbers, that is, the interval power flow calculation equation of distributed energy system can be obtained as follows: The next work is to solve Equation (19) through some algorithm, and finally get the interval range satisfied by the state variable x.

Affine Algorithm
Affine algorithm is the most widely used interval algorithm in power system because its method is easy to implement and requires less uncertain input conditions.
In affine mathematics, uncertain is usually expressed as a linear polynomial in affine form, denoted as vectorx: where, x i is the real coefficient; ε i is the noise element marker, whose value is in the interval [−1, 1]; x 0 is the central value, similar to the median value in the interval number. The interval number can be converted into affine number by adding information of noise element marker. Suppose an interval number is converted into affine form as follows: The affine numberx = x 0 + x 11 + . . . + x n ε n is converted into the corresponding interval number: where: rad(x) = ∑ n i=1 |x i |. It should be noted that the conversion of affine numbers to interval numbers is irreversible. In the process of converting affine number to interval number, the information of noise element marker will be lost. The affine number can be regarded as the interval number with increased information, and for such information is increased, affine number has the advantage of being less conservative in calculation.

Analysis of Examples
In this section, multiple load parameters and varying intervals of energy input are comprehensively considered, including load fluctuations of wind power output, photovoltaic output, thermal power system and power system. Affine algorithm is used to solve the interval power flow of distributed energy system.
Based on the topology of distributed energy system in Figure 1, a group of photovoltaic power generation devices are added at node 7 of the power system, and a group of wind power generation devices are added at node 13, in order to analyze the power flow of a multi-energy complementary distributed energy system that studies the changes of multiple uncertain parameters at the same time, as shown in Figure 2. As a group of photovoltaic and wind power generation is added to the power system nodes 7 and 13, the power balance at these two nodes changes. The balance relationship of photovoltaic power generation at node 7 is: P grid_6,7 + P grid_7,8 + P PV + P load_7 = P gen_7 (23) In the equation P PV refers to Photovoltaic output (KW). The balance relation of wind power generation node 13 is: P grid_12,13 + P grid_13,14 + P wind + P load_13 = P gen_13 (24) In the equation P wind refers to wind power generation output (KW). According to the historical data of light intensity and wind speed, the value range of light intensity and wind speed is predicted, so as to calculate the output range of photovoltaic power generation is [0, 146.3] kW, and the output range of wind power generation is [0, 122.25] kW.
In this paper, this study relies on computer simulation, the computer accessories used: CPU I5-7300, 8G memory, 64-bit operating system, and use C language editing, the electrical and thermal loads of this standard are detailed in Appendix A. According to the uncertainty of the fluctuation range of power load and thermal load at the same time, when the load of both fluctuates within the range of 1-100%, it is called low load. When the load of both fluctuates within the range of 90-110%, it is called high load.
When the load of both fluctuates within the range of 110% or more, the system is prone to instability, which is beyond the scope of steady-state research, it will be considered in future research.

Uncertain Study under Low Load
Considering the fluctuation range of power load and thermal load of 1-100% at the same time, affine algorithm is adopted to calculate the power flow of the cold-heatelectricity complementary distributed energy system containing the uncertainty of photovoltaic, wind power, and load fluctuation, and the results are as follows. Figures 3 and 4 show that the upper and lower limits of bus voltage in the power subsystem and the upper and lower limits of pipeline flow in the thermal subsystem can be calculated respectively by affine algorithm. Figure 3 shows that when the load of system changes over a smaller interval, the voltage variation range of nodes (node 1-3 and node 18-21) in the power system close to the coupling link is small, less than 1%, shows that when the load demand was great, the system voltage is weak, and the system have the risk of voltage collapse. Therefore, in the near several nodes, additional generators may be considered to improve the voltage stability of the system. It can be seen from Figure 4 that, under the low load, the flow rate at the end node 5 flows in the opposite direction, with a small and low flow rate, which also means that the demand for pipeline radius is small. As node 1 and node 2 are close to the coupling link, where is a large demand for regulation and pipeline flow, so a larger pipeline is needed to support the operation of the thermal system. For the output end of the cooling system is only connected to the coupling link through the cooling load, only the energy flow, equivalent thermoelectric ratio and equivalent heatcooling ratio of the coupling link are changed. After calculation, the fluctuation range of the energy supply output of the cooling force subsystem is [0.052, 53.29] kW. Among them, the output power of photovoltaic power generation is 127.5 kW, and the output power of wind power is 96.1 kW. The affine algorithm gives the variation range of state quantities of power system, thermal system, and cooling system under the influence of photovoltaic, wind power, and load fluctuation, and can obtain more accurate and reasonable solutions. At the same time, in terms of the calculation time of the algorithm, affine algorithm has few iterations and short calculation time, which meets the requirements of analysis. The results are shown in Table 1 below. Due to affine algorithm by adopting the idea of integral calculation, so the number of iterations of the power system and the thermal system are consistent. The calculation of both with the method of distributed calculation is adopted, so the calculation time of the power system is less than that of the thermal system, which is better for power systems with more complex topological systems and more nodes.

Study on Uncertainty under High Load
When the fluctuation range of power load and thermal load is considered from 90% to 110% at the same time, affine algorithm is used to calculate the power flow of the coldheat-electricity complementary distributed energy system containing the uncertainty of photovoltaic, wind power, and load fluctuation. The results are as follows. Figures 5 and 6 show that the upper and lower limits of bus voltage in power system and the upper and lower limits of pipeline flow in thermal system can be calculated respectively by affine algorithm. Under the condition of high load, uncertain system for distributed energy system of bus voltage limit is bigger, operation range is small, especially near the coupling link node 1-3, 18-22, the bus voltage is basically limited to a certain range, the operating range of other nodes is relatively small. When the variation difference of the system under high load reaches 8% at full load, the power system needs more generators to ensure the system voltage balance. In the aspect of thermal system, the end node 5 is limited to a small pipeline flow range (0.42-0.48 kg/s). The operating range of nodes 1 and 2 is similar to that of low load, maintaining a high flow rate. The lower limit of the flow rate of other nodes is increased to different degrees, and the operating range of the thermal system is greatly compressed. Meanwhile, the fluctuation range of the power supply output of the cooling subsystem is [40.80, 58.34] kW. Among them, the output power of photovoltaic power generation is 144.6 kW, and the output power of wind power is 120.75 kW.  Compared with the operating conditions in which the load fluctuates within the range of 1% to 100%, the energy flow interval obtained under the condition of 10% fluctuation of load is smaller, which can be considered as the energy flow under the reasonable fluctuation of load demand in normal operation.
To sum up, affine algorithm is used to solve the interval power flow of the cold-heatelectric coupled multi-energy complementary distributed energy system. The calculation speed is reasonable, and the calculation results are relatively accurate. By solving the power flow under the action of various uncertain factors, the theoretical basis and reference basis are laid for the stability analysis and optimal operation of the multi-energy complementary distributed energy system.

Conclusions
In this paper, the uncertain input factors in the multi-energy complementary distributed energy system are considered and the interval power flow of the system is solved by affine algorithm. First of all, a distributed energy system with complementary coldheat-electricity multi-energy is built, including power system, thermal system, cooling system, and coupling link, which modeling is carried out for each subsystem. Then affine algorithm is adopted to calculate the steady-state power flow of distributed energy system under the condition of high and low load, considering various uncertain input factors (photovoltaic power, wind generation power). The simulation results show that when the system is under low load (1-100%), the voltage variation range of the nodes close to the coupling link in the power system is small, and the voltage level of the nodes is relatively weak. For the thermal system, the flow direction of the end node 5 is opposite and the flow velocity is small. Therefore, the end pipe far from the coupling link requires a small pipe radius of the thermal network, while the pipe close to the coupling link needs to increase the pipe radius in order to cope with the possible load changes. The cooling energy output range of the system is also large. When the electricity load and thermal load in the range of the rated load fluctuate up and down (10%), the limit of power system bus voltage is higher. In some nodes close to the coupling link, the node voltage even remains unchanged when the load change reaches 8%, the bus voltage of power system starts to become unstable, it is necessary to increase the generator to stabilize the system voltage and prevent the risk of voltage collapse or even decomposing. However, the lower limit of pipeline flow in the thermal system is increased to different degrees under low load. The flow at the end node 5 is nearly unchanged when the load changes greatly, and the optimization space available is relatively small. The output range of the cold energy system is also greatly limited. By calculating the interval power flow of the distributed energy system, this paper analyzes the change of the power flow of the distributed energy system under high and low load, thus providing a theoretical basis and data support for the stability analysis and optimization operation of the distributed energy system.

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