<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1 20151215//EN" "http://jats.nlm.nih.gov/publishing/1.1/JATS-journalpublishing1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xml:lang="en" article-type="research-article" dtd-version="1.1">
<front>
<journal-meta>
<journal-id journal-id-type="pmc">FDMP</journal-id>
<journal-id journal-id-type="nlm-ta">FDMP</journal-id>
<journal-id journal-id-type="publisher-id">FDMP</journal-id>
<journal-title-group>
<journal-title>Fluid Dynamics &#x0026; Materials Processing</journal-title>
</journal-title-group>
<issn pub-type="epub">1555-2578</issn>
<issn pub-type="ppub">1555-256X</issn>
<publisher>
<publisher-name>Tech Science Press</publisher-name>
<publisher-loc>USA</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">25349</article-id>
<article-id pub-id-type="doi">10.32604/fdmp.2023.025349</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Article</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>An Artificial Intelligence Algorithm for the Real-Time Early Detection of Sticking Phenomena in Horizontal Shale Gas Wells</article-title><alt-title alt-title-type="left-running-head">An Artificial Intelligence Algorithm for the Real-Time Early Detection of Sticking Phenomena in Horizontal Shale Gas Wells</alt-title><alt-title alt-title-type="right-running-head">An Artificial Intelligence Algorithm for the Real-Time Early Detection of Sticking Phenomena in Horizontal Shale Gas Wells</alt-title>
</title-group>
<contrib-group>
<contrib id="author-1" contrib-type="author" corresp="yes">
<name name-style="western"><surname>Wang</surname><given-names>Qing</given-names></name><email>wq4967079@163.com</email>
</contrib>
<contrib id="author-2" contrib-type="author">
<name name-style="western"><surname>Wang</surname><given-names>Haige</given-names></name>
</contrib>
<contrib id="author-3" contrib-type="author">
<name name-style="western"><surname>Huang</surname><given-names>Hongchun</given-names></name>
</contrib>
<contrib id="author-4" contrib-type="author">
<name name-style="western"><surname>Zhuo</surname><given-names>Lubin</given-names></name>
</contrib>
<contrib id="author-5" contrib-type="author">
<name name-style="western"><surname>Ji</surname><given-names>Guodong</given-names></name>
</contrib><aff><institution>CNPC Engineering Technology R&#x0026;D Company Limited, Planning and Support Institute</institution>, <addr-line>Beijing, 102206</addr-line>, <country>China</country></aff>
</contrib-group><author-notes><corresp id="cor1"><label>&#x002A;</label>Corresponding Author: Qing Wang. Email: <email>wq4967079@163.com</email></corresp></author-notes>
<pub-date date-type="collection" publication-format="electronic">
<year>2023</year></pub-date>
<pub-date date-type="pub" publication-format="electronic"><day>26</day><month>6</month><year>2023</year></pub-date>
<volume>19</volume>
<issue>10</issue>
<fpage>2569</fpage>
<lpage>2578</lpage>
<history>
<date date-type="received"><day>07</day><month>7</month><year>2022</year></date>
<date date-type="accepted"><day>27</day><month>9</month><year>2022</year></date>
</history>
<permissions>
<copyright-statement>&#x00A9; 2023 Wang et al.</copyright-statement>
<copyright-year>2023</copyright-year>
<copyright-holder>Wang et al.</copyright-holder>
<license xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>This work is licensed under a <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="TSP_FDMP_25349.pdf"></self-uri>
<abstract>
<p>Sticking is the most serious cause of failure in complex drilling operations. In the present work a novel &#x201C;early warning&#x201D; method based on an artificial intelligence algorithm is proposed to overcome some of the known problems associated with existing sticking-identification technologies. The method is tested against a practical case study (Southern Sichuan shale gas drilling operations). It is shown that the twelve sets of sticking fault diagnostic results obtained from a simulation are all consistent with the actual downhole state; furthermore, the results from four groups of verification samples are also consistent with the actual downhole state. This shows that the proposed training-based model can effectively be applied to practical situations.</p>
</abstract>
<kwd-group kwd-group-type="author">
<kwd>Shale gas drilling</kwd>
<kwd>sticking fault</kwd>
<kwd>artificial intelligence</kwd>
<kwd>risk early warning technology</kwd>
</kwd-group>
<funding-group>
<award-group id="awg1">
<funding-source>CNPC Key Core Technology Research Projects</funding-source>
<award-id>2022ZG06</award-id>
</award-group>
<award-group id="awg2">
<funding-source>Qing Wang and project funded by China Postdoctoral Science Foundation</funding-source>
<award-id>2021M693508</award-id>
</award-group>
</funding-group>
</article-meta>
</front>
<body>
<sec id="s1">
<label>1</label>
<title>Introduction</title>
<p>As the demand for clean energy continues to expand, the price of natural gas continues to rise, and people&#x2019;s understanding of shale gas has rapidly improved [<xref ref-type="bibr" rid="ref-1">1</xref>,<xref ref-type="bibr" rid="ref-2">2</xref>]. In particular, the technology level of horizontal wells is constantly improving, and the exploration and development of shale gas is forming a boom. The high formation pressure coefficient and complex geological conditions in shale formations have led to complex drilling operations with frequent failures, among which sticking is the most prominent. The sticking faults seriously restricted the safe and efficient development of shale gas. Therefore, it is important to ensure the safety of drilling and completion in horizontal sections of shale gas horizontal wells. The traditional methods for identification of sticking relied only on experts&#x2019; experience to make qualitative judgments on downhole risks. They simply transplanted the commonly used risk assessment methods (such as analytic hierarchy process, event tree, fault tree, bow-tie model, among others) into drilling engineering. Most of these methods are qualitative and semi-quantitative, and their prediction accuracy and efficiency are insufficient to ensure drilling safety [<xref ref-type="bibr" rid="ref-3">3</xref>&#x2013;<xref ref-type="bibr" rid="ref-5">5</xref>]. In addition, only a small amount of measurement and calculation work is automatically performed by computers, with most of the judgments still relying on manual work. Due to the differences of individual knowledge, experience, and sense of responsibility, it often leads to the failure to detect and handle drilling abnormalities in time, which increases the risk [<xref ref-type="bibr" rid="ref-6">6</xref>&#x2013;<xref ref-type="bibr" rid="ref-8">8</xref>]. The existing sticking risk assessment methods are based on fuzzy analytic hierarchy process, bow model, fault tree, and so on [<xref ref-type="bibr" rid="ref-9">9</xref>]. In fact, it is not realistic to require operators to observe the changes in monitoring data and judge the potential risk of an accident quickly. Therefore, the problems associated with the existing technology for identification of sticking, such as the poor comprehensive utilization of monitoring information, the untimely risk warning, and the strong subjectivity are of huge importance to operational safety and efficiency [<xref ref-type="bibr" rid="ref-10">10</xref>,<xref ref-type="bibr" rid="ref-11">11</xref>]. To solve these problems, this paper proposed a real-time warning method based on an artificial intelligence algorithm, which can predict and control the sticking. The application of this technology is of great significance for companies to reduce the loss of complexity and failure.</p>
</sec>
<sec id="s2">
<label>2</label>
<title>Expert Knowledge Judgment of Sticking</title>
<sec id="s2_1">
<label>2.1</label>
<title>Judgment Methods for Different Types of Sticking</title>
<p>Firstly, it is necessary to combine the traditional method of expert knowledge judgment to summarize the qualitative methods for identification of sticking, which is one of the important basic work of artificial intelligence risk prediction. According to the different causes, the sticking can be divided into differential pressure, collapse, sand bridge, shrinkage, keyway, balling-up, and junk sticking [<xref ref-type="bibr" rid="ref-12">12</xref>]. The different types of sticking are correspond to different judgment methods. According to the field drilling practice and expert knowledge judgment [<xref ref-type="bibr" rid="ref-13">13</xref>,<xref ref-type="bibr" rid="ref-14">14</xref>], the judgment methods of sticking are summarized, as shown in <xref ref-type="table" rid="table-1">Table 1</xref>.</p>
<table-wrap id="table-1"><label>Table 1</label>
<caption>
<title>Judgment methods for different types of sticking</title></caption>
<table><colgroup>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>Sticking type</th>
<th>Judgment method</th>
</tr>
</thead>
<tbody>
<tr>
<td>Differential pressure<break/>sticking</td>
<td><list list-type="bullet"><list-item>
<p>No change in Standpipe pressure. Drilling fluid circulation is normal.</p></list-item><list-item>
<p>Dynamic balance of inlet and outlet flow.</p></list-item><list-item>
<p>The checkpoint moves up, even to the casing shoe.</p></list-item></list></td>
</tr>
<tr>
<td>Collapse sticking</td>
<td><list list-type="bullet"><list-item>
<p>Standpipe pressure increases. Hook load decreases. Torque increases.</p></list-item><list-item>
<p>The amount of drilling fluid returned from the wellhead decreases.</p></list-item></list></td>
</tr>
<tr>
<td>Bridge sticking</td>
<td><list list-type="bullet"><list-item>
<p>During tripping out, the hook load decreases, and the Standpipe pressure increases.</p></list-item><list-item>
<p>During tripping in, the wellhead will not return the drilling fluid, and no drilling fluid is returned from the wellhead.</p></list-item></list></td>
</tr>
<tr>
<td>Shrinkage sticking</td>
<td><list list-type="bullet"><list-item>
<p>Standpipe pressure increases. Torque increases.</p></list-item><list-item>
<p>Rate of penetration increases.</p></list-item></list></td>
</tr>
<tr>
<td>Keyway sticking</td>
<td><list list-type="bullet"><list-item>
<p>Hook load decreases. Torque increases.</p></list-item><list-item>
<p>The drilling tool returns to normal state after putting out the keyway.</p></list-item></list></td>
</tr>
<tr>
<td>Balling-up sticking</td>
<td><list list-type="bullet"><list-item>
<p>When the pump is turned on, the Standpipe pressure is high, even unable to circulate, and the Standpipe pressure drops for a period.</p></list-item><list-item>
<p>Rate of penetration decreases.</p></list-item></list></td>
</tr>
<tr>
<td>Junk sticking</td>
<td><list list-type="bullet"><list-item>
<p>It is easy to lower the drilling tool.</p></list-item><list-item>
<p>Drilling fluid circulation is normal.</p></list-item></list></td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s2_2">
<label>2.2</label>
<title>Logging Characteristic Parameters Related to Sticking</title>
<p>According to the expert knowledge judgment of sticking failure, the comprehensive logging parameters that can characterize the sticking are hook load (WHO), standpipe pressure (SPP), torque (TOR), rate of penetration (ROP), rotary speed (RPM), and weight on bit (WOB). Although the types of sticking are different, the change rules of logging data before and after sticking are consistent. After the drill sticking fault occurs, the rotary table torque and the standpipe pressure increases, the rotary speed decreases. When sticking occurs during tripping out, the hook load and torque increases. When sticking occurs during tripping in, the hook load decreases, the torque increases, and the rotary speed increases.</p>
</sec>
</sec>
<sec id="s3">
<label>3</label>
<title>Intelligent Algorithm of BP Neural Network Based on PSO</title>
<sec id="s3_1">
<label>3.1</label>
<title>BP Neural Network</title>
<p>The back propagation (BP) neural network is a typical multi-layer and feed-forward network. The main advantage of the BP neural network is its strong nonlinear mapping ability. It is a three-layer forward artificial neural network composed of input layer, hidden layer, and output layer. According to the calculation formula of neuron output signal, the output of each neuron in the hidden layer can be obtained as follows:</p>
<p><disp-formula id="eqn-1"><label>(1)</label>
<mml:math id="mml-eqn-1" display="block"><mml:mtable><mml:mtr><mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>n</mml:mi></mml:munderover><mml:mrow><mml:mrow><mml:msub><mml:mi>&#x03BD;</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>&#x03B8;</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mtext>&#xA0;</mml:mtext><mml:mrow></mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mi>l</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="left"><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mrow></mml:mrow><mml:mtext>&#x00A0;</mml:mtext><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mi>l</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math>
</disp-formula></p>
<p>In the formula, <italic>v</italic><sub><italic>ij</italic></sub>&#x2014;connection weight of input layer neuron <italic>i</italic> and hidden layer neuron <italic>j</italic>. <italic>&#x03B8;</italic><sub><italic>j</italic></sub>&#x2014;threshold value of hidden layer neuron <italic>j</italic>. <italic>f</italic>(<italic>I</italic><sub><italic>j</italic></sub>)&#x2014;activation function of neurons.</p>
<p>Similarly, the output signal of the output layer of BP neural network is obtained as follows:</p>
<p><disp-formula id="eqn-2"><label>(2)</label>
<mml:math id="mml-eqn-2" display="block"><mml:mtable columnalign="left" rowspacing=".5em" columnspacing="thickmathspace" displaystyle="true"><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>l</mml:mi></mml:munderover><mml:mrow><mml:mrow><mml:msub><mml:mi>&#x03BC;</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>&#x03B2;</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mtext>&#xA0;</mml:mtext><mml:mrow></mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mi>I</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mrow></mml:mrow><mml:mtext>&#x00A0;</mml:mtext><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mi>m</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math>
</disp-formula></p>
<p>In the formula, <italic>&#x03BC;</italic><sub><italic>jk</italic></sub>&#x2014;connection weight of output layer neuron <italic>k</italic> and hidden layer neuron <italic>j</italic>.</p>
<p><italic>&#x03B2;</italic><sub><italic>k</italic></sub>&#x2014;threshold value of output layer neuron <italic>k</italic>. <italic>f</italic>(<italic>I</italic><sub><italic>k</italic></sub>)&#x2014;activation function of neurons.</p>
<p>This paper systematically analyzed the learning steps of BP neural network.</p>
<p>a) Initialize parameters of neural network</p>
<p>The connection weights <italic>v</italic><sub><italic>ij</italic></sub> and <italic>&#x03BC;</italic><sub><italic>jk</italic></sub> of each layer of neurons are given a random number between [&#x2212;1, 1]. The learning rate <italic>&#x03B7;</italic> is set to a decimal within 0&#x007E;1. The error <italic>E</italic> is set to 0. The error threshold <italic>E</italic><sub><italic>min</italic></sub> is set to a positive decimal. The number of hidden layer nodes <italic>m</italic> is obtained by an empirical formula. The sample mode calculator <italic>p</italic> and training times <italic>q</italic> are reset to 1. The default number of workouts is <italic>M</italic>.</p>
<p>b) Input training samples and calculate output of each layer</p>
<p>A pair of training samples (<italic>X</italic><sup><italic>P</italic></sup>, <italic>Q</italic><sup><italic>P</italic></sup>) are selected to assign values of the input parameters, and the output <italic>O</italic>, <italic>Y</italic> are calculated.</p>
<p>c) Calculating the output error of neural network</p>
<p>Suppose the total number of training samples is <italic>P</italic>. The error of each training is <inline-formula id="ieqn-1">
<mml:math id="mml-ieqn-1"><mml:mrow><mml:msup><mml:mi>E</mml:mi><mml:mi>p</mml:mi></mml:msup></mml:mrow><mml:mo>=</mml:mo><mml:msqrt><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>l</mml:mi></mml:munderover><mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msubsup><mml:mi>q</mml:mi><mml:mi>k</mml:mi><mml:mi>p</mml:mi></mml:msubsup><mml:mo>&#x2212;</mml:mo><mml:msubsup><mml:mi>y</mml:mi><mml:mi>k</mml:mi><mml:mi>p</mml:mi></mml:msubsup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mrow></mml:msqrt></mml:math>
</inline-formula> . The total output error is <inline-formula id="ieqn-2">
<mml:math id="mml-ieqn-2"><mml:mrow><mml:msub><mml:mi>E</mml:mi><mml:mrow><mml:mi>R</mml:mi><mml:mi>M</mml:mi><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:msqrt><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mi>p</mml:mi></mml:mfrac></mml:mrow><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>P</mml:mi></mml:munderover><mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi>E</mml:mi><mml:mi>p</mml:mi></mml:msup></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:mrow></mml:mstyle></mml:msqrt></mml:math>
</inline-formula>.</p>
<p>d) Calculate error signal of each layer</p>
<p>The error calculation formula of output layer and hidden layer is as follows:</p>
<p><disp-formula id="eqn-3"><label>(3)</label>
<mml:math id="mml-eqn-3" display="block"><mml:msubsup><mml:mi>&#x03B4;</mml:mi><mml:mi>k</mml:mi><mml:mi>y</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mi>q</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</disp-formula></p>
<p>The error calculation formula of hidden layer and input layer is as follows:</p>
<p><disp-formula id="eqn-4"><label>(4)</label>
<mml:math id="mml-eqn-4" display="block"><mml:msubsup><mml:mi>&#x03B4;</mml:mi><mml:mi>j</mml:mi><mml:mi>O</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mn>1</mml:mn><mml:mi>l</mml:mi></mml:munderover><mml:mrow><mml:msubsup><mml:mi>&#x03B4;</mml:mi><mml:mi>k</mml:mi><mml:mi>y</mml:mi></mml:msubsup><mml:mrow><mml:msub><mml:mi>&#x03BC;</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</disp-formula></p>
<p>e) Adjust connection weight and threshold of each layer</p>
<p>The calculation formula of connection weight and threshold of output layer and hidden layer are as follows:</p>
<p><disp-formula id="eqn-5"><label>(5)</label>
<mml:math id="mml-eqn-5" display="block"><mml:mi mathvariant="normal">&#x0394;</mml:mi><mml:mrow><mml:msub><mml:mi>&#x03BC;</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x03B7;</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mi>q</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math>
</disp-formula></p>
<p><disp-formula id="eqn-6"><label>(6)</label>
<mml:math id="mml-eqn-6" display="block"><mml:mi mathvariant="normal">&#x0394;</mml:mi><mml:mrow><mml:msub><mml:mi>&#x03B2;</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x03B7;</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mi>q</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</disp-formula></p>
<p>The calculation formula of connection weight and threshold value of hidden layer and input layer are as follows:</p>
<p><disp-formula id="eqn-7"><label>(7)</label>
<mml:math id="mml-eqn-7" display="block"><mml:mi mathvariant="normal">&#x0394;</mml:mi><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x03B7;</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mn>1</mml:mn><mml:mi>l</mml:mi></mml:munderover><mml:mrow><mml:msubsup><mml:mi>&#x03B4;</mml:mi><mml:mi>k</mml:mi><mml:mi>y</mml:mi></mml:msubsup><mml:mrow><mml:msub><mml:mi>&#x03BC;</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math>
</disp-formula></p>
<p><disp-formula id="eqn-8"><label>(8)</label>
<mml:math id="mml-eqn-8" display="block"><mml:mi mathvariant="normal">&#x0394;</mml:mi><mml:mrow><mml:msub><mml:mi>&#x03B8;</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x03B7;</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mn>1</mml:mn><mml:mi>l</mml:mi></mml:munderover><mml:mrow><mml:msubsup><mml:mi>&#x03B4;</mml:mi><mml:mi>k</mml:mi><mml:mi>y</mml:mi></mml:msubsup><mml:mrow><mml:msub><mml:mi>&#x03BC;</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>O</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</disp-formula></p>
<p>f) Determine whether to complete one training for all samples</p>
<p>If <italic>p</italic> &#x003C; <italic>P</italic>, <italic>p</italic>, <italic>q</italic> increased by 1, return to Step b. Otherwise, go to Step g.</p>
<p>g) Check whether the total error of neural network meets the error threshold</p>
<p><italic>E<sub>RME</sub> &#x003C; E</italic><sub>min</sub> or <italic>q</italic> &#x003E; <italic>M</italic>, end. Otherwise, <italic>E</italic> is reset to 0, <italic>p</italic> is reset to 1, return to Step b.</p>
</sec>
<sec id="s3_2">
<label>3.2</label>
<title>Particle Swarm Optimization Algorithm (PSO)</title>
<p>The BP neural network has its own defects. It is difficult to get the optimal value of the connection weight and threshold value, which eventually results in a large error between the prediction result and the actual value of BP neural network. Therefore, it is necessary to combine another optimal solution algorithm with the BP neural network to improve the accuracy of prediction. In this paper, the ability of PSO to search the optimal solution globally is used together with BP network to improve the prediction accuracy. The principle and model of PSO [<xref ref-type="bibr" rid="ref-15">15</xref>] are as follows: The <italic>M</italic> particles are initialized to form a &#x201C;bird swarm&#x201D; <inline-formula id="ieqn-3">
<mml:math id="mml-ieqn-3"><mml:mi>T</mml:mi><mml:mrow><mml:mtext>&#x00A0;</mml:mtext><mml:mo>=</mml:mo><mml:mtext>&#xA0;</mml:mtext></mml:mrow><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>Z</mml:mi><mml:mi>M</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>}</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mi>M</mml:mi><mml:mo>.</mml:mo></mml:math>
</inline-formula> <inline-formula id="ieqn-4">
<mml:math id="mml-ieqn-4"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mi>M</mml:mi></mml:math>
</inline-formula>, which represents the position vector of the <italic>i</italic>-th particle in D-dimensional space. <inline-formula id="ieqn-5">
<mml:math id="mml-ieqn-5"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mi>M</mml:mi></mml:math>
</inline-formula> represents the velocity vector of the <italic>i</italic>-th particle in D-dimensional space. The flight motion experience of the particle itself is <inline-formula id="ieqn-6">
<mml:math id="mml-ieqn-6"><mml:mi>P</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>P</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mi>P</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mi>P</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</inline-formula>. The global optimal position is <inline-formula id="ieqn-7">
<mml:math id="mml-ieqn-7"><mml:mi>G</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>G</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mi>G</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mo>&#x2026;</mml:mo><mml:mo>,</mml:mo><mml:mi>G</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</inline-formula>. The recurrence formula of particle algorithm is:</p>
<p><disp-formula id="eqn-9"><label>(9)</label>
<mml:math id="mml-eqn-9" display="block"><mml:mtable columnalign="left" rowspacing=".5em" columnspacing="thickmathspace" displaystyle="true"><mml:mtr><mml:mtd><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mi>k</mml:mi></mml:msubsup><mml:mo>+</mml:mo><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>P</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:msubsup><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mi>k</mml:mi></mml:msubsup></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>+</mml:mo><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>G</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>d</mml:mi></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:msubsup><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mi>k</mml:mi></mml:msubsup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:msubsup><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msubsup><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mi>k</mml:mi></mml:msubsup><mml:mo>+</mml:mo><mml:msubsup><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup></mml:mtd></mml:mtr></mml:mtable></mml:math>
</disp-formula></p>
<p>In the formula, <inline-formula id="ieqn-8">
<mml:math id="mml-ieqn-8"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>P</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:msubsup><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mi>k</mml:mi></mml:msubsup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</inline-formula>&#x2014;the memory ability of particles to their optimal position. At the same time, <inline-formula id="ieqn-9">
<mml:math id="mml-ieqn-9"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>G</mml:mi><mml:mi>b</mml:mi><mml:mi>e</mml:mi><mml:mi>s</mml:mi><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mi>d</mml:mi></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:msubsup><mml:mi>z</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi></mml:mrow><mml:mi>k</mml:mi></mml:msubsup></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</inline-formula>&#x2014;reflect the information sharing among particles.</p>
</sec>
<sec id="s3_3">
<label>3.3</label>
<title>Optimization of BP Neural Network Based on PSO</title>
<p>In this paper, the main steps of BP neural network based on PSO are as follows:</p>
<p>a) Initialization parameters.</p>
<p>Determine the topological structure of the BP neural network, initially set connect the weights and thresholds, and determine the particle swarm dimension <italic>D</italic> according to the number of weights and thresholds. Set the population size <italic>M</italic> and the number of iterations <italic>N</italic>. real code The weights and thresholds of the BP neural network are coded to obtain the initial population. In addition, the particle speed <italic>s</italic><sub><italic>i,d</italic></sub> and position <italic>z</italic><sub><italic>i,d</italic></sub> are set within the allowable range [<italic>s</italic><sub><italic>min</italic>,</sub> <italic>s</italic><sub><italic>max</italic></sub>], [<italic>z</italic><sub><italic>min</italic>,</sub> <italic>z</italic><sub><italic>max</italic></sub>], and set the learning factors <italic>c</italic><sub><italic>1</italic>,</sub> <italic>c</italic><sub><italic>2</italic></sub>.</p>
<p>b) The mean square error of each iteration in neural network is taken as the fitness function of particles.</p>
<p>c) According to the steps of particle swarm optimization algorithm, the global optimal position of particles is solved.</p>
<p>d) Check whether the iteration termination condition is met, if satisfied, stop, output the optimal particle, and decode it to get the optimal weight and threshold.</p>
<p>e) Training and prediction according to BP neural network.</p>
</sec>
</sec>
<sec id="s4">
<label>4</label>
<title>Early Warning Model of Sticking</title>
<p>The algorithm based on particle swarm optimization (PSO) to optimize BP neural network is applied to early warning of sticking. In this paper, an intelligent and real-time quantitative evaluation method for downhole drilling risks is proposed, which is advanced compared to the existing qualitative and semi-quantitative assessment methods. This method includes the design of BP neural network, the design of particle swarm optimization algorithm and the prepossessing of model input parameters.</p>
<sec id="s4_1">
<label>4.1</label>
<title>BP Neural Network Design</title>
<p>a) Input layer design</p>
<p>According to the expert knowledge, the six input neurons are set by selecting the characterization parameters with strong correlation with the sticking: hook load, standpipe pressure, torque, rate of penetration, rotary speed, and weight on bit.</p>
<p>b) Output layer design</p>
<p>This paper mainly deals with the identification of sticking. It only needs to judge whether it occurs and how likely it will happen. Therefore, there are two output neurons: expected output vector of sticking <italic>q</italic><sub><italic>1</italic></sub> &#x003D; (1, 0), expected output vector of no sticking <italic>q</italic><sub><italic>2</italic></sub> &#x003D; (0, 1).</p>
<p>c) Hidden layer design</p>
<p>In this paper, the number of hidden layers is set to 10 through research, and the result is most consistent with the actual situation.</p>
<p>Finally, the BP neural network structure is established, as shown in <xref ref-type="fig" rid="fig-1">Fig. 1</xref>.</p>
<fig id="fig-1">
<label>Figure 1</label>
<caption>
<title>Schematic diagram of BP neural network structure for early warning of sticking</title></caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="FDMP_25349-fig-1.tif"/>
</fig>
</sec>
<sec id="s4_2">
<label>4.2</label>
<title>PSO Design</title>
<p>a) Particle coding</p>
<p>The structure of neural network is 6-10-2, as shown in <xref ref-type="fig" rid="fig-2">Fig. 2</xref>. Therefore, there are 6 &#x00D7; 10 &#x002B; 10 &#x00D7; 2 &#x003D; 80 weight vectors and 10 &#x002B; 2 &#x003D; 12 threshold vectors. The number of particle swarm optimization parameters is 92, and the particle length is 92.</p>
<fig id="fig-2">
<label>Figure 2</label>
<caption>
<title>Schematic diagram of PSO-BP for early warning of sticking</title></caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="FDMP_25349-fig-2.tif"/>
</fig>
<p>In this paper, the vector coding is used, and particle <italic>i</italic> is encoded as follows:</p>
<p><disp-formula id="eqn-10"><label>(10)</label>
<mml:math id="mml-eqn-10" display="block"><mml:mtable columnalign="right left" rowspacing=".5em" columnspacing="thickmathspace" displaystyle="true"><mml:mtr><mml:mtd><mml:mi>p</mml:mi><mml:mi>a</mml:mi><mml:mi>r</mml:mi><mml:mi>t</mml:mi><mml:mi>i</mml:mi><mml:mi>c</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mo stretchy="false">[</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>10</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>10</mml:mn><mml:mo>,</mml:mo><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>19</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>19</mml:mn><mml:mo>,</mml:mo><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mrow></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd /><mml:mtd><mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>20</mml:mn><mml:mo>,</mml:mo><mml:mn>10</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>20</mml:mn><mml:mo>,</mml:mo><mml:mn>19</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>21</mml:mn><mml:mo>,</mml:mo><mml:mn>10</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mn>21</mml:mn><mml:mo>,</mml:mo><mml:mn>19</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mrow></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd /><mml:mtd><mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mi>&#x03B2;</mml:mi><mml:mrow><mml:mn>10</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>&#x03B2;</mml:mi><mml:mrow><mml:mn>19</mml:mn><mml:mo>,</mml:mo><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>&#x03B2;</mml:mi><mml:mrow><mml:mn>20</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x22EF;</mml:mo><mml:mrow><mml:msub><mml:mi>&#x03B2;</mml:mi><mml:mrow><mml:mn>21</mml:mn><mml:mo>,</mml:mo><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">]</mml:mo><mml:mrow></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math>
</disp-formula></p>
<p>b) Fitness function</p>
<p>The root mean square error of BP network training is taken as fitness function:</p>
<p><disp-formula id="eqn-11"><label>(11)</label>
<mml:math id="mml-eqn-11" display="block"><mml:mi>M</mml:mi><mml:mi>E</mml:mi><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mn>2</mml:mn><mml:mi>M</mml:mi></mml:mrow></mml:mfrac></mml:mrow><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>M</mml:mi></mml:munderover><mml:mrow><mml:munderover><mml:mo movablelimits="false">&#x2211;</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>l</mml:mi></mml:munderover><mml:mrow><mml:msqrt><mml:mrow><mml:msup><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>q</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:msqrt></mml:mrow></mml:mrow></mml:mstyle></mml:math>
</disp-formula></p>
<p>c) Data processing</p>
<p>To avoid the increasing error of network prediction result caused by the large difference of input and output data, the data normalization is carried out. In this paper, the minimum-maximum method is used for normalization [<xref ref-type="bibr" rid="ref-16">16</xref>,<xref ref-type="bibr" rid="ref-17">17</xref>]:</p>
<p><disp-formula id="eqn-12"><label>(12)</label>
<mml:math id="mml-eqn-12" display="block"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mfrac><mml:mrow><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>k</mml:mi></mml:msub></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>m</mml:mi><mml:mi>e</mml:mi><mml:mi>a</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mi>var</mml:mi></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:mfrac></mml:mrow></mml:mstyle></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math>
</disp-formula></p>
<p>In formula, <italic>x</italic><sub><italic>min</italic></sub>, <italic>x</italic><sub><italic>max</italic></sub>&#x2014;minimum and maximum values of logging data.</p>
</sec>
</sec>
<sec id="s5">
<label>5</label>
<title>Training and Optimization of Early Sticking Warning Model</title>
<p>Combined with the field practice of shale gas drilling in South Sichuan, the comprehensive logging data of sticking are selected as the training samples to train and optimize the early warning model of sticking.</p>
<sec id="s5_1">
<label>5.1</label>
<title>Algorithmic Control Elements</title>
<p>The elements of BP neural network and particle swarm optimization algorithm in the early warning model of sticking are set, as shown in <xref ref-type="table" rid="table-2">Table 2</xref>.</p>
<table-wrap id="table-2"><label>Table 2</label>
<caption>
<title>Algorithmic control elements</title></caption>
<table><colgroup>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>Algorithm</th>
<th>Basic elements</th>
<th>Control value</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="5">BP</td>
<td>Target error</td>
<td>0.0001</td>
</tr>
<tr>
<td>Learning rate</td>
<td>0.01</td>
</tr>
<tr>
<td>Maximum training times</td>
<td>100</td>
</tr>
<tr>
<td>Implicit output layer transfer function</td>
<td>log-Sigmoid</td>
</tr>
<tr>
<td>Initial connection weights and thresholds</td>
<td>[&#x2212;1,1] random number</td>
</tr>
<tr>
<td rowspan="4">PSO</td>
<td>Population size</td>
<td>30</td>
</tr>
<tr>
<td>Iteration times</td>
<td>100</td>
</tr>
<tr>
<td>Particle length</td>
<td>92</td>
</tr>
<tr>
<td>Learning factor</td>
<td><italic>c</italic><sub>1</sub> &#x003D; <italic>c</italic><sub>2</sub> &#x003D; 2.0</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s5_2">
<label>5.2</label>
<title>Model Training and Simulating</title>
<p>Based on the logging and well history data of seven sticking wells in South Sichuan shale gas work area (XX-1, XX-2, XX-3, XX-4, XX-5, XX-6, and XX-8), the sixteen sets of working condition data are selected as samples, eight sets of data correspond to sticking and eight sets of data correspond to no sticking. The comprehensive logging parameters monitored in given time period before and after the occurrence of sticking are selected and normalized according to the minimum-maximum method. The results are shown in <xref ref-type="table" rid="table-3">Table 3</xref>. The first twelve groups of samples are selected as training samples to train the model, and the other four groups of samples as verification samples to verify the accuracy of the model.</p>
<table-wrap id="table-3"><label>Table 3</label>
<caption>
<title>Network training simulation sample</title></caption>
<table><colgroup>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>Sample<break/>category</th>
<th>Number</th>
<th>WHO</th>
<th>SPP</th>
<th>RPM</th>
<th>TOR</th>
<th>WOB</th>
<th>ROP</th>
<th>Condition type</th>
<th>Expect<break/>vector</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="12">Training sample</td>
<td style="background:#FFFFFF;">1</td>
<td style="background:#FFFFFF;">0.89</td>
<td style="background:#FFFFFF;">0.91</td>
<td style="background:#FFFFFF;">0.07</td>
<td style="background:#FFFFFF;">0.94</td>
<td style="background:#FFFFFF;">0.67</td>
<td style="background:#FFFFFF;">0.003</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">2</td>
<td style="background:#FFFFFF;">0.95</td>
<td style="background:#FFFFFF;">0.87</td>
<td style="background:#FFFFFF;">0.01</td>
<td style="background:#FFFFFF;">0.88</td>
<td style="background:#FFFFFF;">0.74</td>
<td style="background:#FFFFFF;">0.004</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">3</td>
<td style="background:#FFFFFF;">0.94</td>
<td style="background:#FFFFFF;">0.85</td>
<td style="background:#FFFFFF;">0.03</td>
<td style="background:#FFFFFF;">0.89</td>
<td style="background:#FFFFFF;">0.78</td>
<td style="background:#FFFFFF;">0.005</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">4</td>
<td style="background:#FFFFFF;">1</td>
<td style="background:#FFFFFF;">0.97</td>
<td style="background:#FFFFFF;">0.03</td>
<td style="background:#FFFFFF;">0.98</td>
<td style="background:#FFFFFF;">0.65</td>
<td style="background:#FFFFFF;">0.004</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">5</td>
<td style="background:#FFFFFF;">0.98</td>
<td style="background:#FFFFFF;">0.96</td>
<td style="background:#FFFFFF;">0.02</td>
<td style="background:#FFFFFF;">1</td>
<td style="background:#FFFFFF;">0.71</td>
<td style="background:#FFFFFF;">0.002</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">6</td>
<td style="background:#FFFFFF;">0.84</td>
<td style="background:#FFFFFF;">0.95</td>
<td style="background:#FFFFFF;">0.02</td>
<td style="background:#FFFFFF;">0.87</td>
<td style="background:#FFFFFF;">0.73</td>
<td style="background:#FFFFFF;">0.004</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">7</td>
<td style="background:#FFFFFF;">0.57</td>
<td style="background:#FFFFFF;">0.23</td>
<td style="background:#FFFFFF;">0.66</td>
<td style="background:#FFFFFF;">0.11</td>
<td style="background:#FFFFFF;">0.94</td>
<td style="background:#FFFFFF;">0.15</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">8</td>
<td style="background:#FFFFFF;">0.43</td>
<td style="background:#FFFFFF;">0.17</td>
<td style="background:#FFFFFF;">0.66</td>
<td style="background:#FFFFFF;">0.24</td>
<td style="background:#FFFFFF;">0.89</td>
<td style="background:#FFFFFF;">0.11</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">9</td>
<td style="background:#FFFFFF;">0.61</td>
<td style="background:#FFFFFF;">0.09</td>
<td style="background:#FFFFFF;">0.65</td>
<td style="background:#FFFFFF;">0.21</td>
<td style="background:#FFFFFF;">0.97</td>
<td style="background:#FFFFFF;">0.21</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">10</td>
<td style="background:#FFFFFF;">0.58</td>
<td style="background:#FFFFFF;">0.12</td>
<td style="background:#FFFFFF;">0.68</td>
<td style="background:#FFFFFF;">0.13</td>
<td style="background:#FFFFFF;">1</td>
<td style="background:#FFFFFF;">0.17</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">11</td>
<td style="background:#FFFFFF;">0.61</td>
<td style="background:#FFFFFF;">0.15</td>
<td style="background:#FFFFFF;">0.72</td>
<td style="background:#FFFFFF;">0.19</td>
<td style="background:#FFFFFF;">0.95</td>
<td style="background:#FFFFFF;">0.23</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">12</td>
<td style="background:#FFFFFF;">0.46</td>
<td style="background:#FFFFFF;">0.27</td>
<td style="background:#FFFFFF;">0.63</td>
<td style="background:#FFFFFF;">0.26</td>
<td style="background:#FFFFFF;">0.87</td>
<td style="background:#FFFFFF;">0.24</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td rowspan="4">Verification<break/>sample</td>
<td style="background:#FFFFFF;">13</td>
<td style="background:#FFFFFF;">0.88</td>
<td style="background:#FFFFFF;">0.90</td>
<td style="background:#FFFFFF;">0.01</td>
<td style="background:#FFFFFF;">0.91</td>
<td style="background:#FFFFFF;">0.66</td>
<td style="background:#FFFFFF;">0.005</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">14</td>
<td style="background:#FFFFFF;">0.99</td>
<td style="background:#FFFFFF;">0.96</td>
<td style="background:#FFFFFF;">0.04</td>
<td style="background:#FFFFFF;">0.95</td>
<td style="background:#FFFFFF;">0.81</td>
<td style="background:#FFFFFF;">0.004</td>
<td style="background:#FFFFFF;">Sticking</td>
<td style="background:#FFFFFF;">(1,0)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">15</td>
<td style="background:#FFFFFF;">0.37</td>
<td style="background:#FFFFFF;">0.25</td>
<td style="background:#FFFFFF;">0.71</td>
<td style="background:#FFFFFF;">0.11</td>
<td style="background:#FFFFFF;">0.98</td>
<td style="background:#FFFFFF;">0.30</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
<tr>
<td style="background:#FFFFFF;">16</td>
<td style="background:#FFFFFF;">0.44</td>
<td style="background:#FFFFFF;">0.31</td>
<td style="background:#FFFFFF;">0.68</td>
<td style="background:#FFFFFF;">0.19</td>
<td style="background:#FFFFFF;">0.89</td>
<td style="background:#FFFFFF;">0.28</td>
<td style="background:#FFFFFF;">No sticking</td>
<td style="background:#FFFFFF;">(0,1)</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The training results of the sticking model are shown in <xref ref-type="table" rid="table-4">Table 4</xref>. The conclusions are listed below: the simulation results are consistent with the actual downhole state, which shows that the training model can be applied to the early warning of sticking in the block.</p>
<table-wrap id="table-4"><label>Table 4</label>
<caption>
<title>Simulation results of early warning model training for sticking</title></caption>
<table><colgroup>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>Sample category</th>
<th>Number</th>
<th><italic>q</italic><sub>1</sub></th>
<th><italic>q</italic><sub>2</sub></th>
<th>Condition type</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="12">Simulation training sample</td>
<td>1</td>
<td style="background:#FFFFFF;">0.96864</td>
<td style="background:#FFFFFF;">0.033179</td>
<td>Sticking</td>
</tr>
<tr>
<td>2</td>
<td style="background:#FFFFFF;">0.9775</td>
<td style="background:#FFFFFF;">0.035743</td>
<td>Sticking</td>
</tr>
<tr>
<td>3</td>
<td style="background:#FFFFFF;">0.61327</td>
<td style="background:#FFFFFF;">0.010748</td>
<td>Sticking</td>
</tr>
<tr>
<td>4</td>
<td style="background:#FFFFFF;">0.77001</td>
<td style="background:#FFFFFF;">0.017822</td>
<td>Sticking</td>
</tr>
<tr>
<td>5</td>
<td style="background:#FFFFFF;">0.55134</td>
<td style="background:#FFFFFF;">0.002513</td>
<td>Sticking</td>
</tr>
<tr>
<td>6</td>
<td style="background:#FFFFFF;">0.86937</td>
<td style="background:#FFFFFF;">0.013817</td>
<td>Sticking</td>
</tr>
<tr>
<td>7</td>
<td style="background:#FFFFFF;">0.008818</td>
<td style="background:#FFFFFF;">0.98627</td>
<td>No sticking</td>
</tr>
<tr>
<td>8</td>
<td style="background:#FFFFFF;">0.005764</td>
<td style="background:#FFFFFF;">0.99378</td>
<td>No sticking</td>
</tr>
<tr>
<td>9</td>
<td style="background:#FFFFFF;">0.013284</td>
<td style="background:#FFFFFF;">0.77387</td>
<td>No sticking</td>
</tr>
<tr>
<td>10</td>
<td style="background:#FFFFFF;">0.00525</td>
<td style="background:#FFFFFF;">0.95334</td>
<td>No sticking</td>
</tr>
<tr>
<td>11</td>
<td style="background:#FFFFFF;">0.021962</td>
<td style="background:#FFFFFF;">0.94467</td>
<td>No sticking</td>
</tr>
<tr>
<td>12</td>
<td style="background:#FFFFFF;">0.03491</td>
<td style="background:#FFFFFF;">0.79564</td>
<td>No sticking</td>
</tr>
<tr>
<td rowspan="4">Verification sample</td>
<td>13</td>
<td style="background:#FFFFFF;">0.94875</td>
<td style="background:#FFFFFF;">0.006218</td>
<td>Sticking</td>
</tr>
<tr>
<td>14</td>
<td style="background:#FFFFFF;">0.889748</td>
<td style="background:#FFFFFF;">0.014785</td>
<td>Sticking</td>
</tr>
<tr>
<td>15</td>
<td style="background:#FFFFFF;">0.029633</td>
<td style="background:#FFFFFF;">0.89496</td>
<td>No sticking</td>
</tr>
<tr>
<td>16</td>
<td style="background:#FFFFFF;">0.001178</td>
<td style="background:#FFFFFF;">0.99815</td>
<td>No sticking</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s5_3">
<label>5.3</label>
<title>Application of Sticking Warning Model</title>
<p>To verify the accuracy of the developed early warning model, the being drilled WY-XX well in South Sichuan work area is selected for trial analysis. In the process of drilling in the fourth spud horizontal section, the sticking early warning model developed in this paper was used to conduct the real-time diagnosis of sticking. The probability of the sticking fault diagnosed at 4279 m was high (as shown in <xref ref-type="table" rid="table-5">Table 5</xref>), and the drill sticking early warning information was timely sent to the driller operator. After drilling the column to 4280 m, the technicians took corresponding measures to avoid sticking. Thus, the possible sticking was effectively avoided. The field test application showed that the model developed in this paper can diagnose the sticking in real time, and the accuracy and efficiency of risk identification can meet the needs of field drilling operations and effectively ensure the safety of drilling operations.</p>
<table-wrap id="table-5"><label>Table 5</label>
<caption>
<title>Real time warning result of sticking</title></caption>
<table><colgroup>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>Depth<break/>/m</th>
<th>WHO</th>
<th>SPP</th>
<th>RPM</th>
<th>TOR</th>
<th>WOB</th>
<th>ROP</th>
<th>Calculation results (<italic>q</italic><sub>1</sub>, <italic>q</italic><sub>2</sub>)</th>
<th>Warning results</th>
</tr>
</thead>
<tbody>
<tr>
<td>4276</td>
<td>0.61</td>
<td>0.15</td>
<td>0.72</td>
<td>0.19</td>
<td>0.95</td>
<td>0.23</td>
<td>(0.0208, 0.9533)</td>
<td>No sticking</td>
</tr>
<tr>
<td>4277</td>
<td>0.58</td>
<td>0.12</td>
<td>0.68</td>
<td>0.23</td>
<td>1</td>
<td>0.17</td>
<td>(0.1371, 0.7862)</td>
<td>No sticking</td>
</tr>
<tr>
<td>4278</td>
<td>0.48</td>
<td>0.16</td>
<td>0.72</td>
<td>0.29</td>
<td>0.92</td>
<td>0.27</td>
<td>(0.2343, 0.6701)</td>
<td>No sticking</td>
</tr>
<tr>
<td>4279</td>
<td>0.98</td>
<td>0.96</td>
<td>0.02</td>
<td>1</td>
<td>0.71</td>
<td>0.002</td>
<td>(0.7037, 0.3491)</td>
<td>Sticking</td>
</tr>
<tr>
<td>4280</td>
<td>1</td>
<td>0.97</td>
<td>0.03</td>
<td>0.98</td>
<td>0.65</td>
<td>0.004</td>
<td>(0.7664, 0.2327)</td>
<td>Sticking</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
</sec>
<sec id="s6">
<label>6</label>
<title>Conclusion</title>
<p>(1) The traditional sticking fault prediction relies heavily on the subjective judgment of experts, and the results are mostly qualitative or semi-quantitative. In this paper, the method for early-warning of sticking is proposed, which utilizes the intelligent and real-time quantitative judgment of sticking, and solves the problems of poor comprehensive utilization of monitoring information, insufficient early warning of risk, and strong subjectivity.</p>
<p>(2) The error training function of BP neural network is not a strict convex function, thus it is easy to fall into local minimum when searching for the optimal connection weight and threshold value. The defects of BP network affect the accuracy of dynamic risk assessment results. The ability of a global searching optimal solution based on PSO can make up for the defect of local optimization of BP neural network.</p>
<p>(3) A case study and application of the developed early warning model for sticking was carried out. The twelve sets of sticking diagnostic results obtained by simulation were all consistent with the actual downhole state. Further, the results of four groups of verification samples were also consistent with the actual downhole state, which demostrated that the model developed by training can be applied to the early warning and recognition of sticking.</p>
</sec>
</body>
<back>
<sec>
<title>Funding Statement</title>
<p>The project is supported by CNPC Key Core Technology Research Projects (2022ZG06) received by Qing Wang and project funded by China Postdoctoral Science Foundation (2021M693508) received by Qing Wang. Basic Research and Strategic Reserve Technology Research Fund Project of Institutes directly under CNPC received by Qing Wang.</p>
</sec>
<sec sec-type="data-availability">
<title>Availability of Data and Materials</title>
<p>The data that support the findings of this study are available from the corresponding author upon reasonable request.</p>
</sec>
<sec sec-type="COI-statement">
<title>Conflicts of Interest</title>
<p>The authors declare that they have no conflicts of interest to report regarding the present study.</p>
</sec>
<ref-list content-type="authoryear">
<title>References</title>
<ref id="ref-1"><label>1.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Rotman</surname>, <given-names>D.</given-names></string-name></person-group> (<year>2013</year>). <source>Drilling for shale gas</source>. <publisher-loc>China</publisher-loc>: <publisher-name>Technology Review Press</publisher-name>.</mixed-citation></ref>
<ref id="ref-2"><label>2.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Jarvie</surname>, <given-names>D. M.</given-names></string-name></person-group> (<year>2012</year>). <article-title>Shale resource systems for oil and gas: Part 1&#x2014;Shale-gas resource systems</article-title>. <source>AAPG Memoir</source><italic>,</italic> <volume>10</volume><italic>(</italic><issue>6</issue><italic>),</italic> <fpage>89</fpage>&#x2013;<lpage>119</lpage>.</mixed-citation></ref>
<ref id="ref-3"><label>3.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Gholami</surname>, <given-names>R.</given-names></string-name>, <string-name><surname>Rabiei</surname>, <given-names>M.</given-names></string-name>, <string-name><surname>Rasouli</surname>, <given-names>V.</given-names></string-name></person-group> (<year>2015</year>). <article-title>Application of quantitative risk assessment in wellbore stability analysis</article-title>. <source>Journal of Petroleum Science and Engineering</source><italic>,</italic> <volume>135</volume><italic>(</italic><issue>3</issue><italic>),</italic> <fpage>185</fpage>&#x2013;<lpage>200</lpage>. <pub-id pub-id-type="doi">10.1016/j.petrol.2015.09.013</pub-id></mixed-citation></ref>
<ref id="ref-4"><label>4.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Mostafavi</surname>, <given-names>S.</given-names></string-name>, <string-name><surname>Adnoy</surname>, <given-names>B.</given-names></string-name>, <string-name><surname>Hareland</surname>, <given-names>G.</given-names></string-name></person-group> (<year>2011</year>). <article-title>Model based uncertainty assessment of wellbore stability analyses and downhole pressure estimations</article-title>. <source>Journal of American Rock Mechanics</source><italic>,</italic> <volume>12</volume><italic>(</italic><issue>5</issue><italic>),</italic> <fpage>60</fpage>&#x2013;<lpage>65</lpage>.</mixed-citation></ref>
<ref id="ref-5"><label>5.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Udegbunam</surname>, <given-names>J. E.</given-names></string-name>, <string-name><surname>Aadnoy</surname>, <given-names>B. S.</given-names></string-name>, <string-name><surname>Fjelde</surname>, <given-names>K. K.</given-names></string-name></person-group> (<year>2014</year>). <article-title>Uncertainty evaluation of wellbore stability model predictions</article-title>. <source>Journal of Petroleum Science &#x0026; Engineering</source><italic>,</italic> <volume>124</volume><italic>(</italic><issue>6</issue><italic>),</italic> <fpage>254</fpage>&#x2013;<lpage>263</lpage>. <pub-id pub-id-type="doi">10.1016/j.petrol.2014.09.033</pub-id></mixed-citation></ref>
<ref id="ref-6"><label>6.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Guan</surname>, <given-names>Z. C.</given-names></string-name>, <string-name><surname>Sheng</surname>, <given-names>Y.</given-names></string-name>, <string-name><surname>Xu</surname>, <given-names>Y.</given-names></string-name>, <string-name><surname>Wang</surname>, <given-names>Q.</given-names></string-name>, <string-name><surname>Zhang</surname>, <given-names>B.</given-names></string-name> <etal>et al.</etal></person-group> (<year>2017</year>). <article-title>Dynamic risk assessment method of drilling based on PSO optimized BP neural network</article-title>. <source>Journal of Safety Science and Technology</source><italic>,</italic> <volume>13</volume><italic>(</italic><issue>8</issue><italic>),</italic> <fpage>5</fpage>&#x2013;<lpage>11</lpage>.</mixed-citation></ref>
<ref id="ref-7"><label>7.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Jiang</surname>, <given-names>X.</given-names></string-name></person-group> (<year>2006</year>). <source>Drilling accidents and complex problems</source>. <publisher-loc>China</publisher-loc>: <publisher-name>Petroleum Industry Press</publisher-name>.</mixed-citation></ref>
<ref id="ref-8"><label>8.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Khakzad</surname>, <given-names>N.</given-names></string-name>, <string-name><surname>Khan</surname>, <given-names>F.</given-names></string-name>, <string-name><surname>Amyotte</surname>, <given-names>P.</given-names></string-name></person-group> (<year>2013</year>). <article-title>Quantitative risk analysis of offshore drilling operations: A bayesian approach</article-title>. <source>Safety Science</source><italic>,</italic> <volume>57</volume><italic>(</italic><issue>3</issue><italic>),</italic> <fpage>108</fpage>&#x2013;<lpage>117</lpage>. <pub-id pub-id-type="doi">10.1016/j.ssci.2013.01.022</pub-id></mixed-citation></ref>
<ref id="ref-9"><label>9.</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Ostebo</surname>, <given-names>R.</given-names></string-name>, <string-name><surname>Tronstad</surname>, <given-names>L.</given-names></string-name>, <string-name><surname>Fikse</surname>, <given-names>T.</given-names></string-name></person-group> (<year>1991</year>). <article-title>Risk analysis of drilling and well operations</article-title>. <source>SPE/IADC Drilling Conference</source>, <publisher-name>SPE 21952</publisher-name>. <publisher-loc>Houston, USA</publisher-loc>. <pub-id pub-id-type="doi">10.2118/21952-MS</pub-id></mixed-citation></ref>
<ref id="ref-10"><label>10.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Lawal</surname>, <given-names>A. I.</given-names></string-name>, <string-name><surname>Kwon</surname>, <given-names>S.</given-names></string-name></person-group> (<year>2020</year>). <article-title>Application of artificial intelligence to rock mechanics: An overview</article-title>. <source>Journal of Rock Mechanics and Geotechnical Engineering</source><italic>,</italic> <volume>14</volume><italic>(</italic><issue>6</issue><italic>),</italic> <fpage>65</fpage>&#x2013;<lpage>77</lpage>.</mixed-citation></ref>
<ref id="ref-11"><label>11.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Ali</surname>, <given-names>J. A.</given-names></string-name>, <string-name><surname>Kalhury</surname>, <given-names>A. M.</given-names></string-name>, <string-name><surname>Sabir</surname>, <given-names>A. N.</given-names></string-name></person-group> (<year>2020</year>). <article-title>A state-of-the-art review of the application of nanotechnology in the oil and gas industry with a focus on drilling engineering</article-title>. <source>Journal of Petroleum Science &#x0026; Engineering</source><italic>,</italic> <volume>16</volume><italic>(</italic><issue>5</issue><italic>),</italic> <fpage>30</fpage>&#x2013;<lpage>45</lpage>. <pub-id pub-id-type="doi">10.1016/j.petrol.2020.107118</pub-id></mixed-citation></ref>
<ref id="ref-12"><label>12.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Chen</surname>, <given-names>T.</given-names></string-name>, <string-name><surname>Guan</surname>, <given-names>Z.</given-names></string-name></person-group> (<year>2000</year>). <source>Theory and technology of drilling engineering</source>. <publisher-loc>China</publisher-loc>: <publisher-name>Petroleum University Press</publisher-name>.</mixed-citation></ref>
<ref id="ref-13"><label>13.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Liao</surname>, <given-names>T.</given-names></string-name>, <string-name><surname>Lei</surname>, <given-names>J.</given-names></string-name></person-group> (<year>2016</year>). <article-title>Current situation and development direction of mud logging technology at home and abroad</article-title>. <source>Logging Engineering</source><italic>,</italic> <volume>27</volume><italic>(</italic><issue>1</issue><italic>),</italic> <fpage>6</fpage>&#x2013;<lpage>13</lpage>.</mixed-citation></ref>
<ref id="ref-14"><label>14.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Gao</surname>, <given-names>D.</given-names></string-name></person-group> (<year>2004</year>). <source>Deep and ultra-deep well drilling technology under complex geological condition</source>. <publisher-loc>China</publisher-loc>: <publisher-name>Petroleum Industry Press</publisher-name>.</mixed-citation></ref>
<ref id="ref-15"><label>15.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Liao</surname>, <given-names>M.</given-names></string-name></person-group> (<year>2010</year>). <source>Research on real-time monitoring technology of drilling process</source>. <publisher-loc>China</publisher-loc>: <publisher-name>China University of Petroleum Press</publisher-name>.</mixed-citation></ref>
<ref id="ref-16"><label>16.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Liu</surname>, <given-names>X.</given-names></string-name></person-group> (<year>2010</year>). <article-title>Input layer normalization of BP neural network</article-title>. <source>Mechanical Engineering and Automation</source><italic>,</italic> <volume>11</volume><italic>(</italic><issue>3</issue><italic>),</italic> <fpage>122</fpage>&#x2013;<lpage>126</lpage>.</mixed-citation></ref>
<ref id="ref-17"><label>17.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Zeng</surname>, <given-names>Y.</given-names></string-name>, <string-name><surname>Liu</surname>, <given-names>J.</given-names></string-name></person-group> (<year>2005</year>). <article-title>Technical status and developmental trend of drilling techniques in deep and ultra-deep wells</article-title>. <source>Petroleum Drilling Techniques</source><italic>,</italic> <volume>33</volume><italic>(</italic><issue>5</issue><italic>),</italic> <fpage>1</fpage>&#x2013;<lpage>5</lpage>.</mixed-citation></ref>
</ref-list>
</back>
</article>






