An Improved Dynamic Programming Method in The Optimization of Gas Transmission Pipeline Operation

The operation and optimization of gas transmission pipe network system is a mixed integer nonlinear programming problem, with nonlinear and nonconvex objective function and constraints. The dynamic programming method has the advantages of not sensitive to the nonlinearity and nonconvexity of the optimization problem, and it can obtain the global optimal solution, which should have convince performance in the operation and optimization applications of gas transmission pipe network system. However, the use of dynamic programming method may lead to dimension disaster and exponentially increasement of the computational cost. In this paper, the traditional dynamic planning method in the operation optimization of gas transmission pipeline is improved, and the idea of two-level optimization and the concept of local search are introduced, which can effectively avoid the dimension disaster and significantly improve calculation efficiency of dynamic planning method. Through the above two improved measures, the dynamic programming method can be applied to the operation optimization of large-scale gas transmission pipe network system to obtain the optimal solution quickly, which provides certain guidance and assists in the formulation of pipeline operation scheme.


Introduction
At present, the total mileage of China's onshore oil and gas pipeline network has exceeded 120,000 km. Among them, the natural gas pipeline mileage is more than 70,000 kilometres, and a large-scale natural gas pipeline network has been interconnected. There are numerous users of gas sources in the system, and the inter connection lines are widely distributed. With the huge scale of the pipeline network and the increase of the complexity of the operation conditions, higher requirements are put forward for centralized control of the pipeline network. On the other hand, in the process of natural gas transmission, the compressor is a large energy consumer. According to statistics, compressor gas consumption accounts for about 3% ~ 5% throughput of the total natural gas transmission. In the context of social energy conservation and emission reduction, cost reduction and efficiency increase of CNPC, it is of great significance to optimize the operation and management of natural gas pipeline network [1] . The operation and optimization of gas transmission pipeline is a typical mixed integer nonlinear programming problem, which is a difficult problem for conventional mathematical programming method. The dynamic programming method is one of the most mature and successful methods in the operation optimization of a single gas pipeline because it has the advantages of not sensitive to the nonlinearity and nonconvexity of the optimization problem, and it has high computational efficiency and good results. However, the use of dynamic programming method to solve large-scale optimization problems may lead to dimension disaster and exponentially increasement of the computational cost , which limits the application effect of dynamic programming. Therefore, this paper proposes two improvement measures of traditional dynamic planning method in the operational optimization of gas transmission pipeline. Two-level optimization can effectively avoid the computing efforts caused by discrete grid encryption, and local search can further increase the search efficiency in the recursive process. By introducing the above two improvement measures, the calculation amount of dynamic programming method is significantly reduced, which help achieve optimization results in a limited time and meet the actual production needs.

Optimization Model of Gas Pipeline Operation
The optimization problem of gas transmission pipeline operation can be summarized as follows: provided that the gas source capacity, pressure, temperature and the contracted capacity or pressure of the user are known, the outlet pressure and load distribution of each compressor station along the whole line are solved, so that total energy consumption of the compressor station along the whole line is the lowest. The mathematical model is as follows [2][3][4] : ,..., ; 1, 2,..., Where G denotes total energy consumption of the compressor station of the whole line; ij g refers to the energy consumption of the station i and compressor j ; ij q stands for the flow rate of the station i and compressor j ; CS f represents the energy consumption calculation function of compressor station;

Traditional Dynamic Planning
The first step of dynamic programming is to determine the current state space. The state space consists of a series of discrete outbound pressures, the upper and lower limits of which are the highest and lowest outbound pressures of the compressor station respectively. Then it is necessary to determine the optimal process of each state variable in the state space and calculate the optimal index function, which is the second step station inner recurrence. In addition to the initial station, the inlet pressure space of each compressor station is obtained from the state space of the previous compressor station through the state transfer function, which is station inter recurrence. When the dynamic programming is recursive to the end of the pipeline, it is necessary to backtrack the algorithm, and according to the optimal state of the end point and the previously recorded process of station recurrence and station inter recurrence, the optimal state and optimal decision of each stage are calculated [5] .

The Two-level Optimization
The calculation speed and results of the traditional dynamic programming method are significantly affected by the discrete step size of the state space. The smaller the step size is, the more efficient the computation speed will be, but the following dimension disaster will lead to the exponential growth of computing time. In the optimization of oil pipeline operation, the minimum discrete step size of pressure is 0.01 MPa, because this is the highest precision that can be controlled in actual operation. In  .  is recommended to take any integer between 10 and 30.
The optimal solution can be obtained in small steps by using dynamic programming method again.

Local Search
Station inner recurrence is an important part of dynamic programming method, and it needs a flood of time in computing. Taking state space [10,12] MPa, inlet pressure range [7,9] MPa, discrete step size 0.01 MPa as an example, a complete station inner recurrence would require 40,000 compressor simulation functions. Reducing the recurrence time in the station as much as possible will greatly improve the calculation efficiency. Through the analysis of the station inner recurrence, it is obviously that when the optimal inbound pressure corresponding to the outbound pressure i d p is j s p , the optimal inbound pressure corresponding to the outbound pressure 1 i d p  is often within the range of (1 3%) , (1 3%) so it is not necessary to conduct a global search in the station for each outbound pressure, only a local search near the previous optimal inbound pressure is needed, instead of enumerating them all like the traditional dynamic programming method.

Numerical Experiment of Two-level Optimization
The results of different state space discrete steps in traditional dynamic programming method are compared with those of two-level optimization method. It can be seen from Figure 4 and Figure 5 that in the traditional dynamic programming method, energy consumption becomes lower with the decrease of discrete step size. The calculated energy consumption at 0.01Mpa is 1.7% lower than that at 0.1MPa. However, it can also be seen that with the decrease of discrete step size, the computing time begins to increase exponentially. The calculation time at 0.01Mpa is 28 times of that at 0.1MPa. Therefore, the advantages of two-level optimization are highlighted. The result of two-stage optimization is only 0.15% different from that of 0.01 MPa, but the calculation time is reduced by more than 90%.

Numerical Experiment of Local Search
Local search will not have any impact on the accuracy of the calculation results, but through comparison, it is found that local search can distinctly reduce the calculation time of the traditional dynamic programming method. And it can be seen from Figure 6 that the smaller the discrete step size of state space is, the more significant the effect of saving calculation time is.

Example Test of Actual Pipeline
A real pipeline in China is used as an example to optimize its operation scheme by dynamic programming method. Two-level optimization and local search are used to speed up the calculation speed, and it is compared with the actual operation scheme.