# Study on the Vertical Stability of Drilling Wellbore under Optimized Constraints
## 2 Theoretical Methodology
### Building the Total Potential Energy Function  
From the force analysis of the wellbore in Section 2.1, the total potential energy equation of the drilled wellbore structure is obtained [27]  
\[\Pi=U+V \tag{10}\]  
where \(U\) is the elastic strain energy released by the vertical flexural deformation of the structure and \(V\) is the total external potential energy, which consists of the following components: \(W_{c}\), the change in the external potential energy of the wellbore structure caused by the self-weight; \(W_{m}\), the change in the external potential energy due to mud on the outside of the wellbore; and \(W_{w}\), the change in the external potential energy due to counterweight water on the inside of the wellbore. Since no displacement occurs under the function of forces \(R_{A}\) and \(R_{B}\), the potential energy generated by the function of forces \(R_{A}\) and \(R_{B}\) is zero. Therefore, the total potential energy equation for the wellbore structure \(\Pi\) can be written as  
\[\Pi=U+W_{c}+W_{m}+W_{w} \tag{11}\]  
The elastic strain energy of wellbore cylinder is  
\[U=\frac{1}{2}\int_{0}^{H}EI\big{(}y^{\prime\prime}\big{)}^{2}\mathrm{d}x=\frac {41 EI\pi^{4}}{32H^{3}}\delta^{2} \tag{12}\]  
where \(E\) represents the elastic modulus of the material used for the wellbore structure. Since the wellbore structure can be either fully reinforced concrete or steel plate concrete, the elastic modulus of the wellbore structure needs to be determined based on the structural form of the wellbore. For commonly encountered reinforced concrete wellbore structures, the elastic modulus of the material used for the wellbore structure \(E\) is the composite elastic modulus of the steel bar and concrete converted according to the reinforcement ratio; \(I\) is the sectional moment of inertia of the wellbore. The external potential energy change due to self-weight is  
\[W_{c}=-\frac{1}{2}\int_{0}^{H}q_{c}(H-x)\big{(}y^{\prime}\big{)}^{2}\mathrm{d}x =\  
Then, Equation (19) can then be simplified as  
\[\left(W_{w}\right)_{\rm y}=-\frac{A\delta^{4}\pi^{4}}{32H^{2}}q_{w} \tag{21}\]  
According to Equations (12)-(21), the total potential energy function of the system can be obtained  
\[\Pi=\left(-\frac{A\pi^{4}q_{w}}{32H^{2}}+q_{m}\pi^{2}\bigg{(}\frac{183\pi^{2}}{ 256H^{2}}+\frac{308}{75}\bigg{)}\right)\delta^{4}+\bigg{\{}\frac{41 EI\pi^{4}}{3 2H^{3}}+\bigg{(}1-\frac{5}{16}\pi^{2}\bigg{)}q_{c}-2q_{w}\sin^{2}\frac{\pi H_{w }}{2H}\sin^{2}\frac{\pi H_{w}}{H}\bigg{\}}\delta^{2}+0\delta \tag{22}\]  
An equivalent transformation of the Equation (22) yields  
\[A_{1}=0 \tag{23}\]  
\[A_{2}=\frac{41 EI\pi^{4}}{32H^{3}}+\bigg{(}1-\frac{5}{16}\pi^{2}\bigg{)}q_{c}-2 q_{w}\sin^{2}\frac{\pi H_{w}}{2H}\sin^{2}\frac{\pi H_{w}}{H} \tag{24}\]  
\[A_{4}=-\frac{A\pi^{4}q_{w}}{32H^{2}}+q_{m}\pi^{2}\bigg{(}\frac{183\pi^{2}}{256 H^{2}}+\frac{308}{75}\bigg{)} \tag{25}\]  
Then, set  
\[x=4\sqrt{4A_{4}}\cdot\delta \tag{26}\]  
\[m=\frac{A_{2}}{\sqrt{A_{4}}} \tag{27}\]  
\[\Pi=U+W_{c}+W_{m}+W_{w} \tag{11}\]0  
Then, the total potential energy function of the system can be written as  
\[\Pi=U+W_{c}+W_{m}+W_{w} \tag{11}\]1  
which shows that the form of the potential function satisfies the standard form of the cusp catastrophe model [28; 29]. In Equation (29), \(x\), \(m\), and \(n\) are parameters in the standard form of the total potential energy function of the cusp catastrophe model, \(x\) is the state variable of the system, and \(m\) and \(n\) are two control variables of the system. Set the first-order derivative of the total potential energy function equal to zero, then  
\[\Pi=U+W_{c}+W_{m}+W_{w} \tag{11}\]2  
Those points whose first-order derivative of the total potential energy function is zero are singularities, also known as critical points. The surface formed by the set of critical points is called the equilibrium surface, as shown in \[\Pi=U+W_{c}+W_{m}+W_{w} \tag{11}\]3  
However, critical points do not necessarily guarantee that the system is stable.