## 3 Results and Discussions
### Discussions  
(1) Comparison with the current method  
At present, the type of gas kick can be judged by changing the wellhead back pressure, during managed pressure drilling. As the underbalanced gas kick is mainly affected by the bottomhole pressure, and the bottomhole pressure has little effect on the gravity displacement gas kick. By increasing the wellhead back pressure, after the bottomhole pressure state changes from underbalanced to overbalanced, the underbalanced gas kick will no longer occur, and the outlet flow will gradually decrease, while the gravity displacement gas kick will maintain the original intrusion rate, the outlet flow will continue to increase. In [12], the wellhead back pressure increased by 3.4 MPa at 1300s after the kick was detected on the ground. It was observed that the outlet flow was equal to the inlet flow after a lag time of about 7 h, and judged as an underbalanced gas kick.  
Compared with the existing methods, the method proposed in this paper does not need to wait for a lag time, and there is no need to adjust the wellhead backpressure, and the fine outlet flow measurement is not required, which is not only suitable for managed pressure drilling but also for conventional drilling.  
(2) DTW Computational Feature Analysis  
From the calculation results in Tables 5-7, it can be seen that, according to the increase of time series data, the judgment effect is better. Note that Tables 5-7 reveal the characteristics of DTW, where the DTW distance between the same time series is 0, indicating that the same time series is perfectly similar. The maximum DTW distance between time series \(A\) and \(B\) indicates the least similarity between the outlet flow rate of the underbalanced pressure gas kick and the gravity displacement gas kick. Meanwhile, it indirectly demonstrates that there is a difference in the presentation between an underbalanced pressure gas kick and a gravity displacement gas kick, and they can be identified using DTW algorithms.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Time Series** & **The Measured \(C\)** & **The Simulated \(A\)** & **The Simulated \(B\)** \\ \hline The measured \(C\) & 0 & 7.68 & 11.62 \\ \hline The simulated \(A\) & 7.68 & 0 & 42.5 \\ \hline The simulated \(B\) & 11.62 & 42.5 & 0 \\ \hline \hline \end{tabular} (3) The calculation period is 0 to 1300 s  
Table 7 displays the DTW distances between any two of the above three time series. As can be seen from Table 7, the DTW distance \(L_{A\text{-}C}\) between time series \(A\) and \(C\) is 8.25, and the DTW distance \(L_{B\text{-}C}\) between time series \(B\) and \(C\) is 20.66. There is a higher similarity between the measured time series \(C\) and the time series of the simulated underbalanced pressure gas kick. Therefore, the type of gas kick is judged to be the underbalanced pressure gas kick, and the results are consistent with the actual drilling conditions.  
\end{table}
Table 6: Dynamic time warping distance calculation results (calculation period [0, 1000]).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Time Series** & **The Measured \(C\)** & **The Simulated \(A\)** & **The Simulated \(B\)** \\ \hline The measured \(C\) & 0 & 8.25 & 20.66 \\ \hline The simulated \(A\) & 8.25 & 0 & 88.1 \\ \hline The simulated \(B\) & 20.66 & 88.1 & 0 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Dynamic time warping distance calculation results (calculation period [0, 1300]).