Multi-energy flow calculation method and system for integrated energy system based on ensemble learning
Through the integrated learning method, combined with partial least squares method and deep neural network algorithm, a multi-energy flow model of the integrated energy system is constructed, which solves the computational complexity and accuracy problems and realizes efficient multi-energy flow calculation.
Patent Information
- Application Number
- CN202210841297.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-07-18
AI Technical Summary
The prior art has problems in the multi-energy flow calculation of integrated energy systems with large calculation volume, complex iteration process, high initial value sensitivity, and the difficulty of single data-driven modeling to match the data characteristics of various variables at the same time, resulting in a decrease in model accuracy.
Using an integrated learning method, the Stacking integrated learning model combination strategy is used to integrate the partial least squares method and the deep neural network algorithm under linear and nonlinear data characteristics, and a multi-energy flow model of the electrical-gas-thermal integrated energy system is constructed, and the combined training of primary learners and secondary learners is used to improve the generalization ability and accuracy of the model.
It realizes high-precision multi-energy trend computing in different energy networks, avoids the large amount of calculation and convergence problems of traditional iterative algorithms, improves the calculation speed and accuracy of the model, and is suitable for complex comprehensive energy systems.
Smart Images

Figure CN115169710B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the technical field of multi-energy flow calculation, and specifically relates to a multi-energy flow calculation method and system for an integrated energy system based on ensemble learning. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] Currently, the energy industry is a key area of focus for energy conservation and emission reduction efforts. As one of the main forms of future energy, the integrated energy system (IES) enables the rational utilization of multiple energy sources, including electricity, heat, cooling, and gas, through multi-energy integration. This reduces overall energy loss during transmission and improves energy conversion efficiency and end-use efficiency. IES can promote the integration of renewable energy and energy conservation and emission reduction while ensuring a secure and reliable energy supply, contributing to the achievement of the "dual carbon" goals.
[0004] Multiple energy flow (MEF) calculations are fundamental to the steady-state analysis and optimized operation of integrated energy systems. Currently, the Newton method is widely used both domestically and internationally to calculate the steady-state flow of integrated energy systems. Considering the impact of coupled units at the balance nodes of the power and heating systems on the combined flow calculation, a unified and sequential solution algorithm for the electric-thermal system was proposed. Based on the established flow analysis model for the gas system, a unified and sequential solution algorithm for the electric-gas coupled integrated energy system was proposed. Furthermore, a unified solution model for the flow of the electric-gas-heat integrated energy system was established, taking into account multiple coupled devices.
[0005] According to the inventors, compared with the power system, the integrated energy system has more variables and higher dimensions, and the bottlenecks exposed by the Newton method in multi-energy flow calculations are more obvious: 1) During the iteration process, the corresponding elements of the Jacobi matrix need to be corrected and the Jacobi matrix needs to be inverted again, which requires a lot of calculations, and when the system scale is large, it is easy to cause the Jacobi matrix to be singular; 2) It is sensitive to initial values, and unreasonable initial values may lead to increased calculation time and even failure to converge.
[0006] Data-driven modeling approaches rely solely on historical measurements, eliminating the need for understanding system topology and parameters. Furthermore, trained models do not require iterative convergence during the calculation process, circumventing some of the bottlenecks faced by the Newton method and providing new insights into rapid power flow calculations for integrated energy systems. However, current research on power flow modeling based on data-driven approaches primarily focuses on power systems, with limited application to integrated energy systems.
[0007] Currently, no research has explored data-driven modeling of multi-energy power flows in heterogeneous energy networks encompassing electricity, gas, and heat. The theoretical difficulty lies primarily in the higher dimensionality of variables and the more complex inter-variable relationships in integrated energy systems compared to power systems. A single data-driven modeling technique cannot optimally match all the data characteristics of each variable simultaneously. For example, power flow modeling methods based on linear regression have proven effective for power systems, generating models with high accuracy. However, for variables associated with some confluence nodes in heating networks and gas networks, linear regression models struggle to accurately reflect nonlinear characteristics, resulting in reduced model accuracy. Similarly, neural network models, due to their nonlinear activation functions and deep structures, are more suitable for fitting nonlinear characteristics than linear regression models. However, for power systems with more pronounced linear characteristics between variables and for some nodes in heating networks with simpler topologies, their fitting accuracy is not superior to that of linear regression models, and they require significantly more sample size, training time, and parameter tuning time. Summary of the Invention
[0008] In order to solve the above problems, the present disclosure proposes a multi-energy flow calculation method and system for an integrated energy system based on ensemble learning, which integrates the modeling advantages of different machine learning algorithms in specific scenarios, so that the generated multi-energy flow model can ensure high accuracy in different energy networks.
[0009] According to some embodiments, the first solution of the present disclosure provides a method for calculating multi-energy flow in an integrated energy system based on ensemble learning, which adopts the following technical solutions:
[0010] A multi-energy flow calculation method for an integrated energy system based on ensemble learning, comprising:
[0011] Acquire and analyze characteristic data of integrated energy systems;
[0012] Based on the analyzed characteristic data, a multi-energy flow model of the integrated energy system is constructed;
[0013] Training the primary learner of the first layer of the constructed integrated energy system multi-energy flow model;
[0014] Based on the fitting results output by the primary learner, the secondary learner is trained to obtain a multi-energy flow calculation model of the integrated energy system with multi-model fusion, thereby realizing the multi-energy flow calculation of the integrated energy system with multi-model fusion.
[0015] As a further technical limitation, the integrated energy system is an integrated energy system including electricity, gas and heat; the characteristic data of the integrated energy system obtained is obtained through the power system model, the heating system model, the gas system model and the coupling equipment model.
[0016] Furthermore, the power system model adopts an AC system model to obtain an active power balance equation and a reactive power balance equation;
[0017] The heating system model includes a thermal model and a hydraulic model, and obtains a node power balance equation, a loop pressure drop equation, a supply temperature equation, and a return temperature equation;
[0018] The gas system includes a gas pipeline, a gas source, a load, and a compressor. A gas system model is constructed through the gas system to obtain a natural gas pipeline flow equation, a compressor electric power equation, and a compressor horsepower equation;
[0019] The coupling device considers the cogeneration unit in backpressure operation mode to obtain an electrical output power equation of the backpressure cogeneration unit, an equation for the flow of natural gas consumed by the cogeneration unit, and a power equation for the gas boiler.
[0020] As a further technical limitation, in the process of constructing the multi-energy flow model of the integrated energy system, a data-driven algorithm is used to analyze the acquired characteristic data of the integrated energy system to complete the construction of the multi-energy flow model of the integrated energy system.
[0021] As a further technical limitation, the primary learner of the first layer of the constructed integrated energy system multi-energy flow model is trained using the original data set to obtain multiple fitting results, and the second-level learner uses the fitting results obtained in the first layer as input features for training to obtain the final prediction results; an integrated learning framework is used to generalize the final prediction results output by the integrated energy system multi-energy flow model to improve the accuracy of the constructed integrated energy system multi-energy flow model.
[0022] Furthermore, a secondary learner is obtained based on the output of the primary learner. During the primary learning period, the output of the primary learner is obtained through a five-fold cross-validation method. The original data is divided into five parts using a non-repeated sampling method, one of which is selected as a test set and the remaining four as training sets. The model is trained to obtain test results; the model training is repeated five times, and the average value of the five groups of test results is used as the input of the primary learner to the secondary learner.
[0023] As a further technical limitation, the process of obtaining the multi-energy flow calculation model for the integrated energy system multi-model fusion is as follows:
[0024] Obtain the input characteristics and output values of the integrated energy system power flow calculation, and use different algorithms to build different integrated energy system power flow models;
[0025] Analyze the errors and distribution of models trained by different algorithms and select the primary learner;
[0026] Use the divided data set to train the first-layer primary learners in the integrated learning framework, output the fitting results, and generate a new data set;
[0027] Using the newly generated data set, the second-layer algorithm in the integrated learning framework is trained, and the secondary learner is selected according to the output results. The integrated learning algorithm based on multi-model fusion is trained, and the multi-energy flow modeling training based on multi-model fusion is completed, thus realizing the multi-energy flow modeling based on multi-model fusion.
[0028] According to some embodiments, the second solution of the present disclosure provides a multi-energy flow calculation system for an integrated energy system based on ensemble learning, which adopts the following technical solutions:
[0029] A multi-energy flow calculation system for an integrated energy system based on ensemble learning, comprising:
[0030] an acquisition module configured to acquire and analyze characteristic data of the integrated energy system;
[0031] a modeling module configured to construct a multi-energy flow model of the integrated energy system based on the analyzed characteristic data;
[0032] The computing module is configured to train the primary learner of the first layer in the constructed multi-energy flow model of the integrated energy system; based on the fitting results output by the primary learner, the secondary learner is trained to obtain the multi-energy flow calculation model of the integrated energy system multi-model fusion, thereby realizing the multi-energy flow calculation of the integrated energy system multi-model fusion.
[0033] According to some embodiments, a third solution of the present disclosure provides a computer-readable storage medium, which adopts the following technical solution:
[0034] A computer-readable storage medium stores a program thereon, which, when executed by a processor, implements the steps in the method for calculating multi-energy flow in an integrated energy system based on integrated learning as described in the first aspect of the present disclosure.
[0035] According to some embodiments, a fourth solution of the present disclosure provides an electronic device, which adopts the following technical solution:
[0036] An electronic device comprises a memory, a processor and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for calculating multi-energy flow in an integrated energy system based on integrated learning as described in the first aspect of the present disclosure are implemented.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] This paper proposes to construct a multi-energy flow model for an electricity-gas-heat integrated energy system based on a Stacking integrated learning model combination strategy, taking into account the complex variable characteristics of the integrated energy system, and integrating the modeling advantages of the partial least squares method and the deep neural network algorithm under linear and nonlinear data characteristics, so that the generated multi-energy flow model can ensure high accuracy in different energy networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which constitute a part of the present disclosure, are used to provide a further understanding of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation to the present disclosure.
[0040] Figure 1 This is a flow chart of a multi-energy flow calculation method for an integrated energy system based on integrated learning in the first embodiment of the present disclosure;
[0041] Figure 2 Schematic diagram of the stacking-based integrated learning method in the first embodiment of the present disclosure;
[0042] Figure 3 Schematic diagram of a multi-energy power flow modeling method based on multi-model fusion under the Stacking framework in the first embodiment of the present disclosure;
[0043] Figure 4 is a topological structure diagram of the integrated energy system in the first embodiment of the present disclosure;
[0044] Figure 5 1 is a comparison diagram of the calculation errors of LS, PLS and DNN in the first embodiment of the present disclosure;
[0045] Figure 6 is a graph showing the correlation analysis results of the fitting errors of the various models in the first embodiment of the present disclosure;
[0046] Figure 7 This is a structural block diagram of the multi-energy flow calculation system for an integrated energy system based on integrated learning in the second embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0048] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure belongs.
[0049] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0050] In the absence of conflict, the embodiments of the present disclosure and the features thereof may be combined with each other.
[0051] Example 1
[0052] Embodiment 1 of the present disclosure introduces a method for calculating multi-energy flow in an integrated energy system based on ensemble learning.
[0053] like Figure 1 The multi-energy flow calculation method for an integrated energy system based on ensemble learning is shown, including:
[0054] Acquire and analyze characteristic data of integrated energy systems;
[0055] Based on the analyzed characteristic data, a multi-energy flow model of the integrated energy system is constructed;
[0056] Training the primary learner of the first layer of the constructed integrated energy system multi-energy flow model;
[0057] Based on the fitting results output by the primary learner, the secondary learner is trained to obtain a multi-energy flow calculation model of the integrated energy system with multi-model fusion, thereby realizing the multi-energy flow calculation of the integrated energy system with multi-model fusion.
[0058] This embodiment considers an artificial intelligence method that can "draw on the strengths of many" and integrate the modeling advantages of different machine learning algorithms in specific scenarios, so that the generated multi-energy flow model can ensure high accuracy in different energy networks. In this embodiment, a variety of data-driven algorithms are first used to separately model the multi-energy flow of the integrated energy system, and the results are compared and analyzed; then, a multi-energy flow data-driven modeling method based on the Stacking ensemble learning model combination strategy is proposed, which integrates several "accurate but different" primary learners, uses a suitable secondary learner to perform secondary learning on the results of the primary learner, and generates an ensemble learning model with better overall modeling accuracy than various single learners, solving the problem of limited accuracy of single-type data-driven models in complex multi-energy flow scenarios; at the same time, the generated model supports fast calculation and can avoid the large amount of calculation and convergence problems brought by traditional iterative root-finding algorithms.
[0059] The integrated energy system, which includes electricity, gas, and heat, consists of a power system, a gas system, a heating system, and multiple coupled devices such as combined heat and power (CHP) and gas boilers (GB). The system model is as follows:
[0060] Power system model
[0061] The power system adopts the AC system model, and its active power and reactive power balance equations are:
[0062]
[0063]
[0064] ΔP i =P i G +P i CHP -P i COM -P i P -P i LD -P i (3)
[0065]
[0066] Where i = 1, 2, ..., n e , n e is the number of power system nodes; P i G 、P i CHP are the active power generated by the generator and CHP at node i respectively; P i COM 、P i P are the active power consumed by the compressor and water pump at node i respectively; are the reactive power generated by the generator and CHP at node i respectively; are the reactive power consumed by the compressor and water pump at node i respectively; P i LD 、 are the active power and reactive power consumed by the load at node i respectively; P i , Q i Represents the active power and reactive power of node i; V i is the voltage amplitude of node i; θ ij =θ i -θ j is the voltage phase angle difference between node i and node j; Gij and B ij are the real and imaginary parts of the elements in the i-th row and j-th column of the node admittance matrix, respectively.
[0067] Heating system model
[0068] The heating system model consists of two parts: thermal model and hydraulic model.
[0069] 1) Thermal model
[0070] The power transmitted between node k and node l in the thermal system is as follows:
[0071]
[0072] Among them, φ kl is the transmission power of node k and node l; c p is the specific heat capacity of water; m kl is the pipeline flow rate; is the supply temperature of node k; T g is the ambient temperature; is the return temperature of node l; λ is the pipeline heat transfer coefficient; L kl is the pipe length.
[0073] The water temperature calculation formula after hot water is mixed at node k is as follows:
[0074] (∑m lk )T k,mix =∑(m lk T lk ) (6)
[0075] Among them, m lk is the flow from node l to node k; T k,mix is the water temperature at node k; T lk is the temperature of water flowing from node l to node k.
[0076] 2) Hydraulic model
[0077] In thermal systems, friction between pipes and water causes the water's pressure to decrease during flow. Therefore, a water pump is usually installed at the heat source to provide the pressure required for hot water supply and return flow. The formula for calculating the pressure loss during flow is as follows:
[0078]
[0079]
[0080] Where Δp kl is the pressure loss of the pipeline between node k and node l; L kl is the length of the pipeline; d klis the inner diameter of the pipe; Γ is the friction coefficient of the pipe; ρ is the density of water; ε h is the pipe roughness; Re is the Reynolds number.
[0081] The electrical power consumed by the pump is as follows:
[0082]
[0083] Where H is the pressure at the node of the heat source; m P is the water flow through the pump; η P The efficiency of the water pump.
[0084] The thermal system model includes the node power balance equation (10), the loop pressure drop equation (11), the supply temperature equation (12), and the return temperature equation (13). The specific calculation formulas are as follows:
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091] in, is the load thermal power of node k; The water flow supplied to the heat source of node k; sign m (m lk ) represents the direction of water flow in the pipe. When m lk >0 takes +1, otherwise takes -1; is the water flow required for the heat load of node k; is the heating temperature of the heat source at node k; is the return temperature of the heat load at node l, which is generally a given value; n h is the number of nodes in the heating network.
[0092] Gas system model
[0093] The gas system mainly consists of gas pipelines, gas sources, loads and compressors. The flow rate of natural gas pipelines is τt The relationship with the node pressure π is shown in formula (16):
[0094]
[0095]
[0096]
[0097] Where, τ, t is the node number of the natural gas network; D τt is the inner diameter of the pipe; z G is the gas compressibility coefficient; T is the gas temperature; L τt is the pipeline length; δ is the relative density of natural gas; sign(π τ ,π t ) characterizes the direction of gas flow, when π τ >π t +1 when , otherwise -1; ε g is the absolute roughness of the pipeline.
[0098] The compressor in the gas system is mainly used to compensate for the pressure loss of the gas in the pipeline. The required electrical energy is:
[0099]
[0100]
[0101] Among them, P COM E is the electric power consumed by the compressor; COM is the horsepower consumed by the compressor; η COM is the efficiency of the compressor; π 0G 、T 0G are standard atmospheric pressure and standard temperature respectively; λ G is the natural gas adiabatic index; T GC is the temperature of the gas absorbed by the compressor; t / π τ is the compression ratio of the compressor.
[0102] Coupling device model
[0103] The integrated energy system coupling device is a key link in achieving energy conversion between various energy systems. This embodiment mainly considers the CHP unit in backpressure operation mode. In this mode, the power generation of the unit is proportional to the heat generation, as shown in formula (21):
[0104] P CHP =φ CHP / c m (twenty one)
[0105] f CHP =(P CHP +φ CHP ) / (q gas *η CHP ) (twenty two)
[0106] Among them, P CHP 、φCHP Respectively represent the electrical output power and thermal output power of the back pressure CHP unit; c m is the unit's electric-to-heat ratio; f CHP is the natural gas flow consumed by CHP; q gas is the calorific value of natural gas; η CHP is the efficiency of CHP.
[0107] The power equation for a gas boiler is shown below:
[0108]
[0109] Among them, f G is the natural gas flow consumed by the gas boiler; P G is the thermal power generated by the gas boiler; a G 、b G 、c G is the natural gas consumption coefficient of the gas boiler.
[0110] The mathematical essence of the integrated energy system flow calculation is to solve a set of nonlinear equations. The multi-energy flow calculation obtains the values of other variables in the steady-state operation state of the system based on the given network topology, parameters, and source and load values. The data-driven multi-energy flow model only needs to consider the mathematical relationship between the known quantities and the quantities to be determined. Therefore, the known quantities are the required power of the power system, heating system, and gas system loads, and the quantities to be determined are the six types of variables: voltage amplitude, voltage phase angle, supply temperature, return temperature, pipeline flow, and gas pressure node. Once the six basic variables are known, other variables can be inferred through the mechanism formula. For example, the active / reactive branch power of the power grid and the heat loss of the heat network branch can be calculated according to the following formula:
[0111] P ij =G ij (V i 2 -V i V j cosθ ij )-B ij V i V j sinθ ij (twenty four)
[0112] Q ij =-B ij (V i 2 -V i V j cosθ ij )-G ij V i V j sinθ ij (25)
[0113]
[0114]
[0115] Among them, P ij and Q ij are the active and reactive powers of the branch from node i to node j respectively; are the supply water heat loss and return water heat loss of the branch composed of node k and node l respectively.
[0116] Use data-driven algorithms to model the multi-energy flow of integrated energy systems, and select algorithms that have been verified in power system flow modeling and improved algorithms with relatively superior performance, including LS method, PLS method, Lasso method, radial basis function (RBF) neural network, generalized regression neural network (GRNN), and deep neural network algorithm DNN. Among them, LS uses the gradient descent method to optimize the error function in the form of the least squares method, finding the best function match for the data by minimizing the sum of squares of the errors, and is suitable for fitting linear features. Partial least squares (PLS) combines principal component analysis and canonical correlation analysis on the basis of ordinary multivariate regression and is widely used in regression problems. The Lasso method adds L1 regularization after the objective function of linear regression to compress the coefficients of insignificant variables to 0, thereby obtaining a model with fewer variables, achieving more accurate parameter estimation, and also realizing variable selection. RBF is a three-layer forward network with a single hidden layer. It has a simple structure, simple training, fast learning convergence speed, and can approximate any nonlinear function. GRNN is an improvement on RBF. The difference is that a summation layer is added and the weight connection between the hidden layer and the output layer is removed. It has strong nonlinear mapping ability and learning speed, which has greater advantages than RBF. The DNN structure includes an input layer, an output layer, and multiple hidden layers. The neural networks are connected by neurons, which has a stronger ability to fit nonlinear features. This embodiment introduces the two main algorithms, PLS and DNN, and other algorithms are not repeated.
[0117] The PLS method combines principal component analysis and canonical correlation analysis on the basis of multiple regression, which can better deal with problems such as collinearity and few input features.
[0118] The regression equation is expressed as:
[0119]
[0120] Among them, A' is the coefficient matrix, C is the constant matrix, L gas is the load matrix of the gas system.
[0121] Formula (28) can be simplified as:
[0122] Y=AX (29)
[0123] Among them, A, X and Y are regression coefficient matrix, input variable matrix and output variable matrix respectively, X=[PQ ΦL gas 1] T , Y=[V θ T s T r m π] T .
[0124] PLS decomposes the input matrix and output matrix into p components:
[0125]
[0126] Among them, T, U are the p component matrices extracted, C, R are the load matrices, E, F are the residual matrices, and the covariance of T and U is maximized by decomposing X and Y.
[0127] Given the update input X * , output Y * It can be expressed as follows:
[0128] Y * =AX * (31)
[0129] Among them, A T =X T U(T T XX T U) -1 T T Y.
[0130] DNNs contain multiple hidden layers, each of which undergoes forward computation and backpropagation, enabling them to effectively fit complex nonlinear functions. During training, DNNs extract features from training data and use internal weight parameters to fit the input-output relationship of the data, thereby describing complex functional relationships.
[0131] Essentially, a DNN is a parameterized function whose parameters are typically expressed as θ = {w,v}, where w is the weight between layers and v is the bias. These parameters are optimized during training to minimize the difference between the DNN output and the label. Traditionally, the squared error is chosen as the loss function:
[0132]
[0133]
[0134] Among them, m is the number of samples for each training; L is the number of layers of the deep neural network; Y out is the normalized output vector of DNN; X in is the normalized feature input vector; R γ For the γth th The activation function of the layer. The weight matrix w γ-1 For an n γ ×n γ-1 Matrix; deviation matrix v γ-1 n γ dimensional vector, where n γ For the γth th The number of neurons in the layer.
[0135] Comparison of fitting effects
[0136] In order to demonstrate the fitting effect of the models trained using different data-driven algorithms, tests were conducted on an integrated energy system consisting of an IEEE 14-node power system, a 13-node natural gas system, and a 69-node heating system in a certain region. The Newton method was used to solve the nonlinear equations of the electricity-gas-heat integrated energy system (Equations (1)-(23)) as the benchmark value and data set to test the accuracy of the models built by the above six data-driven algorithms.
[0137] The accuracy of the model is reflected by the average relative error, which is expressed as follows:
[0138]
[0139] Among them, MRE is the mean relative error, m is the number of samples, and y(ι) are the estimated and true values of the variable at the i-th time, respectively.
[0140] Table 1 shows the calculation errors of various variables in the example model trained by different machine learning algorithms. The average relative error results for each variable show that PLS and DNN perform best for each type of variable. PLS performs well for voltage, phase angle, return temperature, and pipe flow, but performs worse than DNN for gas pressure and supply temperature. This is because for variables such as voltage amplitude, voltage phase angle, return temperature, and pipe flow, the linear characteristics between input and output are more pronounced, resulting in better results for linear regression. Conversely, for variables such as gas pressure and return temperature, nonlinear factors in the data characteristics reduce the accuracy of linear regression, but DNN models with nonlinear activation functions and multi-layer neural structures can better fit them. Integrated energy systems have a wide variety of output variables, and a model trained by a single algorithm cannot meet the accuracy requirements for all variables simultaneously. Therefore, ensemble learning can be used to combine different models, leveraging the strengths of various learners while mitigating their weaknesses. This approach can fully leverage the accuracy advantages of data-driven models in the calculation of multi-energy flow in integrated energy systems.
[0141] Table 1 Average relative error (‰) of different modeling algorithms
[0142]
[0143] Note: V is the voltage amplitude, θ is the voltage phase angle, T s Supply temperature for the node, T r is the node return temperature, m is the pipeline flow, and π is the node pressure.
[0144] Stacking is a machine learning method for ensemble learning proposed by Wolpert in 1992. It has been widely used in disease detection, image recognition, spectrum classification, state estimation and other fields. It uses the original data set to train the primary learner in the first layer to obtain multiple fitting results. The second-level learner uses the fitting results obtained in the first layer as input features to train and obtain the final prediction results. The Stacking learning framework improves the model accuracy by generalizing the output results of multiple models, such as Figure 2 shown.
[0145] The specific training method of Stacking ensemble learning is: for the dataset S={(y n ,x n ),n=1,…,N}, where x n is the input feature of the nth sample of the system, y n is the output of the nth sample of the system, ε represents the characteristic dimension of the system, that is, each eigenvector can be expressed as (x1, x2, ... x ε ). Divide the data set into training set Strain and the test set S test To prevent overfitting, the primary learner uses k-fold cross validation (k-fold cross validation, in this embodiment, k = 5) during the training process, that is, randomly divide the training set S train Divide into five subsets of equal size S1, S2, S3, S4, S5. Define S -ο =S train -S ο , where ο=1,2,3,4,5, then S ο and S -ο is the oth fold test set and training set in the five-fold cross validation. For the ξ primary learners included in the first layer, the training set S -ο Use The algorithm obtains the base model
[0146] For the oth fold test set S in the five-fold cross validation ο , primary learner The predicted result is After five-fold cross-validation, the output data of the ξ primary learners are used as new data samples, that is, Among them, Y train For the training set S train output.
[0147] The newly generated data samples are the input data of the second layer in Stacking. new This data is organized and summarized. Using the stacking ensemble learning method, the training data of the first layer can be fully applied to the second layer. At the same time, the secondary learners in the second layer can discover and correct the output results of the primary learners in the first layer to improve the accuracy of the model. The training process of the ensemble learning with five-fold cross-validation is as follows:
[0148] Input: training set S train ={(y n ,x n ),n=1…n train}
[0149] Output: Ensemble learning model
[0150] Step 1: Divide the training set into five equal-sized subsets S1, S2, S3, S4, and S5, and define S -ο =S train -S ο .
[0151] Step 2: Calculate the first layer of ξ primary learners:
[0152]
[0153] Step 3: Construct a new dataset
[0154]
[0155] Step 4: Based on S new L for the second layer model new train.
[0156] Learner selection and ensemble learning framework
[0157] For a single learner, its inherent structure determines its ability to fit input features. Due to the complex relationships between multiple output state variables and input variables in integrated energy systems, this embodiment initially selects LS, PLS, Lasso, RBF, GRNN, and DNN as candidates for primary learners in the first layer of the stacking ensemble learning model. Second-level learners require models with strong generalization capabilities to summarize and correct biases in the training set across multiple learning algorithms.
[0158] In order to obtain the best fitting effect, a model with a large degree of difference needs to be selected as the primary learner in the first layer of the Stacking ensemble learning model. Selecting an algorithm with a large degree of difference can maximize the advantages of different algorithms, so that various differentiated models can complement each other. This embodiment uses the Pearson correlation coefficient to calculate the error difference of each model to analyze the degree of correlation between different primary learners. The two-dimensional vector Pearson correlation coefficient calculation method is
[0159]
[0160] in, and are the average values of the elements of each vector.
[0161] It's worth noting that the training set for the secondary learner is generated from the output of the primary learner. Directly using the primary learner's training data to generate the secondary training set can lead to severe overfitting. To prevent overfitting, a five-fold cross-validation method is used to obtain the output of the primary learner. The original data is randomly divided into five parts without repeated sampling. One part is selected each time as the test set, and the remaining four parts are used as the training set for model training. This process is repeated five times, so that each part of the data has a chance to serve as the test set. The average of the five test results is calculated as the input of the primary learner to the secondary learner.
[0162] The training process of the multi-energy flow modeling method based on multi-model fusion under the Stacking framework is as follows: Figure 3 As shown:
[0163] 1) Obtain the input characteristics and output values of the integrated energy system power flow calculation, and use six algorithms: LS, PLS, Lasso, RBF, GRNN, and DNN to build different models;
[0164] 2) Analyze the errors and distribution of the models trained by each algorithm, and select the algorithm with the largest difference and the best performance as the primary learner;
[0165] 3) Use the divided data set to train the first layer of primary learners in Stacking separately, and output the fitting results to generate a new data set;
[0166] 4) Use the newly generated dataset to train the second-layer algorithm in Stacking. Select the secondary learner with stronger generalization ability based on the output results. The training of the Stacking ensemble learning algorithm based on multi-model fusion is completed.
[0167] Case Analysis
[0168] This example uses a comprehensive energy system consisting of a 14-node IEEE power system, a 13-node gas system, and a 69-node heating system in a certain area of Northeast China for analysis. The system topology is as follows: Figure 4 shown.
[0169] The load data fluctuation range is a random value within ±30% of the baseline load value. Monte Carlo simulations are used to simulate the acquisition of data at different time intervals by varying the active and reactive loads of the power system, the thermal load of the heating system, and the gas load of the gas system. For the algorithm used in this article, 15,000 data sets were used for training and 3,000 data sets for testing.
[0170] Primary learner selection
[0171] As shown in Table 1, the fitting effects of the models built by the three algorithms, Lasso, RBF, and GRNN, are somewhat lower than those of LS, PLS, and DNN. Figure 5 Only the relative error comparison results of the models fitted by the LS, PLS, and DNN algorithms are shown.
[0172] Depend on Figure 5 As can be seen, LS and PLS achieve high accuracy when fitting the variables voltage, phase angle, and pipe flow. However, for the variables supply temperature and return temperature, PLS, LS, and DNN each have their own strengths and weaknesses. This is due to the varying degrees of nonlinearity at different nodes in these two variables, resulting in different performances among the three methods. Furthermore, DNN provides superior fitting results for variables with significant nonlinear characteristics, such as air pressure.
[0173] For stacking ensemble learning, the primary learner should follow the "accurate but different" selection strategy. Therefore, on the basis of selecting the primary learner with excellent performance, the differences between each learner should also be considered. Figure 5 It is the Pearson correlation coefficient of the errors of the fitting models of the six learners: LS, PLS, Lasso, RBF, GRNN, and DNN, which reflects the differences between the models built by the learners.
[0174] Depend on Figure 6 As can be seen, the correlation coefficient between LS and PLS is high, at 0.9986. This is due to the similarity in principle between LS and PLS, with PLS adding principal component analysis and canonical correlation analysis to LS, resulting in a strong correlation between the two. Furthermore, the correlation coefficients between RBF, GRNN, and DNN all exceed 0.8. This is because RBF, GRNN, and DNN are all neural networks, differing in that RBF has a three-layer structure with Gaussian kernels in its hidden layer neurons; GRNN is an improvement on radial basis neural networks, adding a summation layer to the previous hidden layer. Therefore, among the six learners, GRNN has the highest correlation with RBF. DNN is a multi-layer neural network structure, differing from RBF in that its internal activation function is ReLU and it can have multiple hidden layers. After comprehensively comparing the performance and differences among the six learners, PLS and DNN were ultimately selected as the primary learners for the Stacking ensemble learning framework.
[0175] When building a model using stacking ensemble learning, the type of secondary learner needs to be considered, as the secondary learner needs to improve the bias of each learner while maintaining a certain level of generalization to prevent overfitting. This example, based on the selected primary learners, trains the six primary learners initially compared as secondary learners. The trained models are then evaluated for their average relative error on various variables and the secondary learner test time. The results are shown in Table 2.
[0176] Table 2 Average relative error (‰) of the six learners used as meta-learners
[0177]
[0178]
[0179] Table 2 shows that the Stacking ensemble model performs better when LS, PLS, and RBF are used as secondary learners. However, the test time for RBF as a secondary learner is 101.228 seconds, far exceeding the test run times for LS and PLS as secondary learners. Compared to PLS, the model built using the LS algorithm is more interpretable, so LS is used as the secondary learner in the Stacking ensemble framework.
[0180] Ensemble learning algorithm performance verification
[0181] The modeling results of the ensemble learning model are compared with those of the single PLS and DNN algorithms. The evaluation indicators are the mean absolute error (MAE) and mean absolute percentage error (MAPE). The results are shown in Table 3.
[0182] Table 3 shows that the accuracy of models trained using the Stacking ensemble learning algorithm is superior to that of models built using any of the primary learner algorithms. Appropriately introducing more primary learners that meet the criteria may lead to even better results. However, excessive primary learners slow down the ensemble learning computational speed and make it more difficult to meet the "accurate yet diverse" learner combination criteria. In this study, since efficient and accurate multi-energy flow calculations are required rather than a single, high-precision algorithm, only two highly differentiated primary learners are considered to reduce the computational burden.
[0183] To further verify the effectiveness of the method of this embodiment in other systems, the results are shown in Table 4.
[0184] The results in Tables 3 and 4 demonstrate that this multi-algorithm integration strategy addresses the difficulty of maintaining high accuracy across power, gas, and heating networks using single-algorithm data-driven models. Furthermore, this integration framework offers strong scalability. While this embodiment only integrates two highly complementary algorithms, it can be used to integrate a wider variety of more advanced machine learning algorithms if needed, ensuring that the trained models achieve accuracy comparable to the most advanced algorithms currently available.
[0185] Table 3 Comparison of results between ensemble learning algorithm and basic learning algorithm
[0186]
[0187]
[0188] Table 4 Comparison of results between ensemble learning algorithm and basic learning algorithm
[0189]
[0190] Table 5 shows a comparison of the computational time for 10,000 integrated energy system power flows in this example using the method proposed in this embodiment and the Newton method. These results demonstrate that the method proposed in this embodiment is 47.8 times faster than the traditional Newton method, with no non-convergence issues. The average relative error of each variable is kept within 0.5%, making it suitable for scenarios involving extensive repetitive calculations, such as the probabilistic power flow calculation of integrated energy systems with uncertain renewable energy sources. To further validate the feasibility of the method proposed in this embodiment in other scenarios, tests were conducted in this example. The test results were similar to those in the example, with the method being 46.0 times faster than the traditional Newton method.
[0191] Table 5 Comparison of power flow calculation time (10,000 times)
[0192]
[0193]
[0194] This embodiment proposes a multi-energy flow modeling method for an electricity-gas-heat integrated energy system based on a Stacking ensemble learning model combination strategy. Taking into account the complex variable characteristics of the integrated energy system, the modeling advantages of the PLS and DNN algorithms under linear and nonlinear data characteristics are integrated, so that the generated multi-energy flow model can ensure high accuracy in different energy networks. Finally, the effectiveness of the method proposed in this article is verified by using an integrated energy system example consisting of an IEEE 14-node power system, a 13-node gas system, and a 69-node heating system in a certain area in Northeast China, as well as an example of an electricity-gas-heat integrated energy system on the campus of the University of Manchester in the UK. The models trained in both examples have good accuracy, with the average relative error of each variable being less than 0.5%, and the calculation speed is more than 45 times faster than the Newton method, avoiding convergence problems. It is suitable for scenarios that require a large number of repeated calculations, such as probabilistic flow calculations of integrated energy systems taking into account source and load uncertainties.
[0195] Example 2
[0196] The second embodiment of the present disclosure introduces a multi-energy flow calculation system for an integrated energy system based on ensemble learning.
[0197] like Figure 7 The multi-energy flow calculation system for an integrated energy system based on ensemble learning is shown, comprising:
[0198] an acquisition module configured to acquire and analyze characteristic data of the integrated energy system;
[0199] a modeling module configured to construct a multi-energy flow model of the integrated energy system based on the analyzed characteristic data;
[0200] The computing module is configured to train the primary learner of the first layer in the constructed multi-energy flow model of the integrated energy system; based on the fitting results output by the primary learner, the secondary learner is trained to obtain the multi-energy flow calculation model of the integrated energy system multi-model fusion, thereby realizing the multi-energy flow calculation of the integrated energy system multi-model fusion.
[0201] The detailed steps are the same as those of the integrated energy system multi-energy flow calculation method based on ensemble learning provided in Example 1, and will not be repeated here.
[0202] Example 3
[0203] A third embodiment of the present disclosure provides a computer-readable storage medium.
[0204] A computer-readable storage medium stores a program thereon, which, when executed by a processor, implements the steps of the method for calculating multi-energy flow in an integrated energy system based on integrated learning as described in the first embodiment of the present disclosure.
[0205] The detailed steps are the same as those of the integrated energy system multi-energy flow calculation method based on ensemble learning provided in Example 1, and will not be repeated here.
[0206] Example 4
[0207] A fourth embodiment of the present disclosure provides an electronic device.
[0208] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for calculating multi-energy flow in an integrated energy system based on integrated learning are implemented as described in the first embodiment of the present disclosure.
[0209] The detailed steps are the same as those of the integrated energy system multi-energy flow calculation method based on ensemble learning provided in Example 1, and will not be repeated here.
[0210] The foregoing description is merely a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.
Claims
1. A multi-energy flow calculation method for an integrated energy system based on ensemble learning, characterized in that: include: Acquire and analyze characteristic data of integrated energy systems; Based on the analyzed characteristic data, a multi-energy flow model of the integrated energy system is constructed; Training the primary learner of the first layer of the constructed integrated energy system multi-energy flow model; Based on the fitting results output by the primary learner, the secondary learner is trained to obtain a multi-energy flow calculation model for the integrated energy system with multi-model fusion, thus realizing the multi-energy flow calculation for the integrated energy system with multi-model fusion; The process of obtaining the multi-energy flow calculation model of the integrated energy system multi-model fusion is as follows: Obtain the input characteristics and output values of the integrated energy system power flow calculation, and use different algorithms to build different integrated energy system power flow models; Analyze the errors and distribution of models trained by different algorithms and select the primary learner; Use the divided data set to train the first-layer primary learners in the integrated learning framework, output the fitting results, and generate a new data set; Using the newly generated data set, the second-layer algorithm in the integrated learning framework is trained, and the secondary learner is selected according to the output results. The integrated learning algorithm based on multi-model fusion is trained, and the multi-energy flow modeling training based on multi-model fusion is completed, thus realizing the multi-energy flow modeling based on multi-model fusion.
2. A method for calculating multi-energy flow in an integrated energy system based on ensemble learning as claimed in claim 1, characterized in that: The integrated energy system is an integrated energy system including electricity, gas and heat; the acquired characteristic data of the integrated energy system is obtained through an electric power system model, a heating system model, a gas system model and a coupling device model.
3. A method for calculating multi-energy flow in an integrated energy system based on ensemble learning as claimed in claim 2, characterized in that: The power system model adopts an AC system model to obtain an active power balance equation and a reactive power balance equation; The heating system model includes a thermal model and a hydraulic model, and obtains a node power balance equation, a loop pressure drop equation, a supply temperature equation, and a return temperature equation; The gas system includes a gas pipeline, a gas source, a load, and a compressor. A gas system model is constructed through the gas system to obtain a natural gas pipeline flow equation, a compressor electric power equation, and a compressor horsepower equation; The coupling device considers the cogeneration unit in backpressure operation mode to obtain an electrical output power equation of the backpressure cogeneration unit, an equation for the flow of natural gas consumed by the cogeneration unit, and a power equation for the gas boiler.
4. A method for calculating multi-energy flow in an integrated energy system based on ensemble learning as claimed in claim 1, characterized in that: In the process of constructing the multi-energy flow model of the integrated energy system, a data-driven algorithm is used to analyze the acquired characteristic data of the integrated energy system to complete the construction of the multi-energy flow model of the integrated energy system.
5. A method for calculating multi-energy flow in an integrated energy system based on ensemble learning as claimed in claim 1, characterized in that: The primary learner of the first layer of the constructed integrated energy system multi-energy flow model is trained using the original data set to obtain multiple fitting results. The second-level learner uses the fitting results obtained in the first layer as input features for training to obtain the final prediction results. The integrated learning framework is used to generalize the final prediction results output by the integrated energy system multi-energy flow model to improve the accuracy of the constructed integrated energy system multi-energy flow model.
6. A method for calculating multi-energy flow in an integrated energy system based on ensemble learning as claimed in claim 5, characterized in that: The secondary learner is obtained based on the output of the primary learner. During the primary learning training process, the output of the primary learner is obtained through the five-fold cross-validation method. The original data is divided into five parts using non-repeated sampling. One of them is selected as the test set and the remaining four are used as training sets to train the model and obtain the test results. The model training is repeated five times, and the average value of the five groups of test results is used as the input of the primary learner to the secondary learner.
7. A multi-energy flow calculation system for an integrated energy system based on ensemble learning, characterized in that: include: an acquisition module configured to acquire and analyze characteristic data of the integrated energy system; a modeling module configured to construct a multi-energy flow model of the integrated energy system based on the analyzed characteristic data; A calculation module is configured to train a primary learner of the first layer of the constructed multi-energy flow model of the integrated energy system; based on the fitting results output by the primary learner, a secondary learner is trained to obtain a multi-energy flow calculation model of the integrated energy system that integrates multiple models, thereby realizing multi-energy flow calculation of the integrated energy system that integrates multiple models; The process of obtaining the multi-energy flow calculation model of the integrated energy system multi-model fusion is as follows: Obtain the input characteristics and output values of the integrated energy system power flow calculation, and use different algorithms to build different integrated energy system power flow models; Analyze the errors and distribution of models trained by different algorithms and select the primary learner; Use the divided data set to train the first-layer primary learners in the integrated learning framework, output the fitting results, and generate a new data set; Using the newly generated data set, the second-layer algorithm in the integrated learning framework is trained, and the secondary learner is selected according to the output results. The integrated learning algorithm based on multi-model fusion is trained, and the multi-energy flow modeling training based on multi-model fusion is completed, thus realizing the multi-energy flow modeling based on multi-model fusion.
8. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method for calculating multi-energy flow in an integrated energy system based on integrated learning are implemented as described in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps in the multi-energy flow calculation method for an integrated energy system based on integrated learning are implemented as described in any one of claims 1-6.