## 6 A Physical Experiment Case Study  
Due to the flammable and explosive nature of natural gas, it is nearly impossible to carry out leakage rate measurement experiments using real natural gas in a pipeline. In this paper, an experimental platform was built, and compressed air was used instead of natural gas in the experiment for safety reasons. The system setup, displaying the layout of the gas leakage experimental platform, is shown in Figure 7. The platform is mainly composed of pipeline sections, a compressor, and air tanks. The compressor is a belt piston machine, with a 7.5 kW rated power, 800 L/min displacement, and 1.25 MPa working pressure. The dimensions of the cylindrical air tanks are 1 \(\times\) 2.4 m (diameter \(\times\) height). The weight of the air tank is 515 kg. There is one location where a leak can be simulated, named leak point in Figure 7. A leakage can be simulated by opening valve V4, and a flowmeter is set to measure the leakage rate. There are two pressure sensors (P1, P2). The specific parameters of the experimental pipeline are:  
\[L\] (the length between P1 and P2) = 9 m, \[D\] (inner diameter) = 0.253 m, \[c\] = 300 m/s. The photos of the platform are shown in Figure 8.  
The sampling frequencies \(f\) of pressure sensors and flow sensors are 1000 Hz, so:  
\[\Delta x=c/f=0.3\;\mathrm{m}.\]  
The pipe is divided into \(N-1=L/\Delta x=30\) segments, where \(N\) = 31. Referring to Figure 7, the specific steps of the experiment are as follows. 1. In order to simulate the actual natural gas pipelines, an air compressor is used to pressurize tank T1. 2. Once a stable pressure is achieved, the valve M1 is opened to form the flow from T1 to T2. 3. Adjusting the pressure of the gas storage tank and the opening of the butterfly valve B to maintain starting and ending pressures in the pipeline to be 800 and 750 kPa, respectively. At this point, the flow rate at the beginning of the pipeline is 132 kg/h and all the sensors begin to collect data. 4. After 80 s, the ball valve V4 is open to a certain degree to allow a leak at leak point 1. Figure 7: The system diagram of the gas pipeline leak detection experiment testbed. After 20 s, V4 is closed to stop the leak. The state vector is:  
\[\mathbf{X_{j}}=[P_{1,j},P_{2,j},P_{3,j},\cdots,P_{31,j},Q_{1,j}^{-},Q_{2,j}^{-}, \cdots,Q_{31,j}^{-},K_{2,j},K_{3,j},\cdots,K_{30,j}]^{T}.\]  
The initial condition is:  
\[\hat{\mathbf{X_{0}}}=[P_{1,0},P_{2,0},P_{3,0},\cdots,P_{31,0},Q_{1,0}^{-},Q_{2,0}^{ -},\cdots,Q_{31,0}^{-},K_{2,0},K_{3,0},\cdots,K_{30,0}]^{T}.\]  
Among them,  
Figure 7.0  
Figure 7.1  
Figure 7.2  
There are three observation points of starting pressure, flow, and terminal pressure in this experiment. Therefore, the matrix \(H\) has the dimension of \(3\times 91\), where \(\mathbf{H}(1,1)=1\), \(\mathbf{H}(2,31)=1\), \(\mathbf{H}(3,32)=1\) and the remainder of elements were 0. The measurement noise covariance was estimated by the data collected in the experiment. The setting of process noise was similar to the simulation example. The computational steps in the simulation example were repeated to obtain the estimated leakage rate and leakage location with the EKF, as shown in Figures 9 and 10. Figure 7.3 Photos of the gas pipeline leak detection testbed. As can be seen from Figure 9, the estimated leakage rate increased between 80 and 100 s and then declined thereafter. This is consistent with the experimental procedure where leakage commences at 80 s through the opening of the ball valve. By 100 s, the leak has stopped and the leak was reduced to zero. It can be seen from the analysis that the change of the estimated leakage rate is consistent with the change of the actual leakage rate. Since the leakage state cannot be maintained under experimental conditions, the estimation of the leakage rate is affected.