FSQGA based 3D complexity wellbore trajectory optimization

. Determination of the trajectory of a complex wellbore is very challenging due to the variety of possible well types, as well as the numerous complicated drilling variables and constraints. The well type could be directional wells, cluster wells, horizontal wells, extended reach wells, redrilling wells, and complex structure wells, etc. The drilling variables and constraints include wellbore length, inclination hold angles, azimuth angles, dogleg severity, true vertical depths, lateral length, casing setting depths, and true vertical depth. In this paper, we propose and develop an improved computational model based on Fibonacci sequence to adjust the quantum rotation step in quantum genetic algorithm for achieving cost-ef ﬁ cient complex wellbore trajectories. By using Fibonacci sequence based quantum genetic algorithm (FSQGA) in a complex searching problem, we can ﬁ nd high-quality globally optimal solutions with high speed through a parallel process. The simulation results show that FSQGA can signi ﬁ cantly reduce computation complexity, and reach minimum objection values faster. Meanwhile, minimization of the true measurement depth of complex wellbore trajectory in actual gas-oil ﬁ eld shows that the drilling cost can be reduced up to 4.65%. We believe this new algorithm has the potential to improve drilling ef ﬁ ciency, to reduce the drilling time and drilling cost in real-time wellbore trajectory control.


Introduction
The number of unconventional oil and gas wells, including deviated well, highly-deviated well, extended reach well, horizontal well, etc., is steadily increasing over past years. Many of them are in the complex and fiercest of drilling fields, such as in deepwater, deep stratum, and polar fields (Ma et al., 2015). Though directional and horizontal drillings are more expensive than vertical drilling, they have the potential to significantly increase well productivity and to deliver a lower overall cost of supply on a cost/ unit of gas and oil produced (Dalzell, 2013). Finding minimum trajectory length and more accurate well paths to the predetermined target are two key factors in reducing drilling time and overall well cost in directional and horizontal drillings, and at the same time reducing the risk of drilling (Karimpour et al., 2016). Thus, optimizing the trajectory of complex wellbores is of great interest to minimize drilling time and cost in drilling industry. One key method to increase efficiency and successful drilling is using optimum drilling technique in trajectory wellbore designing and accurate trajectory controlling.
Complex wellbore trajectories can be optimized in various ways with the common objective of minimizing the true measured depth (TMD) of multi-targets leading to a horizontal section in the reservoir. The trajectory design model for an objective function was originally proposed by Adams and Charrier (Adams and Charrier, 1985). In 2014, using the novel particle swarm algorithm (NPSO), a deviated well trajectory design illustrated that the geometrical distances and angles need to be considered in calculating the minimum well paths (Atashnezhad et al., 2014). In 2015, a 3D well path was designed using a multi-objective genetic algorithm (Mansouri et al., 2015). In 2016, David A. Wood applied Hybrid cuckoo search optimization (HCSO) algorithm to deal with the complex wellbore trajectories optimization (Wood, 2016a). In 2016, Wood proposed metaheuristic profiling to assess performance of hybrid evolutionary optimization algorithm in complex wellbore trajectories optimization problem (Wood, 2016b).
In this paper, we propose a Fibonacci sequence based self-adjustment quantum genetic algorithm (FSQGA) for 3D wellbore trajectory optimization problems with multivariables and complex constraint conditions. Compared to the existing algorithms, this new approach has abilities on parallel process and fast global searching, thus can provide real-time optimal results with higher efficiency and better accuracy.
In FSQGA, the Fibonacci sequence is adopted to selfadjust the step of quantum rotation gate to optimal trajectory of complex 3D wellbore of multi-targets in the Bloch spherical coordinate. Fibonacci series has a negative exponent property which can be used to update quantum rotation gate. Firstly, we show that the time complexity of the algorithm based on Fibonacci series can be declined to O(1) without increasing space complexity. Secondly, we demonstrate that FSQGA enhances ergodicity of solution space through mapping each quantum bit into a point in Bloch sphere. Finally, we use the FSQGA to optimize TMD under the nine constrain conditions of each wellbore section, casing setting depths, true vertical depth, and boundaries with total 16 variables, including the wellbore length, inclination hold angles, azimuth angles, dogleg severities, and lateral length, etc. The simulation results show that this algorithm is faster and less time consuming; and has better minimum objective function values. The simulation also shows that the TMD of complex wellbore trajectory in actual gas-oil field can be reduced up to 4.65%. In summary, this new algorithm has the potential to improve drilling efficiency, and to reduce the drilling time and drilling cost in real-time wellbore trajectory control.

Concept of FSQGA
In 2000, Han proposed the quantum genetic algorithm (QGA) which is a probability optimal algorithm of quantum computing theory based on quantum state, quantum state interference and quantum state superposition. QGA has small population size, fast convergence speed and excellent global searching properties (Han and Kim, 2000). In 2009, a double chain quantum genetic algorithm (DCQGA) was designed to avoid binary coding randomness which was induced by quantum bit measurement, and frequent decoding in solving continuous function optimization problems. This algorithm can also enlarge the number of optimal solutions Li, 2008, 2009). In 2010, an improved DCQGA was proposed to increase the convergence speed. However, this method lacks of robustness (Xu and Xu, 2010). In 2012, a variable step double chain QGA was proposed to enhance both the convergence speed and stability (Sha and He, 2010). Since only the first order linear regulation was adopted for angle rotation, the convergence speed is still slow specially when the change rate of the objective fitness value at the searching point is extremely low or high (Sha and He, 2012). To improve the direction and speed of convergence, the FSQGA utilizes the change rates of the two adjacent generations of the objective function to direct the search towards the global optimum solution.

Q-bit solution space transformation
Using the linear transformation, each q-bit can be represented as |f ⟩ = [cosfsinu, sinfsinu, cosu] T . Then m q-bits can be turned into 3m solutions in the unity solution space I n = [ À 1, 1] n . The solution space variables which are transformed from the jth quantum bit of the ith quantum chromosome q t i in tth iteration can be defined as: where x j i , y j i and z j i are coordinate values of q-bits in Bloch spherical coordinate. Each chromosome has three solutions in optimization problem. b i and a i are maximum and minimum values of the optimization problem, respectively.

Update the quantum chromosomes
The algorithm efficiency in QGA is determined by the rotation angle of a quantum rotation gate R. In each iteration, the phase of q-bit is updated without changing its length. Quantum chromosome is updated through the phase change of quantum rotation gate R. For each ith quantum chromosome q t i , the q tþ1 i quantum chromosomes can be described as: The function of R is to rotate the phase of quantum bit by Df in XOY plane and Du in Z direction. The signs of Df and Du decide the direction of convergence and the values decide the rate of convergence.

Negative exponent characteristic of Fibonacci series
Let F N be the Nth element of Fibonacci series, which can be defined as: In equation (3), each element equals to the sum of the first two elements from the 3rd one. It can be shown (Eq. (4)): where x = 0, 1, 2, …, positive integer. N is more than 10 (Sha, 2013). The fitting relation of x and F N /F N+x is shown in Figure 1. The dashed line represents fitting relation curve of e À0.4812x . In Figure 1, x reflects the change rate of the objective function at the search point and F N /F N+x reflects the step of rotation angle of quantum rotation gate in the process of searching the optimal solution of FSQGA. The step of rotation angle decreases at high gradient points to avoid crossing over the global solution and oscillation. Conversely, the step of rotation angle increases at low gradient points to accelerate the convergence rate and robustness.
Considering fitting relation precision and range of rotation angle step, the negative exponent characteristic of fitting relation between F N /F N+x and x can be used to adjust rotation angle when N = 15, x ∊ [0,15], x ∊ N + . The fitting relation can be described as: Analyzing the fitting error of equation (5) and making E(x) = e À0.4812x À F N /F N+x , the relation curve between E(x) and x is shown in Figure 2.

Calculate steps Df and Du based on Fibonacci series
According to difference of chromosomes in population, the change rate of objective function fitness of adjacent two generations can be used to update the steps of the rotation angles. Df and Du can be obtained as follow: where sgn(.) is symbolic function. Df 0 and Du 0 are constants with Df 0 = Du 0 = 0.05p. x reflects the change rate of objective function fitness of adjacent two generations, defined as: where int(.) is a round function which returns the nearest integer.
x is the step adjustment matrix which has Size rows and Coder columns. Size is the size of population, with the value of 50-80. Coder is the number of optimal variables. ∇f i ðX j iÃ Þ is the gradient of objective function fðX j iÃ Þ at the point of X j iÃ . ∇f i max and ∇f i min is the maximum and minimum of objective function gradients of two adjacent generations.

Analyze the algorithm complexity
Comparing FSQGA to ordinary QGA and BEGA, the algorithm time complexity T(n) and space complexity S(n) are shown in Table 1.

Optimal complexity wellbore trajectory
Complex wellbore trajectory can be composed of n straight line segments and m curved segments. Each section must   (3) it is 3rd order differentiable at the common point of two adjacent sections. The vertical plane cross-section of a typical complex wellbore trajectory is shown in Figure 3.

Objective function of optimal 3D wellbore trajectory
Under multi-variables and multi-constraint conditions in complex multi-targets wellbore trajectory, FSQGA is adopted to optimize the TMD of the objective function. All sixteen variables, including the wellbore length, inclination angles, azimuth angles, and curvature of sections, are optimized under the nine constraint conditions in each wellbore section, casing setting depths and true vertical depth. The objective function is defined as: where TMD is optimal objective function, ft. X = (HD, phi1 ∼ phi3, theta1 ∼ theta6, D D , D B , D S1 ∼ D S3 , D KOP ) ∈ R 16 . The solution space consists of 16 dimension decision vector X which is the number of optimal variables. j is the number of casing section, j = 1, 2, 3. D 1 to D 5 are the calculated measured depths of specific segments of the wellbore trajectory (Shokir et al., 2004;Atashnezhad et al., 2014). The boundaries of variables are defined in Table A1 in the Appendix.

FSQGA in 3D wellbore trajectory optimization
The flowchart of FSQGA-based 3D wellbore trajectory optimization is shown in Figure 4. The u and f of the first population are generated randomly. The parameter set of FSQGA are listed in Table 2. The 16 independent variables are adjusted to realize 3D wellbore trajectory control and optimization. The objective is to minimize true measured depth min{TMD} under constraint and boundary conditions.

Simulation results and discussions 4.1 Simulation results
Using FSQGA to optimize 3D wellbore trajectory, the optimization simulation results of TMD is shown in Figure 5. As shown in Figure 5, the optimal solution is approaching to the global optimization as step functions. The progressive steps of the optimal solution are shown in Table 3.
From Figure 5 and Table 3, it can be find: (1) in the iteration sections of the 0-14, 15-31, 32-39, 40-53, 54-144 and 145-200, no update on the best optimal solution since  (2) Dvalue almost progressively reduces with increased iterations. It is difficult to determine the maximum iteration numbers due to the unknown real global optimal TMD solution. Therefore, in FSQGA, the convergence criteria are selected as Iteration > 200 or D-value < 10 ft. TMD is tending to be a global optimal solution 1.48 * 10 4 ft when the iteration > 145. In Figure 6, the value of TVD fluctuates with the identical frequency and width as TMD in Figure 5. As a boundary condition, TVD is always within the range of 10 850-10 900 ft. When the iteration is greater than 145 to reach the global optimal TMD solution, TVD tends to be stable at 1.0887 * 10 4 ft.

The algorithm complexity
To analyze the algorithm complexity of FSQGA for TMD optimization, we define t as the number of iterations, n as the population size, k as the number of  Note that TMD is tending to be a global optimal solution 1.48 * 10 4 ft when the iteration > 145.

Space-complexity
The space complexity of PSO algorithm equals S(n) = O(n 2 ) + O(nm) which can be represented as O(n 2 ). The space complexity of normal QGA equals S(n) = O(nkj) which can be described as O(n 3 ). The space complexity of FSQGA equals S(n) = O(3nk) which can be recorded as O(n 2 ). The space complexity of GA equals S(n) = O(nkj) which can be represented as O(n 3 ).
As shown in the Table 4, the time complexity of FSQGA is greatly reduced by introducing the Fibonacci sequence. Meanwhile, there is no increase in the space complexity. Therefore, this algorithm can improve the operation efficiency and reduce the running time.

Discussions
Using the TMD as the optimization objective, the 16 dimensional decision vectors, X = (HD, phi1 ∼ phi3, theta1 ∼ theta6, D D , D B , D S1 ∼ D S3 , D KOP ) ∈ R 16 , are optimized under constraint conditions of the variable values of each section, casing lengths and vertical target depth. The optimization results are shown in Table 5. Comparing with other intelligent algorithms, the optimal TMD by FSQGA has higher efficiency and considerably less running time.  (Yin, 2006) O(n 2 ) O(n 2 ) QGA (Zhang et al., 2004) O Table 5. The optimization results of different algorithms. Using the FSQGA, the optimization result of TMD is 14 807.5 ft in optimal complexity wellbore trajectory. Running time of the algorithm is 3.5075 s. Using the FSQGA to optimal the TMD, it is improved greatly running efficiency of the algorithm and shortened sharply running time which is compared the algorithm optimization results with NPSO (Atashnezhad et al., 2014), GA (Shokir et al., 2004), hCSO (Wood, 2016a), hBFO (Wood, 2016b) and PSO (Shokir et al., 2004). Therefore, it not only enhances the real-time of optimal progress, drilling efficiency and success rate, but also reduces the drilling time and total drilling cost. From the data shown in Table 5 Meanwhile, it also provides the better global optimization solution, and can thus reduce the cost of drilling with improved drilling efficiency. From the data shown in Table 5, the TMD of FSQGA is shortened by 1.46% to 4.65%. Thus the drilling cost can be reduced up to 4.65%. Moreover, FSQGA algorithm can reduce the running time significantly (from >2000 s to 3.5 s).

Conclusion
We proposed and developed a new fast self-adjustment QGA to optimize the 3D complexity wellbore trajectory with multiple variables and complex constraint conditions. Compared to the existing algorithm, the new method has enhanced real-time processing ability, and can provide higher optimization accuracy and speed. Firstly, Fibonacci sequence has a negative exponent characteristic which can be introduced into self-adaptive updating step of quantum rotation gate to reduce the time complexity of the algorithm to O(1) without increasing the space complexity of algorithm. Secondly, there is an enhanced ergodicity of solutions space through mapping each quantum bit point into a point in Bloch spherical coordinate. The FSQGA algorithm is more rapidly and have more quantum chromosomes of solution space than five other algorithms, using similar population sizes, number of iterations run and execution on the same computer, and therefore it is a suitable and efficient to solve complex multivariable /multi-constraint engineering problems, such as wellbore trajectory design. Finally, the new proposed method is demonstrated that it enhanced the global search capability in the multi targets 3D complex wellbore trajectory optimization. The drilling parameters, such as inclination hold angles, azimuth angles, dogleg severity, true vertical depths, and lateral length can be processed by using the FSQGA to optimize objective function TMD under the nine constraint conditions. The simulations show that FSQGA has better minimum objective value, faster running speed. We believe that using the new algorithm in actual drilling processing for wellbore trajectory control can enhance the real-time processing ability, improve drilling efficiency, and reduce drilling cost and time.