{'fraction_non_alphanumeric': 0.02341045727819275, 'fraction_numerical': 0.006740754235744216, 'mean_word_length': 4.4459325396825395, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Benefits and Limitations of Simplified Transient Gas Flow Formulations

Although intensively studied in recent years, the optimization of the transient (time-dependent) control of large real-world gas networks is still out of reach for current state-of-the-art approaches. For this reason, we present further simplifications of the commonly used model, which lead to a linear description of the gas flow on pipelines. In an empirical analysis of real-world data, we investigate the properties of the involved quantities and evaluate the errors made by our simplification.


Introduction
For the past years, the mathematics of gas transport have been intensively studied, mainly focusing on the stationary (time-independent) case, which can be applied to planning scenarios for example [2] [6]. However, when aiming to optimize the actual short-term control of the technical gas network elements, we have to consider the time dependent so-called transient case. Here, research is still in the early stages and current state-of-the-art approaches cannot solve instances of large real-world network size [7].
One difficulty are the Euler Equations [2] describing the one dimensional gas flow in a cylindric pipeline, a set of nonlinear hyperbolic partial differential equations. For the isothermal case they can be stated as where x denotes the position in the pipe, t the time, ρ the density of the gas, v the velocity of the gas, p the pressure of the gas, λ the friction factor of the pipeline, D the diameter of the pipeline, g the gravitational acceleration and h the constant slope of the pipe. Note that ρ, v and p depend on x and t. The second equation can be further simplified by assuming the terms ∂ t (ρ v) and ∂ x (ρ v 2 ) to be small as in [1]. We finally reduce the number of variables by rewriting the constraints using the equation of state for real gases p = R s ρ T z(p) and the definition of the mass flow q = Aρv with A = D 2 π/4 being the cross sectional area of the pipe as Here R s denotes the specific gas constant, T the constant gas temperature and z(p, T ) the compressibility factor, which is often assumed to be constant and hence just stated as z. This model of gas flow in pipelines still contains non-convex terms, which introduce a lot of complexity to any model aiming to solve these equations. For this reason, we will present an additional simplification of the constraints and investigate the resulting theoretical properties as well as evaluate the caused errors based on historic flow data of real pipelines.

A linearization approach
The non-convexity of the stated equations is based in the second term in (2) f := λ R s T z We can now rewrite (2) as and observe that the equation becomes linear if we assume the absolute velocity in the friction term to be constant, that is |v| = v c . Note that we do not restrict ourselves to one flow direction, since we fix the absolute velocity. Furthermore, we only fix the absolute velocity in the friction term. Hence, the actual absolute velocity calculated from p and q might be different from v c . If the proposed simplification can be verified to be reasonable, the overall modeling complexity would decrease drastically. However, since the friction-based pressure difference scales linearly with the velocity, the assumption of fixed velocity might easily lead to large errors in terms of pressure differences. On the other hand, both the friction-induced pressure difference and the absolute velocity increase with increasing absolute flow values. As a consequence, overestimating the absolute velocity should in general be more favorable for minimizing the error in terms of pressure differences.

Analysis of real-world data
In order to see if the approximation of the friction term by using a constant absolute velocity is reasonably close to the actual friction-induced pressure differences, we use real pipeline data in the network of our project partner OGE [4], which is the biggest gas network operator in Germany. For this network, a history of states is given, measured every three minutes over a period of two years. There are two types of pipelines we consider here: (a) four large pipes A to D, which are used to transport gas between large network intersection areas, and (b) two small pipelines E and F , which are part of the network section connecting customers nodes with bigger pipelines. An overview of the properties of the six pipes can be found in Table 1. One idea to choose a fixed absolute velocity value for each pipe is to set this value to a mean velocity computed over a given time period. The fixed velocity error would be small if a major part of absolute velocity values were to lie within a small interval and hence near the mean value. To investigate this, we plotted the absolute velocity values occurring on all pipelines over the two years in Figure 1.
We can observe that the pipes A, B and C share a distinct characteristic with a high population of similar values and steep tails of the distributions. For example, for pipe A, the absolute difference between the 10th percentile and the 90th percentile is 3.10. Thus, only a relative error of less than 36% has to be taken into account for these values, when assuming a mean value of 4.290 m/s. For B and C the same percentiles yield a relative error of less than 44% resp. 54% for mean values of 3.445 resp. 2.610 m/s.
In contrast, the other pipes have a much larger span of velocity values, even when ignoring the first 13% of values smaller than 0.02 m/s of pipe E. We can conclude that for the bigger pipes with unique flow directions, namely A, B and C, a precalculated constant mean velocity value should lead to relatively small errors in terms of friction loss.
A second idea to approximate the velocity term, would be to fix the velocity to some value known from the recent history, such as the velocity value given in the initial state of the gas network control problem for example. To estimate a possible error here, we compute for each time step the relative velocity changes over one week and average these over the whole time period of two years. The results are given in Figure 2. In our discussion we focus on the value at 48 hours since this is a typical time horizon for short-term gas network control problems. In the picture we see, that for the pipes A, B and C the velocities change only slowly over short time periods, i.e. on average less than 0.35 m/s in 48 hours for each of the pipes. Pipe A and C even seem to reach some constant level of relative velocity change over time. For the other three pipes we have higher relative velocity changes in the first 48 hours, especially for pipe D. However, the smaller pipes E and F seem to have some daily pattern with a local minimum every 24 hours, which should be taken into account when substituting the velocity with historical values.

Determining fixed velocity values
After studying the historical velocity values on the six pipes, we will now compute concrete predefined velocity values and examine the actual errors in terms of pressure difference. We use the two approaches already briefly mentioned above: Calculating a constant velocity for each pipe based on a large set of historical data (approach A) and taking the velocity, which has been measured on the pipe exactly 48 hours before (approach B).
The constant velocity of A is calculated as the velocity that minimizes the sum over time of squared pressure difference errors on the whole pipe length f L. These errors are derived based on (2) by replacing the derivative with the corresponding difference quotient and using v c . Again we use Papay for the compressibility factor z and the formula of Nikuradse [3] for the friction factor λ.
To have an unbiased evaluation, we use only the first year of the time period for calculating the constant velocity and compare the results of the two approaches on the basis of the second year data. The results of approach A can be found in Table 2. We observe, that the constant velocity values are slightly above the average values given in Table 1. This supports our claim from Section 2 that overestimating the velocity is more favorable to reduce the pressure difference error. The actual average error values are quite small in terms of absolute values. However, when comparing to the actual average friction values, the values are quite high with an error to friction ratio above 20%. For pipe D the error is even higher than the friction-based difference. When looking at the maximum values, the relative errors are mainly at a level of about 50%, which is also rather high.
In contrast to the results expected in Section 3, the values for pipes A to C are not significantly better than the ones of pipes D to F . The only clear difference between the pipes in the results is the bad average error of pipe D in relation to the friction values. For approach B the results are shown in Table 3. For all pipes, the average values are smaller for approach B. The best improvement is made on pipe D, where the error could be more than halved. However, in relation to the average friction, pipe D has still by far the highest ratio.
For the maximum values, B performs even worse than A on all pipes except for pipe E. On pipe B and D the error value nearly doubled, which leads to a maximum error nearly as big as the actual friction on pipe D.
Regarding the expected performance due to the investigated velocity changes in Section 3, we observe that the values for pipe D are better than expected, but are clearly still the worst among all pipes, which is consistent with Figure 2. Despite the different values for hour 48 in the graphic, the other five pipes have quite similar results. One reason could be the different evaluation periods: two years for Figure 2 and only the second year for the results of Table 3.

Conclusion
We linearized the isothermal Euler Equations by fixing the velocity in the friction term to a constant value for each pipe. The results of approach B for determining the constant value, where we fixed the velocity to the historic values of two days before, indicate that the average errors made are not too large compared to the overall friction-induced pressure drop on the pipelines. However, the maximal error values turned out to be quite high, even in relation to the maximal friction values. Hence, we can conclude that the presented fixed velocity approaches can only be considered as rough approximations.
For future research, the results on our six pipes have to be verified on the complete network. Especially the bad values of pipe D have to be analyzed to find potential structural problems, maybe due to the change in flow direction. Furthermore, more sophisticated approaches to determine the fixed velocity might be possible. One option is to examine if compressor configurations at network intersection points have an impact on the velocity of the adjacent pipelines.