# A Model-Based Intelligent Adjustment Method of Toolface for Bent-Housing Motor
## 2 Physical Model  
### Drill String Dynamics Model for Toolface Adjustment  
According to the reference [22], the displacement of the drill string element in the torsional directions over time is as follows. \[\phi_{S_{0}}^{t_{0}+\Delta t}=\frac{2\Delta t^{2}}{2I_{S_{0}}^{t_{0}}+C_{2S_{0} }^{t_{0}}\Delta t}\bigg{[}M_{S_{0}+\frac{t}{2}}^{t_{0}}-M_{S_{0}-\frac{t}{2}}^ {t_{0}}-m_{S_{0}}^{t_{0}}+\frac{2I_{S_{0}}^{t_{0}}}{\Delta t^{2}}\phi_{S_{0}}^ {t_{0}}+\bigg{(}\frac{C_{1S_{0}}^{t_{0}}\Delta t-2I_{S_{0}}^{t_{0}}}{2\Delta t ^{2}}\bigg{)}\phi_{S_{0}}^{t_{0}-\Delta t}\bigg{]} \tag{1}\]  
where \(\Delta t\) represents the time step, \(L\) represents the spatial step, \(t_{0}\) represents the current time, \(S_{0}\) represents the displacement of the center position of the current drill string element from the zero point of the global coordinate system. \(\phi_{S_{0}}^{t_{0}+\Delta t}\), \(\phi_{S_{0}}^{t_{0}}\), and \(\phi_{S_{0}}^{t_{0}-\Delta t}\) represent the displacement in the torsion direction of the drill string element with a center position \(S_{0}\) at moments \(t_{0}+\Delta t\), \(t_{0}\), and \(t_{0}-\Delta t\). \(M_{S_{0}+\frac{t}{2}}^{t_{0}}\) and \(M_{S_{0}-\frac{t}{2}}^{t_{0}}\) represent the torque in the direction of torsion at positions \(S_{0}+\frac{t}{2}\) and \(S_{0}-\frac{t}{2}\) at time \(t_{0}\), respectively. \(m_{S_{0}}^{t_{0}}\) represents the friction resistance moment in the torsion direction acting on the drill string element. \(I_{S_{0}}^{t_{0}}\) represents the rotational inertia of the drill string element. \(C_{1S_{0}}^{t_{0}}\) represents the viscous resistance term of drilling fluid in the torsion direction. Some parameters in Equation (1) can be calculated as follows. \[M_{S_{0}+\frac{t}{2}}^{t_{0}}=\bigg{(}GI_{p}\frac{\partial\phi}{\partial s} \bigg{)}_{S_{0}+\frac{t}{2}}^{t_{0}} \tag{2}\]  
\[M_{S_{0}-\frac{t}{2}}^{t_{0}}=\bigg{(}GI_{p}\frac{\partial\phi}{\partial s} \bigg{)}_{S_{0}-\frac{t}{2}}^{t_{0}} \tag{3}\]  
\[I_{S_{0}}^{t_{0}}=\int_{S_{0}-\frac{t}{2}}^{S_{0}+\frac{t}{2}}\rho_{p}ds \tag{4}\]  
\[C_{1S_{0}}^{t_{0}}=\int_{S_{0}-\frac{t}{2}}^{S_{0}+\frac{t}{2}}c_{1}ds \tag{5}\]\[m_{S_{0}}^{t_{0}}=\text{sgn}\Big{(}\phi_{S_{0}}^{t_{0}}-\phi_{S_{0}}^{t_{0}-At} \Big{)}\int_{S_{0}-\frac{t}{2}}^{s_{0}+\frac{t}{2}}\mu_{t}F\frac{D_{O}}{2}ds \tag{6}\]  
where \(G\) is the shear modulus of the drill string element. \(I_{p}\) is the cross-sectional moment of inertia of the drill string element. \(\rho\) is the density of the drill string element. \(c_{1}\) is the viscous resistance coefficient in the torsional direction between the drilling fluid and the drill string element. \(\mu_{t}\) is the friction coefficient in the torsional direction between the drill string element and the wellbore. \(F\) is the lateral force received by the drill string element. \(D_{O}\) is the outer diameter of the drill string element. The torsional equivalent damping coefficients of drilling mud can be expressed as follows  
\[c_{1}=\pi\cdot\Big{(}D_{i}^{2}+D_{o}^{2}\Big{)}\cdot\tau_{0}\cdot L+\pi\cdot\mu _{pv}\cdot\bigg{(}\frac{D_{w}^{3}}{D_{w}-D_{o}}+D_{i}^{2}\bigg{)}\frac{\partial \phi}{\partial t}L \tag{7}\]  
where \(D_{i}\) represents the inner diameter of the drill string. \(D_{w}\) represents the well diameter. \(\tau_{0}\) represents the dynamic shear stress of drilling mud. \(\mu_{pv}\) represents the plastic viscosity of drilling mud. When the axial load of the wellhead is known, the axial tension and the normal contact force of the drill string element can be calculated from the wellhead to the bottom. The lateral force can be expressed as  
\[F=\frac{\sqrt{\big{[}(2T_{1}-W_{t})\sin\frac{\gamma}{2}+W_{n}\big{]}^{2}+W_{b} ^{2}}}{\sqrt{1+\mu_{a}^{2}}} \tag{8}\]  
when the WOB is known, the axial tension and the normal contact force of the drill string element can be calculated from the bottom to the wellhead.