1. Introduction
Gas-lifted systems are usually situated in harsh environments or deep below the sea surface for sensors to produce reliable measurements. This is due to the difficulty encountered when deploying the sensors in the location required to provide good measurement, excess heat effect on the sensors, and reaction between the sensors and the harsh environments among other reasons.
Most control solutions in gas-lifted systems rely on these sensor measurements, hence the states or variables used in the controllers are unreliable. This is the case in [
1,
2] where a control solution was used to remove casing heading instability assuming all measurements were available and reliable. However, in [
3,
4,
5] top-side measurements were used by the observers and Kalman filters to estimate the states for the controller.
The performances of these filters on gas-lifted systems vary due to the dependence of the model on the underlying assumptions used at the modelling stage, in addition to the noise assumption. In the linear case, the Kalman filter is the optimal estimation method used [
6,
7]. A gas-lifted system is inherently nonlinear, and if it is used in this form, nonlinear filters such as the extended Kalman filter (EKF) [
8], unscented Kalman filter (UKF) [
9,
10] or particle filter (PF) [
11] among other nonlinear state estimation methods should be used. These nonlinear state estimation methods have been applied successfully in many fields such as navigation [
12], robot localisation [
13] and fault detection in chemical process [
14], but they have not found much application in gas-lifted systems. A close application to gas-lifted systems are the use of the EKF for leak detection in pipes (which may not necessarily be gas lift pipes) [
15] and the UKF with linear model predictive control (MPC) for optimisation of gas-lifted systems [
16].
This limited application of nonlinear filters in gas-lifted systems is due to the fact that linearising the system about an operating point and applying the linear Kalman filter is usually sufficient in most control applications. However, as the demand for optimal operation of gas-lifted systems is increasing, using the nonlinear filters makes it possible to estimate the states at various points, hence making it easier to approach these demands as much as possible. The choice of filter type to use in state estimation depends on the accuracy requirements, the complexity of the filter, the computational demand, the speed of convergence and the degree of linearity of the system among other factors.
A hybrid approach to optimisation of gas-lifted systems proposed in [
17] reduces the steady state wait-time associated with static real-time optimisation (RTO). This hybrid approach uses model adaptation that involves parameter updates using dynamic models while optimisation takes place using static nonlinear models. To meet up with the model adaptation, speed of convergence is the most important consideration for filter selection. Faster filters such as that proposed in [
18] which uses a direct approach to parameter estimation are used to decrease the convergence time of the parameter estimation. When the sensor measurements are unreliable, this hybrid approach can be implemented at a more optimal level using both state and parameter estimation approach like that presented in [
19].
In this article, we discuss and apply the EKF, UKF and PF to gas-lifted systems and examine the performances of these filters on the system. We compare the performances of the filters on the system by examining the residuals and performing hypothesis tests on the residuals. This research provides a basis to select a nonlinear filter based on estimation accuracy and computational demand when the gas-lifted system is to be operated with nonlinear models. The outputs from these nonlinear filters in gas-lifted systems are useful for decision making in areas of control application such as fault detection and diagnosis, casing heading instability removal and general optimal operation of the system.
This paper is organized as follows:
Section 1 introduces the paper.
Section 2 discusses the state estimation methods considering the linear Kalman filter before discussing the main nonlinear filters of EKF, UKF and PF.
Section 3 discusses gas-lifted systems and presents the differential algebraic equations (DAEs) that describe them.
Section 4 presents the results and discussion which is the filter performances and
Section 5 concludes the paper.
4. Results and Discussion—Filters Performances on Gas-Lifted Systems
In this section, we compare the performances of the three nonlinear filters on the gas-lifted system. The assumed distribution is Gaussian for all three filters. The initial condition,
= [2300 750 5800] kg is the same for all three filters and the input is fixed at
throughout for all three filters. The state covariance,
([100 10 1000]), the state noise,
([100 16 160]) and the measurement noise,
([1000 1000 40]) are the same for all three filters. The sampling time is 60 s (1 min) for all three filters and the system is simulated over 150 samples (2.5 h). For the UKF,
,
and
. The PF uses maximum weight to obtain the state estimates from the posterior distribution since the weight reflects the probability that the true state is the given particle (i.e., the states with higher weight have a higher chance of being the true state of the system). The threshold for triggering resampling is set to 0.8 to quickly remove particles that are not contributing significantly to the distribution while the sampling method is residual. All the simulations were done in MATLAB version R2021a [
27]. Euler and ODE15S were used to solve state trajectories of the differential algebraic equation (DAE).
4.1. States and Residuals Visualisation
Figure 2,
Figure 3 and
Figure 4 show the true and estimated states for the EKF, UKF and PF respectively. In
Figure 2 the estimated states (red dash, dotted) converge to the actual states (blue solid) in under 10 min for all three states. The estimated states converge to the true states in
Figure 3 too but at different times with
fastest whereas
being the slowest.
Figure 4 shows that estimated states track the actual states poorly.
The effect of random sampling of the states into particles and obtaining the state estimates from the posterior distribution is seen in the poor tracking performance of the PF. While the UKF also samples the states before using the unscented transformation to obtain the anterior state statistics, the sampling here is carefully and deterministically done hence the UKF tracks better than PF. Unlike in the case of EKF and UKF where each state is propagated through the state transition function and is estimated individually, the PF propagates states hypotheses. The consequence of this is that the actual state is not being properly tracked like that of the EKF and UKF. The result is not better when the state estimate is obtained from the posterior distribution by using the mean of the particles despite that the true state is believed to be around the mean of the 3000 particles.
From
Figure 2 and
Figure 3, the UKF tracks better than EKF due to the use of three term approximation of the Taylor series of the nonlinear system by the UKF while EKF uses two terms. Hence based on the visualisation of the true and estimated states, the UKF performs better whereas the PF performs least. This result is different from the one performed on mechanical system in [
12] where the EKF performed poorest while the performances of the UKF and PF were similar. This justifies the extension of these methods to gas-lifted systems as the performance of the filters depends also on the system whose states are estimated in addition to the noise distribution.
The initial slow convergence of the states means that the residuals have a higher magnitude for the first few state estimates. We remove this transient part and show in
Figure 5, the residuals. In all three measurements, the residuals from the PF is larger than the EKF and the UKF reaching a value of
,
and
for
,
and
respectively. The UKF has a smaller residual than the EKF for
and
but bigger for
indicating that the UKF still has the best estimation performance by residual visualisation.
We examine the residuals further by first considering the normalised residuals. The normalised residuals are obtained by dividing the residuals by the steady state values of the actual measurements given as
= [
] = [9,930,500 N m
4,678,800 N m
71.9316 kg m
].
Figure 6 shows the normalised residual plots. For each output, the residuals resulting from the EKF (blue solid line), UKF (red dash-dotted line) and PF (blue dotted line) are compared.
We observe from
Figure 6 that normalised residual has a very low value, especially for the EKF and the UKF. On zooming in on
Figure 6 at steady state, these values are of the order of
for UKF and
for the EKF but about 0.2 and −0.2 for PF when the residual is the mixture density. This shows that the estimates are better in the EKF and UKF than in PF with the UKF still the best. Additionally, for the three measurements, the distribution of the residuals around the zero line is poor for the PF except in the case of
in
Figure 6c. Furthermore, the distribution of the residual for the EKF and UKF are however even around the zero line including in
Figure 6c where the residual for the UKF is large. The more even the distribution of the residuals around the zero line, the better the estimated states.
The above estimation was performed at a fixed value of which is in the stable region. The performance of the filters depends on the degree of linearity of the system and the noise distribution. The gas lift system is seen to exhibit different behaviour as input increases from 0 to 1. We therefore, perform statistical tests on the residuals. The first check is to see if the residuals of the filter outputs follow the Gaussian distribution of zero mean and non-zero variance. This we obtain from the expectation test on the residual. Next, we examine the RMSE for the residuals of gas lift system at three different inputs: , and . These inputs correspond to the system in the stable region, the system sliding into the unstable region and the system fully into the casing heading instability region respectively.
4.2. Statistical Tests
Two tests were performed on the residual here: the expected value test to examine the shape of the residual distribution and the root mean square error to show how close the estimates are to the true states.
4.2.1. Expected Value Test
Since it is impossible to perform an infinite number of experiments to determine if the mean of the residual is close to zero, we use the expected value test to infer the centre of the residual distributions and with hypothesis tests, we check the mean of the entire residual distribution. The residual (innovation since it is stochastic) is obtained as the difference between the actual measurements from sensors and the outputs computed using the output function in (
6b) with the states being the estimated states. The residual that is more evenly distributed around zero produces a distribution that is close to normal and increases the accuracy of estimation. Non-normality of residual does not exactly translate into poor estimation, especially in the case of nonlinear states with many samples, however, it helps to compare the performance of the estimation methods. A total of 151 samples were used for each filter simulation and the mean value for the residuals is computed using (
27).
where
r is the residual
k is the measurement index corresponding to
,
and
,
N is the number of samples which is 151 here and
is the mean of the residuals.
The hypothesis test is conducted on the computed mean of the residuals for the three measurements and
Table 4 shows the results for the nine residuals. A checkmark “√” represents the true hypothesis which is that the residual comes from a normal distribution while an “X” represents an alternative hypothesis which is that the residual does not come from a distribution that is normal. The corresponding
p-values are also provided in the table.
Optimal estimation is associated with a linear Kalman filter where the state and the measurement functions are linear and the noise is Gaussian. The effect of this is that when the state with Gaussian distribution is estimated, the residual (innovation) is Gaussian. This is not the case with other filters whose models are nonlinear. We therefore use the hypothesis test on the residual to see how close the nonlinear filter residuals are to being Gaussian. As seen in
Table 4, the entries for most of the hypothesis tests indicate that the residuals do not come from a distribution that is Gaussian except for the residual
for both EKF and UKF. The acceptance of the true hypothesis in these two isolated cases is not enough to draw the conclusion that the residual of the mixture density is normal when estimated with EKF and UKF as this might have happened by chance.
The p-values that indicate the chance that the true hypothesis holds are also provided and they indicate that the EKF and UKF have a higher chance of having residuals that are normal since they have higher p-values than the PF. The p-values of the UKF are better (bigger) than that of EKF except for . The PF has the worst performance as the p-values are smaller than those of EKF and UKF. Both residual visualisation and the expected value test indicate that UKF is slightly more accurate than EKF with PF having the lowest estimation accuracy of the three filters for this system.
4.2.2. Root Mean Square Error
The RMSE for the residual is the most common error metric for testing the accuracy of the filters [
8,
12,
28]. We examine the RMSE for the filters under three different input conditions to see if the accuracy of the filter depends noticeably on the effect of the casing heading instability. Casing heading instability results from the oscillatory behaviour of system depending on the input value. These inputs are
,
and
which correspond to the stable region, the region going into casing heading instability and the region inside casing heading instability respectively.
Table 5 shows the hypothesis test and the RMSE for the three filters for
,
and
respectively.
It can be observed from
Table 5 for all the three input values, the hypotheses tests are the same except for the
, which changed to true hypothesis when 0.9 while it is the alternative hypothesis for
and
. Again this might have happened by chance. While the RMSE of
residuals resulting from estimating with EKF increases from
to
and
, for the same EKF, the
residual increases from
to
and then decreased to
for
,
and
respectively. The RMSE of the
residual for estimation using EKF increased from 0.52 to 0.97 to 2.1. The RMSE for estimates using the UKF does not show much variation in values as
u is changed into the unstable region. The estimation using the PF behaves similar to the UKF as the RMSE for
increases from
to
to
.
This shows that there is no defined behaviour of the estimation accuracy of the nonlinear filters as input changes from the non-oscillatory region to the oscillatory region. However, using UKF still shows better prospects as it appears to have the least of the change in RMSE when a gas-lifted system is operated within these input ranges. Additionally, note that the best indicator of the accuracy of the measurement is the value of the RMSE of the residuals and residual visualisation. The statistical test does not significantly affect the acceptance of the estimation accuracy considering that the states are nonlinear. This will be different if the states are linear and the noise distribution is Gaussian where having a normally distributed residual gives us confidence in the degree of accuracy of our estimation. Additionally, care should be taken to interpret X in
Table 4 and
Table 5 as a failure of the null hypothesis test and not as products (multiplication).
The estimation accuracy depends on the proper selection of the matrices
P,
Q and
R as described in [
8]. We examine how the change in
R affects the filter performance using the EKF on
(mass of gas in annulus).
Figure 7 shows the true and estimated states for
R = [10 10 4], [100 100 40] and [1000 1000 400] respectively.
Figure 7 shows that there is no significant difference in the estimates for these different values of
R. A minor difference exists during the transient state and during a major change in the direction of the graph. Similar results were obtained when the different filters were used with other states. This result indicates that for the gas-lifted system where we selected
P,
Q and
R arbitrarily, the previous results were not affected significantly by these choices.
5. Conclusions
It is shown here that the gas lift system’s nonlinear states can be estimated directly using the EKF, UKF or PF without the need to linearise the system and apply a linear Kalman filter. Based on the noise assumption here, the UKF performs slightly better than the EKF by examining the RMSE for the residuals, visualising the states and examining the residual using the hypothesis test. This is because the UKF uses three term approximation of the Taylor series while the EKF uses one term. The additional terms improve the accuracy of the UKF over the EKF for the gas lift system. The performance of the PF is the worst. However, with the computational advantage of the EKF, the states of the gas lift system can be estimated using the EKF since there is just a small difference in performance between using it and the UKF. Hence for nonlinear control applications such as casing-heading instability, fault detection and diagnosis and general optimal operation of gas lifted systems, with Gaussian noise, the EKF can be used for state estimation.
The comparison here is based on the estimation error and does not consider explicitly the speed of convergence of the estimates to the true states because sampling times are larger in gas lift systems than in electrical and mechanical systems. Further works should consider both estimation error and the speed of convergence considering the importance of speed of convergence in parameter estimation for the hybrid optimisation in gas lift network.