## 2 Optimization Model
### Friction  
It is assumed that the support of the borehole wall to the drill-string is rigid; the drill-string elastic deformation line completely coincides with the well axis, ignoring the weight on the bit. Assuming that the bending section is divided into 500 equal parts, the expression of the well inclination angle of the microelement section is given below:  
(1) Hold section  
Figure 2 shows the stress analysis of the element string in the hold section. The axial stress balance relation of the microelement section is as follows:  
\[T_{i+1}=T_{i}\pm\mu N(L_{i+1}-L_{i})+q(L_{i+1}-L_{i})\cos\alpha \tag{7}\]  
where \(T_{i+1}\) and \(T_{i}\) are the axial forces at the upper and lower ends, respectively, of the \(i\)-section string unit, \(N\); \"\(\pm\)\" is \"+\" in the process of lifting and is \"\(-\)\" in the process of lowering; \(\mu\) is the sliding friction coefficient between the pipe string and the pipe wall, and is dimensionless; \(L_{i+1}\) and \(L_{i}\) are, respectively, the measured depths at both ends of the \(i\)-section string unit, m; \(q\) is the line weight of the string, N/m; and \(\alpha\) is the well inclination angle. The radial force balance relation is  
\[N=q\sin\alpha \tag{8}\]  
Figure 2: Force analysis of hold section. (**a**) Lifting process; (**b**) lowering process.  
Then the expression of friction force in this element segment is  
\[F=\mu q\cos\alpha \tag{9}\]  
(2) Build-up section  
Figure 3 shows the stress analysis of the build-up section unit string. According to [36], the axial force of the microsegment can be deduced as follows:  
\[T_{i+1}=(T_{i}\mp A\sin\beta_{i}-B\cos\beta_{i})e^{\mp\mu(\beta_{i+1}+\beta_{i} )}\pm A\sin\beta_{i+1}+B\cos\beta_{i+1} \tag{10}\]  
\[A=\frac{2\mu}{1+\mu^{2}}qR,\ B=\frac{\mu^{2}-1}{\mu^{2}+1}qR \tag{11}\]  
where \"\(\mp\)\" is \"\(-\)\" when \(N>0\) or is \"\(+\)\" when \(N<0\) in the process of lifting, and is \"\(+\)\" when \(N>0\) or is \"\(-\)\" when \(N<0\) in the process of lowering; \"\(\pm\)\" is \"\(+\)\" when \(N>0\) or is \"\(-\)\" when \(N<0\) in the process of lifting, and is \"\(-\)\" when \(N>0\) or is \"\(+\)\" when \(N<0\) in the process of lowering; and \(\beta_{i+1}\) and \(\beta_{i}\) are the residual angles of the upper and lower ends of the I string unit, respectively. The expression of frictional force in the microsegment is  
\[F_{i}=\pm T_{i+1}\mp T_{i}\pm qR(\cos\beta_{i+1}-\cos\beta_{i}) \tag{12}\]  
where \"\(\pm\)\" is \"\(+\)\" in the process of lifting and is \"\(-\)\" in the process of lowering; \"\(\mp\)\" is \"\(-\)\" in the process of lifting and is \"\(+\)\" in the process of lowering.  
(3) Drop-off section  
Figure 4 shows the stress analysis of the build-off section unit string. According to [36], the axial force of the microsegment can be deduced as follows:  
\[T_{i+1}=(T_{i}\pm A\sin\alpha_{i}+B\cos\alpha_{i})e^{\pm\mu(\alpha_{i+1}+\alpha _{i})}\mp A\sin\alpha_{i+1}-B\cos\alpha_{i+1} \tag{13}\]  
where \"\(\pm\)\" is \"\(+\)\" in the process of lifting and is \"\(-\)\" in the process of lowering; \"\(\mp\)\" is \"\(-\)\" in the process of lifting and is \"\(+\)\" in the process of lowering. The expression of frictional force in the microsegment is  
\[F_{i}=\pm T_{i+1}\mp T_{i}\mp qR(\sin\alpha_{i+1}-\sin\alpha_{i}) \tag{14}\]  
Figure 3: Force analysis of build-up section unit string. (**a**) Lifting process; (**b**) lowering process.  
In order to reduce the drilling difficulty, friction should be minimized as far as possible. The minimum friction objective function in the process of lifting or lowering the string in front of the target can be expressed as  
\[\text{minF}=\text{min}\left[\mu q\underset{i=1}{\overset{j}{\sum}}(L_{i}\sin \alpha_{i})+\underset{i=1}{\overset{n}{\sum}}F_{i}\right] \tag{15}\]