Development of a Mathematical Model of Stochastic Flow Distribution in Pipeline Engineering Networks

. The article discusses the developed methods for accounting for stochastic water consumption, as well as mathematical models for accounting for stochastic water consumption in water supply and distribution systems. Due to the fact that pipeline engineering networks are non-linear, we will first determine the conditions for their linearization, and then we will show the solution of the problem for the resulting linearized network. The objective of this work is to connect the parameters of the stochastic process of water consumption from the network.


Introduction
The objective of this work is to connect the parameters of the stochastic process of water consumption from the network [1][2][3], at the nodes of its consumption with the parameters of stochastic processes in the power sources of the network and in each of the elements of the network.As initial parameters, the values of the mathematical expectation of the parameters of stochastic processes and its dispersion for each consumption node [4][5][6][7], as well as data on the network topology (incident matrices) and on the coefficients of hydraulic resistance of individual elements (network sections, that is, branches of a graph displaying a real network) can be used.).Due to the fact that pipeline engineering networks are non-linear, we will first determine the conditions for their linearization, and then we will show the solution of the problem for the resulting linearized network.The mathematical model developed here and the algorithm used in the simulation are discussed.The model is general and is able to determine pressures, flow rates, temperatures and gas compositions at any point of the network.The simulator has auxiliary routines for the calculation of thermodynamic properties (enthalpy, entropy and volume) and transport properties (viscosity).There are no constraints on the network topology; cyclic networks can besimulated.Numerical results from simulated data on a proposed network are shown for illustration.The potential of the simulator is explored by the analysis of a pressure relief network, using a stochastic procedure for the evaluation of system performance.

Methods
Let us write the equation of the steady flow distribution for any one deterministic value of loads in the network nodes in matrix form: where: A and B are the incidence matrices in the nodes and circuits of the network, respectively; S and X are diagonal matrices of hydraulic resistance coefficients for each branch of the network and the flow along this branch, respectively; x is a columnar matrix of flows in branches; Q is a columnar matrix of loads in network nodes. Then, However, the price of such a solution is low, since, firstly, for this it is necessary to invert a matrix with dimension pxp (p -is the number of network branches), and secondly, a solution can be obtained only if the matrix ‖‖  is already known, i.e. when the flow distribution has already been found.This means that (1,2) is not an equation, but an identity reflecting the need to fulfill the first and second Kirchhoff laws for a nonlinear network.
If in (1.2) we replace the diagonal sub matrix ‖‖  by ‖  ‖  , in which all elements Zii= SiiXii (i = 1,2...p), then we arrive at the matrix equation: Fair for a linear network and studied in sufficient detail in works on mathematical modeling of electrical networks [1,2].
In accordance with the theory of linear electrical networks, there is no need to invert the matrix ‖ A BZ v ‖.Simpler solutions can be obtained by transforming this matrix into a nodal or contour form, i.e. assuming that either the first or second Kirchhoff's law can be written as an identity valid at any step of the solution.
Then the desired flow distribution is found by solving another group of Kirchhoff equations (either the second -contour, or the first nodal, respectively).In the first (nodal) solution method, the pressures in the network nodes are determined: where:  =  0 −   -matrix column of head loss from the power source to all nodes ( j = 1,2...m);   -matrix of nodal conductivities [2];  -matrix of nodal resistances [2]; The matrix   is called the matrix of nodal conductivities, since its elements have the dimension of the reciprocal of the dimension of the resistances and is determined by the formula: =   −1   (5) where: М -node and branch incidence matrix;   −1 -diagonal matrix obtained by inversion   in (3);   -transposed matrix Y .Matrix  =  −1 , received by appeal   , is composed of elements, the values of each of which depend on the set of parameters of the network elements and their connection scheme.In this regard, the matrix  is called the matrix of generalized network parameters.Another matrix of generalized parameters is also known [3,4,6]: which is called the matrix of coefficients for distributing the load of nodes along the branches of the network, since  =  (7) where:  = ‖  ‖ -a rectangular matrix with dimensions ×  (p is the number of branches, m is the number of nodes).Using (7), we have that is, the flow in the -th branch is the sum of the product of the distribution coefficients for the -th branch and the values of the loads in the network nodes.Equations ( 7) and ( 8) here represent one of the forms of the well-known superposition principle [3,5], which is valid only for linear networks and therefore these equations can be used to calculate the flow distribution for any changes in loads at network nodes.For nonlinear networks, the principle of superposition is generally not applicable, but it can be shown that in some cases the use of ( 7) and ( 8) is still possible.Empty using any of the methods for solving the system of Kirchhoff equations for a nonlinear network with a given topology, the flow distribution is found (matrices  1 and 1 in (1.1) for some values of the elements of the load matrix   .In this case it is easy to find   =  and in accordance with ( 5) and (1.6) one can find the matrix   .Let us show that the matrix of distribution coefficients will remain unchanged for another mode of operation of the nonlinear network, if for this mode the matrix of loads  2 =  1 , that is, in the second mode, each nodal load is proportionally changed in  once.

Fig. 1. One circuit of a multi-ring network
First of all, consider one circuit of a multi-ring network shown in Figure 1, and write down for it the equations of Kirchhoff's laws for two modes of operation.Node 0 in this case can be the source of consumption for the entire network.The interaction of this circuit with other circuits of the network is ensured by the selection of flow rates along the lines extending from nodes 1,2,3 to the network remote in the figure.Node 0 in this case can be the source of consumption for the entire network.
Let the total water supply equal to the sum of withdrawals at all nodes is ∑  =  1 +  2 +  3 +  1 +  2 +  3 .In this case, the ratio of the flow along the branch 0-1 to the total feed ∑  is equal to .We express the flows along all branches included in the circuit through the flow along the branch 0-1-q1-2: Let the flows along the contour branches satisfy not only the first Kirchhoff law (according to (9), but also the second law. Then, Now let the total network load change to  times, that is ∑  2 =  ∑  1 .Let us rewrite (10) for the new conditions, taking into account (9).Wherein: It can be seen from ( 11) that the fulfillment of Kirchhoff's second law is possible only under the condition  1  =  1 ,  2  =  2 ,  3  =  3 and also under the condition that if in this case we use the matrix of distribution coefficients   , found by (6) for the first mode, in order to calculate the flow distribution in the second mode, the new flow distribution will also meet the conditions of the Kirchhoff laws.Wherein

Results
Given that it is practically impossible for all network nodes to experience an equally proportionate change in load, the scenario previously discussed is highly idealized.It is important to remember that stochastic processes of load changes in water, heat, and gas supply systems are non-stationary random processes.Their non-stationarity is primarily related to an approximately proportional change in loads at various times when these systems are operating.The daily routines of those who are the primary target product consumers dictate this.Furthermore, all network nodes experience an almost proportional change in load for the gas and heat supply systems based on variations in air temperature.In this regard, we will obtain variation series of coefficients, whose characteristic in the first approximation can be considered only two: the first central moment of the distribution function M(C_ij)-the mathematical expectation and their variance -D(C_ij).This is achieved by considering a large number of operating modes of any engineering network, finding for each of them a steady flow distribution, and then determining the load factors for each mode according to (1.6).It should be noted that the variation of the values of each of the coefficients   a priori should be significantly less than the load variation in the network nodes, since changes   compared with (  ) can occur not with any change in loads, but if and only if the change in the load in each of the nodes is disproportionate to the change in the load in the whole system.
Let us represent the load in the node at any time as the sum of two loads -  () = ( 1 () +  2 ()), где  1 () и  2 () -coefficients at time  , а mathematical expectation of the load in  -th node for some period.
Let it change in the total load of the system ∑   () =  1 ()(∑   ), where ∑  mathematical expectation of the total load.Then the load at the -th node can be represented as: Where the first term reflects synchronous fluctuations in the load in the node and the total load of the system, and the second term reflects the deviation of the load in the node from synchronous fluctuations.Since the second term (13) for real systems of heat supply, water supply, gas supply is much less than the first, then taking into account that the first term in (13) leads to   = const, then we should expect a small variation of random values   , that is, approximately (  ) ≈ 0. n addition, one should take into account what is necessary to calculate the matrix  by ( 6) matrix of nodal resistances  is found by inverting the matrix   in (4).
At the same time, due to the complex scheme of the network and the complex interaction in the matrices   and =   −1 topological and physical parameters of the network, one can also expect a small change in the matrix С and its elements at various loads in nodes.However, this assumption requires special verification, which can be implemented by simulating the operation modes of various types of transport engineering networks, at which, for each value of the random vector of node loads, a steady flow distribution is determined, by (1.3) we find the corresponding values of the matrix coefficients ‖‖, and with the accumulation of a sufficient amount of statistical data, estimates are found for (  )and(  ) each of the elements of the matrix .
If we assume that (  ) ≈ 0, then we can proceed to the construction of a mathematical model of stochastic flow distribution, based on the fact that (1.7) is an approximate linear transformation of a random node load vector to a random flow vector for each element of the engineering network.
Let's represent the node load matrix in the form: where: () = √() -vector column of load mean square deviations; → -the column vector of the mathematical expectations of the loads;  -parameter of the standardized normal function probability distributions.We will look for a column vector of flows by network elements equal to: where: and() -expectation column vectors and root mean square deviations for flows, respectively;  the same as in (14).To pass from ( 14) to (15), we need to find the relations: S E3S Web of Conferences 477, 00063 (2024) https://doi.org/10.1051/e3sconf/202447700063STAR'2023  =  1 ()and() =  2 (())( 16) Using (1.6), which is a linear transformation, we easily find that = q  ⋅ (17) That is, for each th element (circuit branches): To determine  2 , we use the well-known method for determining the variance of the sum of quantities [5].
Then:  [4,7] value   ≈ 0,6 − 0,7 for various types of consumers of water supply systems (for each type of engineering networks, their own values can be experimentally determined   ).

Discussion
As it was indicated in the introduction that pipeline engineering networks are non-linear, we first determine the conditions for their linearization, and then we show the solution of the problem for the resulting linear zed network.[5] The paper shows the ways of solving this problem on the basis of the research done.Using the proposed method, it was possible to obtain acceptable solutions that meet all the permissible requirements for calculating the parameters of stochastic flow distribution in nonlinear pipeline networks, carried out according to the proposed model with various changes in the network structure.Below is a diagram of a 2-ring highway, an example of which shows the implementation of this method and presents the results that can be compared with the results obtained by the usual simulation method.[7] Comparative calculations were also made for networks with many rings.In all calculations, the results allowed by the restrictions were obtained [6].Comparison of simulation results and calculations of the mathematical model of stochastic flow distribution for the network in Table 1Through the physical tests it is found that the density of WPC is when the content of the wood for the composite increases.It shows the variation in the density of the material with respect to composition of the material.The Water absorption of the WPC decreases due to the use of thermoplastics and it is seen that the weight of the material is increased when completely immersed.

Conclusion
An algorithm for calculating the matrix of generalized network parameters (load distribution coefficients) is proposed when the network structure changes as a result of emergency shutdowns of individual sections.It is shown that the results of calculating the steady flow distribution using this algorithm for non-linear pipeline networks agree quite well with the results of traditional hydraulic (linking) calculations.It is shown that the calculation of the parameters of stochastic flow distribution in nonlinear pipeline networks, carried out according to the proposed model with various changes in the network structure, converges with the results of simulation modeling with sufficient accuracy for practical purposes.
A mathematical model for the rigorous steady-state simulation of pipeline networks for compressible fluids is formulated.This model is composed of a system of algebraic linear and non linear equations.The model is solve dusing the Newton-Raphson Method associated with a successive substitution procedure.

Table 1 .
Comparison of simulation results and calculations of the mathematical model of stochastic flow distribution for the network