# A Sensitivity Analysis of a Computer Model-Based Leak Detection System for Oil Pipelines
## 3 Results and Discussion  
### Uncertainty in \(R\) Factor  
The effect of uncertainty in \(R\) factor, caused by errors in the different variables it comprises, was first evaluated. A \(\pm\)20% error was introduced in \(R\) factor by varying the viscosity or bulk modulus as listed in Table 1. For all cases, Statefinder was configured to allow for adjustment of the viscosity or bulk modulus to their correct values. Figure 2 shows that leak detectability was not affected by the viscosity error with either perfect or noisy data because the \(DVB\) baseline and two viscosity error curves overlap precisely in both plots. However, this was not the case when the uncertainty in \(R\) factor was introduced by varying the bulk modulus. For perfect data (Figure 2a), the detection time for the baseline case was 24.9 min after the leak started. The curve with +20% error in \(R\) deviated from the baseline, and detection of the leak was delayed by 11.5 min, a 46% increase in detection time. However, when a \(-\)20% error in \(R\) factor was introduced with perfect data, there was no change in leak detectability. The \(DVB\) curves for both \(\pm\)20% error in \(R\) deviated from the baseline for noisy data (Figure 2b). The detection time was 5.9 min earlier and 17.6 min later for the test with \(-\)20% and +20% error in \(R\) factor, respectively, compared to the detection time of 33.1 min for the baseline. Evidently, the viscosity error and bulk modulus error have different effects on leak detectability, even though they introduced exactly the same amount of error in \(R\) factor. The impact of viscosity uncertainty on leak detection was significantly less than the impact of bulk modulus uncertainty. Figure 2 shows only the results during a flow decrease transient in a system with \(R\) = 2.20 as the findings were similar for other flow conditions and for systems with \(R\) = 0.49. Clearly, the effect of the uncertainties in individual variables comprising \(R\) factor must be evaluated separately. This is a different finding than the conclusion of API 1149 [12] and may be due to the different leak detection methods employed.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Tuning Weights** & **Viscosity Error** & **Bulk Modulus Error** & **SCADA Error** & **Random Error** \\ \hline \(W_{1}\) & \(1\) & \(1\) & \(1\) & \(1\) \\ \(W_{2}\) & \(1\) & \(1\) & \(1\) & \(1\) \\ \(W_{3}\) & \(1\) & \(10^{7}\) & \(10^{7}\) & \(1\) \\ \(W_{4}\) & \(10\) & \(10\) & \(10\) & \(10\) \\ \(W_{5}\) & \(500\) & \(10^{7}\) & \(10^{7}\) & \(500\) \\ \(W_{6}\) & \(10^{7}\) & \(1\) & \(10^{7}\) & \(1\) \\ \(W_{7}\) & \(5\) & \(5\) & \(5\) & \(5\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Tuning weights in Statefinder for single error and random error scenarios: \(W_{j}\) (\(j\) = 1–7) are weights assigned to measured pressure and flow rate, friction, rate of change of pressure, friction, and bulk modulus, and diagnostic flow, respectively. SCADA: supervisory control and data acquisition.  
Figure 2: Effect of uncertainty in \(R\) factor on leak detectability in a system with \(R\) = 2.20 for a flow decrease transient: (**a**) perfect data; and (**b**) noisy data. Arrows in (**a**) indicate the interception between the threshold line and the \(DVB\) curve.