Abstract
A pipeline operation optimization model with minimum energy consumption as the objective function was established based on the dynamic programming method. The model was applied to a 3840 km gas pipeline whose designed pipeline capacity was 170 × 108 t/a. There were 40 stations in the line, including 22 compressor stations and 32 compressors. The solution time was controlled within 60 s to show that the algorithm was fast and effective. The number of starting-up compressors in the optimized scheme is two more than that in the actual operation scheme, and the total pressure drop of the pipeline decreased by 3.40 MPa, the average efficiency of the gas turbine units increased by 4.234%, the average efficiency of the electric drive units increased by 4.875%, and the power decreased by 18,720.38 kW, confirming the validity and feasibility of the optimization model.
Introduction
The goal of gas transmission pipeline operation optimization is to minimize the energy consumption and flow noise of the pipeline system and maximize the pipeline throughput. However, this is very difficult to achieve, because more gas requires higher pressure and more compressor energy consumption and creates greater flow noise.1,2,3 For a long gas pipeline, the main expense is the running cost of the compressor stations. Studies have shown that the energy consumption of the compressors is more than 50% of the total energy consumption of a pipeline.4,5 However, optimization methods can be used to direct the operation of compressor stations so that the economy of this part is improved, lowering the cost of the entire pipeline system and maximizing the gas pipeline filling on the premise of safety.
In the 1960s, the United States and some countries in Europe began research on optimizing the operation of gas transmission pipelines. The original mathematical models were steady state, taking the lowest energy consumption of a compressor as the objective function, and the optimal operation plan of compressors was determined through a set of optimization calculations. PJ Wong and RE Larson 6 started the use of dynamic programming in 1968 to solve the modeling of gas pipeline operation optimization. Over the next decades, several studies on pipeline optimization modeling were done, both in China and in overseas.
Objective function: In pipeline optimization, the objective function is usually the maximum throughput, 7 the maximum filling of the pipeline,8,9 or the lowest pipeline energy consumption.10,13 Of these, the latter is the most common focus. In this study, the operation conditions of a gas pipeline were optimized using the lowest energy consumption as the objective function.
Constraint condition: There are usually three kinds: inequality constraints, equality constraints, and compressor constraints. Inequality constraints are used to limit the flow, pressure, and temperature of a pipe within a specific range. 11 Equality constraints are governing equations of gas flow in the pipeline, including a mass conservation equation, a pressure equation, and a temperature equation. 10 Compressor constraints were first established based on ideal compressor assumptions, which ignored the nonlinear relations between the pressure head, power, efficiency, compression ratio, and flow of a compressor. Wu et al. 12 and Liu et al. 13 built up a set of polynomials including surge curves and stagnation curves to describe feasible regions that overcame the shortcomings of the ideal compressor model. Sanaye and Mahmoudimehr 14 promoted their compressor constraints by considering correction parameters relevant to the ambient temperatures, component load running, and excess operations of compressors, which were more likely to represent actual compressor operation. In addition to the operation parameters of a compressor, the operation state (on or off) is also an essential parameter to be optimized, especially for a system with a set of compressors. 15
Optimization variables: Optimization variables are arguments of an optimization model, which generally consist of pressure, temperature of each node, flow rate of each unit (pipe and compressor), and the running state and efficiency of each compressor. The pressure, temperature, and efficiency of a compressor are continuous, whereas the running state of a compressor is discrete.16–18
Over the past decades, experts have promoted many algorithms to solve the pipeline optimization problem. Dynamic programming, generalized reduced gradient, and linear programming were the most common. But dynamic programming became the most successful algorithm for solving this kind of problem because of its advantages of ensuring global optimization and easy handling of nonlinear situations.19–23
After years of effort by experts, many algorithms are now available to create natural gas pipeline optimization models, but research on and energy consumption models of gas pipelines with very large compressors based on dynamic programming is insufficient. In our research, based on the characteristics of long distances and multiple compressor stations, an optimal operating plan was determined that accommodated the actual conditions of a pipeline. By taking a gas pipeline as an example, we created a relevant dynamic programming optimization model whose results have shown its feasibility.
Modeling and method
Modeling
Objective function
Our objective function reflected the objectives of pipeline operations. In the actual situation, the lowest energy consumption is taken as the objective function, and because it consists mainly of the energy consumption of compressor stations, the objective function can be the minimum sum of that energy consumption
where F is the total energy consumption of all compressor stations; fi is the energy consumption of the ith compressor station, i = 1, 2, 3,…, m; kij is the switch state of the jth compressor in the ith compressor station, where kij = 0 means no power on, and kij = 1 means power on; Qij is the flow rate of the jth compressor in the ith compressor station in m3/s (it is divided evenly when the compressor configuration in the station is the same); and Pdi is the outbound pressure of the ith compressor station in MPa.
Optimization variables
The outbound pressure and the running state of the compressors are directly related to the objective function of the optimization model. The energy consumption of a compressor depends on its compression ratio, flow rate, and temperature, but when the inlet condition of the compressor station is known, the energy consumption can be simplified as a function of compression ratio and temperature. The inlet and outlet temperatures of a compressor also depend on its compression ratio, so the optimization variables can be set to be the compression ratio that optimizes the outbound pressure. As a result, we set the optimization variables of the pipeline optimization model to be the number of powered-on compressors and the outbound pressure of a typical compressor station
Constraint conditions
To ensure the operation security of the pipeline and equipment, the process parameters must be restricted within a certain range that meets the constraint conditions of the model.
Flow rate constraints
The amount of gas can change in only a certain range, which is
where Qi is the intake (partial) volume of node i in m3/s,
Node pressure constraints
The pressure of each natural gas pipeline node must be limited based on the terminal demands, thus
where Pi is the node i pressure in MPa,
Pipe stress constraints
When there are Np pipes in the gas pipeline system, for the sake of pipeline safety, the pressure in pipe k must be less than the maximum allowable operating pressure, which is
where Pk is the pressure of natural gas in pipeline k in MPa, and
Flow equilibrium constraints
Because of the conservation of mass, for each pipe node, the gas mass flow into and out of the node should be consistent. Generally, for a gas pipeline system with Nn nodes, the gas flow balance equation of nodes can be written as
where Ci is a collection of components connected to node i, Mik is the absolute value of the flow in (or out) from the ith node of the connected component k, Qi is the flow exchanged between node i and the outside world (inflow is positive and outflow is negative), and αik is the coefficient (when the flow from k components flows into the i node, it is +1; when it flows out of the i node, it is −1).
Compressor performance constraints
The compressor power equation is
where M is the overflow rate of the compressor in kg/s, H is the polytropic head of the compressor, and η is the efficiency of the compressor.
The head curve is calculated according to
where h1, h2, and h3 are the fitting coefficients of the head curve, S is the speed of the compressor, and Q is the actual overflow rate of the compressor in m3/d.
The efficiency curve is calculated according to
where
The buzz curve is calculated according to
where Qsurge is the surging flow in m3/d, and s1 and s2 are the fitting coefficients of the buzz curve.
The stagnation curve is calculated according to
where Qstone is the stagnation flow in m3/d, and
Equations (7)–(11) are plotted in Figure 1, forming a closed area. This area is the operating area of the compressor. Using the online test software of the Beijing Oil & Gas Pipeline Control Center, we obtained the actual running data of the compressor in real time, and then corrected and fitted the curve of the compressor to obtain the actual running of the compressor curve (Figure 1), which had rarely been considered before.

Compressor head characteristic curve.
Compressor power constraints
The power of every compressor (station) was limited to the characteristics of the compressor
where Nj is the power of the jth compressor (station) in W,
Outlet temperature constraints
The outlet temperature of every compressor was restricted
where
Method for modeling based on dynamic programming
Dynamic programming is one of the most important solutions to pipeline optimization. It developed quickly with improvements in computer science. In this study, dynamic programming was innovatively applied to long-distance natural gas transmission pipeline operation optimization, which had not been done in previous studies.
Dynamic programming
When the distribution branch pipes along a gas pipeline are simplified to discharge nodes, the operation of the pipeline can be regarded as a multistage process; hence, dynamic programming is eligible for optimizing compressor stations along the pipeline, as shown in Figure 2.

Schematic of dynamic programming stage.
We established the dynamic programming model of the optimal configuration of each compressor station in the pipeline as equations (14)–(22) after setting the number of compressors as m and considering the gas transmission process between the compressor station k – 1 and station k as stage k of the problem. In that problem, the state variable xk (for the starting state of the phase) was the outbound pressure
Stage variables
Decision variables
Stage evolution equation
Stage effect
Objective function
Optimal objective function
Function recurrence equation
Initial conditions
and
where
Solution
The solution to dynamic programming applied to the pipeline optimization model comprises four main parts: (1) state space determination, (2) recurrence between stations, (3) recurrence within stations, and (4) a backtracking algorithm, as shown in Figure 3.

Flowchart of the pipeline operation optimization dynamic programming algorithm.
Case study
Operation program optimization
The total length of the west–east gas pipeline we studied was 3840 km. The designed pipeline capacity was 170 × 108 t/a and the pipe diameter was 1016 mm. The pipe length between each compressor station and the number of compressors in each station are shown in Figure 4.

Length of pipe between each compressor station and number of compressors in each station.
In this study, the curves for pressure head, pressure head/efficiency, surge flow, stagnation flow, speed, and flows of centrifugal compressors were fitted with actual field operation data. The centrifugal compressors of stations 13, 15, 16, 17, and 19 were selected for fitting calculation. The coefficient values in equations (8)–(11) are shown in Table 1.
Compressor characteristic curve coefficients.
The daily operation report of a pipeline is the practical operation plan that can be acquired from the production daily report. Basing our work on the daily operation report of the west–east gas pipeline, to evaluate the effectiveness of the model, we generated the optimum operation programs and compared them with the appointed programs in the daily report. The transporting conditions and the injection and distribution volume of each station were demonstrated. As shown in Figure 5, there were 5 stations with gas injection and 20 stations distributing gas from the main stream to branches. The first station’s pitted temperature was 15°C and pitted pressure was 6.5 MPa.

Multipoint injection volume and distribution volume.
Daily operation report (the practical operation program)
We obtained the process parameters of each station in the case from the practical operation report, as shown in Table 2.
Daily operation report of each compressor station in the case.
As shown in Table 2, in the actual operation scheme, the total number of starting stations of the compressors was 23—at least one for every station listed, except for compressor station 12. All the other compressor stations were in the starting state, of which only stations 1 and 16 opened two compressors. For a compressor station driven by a gas turbine, unit efficiency refers to the combined efficiency of the gas turbine and the compressor. For a compressor station driven by a motor, unit efficiency refers to the combined efficiency of the electric drive and the compressor. The average efficiency of a gas turbine unit was 21.09%, the average efficiency of a motor-driven unit was 65.58%, the total pressure drop was 44.67 MPa, and the total power was 245,495.4 kW. In actual operation, the energy consumption was high, the pressure drop was large, the unit efficiency was low, and there was still much room for optimization.
Optimized operation program
After calculations, we obtained the optimum operation program shown in Table 3. In the optimum program, stations 4, 8, and 12 were powered off; for stations 3, 7, 10, 11, 15, 16, 17, 19, and 20, a total of nine stations, outbound pressures were all 9.8 MPa, which was the design pressure of the pipeline.
Optimized operation scheme of the case.
Number of starting-up compressors, Power of compressor units, pitted and outbound pressure of each station, pressure drop along the pipeline, average efficiency of the driving device are compared in the daily operation report and the optimized operation scheme, as shown in Figures 6–10.

Comparison of the numbers of starting-up compressors.

Power comparison between actual operation and optimized operation.

Comparison of inlet and outlet pressures.

Comparison of pressure drops between daily operation report and optimized operation scheme.

Comparison of average efficiency between daily operation report and optimization operation scheme.
In the actual operation scheme, there were 23 starting-up compressors. In the optimization operation scheme, there were 25 starting-up compressors: one compressor was added to stations 2, 5, 7, 9, and 10, and one compressor was removed from stations 1, 4, and 8.
According to the daily operation report, the total power used was 245,495.4 kW, and the total power used in the optimization scheme was 226,775.1 kW. The optimization scheme reduced the power used by 18,720.3 kW, or 7.6%. The power used by stations 1, 4, 8, 13, 16, 22, 24, and 29 decreased substantially, and the optimization results were obvious.
After optimization, the outbound pressures of stations 1, 3, 5, 6, 9, and 13 fell. In stations 4, 8, 11, 12, 13, 16, 17, 19, 20, 22, 24, 26, and 29, the pressures increased (the pitted pressure was low in station 5 because of a pressure crossing), thereby reducing the energy consumption of the compressors.
In the daily operation report, the total pressure drop of the pipeline was 46.46 MPa, whereas in the optimization plan, the total pressure drop of the pipeline was 43.06 MPa; the optimized scheme reduced the total pressure drop by 3.4MPa compared with the actual scheme. The pressure drops of pipeline sections 3, 7, 10, 11, 12, 15, 16, 17 + 18, 19, 20 + 21, 22 + 23, 24 + 25, and 26 + 27 + 28 decreased markedly.
After optimization, the efficiency of each station’s units was substantially improved. Except for station 11, the average efficiency of the gas-driven units was over 23%, and the average efficiency of the motor-driven units was over 70%. The average efficiency of the gas-driven units increased by 4.234% and that of the motor-driven units increased by 4.875%, which substantially reduced energy consumption.
As illustrated in the comparison charts above, the optimization program optimized the number of starting-up compressors at some compressor stations, the inlet and outlet pressures of stations, and so forth. The average pressure between stations was higher, and the pressure drop of most pipeline section was less. The total pressure drop in the actual operation scheme is 46.46MPa, and the total pressure drop in the optimized scheme is 43.06MPa. The total pressure drop in the optimized scheme is significantly lower than that in the actual operation scheme, which proves the feasibility and validity of the model and the solution method.
Estimation and comparison of optimum energy consumption
To compare and analyze the energy consumption of the pipeline, equations (23) and (24) were adopted to calculate its energy and gas consumption, and equation (25) was adopted to convert that consumption into standard coal consumption. The results are shown in Figures 11 and 12. 13

Comparison of total energy consumption.

Comparison of unit energy consumption.
Based on the Chinese National Standard GB 52589-2008, the energy consumption of a pipeline is estimated by the indicators, such as gas consumption, power consumption, production consumption and gas unit consumption, power unit consumption, production unit consumption.
Gas consumption 13 and power consumption are calculated by equations (23) and (24)
where We is the power consumption in kW·h, Wg is the gas consumption in m3, n is the number of compressors,
Hence, the total energy consumption is
where F is the production unit consumption of the pipeline in kgce/(107 N m3 ·km),
Figures 11 and 12 directly reflect that every energy consumption index was decreased after optimization, which confirms the feasibility and validity of the optimization model. Compared with the daily operation report, the optimization scheme reduced total gas consumption by 527.45 (104 N m3), total electricity consumption by 406.69 (104 kW·h), total production energy consumption by 7515.25 tce, and total energy consumption by 8.65%. Therefore, the optimized operation plan can save much energy.
Compared with the daily operation report, the optimization scheme reduced gas consumption by 11.39 (N m3/(107 N m3·km), electricity consumption by 8.78 (kW·h/(107 N m3·km), and production consumption by 16.24 (kgce/(107 N m3·km)). The length of the west–east gas pipeline, the number of stations, the volume of transmission, and the number of compressors are large. The proposed optimization program can reduce much energy consumption and have great economic benefits.
Discussion
Table 4 shows that PJ Wong started to use dynamic programming to solve the gas pipeline operation optimization problem for small gas pipelines in 1968. As can be seen in the table, for many years, more and more experts began to use dynamic programming to optimize the energy consumption of gas pipelines. However, one limitation was that the pipelines studied were too small (few compressor stations and few compressors). Also, some scholars had different views on the actual operation of a compressor.
Research progress of dynamic programming.
Basing our work on our predecessors, in this study, we used the dynamic programming method to optimize the energy consumption of a large gas pipeline. The description of the compressors was in line with engineering practice. (The total length of the pipeline was 3840 km. There were 40 stations in the line, including 22 compressor stations and 32 compressors.) Such a large-scale, long-distance pipeline model can be solved in 60 s (a small increase in size can add tens of times more work and computation). The algorithm was fast and effective. Moreover, the compressor description combined with the field data measured by the online testing software of the Beijing Oil & Gas Control Center was used to correct the fitting curve, making it consistent with the actual operation of the compressor. This had a more advanced and practical value compared with previous treatments of the compressor, which used only a simple curve equation and ignored the actual operation. This also distinguishes our study from previous work.
Conclusion
An energy consumption optimization model of a gas pipeline is proposed. The model was applied to a gas pipeline of 3840 km whose designed pipeline capacity was 170 × 108 t/a. There were 40 stations in the line, including 22 compressor stations and 32 compressors. The object was to optimize the pipeline’s energy consumption. An optimum operation plan was obtained with specific pipeline throughput, and the solution time was controlled to within 60 s to show that the algorithm was fast and effective. The pipe pressures and operation energy consumption of the model and the real pipeline were compared, and the results can be summarized as follows: For the optimized operation plan, the pipe pressure drop was 3.4 MPa less, the average efficiency of the gas-driven units increased by 4.234%, the average efficiency of the motor-driven units increased by 4.875%, the power decreased by 18,720.38 kW, and the production energy consumption decreased by 8.65%. The effectiveness of the optimization method proposed in this article shows that it can be applied in engineering practice.
Footnotes
Handling Editor: Hongfang Lu
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the special fund of Key Technology Project of Safety Production of Major Accident Prevention and Control (sichuan-0002-2016AQ, sichuan-0013-2016AQ), Open Fund Project of Sichuan Key Laboratory of Oil and Gas Fire Fighting (YQXF201603 and YQXF201604) and Applied Basic Research Project of Sichuan Province (19YYJC1078).
