Natural gas pipeline network operation optimization method considering neural network-mechanism fusion
By constructing a neural network-mechanism fusion optimization method for natural gas pipeline networks, and utilizing deep neural networks and mixed-integer linear programming constraints, the contradiction between model accuracy and solution efficiency in traditional methods is resolved, achieving efficient and accurate optimization of natural gas pipeline networks.
Patent Information
- Application Number
- CN202511341398.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-01-02
AI Technical Summary
Traditional natural gas pipeline network optimization methods present a contradiction between model accuracy and solution efficiency, making it difficult to meet the timeliness requirements of actual scheduling. In particular, the description of compressor operating characteristics involves highly complex, nonlinear, and non-convex coupling relationships, resulting in high computational costs and insufficient decision-making accuracy.
A compressor surrogate model based on a deep neural network is constructed. A high-precision model is obtained through training and then reconstructed into a mixed-integer linear programming constraint. This constraint is coupled with a pipeline hydraulic constraint that has undergone convex relaxation to construct an optimization model. A heuristic enhanced branch cutting algorithm is then used to solve the model.
It significantly improves the accuracy of compressor operating characteristics, reduces model solution costs, meets the needs of refined and intelligent operation of natural gas pipeline networks, and solves the bottlenecks of traditional optimization methods in terms of accuracy and efficiency.
Smart Images

Figure CN121256997A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of natural gas pipeline network operation optimization, and in particular to a natural gas pipeline network operation optimization method considering neural network-mechanism fusion. BACKGROUND
[0002] As a key component in the global energy structure, the long-distance and large-scale transportation of natural gas relies on a complex and massive pipeline network system. Efficient, economic and low-carbon operation of the pipeline network is of great significance to the protection of national energy security, the improvement of enterprise economic benefits and the realization of the "double carbon" strategic goal. The operation optimization of the natural gas pipeline network is a typical, large-scale and complex system engineering problem. The core of the problem is how to accurately schedule the energy-consuming devices such as compressor units in the compression station, so as to minimize the total energy consumption and carbon emissions of the system while meeting the demands of downstream users.
[0003] However, traditional pipeline network optimization methods mainly rely on pure physical mechanism models. These models face serious challenges in describing the operating characteristics of core devices, especially compressors. There is a highly complex, nonlinear and non-convex coupling relationship between the operating range, efficiency, power and speed of the compressor. Directly incorporating it into the optimization model will result in a large-scale mixed integer nonlinear programming problem. Solving such a problem is a widely recognized technical bottleneck, with extremely high computational cost, which is difficult to meet the timeliness requirements of actual scheduling, and often requires excessive simplification of the model, thereby sacrificing the accuracy of the decision. Therefore, it is urgent to propose an optimization method that can effectively overcome the inherent contradiction between model accuracy and solution efficiency of traditional optimization methods, so as to realize the fine and intelligent operation of the natural gas pipeline network. SUMMARY
[0004] To solve the above problems, the present application proposes a natural gas pipeline network operation optimization method considering neural network-mechanism fusion. The present application aims to overcome the inherent contradiction between model accuracy and solution efficiency of traditional optimization methods. By constructing and training a deep neural network, a high-precision proxy model of key devices such as compressors is obtained. The trained neural network structure is creatively converted into a series of mixed integer linear programming constraints, which are coupled with the mechanism model constraints such as pipeline hydraulics that have been processed by convex relaxation, so as to build a comprehensive optimization model with the goal of minimizing total energy consumption and carbon emission cost. An advanced heuristic enhanced branch-and-cut algorithm is used to accurately and efficiently solve the model. The present application provides a scientific and efficient decision support tool for the economic, low-carbon and safe operation of the natural gas pipeline network.
[0005] The natural gas pipeline network operation optimization method considering neural network-mechanism fusion disclosed in the present application has the following steps:
[0006] S1: Collect natural gas pipeline network operation data and preprocess, the operation data includes pipeline network structure data, equipment operation state data and economic environment data, the preprocessing includes outlier processing, feature selection and standardization;
[0007] S2: Construct a compressor proxy model based on a deep neural network, the compressor proxy model includes a speed proxy model, a power proxy model, a surge boundary proxy model, and a stall boundary proxy model, and the proxy model is trained based on the preprocessed data;
[0008] S3: The trained compressor proxy model is reconstructed into a mixed integer linear programming constraint based on the proxy model, the reconstruction is coupled with the compressor switch variable after input normalization, hierarchical transformation and output denormalization, forming a mixed integer linear programming constraint based on the proxy model;
[0009] S4: Introduce flow direction auxiliary variable and pressure quadratic term, convert hydraulic constraint into convex relaxation constraint;
[0010] S5: Take the minimization of total compressor energy consumption and carbon emission as the objective function, and construct a natural gas pipeline network operation optimization model integrating neural network and mechanism combined with constraint conditions;
[0011] Preferably, the objective function expression is:
[0012]
[0013] In the formula, c tax is the carbon emission tax, ton / yuan; f ce is the compressor carbon emission coefficient, ton / kW; c Pdrop is the pipeline pressure drop loss carbon emission conversion coefficient, yuan / MPa 2 ; c price is the electricity price, yuan / kW; is the power of the compressor of the gas compression station; is the pressure square drop when the natural gas flows forward in the pipeline; is the pressure square drop when the natural gas flows reversely in the pipeline;
[0014] Preferably, the constraint conditions include node flow balance constraint, gas compression station load distribution constraint, mixed integer linear programming constraint based on the proxy model and convex relaxation constraint;
[0015] S6: Solve the natural gas pipeline network operation optimization model integrating neural network and mechanism, and output the natural gas pipeline network operation optimization scheme.
[0016] Preferably, in step S1, the pipe network structure data includes pipe length, diameter, pipe connection relationship, and compressor station compressor number; the equipment operation state data includes node supply flow, node demand flow, compressor inlet pressure, compressor outlet pressure, compressor inlet temperature, compressor outlet temperature, compressor boost flow, compressor speed, compressor power, compressor efficiency, compressor surge boundary flow, and compressor stall boundary flow; and the economic environment data includes carbon emission tax, compressor carbon emission coefficient, pipe pressure drop loss carbon emission conversion coefficient, and electricity price.
[0017] Preferably, in step S1, the outlier processing includes 3σ test and mean filling.
[0018] Preferably, the 3σ test marks samples beyond the range as outliers and directly eliminates the outliers by calculating the mean and standard deviation of the equipment operation state data, and the outlier determination formula is:
[0019] x i is an outlier if x i < μ-3σ or x i > μ+3σ
[0020] In the formula, x i is the i th sample value of the equipment operation state data; μ is the mean of the data; and σ is the standard deviation of the data.
[0021] Preferably, the mean filling replaces the missing value with the mean of the 5 normal data before and after the missing period for the missing value existing in the equipment operation state data.
[0022] Preferably, the feature selection screens feature data for compressor proxy model modeling, and the feature data includes compressor power, compressor speed, compressor inlet temperature, compressor outlet temperature, compressor boost flow, compressor inlet pressure, compressor outlet pressure, compressor inlet pressure quadratic term, compressor outlet pressure quadratic term, compressor surge boundary flow, and compressor stall boundary flow.
[0023] Preferably, the standardization adopts the formula:
[0024]
[0025] In the formula, μ is the feature mean; σ is the feature standard deviation; x is the variable; and x is the standardized variable.
[0026] Preferably, in step S2, the hidden layer function of the compressor proxy model is a ReLU activation function, and the output layer function uses a linear activation function.
[0027] Preferably, the speed proxy model and the power proxy model input features are compressor inlet pressure square, compressor outlet pressure square, compressor boost flow and compressor inlet temperature;
[0028] Preferably, the surge boundary proxy model and the stall boundary proxy model input features are compressor inlet pressure square, compressor outlet pressure square and compressor inlet temperature;
[0029] Preferably, the speed proxy model output feature is compressor speed;
[0030] Preferably, the power proxy model output feature is compressor power;
[0031] Preferably, the surge boundary proxy model output feature is compressor surge boundary flow;
[0032] Preferably, the stall boundary proxy model output feature is compressor stall boundary flow.
[0033] Preferably, in step S3, the input normalization expression is:
[0034]
[0035] wherein ψ i is the inlet pressure square term; ψ j is the outlet pressure square term; is the boost flow under standard conditions; T i is the inlet temperature; is the inlet pressure square term normalization value; is the outlet pressure square term normalization value; is the boost flow under standard conditions normalization value; is the inlet temperature normalization value; is the inlet pressure square term feature mean; is the outlet pressure square term feature mean; is the boost flow under standard conditions feature mean; is the inlet temperature feature mean; is the inlet pressure square term feature standard deviation; is the outlet pressure square term feature standard deviation; is the boost flow under standard conditions feature standard deviation; is the inlet temperature feature standard deviation;
[0036] Preferably, the hierarchical transformation includes linear combination, input layer transformation, activation function transformation and output layer transformation;
[0037] Preferably, the linear combination expression is:
[0038]
[0039] where l is the network layer index; k and h are neuron indices; N l is the number of neurons in the lth layer; and are the pre-trained weights and biases from the (l-1)th layer to the lth layer; is the input to the kth neuron in the lth layer; is the output of the kth neuron in the (l-1)th layer;
[0040] Preferably, the input layer transformation expression is:
[0041]
[0042] Preferably, the activation function transformation expression is:
[0043]
[0044] where, is the lower input limit; is the upper input limit; is the activation function binary variable;
[0045] The output layer transformation expression is:
[0046]
[0047] where, represents the output of the proxy model, in the speed proxy model in the power proxy model in the surge margin proxy model in the stall margin proxy model
[0048] Preferably, the output inverse normalization expression is:
[0049]
[0050] where, is the output speed value of the speed proxy model; is the output power value of the power proxy model; is the output surge margin flow value of the surge margin proxy model; is the output stall margin flow value of the stall margin proxy model; is the output speed normalized value of the speed proxy model; is the output power normalized value of the power proxy model; is the output surge margin flow normalized value of the surge margin proxy model; is the stall boundary flow normalized value for the stall boundary proxy model; μ N is the compressor speed feature mean; μ W is the compressor power feature mean; is the compressor surge boundary flow feature mean; is the compressor stall boundary flow feature mean; σ N is the compressor speed feature standard deviation; σ W is the compressor power feature standard deviation; is the compressor surge boundary flow feature standard deviation; is the compressor stall boundary flow feature standard deviation;
[0051] Preferably, the coupled compressor switch variable expression is:
[0052]
[0053]
[0054] wherein, is the compressor speed decision variable; is the minimum allowable compressor speed when the compressor is on; is the maximum allowable compressor speed when the compressor is on; is the compressor switch variable, 0 means the compressor is off, 1 means the compressor is on; m big is the large M value; is the compressor power decision variable; is the maximum allowable compressor power when the compressor is on; is the compressor boost flow decision variable.
[0055] Preferably, in step S4, the convex relaxation constraints include a pipeline flow direction convex relaxation control constraint, a pipeline hydraulic convex relaxation constraint, and a pipeline hydraulic convex relaxation domain tightening constraint.
[0056] Preferably, the pipeline flow direction convex relaxation control constraint formula is:
[0057]
[0058] wherein, is the forward flowing natural gas flow; is the reverse flowing natural gas flow; is the pipeline flow direction binary variable; Q max represents the maximum allowable flow of the natural gas pipeline;
[0059] Preferably, the pipeline hydraulic convex relaxation constraint formula is:
[0060]
[0061] wherein ψ i is the square of the pressure at node i, representing the start node of the pipe; ψ j is the square of the pressure at node j, representing the end node of the pipe; λ i,j represents the value of the pipe friction factor; β i,j represents the constant term of the convex relaxation of the pipe hydraulic constraint.
[0062] Preferably, the pipe hydraulic convex relaxation domain tightening constraint is:
[0063]
[0064]
[0065] wherein ψ i is the square of the pressure at node i, representing the start node of the pipe; ψ j is the square of the pressure at node j, representing the end node of the pipe; λ i,j represents the value of the pipe friction factor; β i,j represents the constant term of the convex relaxation of the pipe hydraulic constraint.
[0066] Preferably, the compressor station load allocation constraints comprise compressor station switch constraints, compressor station switch-flow coupling constraints, compressor station flow allocation constraints and compressor station switch-pressure coupling constraints.
[0067] Preferably, the compressor station switch constraint formula is:
[0068]
[0069] wherein is the compressor station switch variable; is the compressor station boost function activation variable; is the compressor station compressor bypass valve switch variable.
[0070] Preferably, the compressor station switch-flow coupling constraint formula is:
[0071]
[0072] wherein is the flow through the compressor station for boosting; is the flow through the compressor station bypass valve; is the compressor station minimum treatment flow; is the compressor station maximum treatment flow;
[0073] Preferably, the compressor station flow allocation constraint formula is:
[0074]
[0075] In the formula, Number of compressors activated at the compressor station;
[0076] Preferably, the compressor station switch-pressure coupling constraint formula is:
[0077]
[0078]
[0079] In the formula, This is the minimum pressure ratio of the compressor; This is the compressor's maximum pressure ratio.
[0080] Preferably, in step S6, solving the natural gas pipeline network operation optimization model based on the fused neural network-mechanism specifically employs a heuristic enhanced branching algorithm, including the following steps:
[0081] S601: Construct a branch-bound tree and place the linear programming relaxation problem of the original fusion neural network-mechanism natural gas pipeline network operation optimization model as the root node in a list of nodes to be processed; define and initialize the global lower bound Z. LB With the upper Z UB Initialize the current best integer solution X best Empty;
[0082] S602: Check if the list of nodes to be processed is empty. If it is empty, the algorithm terminates and outputs the current optimal integer solution X. best Conversely, according to the preset node selection strategy, a node is selected from the list for processing, and the linear programming relaxation problem of that node is solved to obtain the objective value Z. LP Reconciliation X LP .
[0083] S603: Perform pruning judgment on the solution results of the current node:
[0084] a) If the linear programming relaxation problem of the current node has no solution, then prune the branch containing that node;
[0085] b) If Z LP ≥Z UB If the target value of the current node is not better than the known global upper bound, then the branch containing that node is pruned.
[0086] c) If Z LP <Z UB And solve X LP If the integer constraints of all variables are satisfied, then the solution is a new feasible integer solution; update the global upper bound Z. UB =Z LP And update the current best integer solution X.best =X LP Then prune the node. If any pruning condition is met, return to S602;
[0087] S604: If the current node has not been pruned and the solution is X LP If there are variables that do not satisfy integer constraints, the cutting plane generation program is initiated. One or more cutting plane separation algorithms are used to generate one or more sets of valid inequalities, i.e., cutting planes. The cutting planes satisfy the following condition: all feasible integer solutions satisfy the inequality, but the current non-integer solution X... LP The inequality is not satisfied; the generated cutting plane is added as a new constraint to the linear programming relaxation problem of the current node to form an enhanced linear programming model, and then the enhanced linear programming model of the node is solved again by returning to S602.
[0088] S605: At a specific node in the branch and bounding tree, one or more primitive heuristic algorithms are invoked according to a preset trigger condition; the primitive heuristic algorithm utilizes the relaxed solution X of the linear programming relaxation model of the current node. LP Quickly search for feasible integer solutions; if a more efficient integer solution X is found... best If a better feasible solution is found, then the global upper bound Z is updated. UB and X best ;
[0089] S606: If, after generating the cutting plane and performing a heuristic search, the linear programming relaxation solution X of the current node is obtained... LP If the integer constraint is still not met, then the branching strategy is activated; select X. LP A non-integer variable x j (its value is v) j This variable is used as a branch variable, and two new child nodes are created based on this variable. Branch constraints are then added to the linear relaxation problems of these two child nodes respectively. and Add the two newly created child nodes to the list of nodes to be processed, and then return to S602.
[0090] Preferably, in step S6, the natural gas pipeline network operation optimization scheme includes the number of compressors in operation at the compressor station, the compressor speed and power, the natural gas flow rate and direction in the pipeline, the pressure at the nodes, and the total energy consumption, total carbon emissions, and total operating cost of the natural gas pipeline network.
[0091] The beneficial effects of this invention are:
[0092] This invention, by constructing a neural network-mechanism fusion optimization model for natural gas pipeline network operation, successfully overcomes the inherent contradiction between model accuracy and solution efficiency in traditional pure physical mechanism optimization methods, providing a scientific and efficient technical path for the refined and intelligent operation of natural gas pipeline networks. First, addressing the technical challenge of highly nonlinear and non-convex compressor operating characteristics, this invention constructs and trains a compressor surrogate model based on a deep neural network, significantly improving the accuracy of characterizing the operating characteristics of core equipment and effectively avoiding scheduling decision biases caused by model simplification, thus laying the foundation for the accuracy of the optimization scheme. Second, this invention innovatively reconstructs the trained neural network structure into mixed-integer linear programming constraints and couples them with pipeline hydraulic constraints that have undergone convex relaxation treatment, greatly reducing the computational cost of model solving and significantly improving solution efficiency. This effectively meets the timeliness requirements of actual natural gas pipeline network scheduling, overcoming the bottleneck of traditional optimization methods that struggle to balance accuracy and efficiency. Attached Figure Description
[0093] Figure 1 This is a flowchart of the present invention;
[0094] Figure 2 Flowchart of the heuristically enhanced branch cutting algorithm;
[0095] Figure 3 This is a topology diagram of a natural gas pipeline network system.
[0096] Figure 4 A graph showing the supply and demand flow rates of a node in a natural gas pipeline network system.
[0097] Figure 5 The iterative convergence graph of the heuristically enhanced branch-cutting algorithm;
[0098] Figure 6 Pressure diagram of nodes in an optimized operation scheme for a natural gas pipeline system;
[0099] Figure 7 Pipeline flow diagram for optimizing the operation of a natural gas pipeline network system;
[0100] Figure 8 A diagram showing the number of compressors in operation and their speeds at a compressor station in an optimized operation plan for a natural gas pipeline system. Detailed Implementation
[0101] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments; the following embodiments are only used to more clearly illustrate the technical solutions of the present invention, and should not be used to limit the scope of protection of the present invention.
[0102] like Figure 1As shown, the present invention discloses a method for optimizing the operation of a natural gas pipeline network that considers neural network-mechanism fusion, characterized by comprising the following steps:
[0103] S1: Collect and preprocess natural gas pipeline network operation data. The operation data includes pipeline network structure data, equipment operation status data, and economic environment data. The preprocessing includes outlier handling, feature selection, and standardization.
[0104] S2: Construct a compressor proxy model based on a deep neural network. The compressor proxy model includes a speed proxy model, a power proxy model, a surge boundary proxy model, and a stagnation boundary proxy model. The proxy model is then trained based on the preprocessed data.
[0105] S3: Reconstruct the trained compressor surrogate model into a mixed-integer linear programming constraint based on the surrogate model. The reconstruction is coupled with the compressor switching variables after input normalization, hierarchical transformation, and output denormalization to form a mixed-integer linear programming constraint based on the surrogate model.
[0106] S4: Introduce the flow direction auxiliary variable and the pressure quadratic term to transform the hydraulic constraint into a convex relaxation constraint;
[0107] S5: Taking the minimization of total compressor energy consumption and carbon emissions as the objective function, and combining constraints, a natural gas pipeline network operation optimization model integrating neural networks and mechanisms is constructed.
[0108] The objective function expression is:
[0109]
[0110] In the formula, c tax Carbon emission tax, per ton / yuan; f ce The carbon emission coefficient of the compressor is given in tons per kW; c Pdrop The carbon emission conversion coefficient for pipeline pressure drop loss is expressed in yuan / MPa. 2 ;c price Electricity price, yuan / kW; The power of the compressor station compressor; This represents the squared pressure drop when natural gas flows forward in the pipeline; The squared pressure drop when natural gas flows in reverse within the pipeline;
[0111] The constraints include node flow balance constraints, compressor station load allocation constraints, mixed integer linear programming constraints based on surrogate models, and convex relaxation constraints.
[0112] S6: Solve the natural gas pipeline network operation optimization model based on the fusion neural network-mechanism, and output the natural gas pipeline network operation optimization scheme.
[0113] In one embodiment, the pipeline network structure data includes pipeline length, diameter, pipeline connection relationships, and the number of compressors in the compressor station; the equipment operation status data includes node supply flow, node demand flow, compressor inlet pressure, compressor outlet pressure, compressor inlet temperature, compressor outlet temperature, compressor boost flow, compressor speed, compressor power, compressor efficiency, compressor surge boundary flow, and compressor stagnation boundary flow; the economic and environmental data includes carbon emission tax, compressor carbon emission coefficient, pipeline pressure drop loss carbon emission conversion coefficient, and electricity price.
[0114] In one embodiment, the outlier handling includes 3σ testing and mean filling;
[0115] In one embodiment, the 3σ test calculates the mean and standard deviation of the equipment operating status data, marks samples that exceed the range as outliers, and directly removes them. The outlier determination formula is:
[0116] x i ∈ outliers, if x i <μ-3σ or x i >μ+3σ
[0117] In the formula, x i represents the i-th sample value of the equipment operating status data; μ is the mean of the data; σ is the standard deviation of the data;
[0118] In one embodiment, the mean filling is used to replace missing values in the device operating status data by taking the mean of five normal data points before and after the missing time period.
[0119] In one embodiment, the feature selection filter is used for feature data modeling of the compressor proxy model. The feature data includes compressor power, compressor speed, compressor inlet temperature, compressor outlet temperature, compressor boost flow rate, compressor inlet pressure, compressor outlet pressure, compressor inlet pressure quadratic term, compressor outlet pressure quadratic term, compressor surge boundary flow rate, and compressor stagnation boundary flow rate.
[0120] In one embodiment, the standardization adopts the following formula:
[0121]
[0122] In the formula, μ is the characteristic mean; σ is the characteristic standard deviation; is a standardized variable; x is a variable.
[0123] In one embodiment, the hidden layer function of the compressor proxy model is a ReLU activation function, and the output layer function is a linear activation function;
[0124] In one embodiment, the input features of the speed proxy model and the power proxy model are the quadratic terms of the compressor inlet pressure, the quadratic terms of the compressor outlet pressure, the compressor boost flow rate, and the compressor inlet temperature;
[0125] In one embodiment, the input features of the surge boundary proxy model and the stagnation boundary proxy model are the quadratic terms of the compressor inlet pressure, the quadratic terms of the compressor outlet pressure, and the compressor inlet temperature;
[0126] In one embodiment, the output feature of the speed proxy model is the compressor speed;
[0127] In one embodiment, the power proxy model outputs a feature of the compressor power;
[0128] In one embodiment, the surge boundary proxy model outputs the compressor surge boundary flow rate as the characteristic;
[0129] In one embodiment, the output feature of the stagnation boundary proxy model is the compressor stagnation boundary flow rate;
[0130] In one embodiment, the input normalization expression is:
[0131]
[0132] In the formula, ψ i ψ is the square term of the import pressure; j This is the squared term of export pressure. Standard condition boosted flow rate; T i The inlet temperature; This is the normalized value of the squared term of the import pressure; This is the normalized value of the squared term of export pressure; Normalized value of boost flow rate under standard conditions; This is the normalized value of the inlet temperature; The characteristic mean of the squared term of the import pressure; The characteristic mean of the squared term of export pressure; The average value of the boosted flow rate characteristic under standard conditions; This represents the average of the inlet temperature characteristics. The characteristic standard deviation of the squared term of the import pressure; Characteristic standard deviation of the squared term of export pressure; The standard deviation of the boosted flow rate characteristic under standard conditions; The standard deviation of the import temperature characteristic;
[0133] In one embodiment, the hierarchical transformation includes linear combination, input layer transformation, activation function transformation, and output layer transformation;
[0134] In one embodiment, the linear combination expression is:
[0135]
[0136] In the formula, l is the network layer index; k and h are neuron indices; N l This represents the number of neurons in the l-th layer. and These are the pre-trained weights and biases from layer l-1 to layer l; This is the input to the k-th neuron in the l-th layer; The output is the output of the k-th neuron in the (l-1)-th layer;
[0137] In one embodiment, the input layer transforms the expression as follows:
[0138]
[0139]
[0140] In one embodiment, the activation function is transformed into the following expression:
[0141]
[0142] In the formula, Enter the lower limit value; Enter the upper limit value; For activation function binary variables;
[0143] The output layer transformation expression is:
[0144]
[0145] In the formula, This represents the output of the surrogate model, in the speed surrogate model. In the power surrogate model In surge boundary proxy model In the stagnant boundary agent model
[0146] In one embodiment, the output inverse normalization expression is:
[0147]
[0148] In the formula, Output the rotational speed value for the rotational speed proxy model; Output power values for the power proxy model; Output surge boundary flow values for the surge boundary proxy model; Output the stagnation boundary flow value for the stagnation boundary proxy model; Output normalized speed values for the speed proxy model; Output the normalized power value for the power proxy model; Output the normalized value of the surge boundary flow for the surge boundary proxy model; Output the normalized value of the stagnation boundary flow for the stagnation boundary surrogate model; μ N The average characteristic value of compressor speed; μ W This represents the average power characteristic of the compressor. The mean value of the flow characteristics at the compressor surge boundary; σ represents the mean flow characteristic of the compressor's stagnation boundary. N σ represents the standard deviation of the compressor speed characteristic. W The standard deviation of the compressor power characteristic; The standard deviation of the flow characteristic at the compressor surge boundary; The standard deviation of the compressor stagnation boundary flow characteristic;
[0149] In one embodiment, the expression for the coupling compressor switching variable is:
[0150]
[0151] In the formula, For compressor speed as the decision variable; This refers to the minimum permissible speed when the compressor is turned on. This refers to the maximum permissible speed when the compressor is turned on. This is a compressor on / off variable; 0 indicates the compressor is off, and 1 indicates the compressor is on. big For large M values; For compressor power decision variables; This refers to the maximum allowable power when the compressor is turned on. The boost flow rate is the decision variable for the compressor.
[0152] In one embodiment, the convex relaxation constraint includes a pipe flow direction convex relaxation control constraint, a pipe hydraulic convex relaxation constraint, and a pipe hydraulic convex relaxation domain contraction constraint.
[0153] In one embodiment, the formula for the convex relaxation control constraint of the pipeline flow direction is:
[0154]
[0155] In the formula, This represents the flow rate of natural gas flowing in the positive direction. This refers to the flow rate of natural gas flowing in the reverse direction. For the direction of flow in the pipeline, Q is a binary variable; max Indicates the maximum allowable flow rate of the natural gas pipeline;
[0156] In one embodiment, the formula for the hydraulic convex relaxation constraint of the pipeline is:
[0157]
[0158] In the formula, ψ i Let ψ be the square of the pressure at node i, representing the starting node of the pipeline; j λ is the square of the pressure at node j, representing the terminal node of the pipeline; i,j This represents the pipe friction coefficient; β i,j The constant term representing the hydraulic constraints of a convex relaxed pipe;
[0159] In one embodiment, the hydraulic convex relaxation region contraction constraint of the pipeline is:
[0160]
[0161] In the formula, ψ i Let ψ be the square of the pressure at node i, representing the starting node of the pipeline; j λ is the square of the pressure at node j, representing the terminal node of the pipeline; i,j This represents the pipe friction coefficient; β i,j This represents the constant term for the hydraulic constraints of a convex relaxed pipe.
[0162] In one embodiment, the compressor station load allocation constraint includes compressor station switch constraint, compressor station switch-flow coupling constraint, compressor station flow allocation constraint, and compressor station switch-pressure coupling constraint;
[0163] In one embodiment, the compressor station switch constraint formula is:
[0164]
[0165] In the formula, For compressor station switch variables; Activate variables for the compressor station's pressurization function; This is the variable for switching the compressor bypass valve on and off.
[0166] In one embodiment, the compressor station switch-flow coupling constraint formula is:
[0167]
[0168] In the formula, The flow rate used for pressurization within the compressor station; The flow rate through the bypass valve of the compressor station; This is the minimum processing flow rate for the compressor station; This represents the maximum processing flow rate of the compressor station.
[0169] In one embodiment, the compressor station flow distribution constraint formula is:
[0170]
[0171] In the formula, Number of compressors activated at the compressor station;
[0172] In one embodiment, the compressor station switch-pressure coupling constraint formula is:
[0173]
[0174] In the formula, This is the minimum pressure ratio of the compressor; This is the compressor's maximum pressure ratio.
[0175] In one embodiment, the solution to the natural gas pipeline network operation optimization model based on the fused neural network-mechanism specifically employs a heuristic enhanced branching algorithm, including the following steps: Figure 2 As shown:
[0176] S601: Construct a branch-bound tree and place the linear programming relaxation problem of the original fusion neural network-mechanism natural gas pipeline network operation optimization model as the root node in a list of nodes to be processed; define and initialize the global lower bound Z. LB With the upper Z UB Initialize the current best integer solution X best Empty;
[0177] S602: Check if the list of nodes to be processed is empty. If it is empty, the algorithm terminates and outputs the current optimal integer solution X. best Conversely, according to the preset node selection strategy, a node is selected from the list for processing, and the linear programming relaxation problem of that node is solved to obtain the objective value Z. LP Reconciliation X LP .
[0178] S603: Perform pruning judgment on the solution results of the current node:
[0179] a) If the linear programming relaxation problem of the current node has no solution, then prune the branch containing that node;
[0180] b) If Z LP ≥Z UB If the target value of the current node is not better than the known global upper bound, then the branch containing that node is pruned.
[0181] c) If Z LP <Z UB And solve X LP If the integer constraints of all variables are satisfied, then the solution is a new feasible integer solution; update the global upper bound Z. UB =Z LP And update the current best integer solution X. best =X LPThen prune the node. If any pruning condition is met, return to S602;
[0182] S604: If the current node has not been pruned and the solution is X LP If there are variables that do not satisfy integer constraints, the cutting plane generation program is initiated. One or more cutting plane separation algorithms are used to generate one or more sets of valid inequalities, i.e., cutting planes. The cutting planes satisfy the following condition: all feasible integer solutions satisfy the inequality, but the current non-integer solution X... LP The inequality is not satisfied; the generated cutting plane is added as a new constraint to the linear programming relaxation problem of the current node to form an enhanced linear programming model, and then the enhanced linear programming model of the node is solved again by returning to S602.
[0183] S605: At a specific node in the branch and bounding tree, one or more primitive heuristic algorithms are invoked according to a preset trigger condition; the primitive heuristic algorithm utilizes the relaxed solution X of the linear programming relaxation model of the current node. LP Quickly search for feasible integer solutions; if a more efficient integer solution X is found... best If a better feasible solution is found, then the global upper bound Z is updated. UB and X best ;
[0184] S606: If, after generating the cutting plane and performing a heuristic search, the linear programming relaxation solution X of the current node is obtained... LP If the integer constraint is still not met, then the branching strategy is activated; select X. LP A non-integer variable x j (its value is v) j This variable is used as a branch variable, and two new child nodes are created based on this variable. Branch constraints are then added to the linear relaxation problems of these two child nodes respectively. and Add the two newly created child nodes to the list of nodes to be processed, and then return to S602.
[0185] In one embodiment, the natural gas pipeline network operation optimization scheme includes the number of compressors in operation at the compressor station, the compressor speed and power, the natural gas flow rate and direction in the pipeline, the pressure at the nodes, and the total energy consumption, total carbon emissions, and total operating cost of the natural gas pipeline network.
[0186] In one embodiment, a natural gas pipeline operation optimization method that incorporates neural network-mechanism fusion, as disclosed in this invention, is used to optimize the operation scheme of a domestic natural gas pipeline network.
[0187] This pipeline network comprises 2 gas source nodes, 30 user nodes, 7 compressor stations, and 37 pipeline segments, effectively characterizing the operational features of a typical natural gas pipeline network. The network structure data is shown in Table 1, and the network topology is as follows:Figure 3 As shown; node supply flow and node demand flow are as follows Figure 4 As shown in Table 2; the equipment operating status data is as follows: carbon emission tax is 60 yuan / ton, compressor carbon emission coefficient is 0.3 tons / MWh, pipeline pressure drop loss carbon emission conversion coefficient is 0.1 tons / kPa, and electricity price is 1.5 yuan / kWh.
[0188] Table 1 Pipeline network structure data
[0189]
[0190] Table 2 Equipment Operating Status Data
[0191]
[0192] Figure 5 This indicates that the algorithm converges iteratively in 3.72 seconds, and the objective function value of the final optimal solution stabilizes at 19059.16. At this time, the optimal lower bound also converges to 19059.16, and the gap between the upper and lower bounds is 0. The algorithm has found the global optimal solution.
[0193] The pipeline network is optimized based on a heuristically enhanced branch-and-cut algorithm, and the optimization results are as follows: Figure 6 to Figure 8 As shown. Figure 6 The results show that the pressure values of each node are distributed in the range of 3.0-9.5, and there are significant differences in the pressure values of different nodes, reflecting the pressure distribution of each node in the optimized natural gas pipeline network. Figure 7 This indicates that the flow rates of each pipeline are distributed in the range of 0-30 million cubic meters per day, and there are significant differences in the flow rates of different pipelines, reflecting the flow distribution of each pipeline in the optimized natural gas pipeline network. Figure 8 This indicates that CS1, CS6, and CS7 have 0 units in operation; CS2 and CS3 each have 1 unit in operation; and CS4 and CS5 each have 2 units in operation. Regarding compressor speed, CS1, CS6, and CS7 have speeds close to 0; CS2's speed has increased to 6951 rpm, CS3's speed is approximately 5895 rpm, and CS4 and CS5's speeds remain at 5633 rpm, demonstrating the optimized scheduling characteristics of the compressor station through the coordination of the number of units in operation and their speeds.
[0194] The above descriptions are merely embodiments of this specification and are not intended to limit the scope of this specification. Various modifications and variations can be made to the embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of this specification should be included within the scope of the claims of the embodiments of this specification.
Claims
1. A method for optimizing the operation of a natural gas pipeline network that considers neural network-mechanism fusion, characterized in that, Includes the following steps: S1: Collect and preprocess natural gas pipeline network operation data. The operation data includes pipeline network structure data, equipment operation status data, and economic environment data. The preprocessing includes outlier handling, feature selection, and standardization. S2: Construct a compressor proxy model based on a deep neural network. The compressor proxy model includes a speed proxy model, a power proxy model, a surge boundary proxy model, and a stagnation boundary proxy model. The proxy model is then trained based on the preprocessed data. S3: Reconstruct the trained compressor surrogate model into a mixed-integer linear programming constraint based on the surrogate model. The reconstruction is coupled with the compressor switching variables after input normalization, hierarchical transformation, and output denormalization to form a mixed-integer linear programming constraint based on the surrogate model. S4: Introduce the flow direction auxiliary variable and the pressure quadratic term to transform the hydraulic constraint into a convex relaxation constraint; S5: Taking the minimization of total compressor energy consumption and carbon emissions as the objective function, and combining constraints, a natural gas pipeline network operation optimization model integrating neural networks and mechanisms is constructed. The objective function expression is: In the formula, c tax Carbon emission tax, per ton / yuan; f ce The carbon emission coefficient of the compressor is given in tons per kW; c Pdrop The carbon emission conversion coefficient for pipeline pressure drop loss is expressed in yuan / MPa. 2 ;c price Electricity price, yuan / kW; The power of the compressor station compressor; This represents the squared pressure drop when natural gas flows forward in the pipeline; The squared pressure drop when natural gas flows in reverse within the pipeline; The constraints include node flow balance constraints, compressor station load allocation constraints, mixed integer linear programming constraints based on surrogate models, and convex relaxation constraints. S6: Solve the natural gas pipeline network operation optimization model based on the fusion neural network-mechanism, and output the natural gas pipeline network operation optimization scheme.
2. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion as described in claim 1, characterized in that, In step S1, the pipeline network structure data includes pipeline length, diameter, pipeline connection relationship, and number of compressors in the compressor station; The equipment operating status data includes node supply flow, node demand flow, compressor inlet pressure, compressor outlet pressure, compressor inlet temperature, compressor outlet temperature, compressor boost flow, compressor speed, compressor power, compressor efficiency, compressor surge boundary flow, and compressor stagnation boundary flow; the economic and environmental data includes carbon emission tax, compressor carbon emission coefficient, pipeline pressure drop loss carbon emission conversion coefficient, and electricity price.
3. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion as described in claim 1, characterized in that, In step S1, the outlier handling includes 3σ test and mean filling; The 3σ test calculates the mean and standard deviation of the equipment operating status data, marks samples that exceed the range as outliers, and removes them directly. The outlier determination formula is as follows: x i ∈ outliers, if x i <μ-3σ or x i >μ+3σ In the formula, x i represents the i-th sample value of the equipment operating status data; μ is the mean of the data; σ is the standard deviation of the data; The mean filling method addresses missing values in the equipment operating status data by taking the mean of five normal data points before and after the missing time period and replacing the missing value. The feature selection filter is used for the feature data of the compressor proxy model. The feature data includes compressor power, compressor speed, compressor inlet temperature, compressor outlet temperature, compressor boost flow rate, compressor inlet pressure, compressor outlet pressure, compressor inlet pressure quadratic term, compressor outlet pressure quadratic term, compressor surge boundary flow rate and compressor stagnation boundary flow rate. The standardization adopts the following formula: In the formula, μ is the characteristic mean; σ is the characteristic standard deviation; is a standardized variable; x is a variable.
4. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion according to claim 1, characterized in that, In step S2, the hidden layer function of the compressor proxy model is the ReLU activation function, and the output layer function is the linear activation function; The input features of the speed proxy model and the power proxy model are the quadratic terms of the compressor inlet pressure, the quadratic terms of the compressor outlet pressure, the compressor boost flow rate, and the compressor inlet temperature; The input features of the surge boundary proxy model and the stagnation boundary proxy model are the quadratic terms of the compressor inlet pressure, the quadratic terms of the compressor outlet pressure, and the compressor inlet temperature. The output feature of the speed proxy model is the compressor speed; The output feature of the power proxy model is the compressor power; The surge boundary proxy model outputs the compressor surge boundary flow rate as its characteristic. The output feature of the stagnation boundary proxy model is the compressor stagnation boundary flow rate.
5. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion according to claim 1, characterized in that, In step S3, the input normalization expression is: In the formula, ψ i ψ is the square term of the import pressure. j This is the squared term of export pressure. Standard condition boosted flow rate; T i The inlet temperature; This is the normalized value of the squared term of the import pressure; This is the normalized value of the squared term of export pressure; Normalized value of boost flow rate under standard conditions; This is the normalized value of the inlet temperature; The characteristic mean of the squared term of the import pressure; The characteristic mean of the squared term of export pressure; The average value of the boosted flow rate characteristic under standard conditions; This represents the average of the inlet temperature characteristics. The characteristic standard deviation of the squared term of the import pressure; Characteristic standard deviation of the squared term of export pressure; The standard deviation of the boosted flow rate characteristic under standard conditions; The standard deviation of the import temperature characteristic; The hierarchical transformation includes linear combination, input layer transformation, activation function transformation, and output layer transformation; The linear combination expression is: In the formula, l is the network layer index; k and h are neuron indices; N l This represents the number of neurons in the l-th layer. and These are the pre-trained weights and biases from layer l-1 to layer l; This is the input to the k-th neuron in the l-th layer; The output is the output of the k-th neuron in the (l-1)-th layer; The input layer transformation expression is: The activation function is transformed into the following expression: In the formula, Enter the lower limit value; Enter the upper limit value; For activation function binary variables; The output layer transformation expression is: In the formula, This represents the output of the surrogate model, in the speed surrogate model. In the power surrogate model In surge boundary proxy model In the stagnant boundary agent model The output denormalization expression is: In the formula, Output the rotational speed value for the rotational speed proxy model; Output power values for the power proxy model; Output surge boundary flow values for the surge boundary proxy model; Output the stagnation boundary flow value for the stagnation boundary proxy model; Output normalized speed values for the speed proxy model; Output the normalized power value for the power proxy model; Output the normalized value of the surge boundary flow for the surge boundary proxy model; Output the normalized value of the stagnation boundary flow for the stagnation boundary surrogate model; μ N The average characteristic value of compressor speed; μ W This represents the average power characteristic of the compressor. The mean value of the flow characteristics at the compressor surge boundary; σ represents the mean flow characteristic of the compressor's stagnation boundary. N σ represents the standard deviation of the compressor speed characteristic. W The standard deviation of the compressor power characteristic; The standard deviation of the flow characteristic at the compressor surge boundary; The standard deviation of the compressor stagnation boundary flow characteristic; The expression for the switching variable of the coupled compressor is: In the formula, For compressor speed as the decision variable; This refers to the minimum permissible speed when the compressor is turned on. This refers to the maximum permissible speed when the compressor is turned on. This is a compressor on / off variable; 0 indicates the compressor is off, and 1 indicates the compressor is on. m big For large M values; For compressor power decision variables; This refers to the maximum allowable power when the compressor is turned on. The boost flow rate is the decision variable for the compressor.
6. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion according to claim 1, characterized in that, In step S4, the convex relaxation constraints include pipeline flow direction convex relaxation control constraints, pipeline hydraulic convex relaxation constraints, and pipeline hydraulic convex relaxation domain contraction constraints. The formula for the pipeline flow direction convex relaxation control constraint is: In the formula, This represents the flow rate of natural gas flowing in the positive direction. This refers to the flow rate of natural gas flowing in the reverse direction. For the direction of flow in the pipeline, Q is a binary variable; max Indicates the maximum allowable flow rate of the natural gas pipeline; The formula for the hydraulic convex relaxation constraint of the pipeline is: In the formula, ψ i Let ψ be the square of the pressure at node i, representing the starting node of the pipeline; j λ is the square of the pressure at node j, representing the terminal node of the pipeline; i,j This represents the coefficient of friction of the pipe. β i,j The constant term representing the hydraulic convex relaxation constraint of the pipeline; The hydraulic convex relaxation region of the pipeline is subject to the following constraint: In the formula, ψ i Let ψ be the square of the pressure at node i, representing the starting node of the pipeline; j λ is the square of the pressure at node j, representing the terminal node of the pipeline; i,j This represents the coefficient of friction of the pipe. β i,j This represents the constant term for the hydraulic constraints of a convex relaxed pipe.
7. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion according to claim 1, characterized in that, The compressor station load allocation constraints include compressor station switch constraints, compressor station switch-flow coupling constraints, compressor station flow allocation constraints, and compressor station switch-pressure coupling constraints; The compressor station switch constraint formula is as follows: In the formula, For compressor station switch variables; Activate variables for the compressor station's pressurization function; This is the variable for the compressor bypass valve switch; The compressor station switch-flow coupling constraint formula is as follows: In the formula, The flow rate used for pressurization within the compressor station; The flow rate through the bypass valve of the compressor station; This is the minimum processing flow rate for the compressor station; This represents the maximum processing flow rate of the compressor station. The formula for the flow distribution constraint of the compressor station is: In the formula, Number of compressors activated at the compressor station; The compressor station switch-pressure coupling constraint formula is as follows: In the formula, This is the minimum pressure ratio of the compressor; This is the compressor's maximum pressure ratio.
8. The method for optimizing the operation of a natural gas pipeline network considering neural network-mechanism fusion according to claim 1, characterized in that, In step S6, solving the natural gas pipeline network operation optimization model based on the fused neural network-mechanism specifically employs a heuristic enhanced branching algorithm, including the following steps: S601: Construct a branch-bound tree and place the linear programming relaxation problem of the original fusion neural network-mechanism natural gas pipeline network operation optimization model as the root node in a list of nodes to be processed; define and initialize the global lower bound Z. LB With the upper Z UB Initialize the current best integer solution X best Empty; S602: Check if the list of nodes to be processed is empty. If it is empty, the algorithm terminates and outputs the current optimal integer solution X. best Conversely, according to the preset node selection strategy, a node is selected from the list for processing, and the linear programming relaxation problem of that node is solved to obtain the objective value Z. LP Reconciliation X LP ; S603: Perform pruning judgment on the solution results of the current node: a) If the linear programming relaxation problem of the current node has no solution, then prune the branch containing that node; b) If Z LP ≥Z UB If the target value of the current node is not better than the known global upper bound, then the branch containing that node is pruned. c) If Z LP <Z UB And solve X LP If the integer constraints of all variables are satisfied, then the solution is a new feasible integer solution; update the global upper bound Z. UB =Z LP And update the current best integer solution X. best =X LP Then prune the node; if any pruning condition is met, return to S602; S604: If the current node has not been pruned and the solution is X LP If there are variables that do not satisfy integer constraints, the cutting plane generation program is initiated; through one or more cutting plane separation algorithms, one or more sets of valid inequalities, i.e., cutting planes, are generated; the cutting planes satisfy the following condition: all feasible integer solutions satisfy the inequality, but the current non-integer solution X... LP The inequality is not satisfied; the generated cutting plane is added as a new constraint to the linear programming relaxation problem of the current node to form an enhanced linear programming model, and then the enhanced linear programming model of the node is solved again by returning to S602. S605: At a specific node in the branch and bounding tree, one or more primitive heuristic algorithms are invoked according to a preset trigger condition; the primitive heuristic algorithm utilizes the relaxed solution X of the linear programming relaxation model of the current node. LP Quickly search for feasible integer solutions; if a more efficient integer solution X is found... best If a better feasible solution is found, then the global upper bound Z is updated. UB and X best ; S606: If, after generating the cutting plane and performing a heuristic search, the linear programming relaxation solution X of the current node is obtained... LP If the integer constraint is still not met, then the branching strategy is activated; select X. LP A non-integer variable x j (its value is v) j This variable is used as a branch variable, and two new child nodes are created based on this variable. Branch constraints are then added to the linear relaxation problems of these two child nodes respectively. and Add the two newly created child nodes to the list of nodes to be processed, and then return to S602.
9. The method according to claim 1, characterized in that, In step S6, the natural gas pipeline network operation optimization scheme includes the number of compressors in operation at the compressor station, the compressor speed and power, the natural gas flow rate and direction in the pipeline, the pressure at the nodes, and the total energy consumption, total carbon emissions, and total operating cost of the natural gas pipeline network.