# A Sensitivity Analysis of a Computer Model-Based Leak Detection System for Oil Pipelines
## 2 Methodology
### Sources of Uncertainty  
The properties of the fluid are often not known accurately since fluids with different properties may get mixed in tanks before being injected to the pipeline. As a result, density, viscosity, and bulk modulus can differ greatly from the nominal value measured in the laboratory. In actual pipeline systems, the density of a fluid is often measured by a densitometer before injection. However, viscosity and bulk modulus are typically not measured in the pipeline, and values measured periodically in the laboratory are used in the leak detection system. The impacts of inaccurate viscosity and bulk modulus were assessed by varying the magnitude of these two variables in the hydraulic model of the leak detection system. Viscosity was varied to introduce a \(\pm\)20% error in \(R\) factor through the friction factor. Initially, the bulk modulus was also varied to introduce a \(\pm\)20% error in \(R\) factor through the wave speed. This was conducted to see whether errors in different variables comprising \(R\) factor would have the same impact on leak detection if they introduced exactly the same level of uncertainty in \(R\). However, it was found that this required an unrealistically large variation in the bulk modulus. Therefore, a more realistic variation in bulk modulus of \(\pm\)10%, which produces an error in \(R\) factor of approximately \(\pm\)3%, was also tested (personal communication industry partner, 2016). The values of viscosity and bulk modulus tested are shown in Table 1.  
Errors may be introduced because the SCADA system polls data from field sensors at discrete time intervals and therefore between the polling intervals there is uncertainty. Polling times of 1 s, 5 s, and 10 s were tested to see whether the loss of important measured data during transient events could degrade leak detectability. In addition, the SCADA system polls data from each sensor consecutively rather than from all field sensors simultaneously. As a result, sensors at different locations are polled at different times but stamped at the same time, causing a \"time skew\". The maximum time skew in real pipeline systems can reach 10 s (personal communication industry partner, 2016). For field sensors where the pressure or flow rate was held constant, variation in reporting time does not affect the reported value. For example, the flow rate at the upstream end and pressure at the downstream end were both held constant during the steady state in this study. Therefore, time skew was introduced to the upstream pressure and downstream flow rate because at these sensor locations, the \"measured\" variable changes with time. This was achieved by shifting the time stamp of each data point in the time series by 10 s. The scenarios tested are shown in Table 2. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Variable**} & \multicolumn{3}{c}{**Variable Value**} & \multicolumn{3}{c}{**Equivalent Error in \(R\)**} \\ \cline{2-7}  & **Lower** & **Base** & **Upper** & **Lower** & **Base** & **Upper** \\ \hline Viscosity (mPa-s): \(R\) = 2.20 system & 1.31 & 4.57 & 11.53 & \(-\)20\% & 0 & +20\% \\ Viscosity (mPa-s): \(R\) = 0.49 system & 1.69 & 4.57 & 9.85 & \(-\)20\% & 0 & +20\% \\ Bulk modulus large (GPa) & 0.86 & 1.45 & 3.31 & +20\% & 0 & \(-\)20\% \\ Bulk modulus realistic (GPa) & 1.30 & 1.45 & 1.59 & +3.5\% & 0 & \(-\)3.0\% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Level of uncertainties in fluid properties. Error was first introduced into each source of uncertainty separately, referred to as single error tests, including viscosity, bulk modulus, polling time, and time skew. Tests were conducted using both perfect and noisy data with 1% Gaussian distributed noise to study the effect of data noise. The noise was created by adding Gaussian noise, statistical noise with a Gaussian probability function (standard deviation 3\(\sigma\) = 1%) scaled by the values of the perfect data.