Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 13, No. 2, 2024 215 Research on Intelligent Control Algorithm of Complex Borehole Trajectory Based on Multi‐objective Optimization Wei Gan*, Bo Wang Xi’an Shiyou University, Xi’an, China *Corresponding author Abstract: Effective wellbore trajectory control is essential in complex drilling environments, where precision and operational efficiency are critical to reducing costs and improving safety. Traditional trajectory control methods often face limitations in addressing multiple conflicting objectives, such as minimizing trajectory deviation while maximizing drilling efficiency. Traditional trajectory control methods often face limitations in addressing multiple conflicting objectives, such as minimizing trajectory deviation while maximizing drilling efficiency. This study presents an intelligent control approach utilizing the Non- Dominated Sorting Genetic Algorithm III (NSGA-III) for multi-objective optimization in complex wellbore trajectory control. designing and implementing a set of objective functions tailored to trajectory control requirements, this approach leverages NSGA-III' s ability to handle high-dimensional trajectories. s ability to handle high-dimensional objective spaces, achieving a balanced optimization across diverse performance metrics. Experimental results Experimental results verify the effectiveness of this approach, with Matlab simulations demonstrating significant improvements in trajectory accuracy and computational efficiency. This research provides a robust framework for multi-objective trajectory control and highlights the potential of NSGA-III in enhancing decision-making for complex drilling applications. decision-making for complex drilling applications. Keywords: Complex borehole trajectory, multi-objective optimization, intelligent control, NSGA-III. 1. Introduction In oil and gas drilling, precise control of the borehole trajectory is one of the key factors in ensuring operational efficiency and cost reduction [1]. The control of complex borehole trajectories usually faces multiple challenges, including conflicting objectives such as borehole deviation, drilling tool stability, and drilling efficiency [2]. Traditional single-objective optimization methods can no longer meet the engineering requirements, and an intelligent control algorithm that can optimize multiple objectives simultaneously is needed [3]. Currently, the application of intelligent algorithms in borehole trajectory control has made some progress, especially in the field of multi-objective optimization, where typical optimization methods include genetic algorithm, particle swarm optimization and fuzzy control[4]. Improving the accuracy and timeliness of borehole trajectory prediction can help to improve the reservoir encounter rate and ensure drilling safety, but the borehole trajectory is often difficult to predict accurately because of the many influencing factors and high nonlinearity, and the extremely complex downhole mechanical behavior[5]. As an advanced multi-objective optimization algorithm, the Non-dominated Sorting Genetic Algorithm III (NSGA-III) has attracted attention because of its high efficiency and robustness in dealing with high- dimensional multi-objective problems[6].With strategies such as non-dominated sorting and congestion distance, NSGA-III can generate a good set of Pareto frontier solutions in complex optimization space, which offers a new Solution. In this study, we propose a complex borehole trajectory intelligent control algorithm based on NSGA-III, which aims to optimize several key indexes such as borehole deviation and drilling efficiency simultaneously. By implementing the NSGA-III algorithm in Matlab, we designed an objective function adapted to the requirements of borehole trajectory control, and carried out simulation experiments to verify the effectiveness of the proposed method. The research on intelligent prediction of borehole trajectory is relatively limited, and the intelligent algorithms used are relatively old, mostly offline models, which do not fully consider the non- chronological features such as formation properties, bottom drilling tool combination structure, etc. There is room for further improvement of prediction accuracy, and the proposed multi-objective optimization method achieves significant results in improving the accuracy of the borehole trajectory, optimizing the drilling efficiency, and reducing the computational overhead. 2. Theoretical Basis of Borehole Trajectory Control Borehole trajectory control is a key link in drilling engineering, and its main goal is to ensure that the drilling tools are stably propelled along the predetermined trajectory, so as to maximize drilling efficiency and borehole stability[7]. Borehole trajectory is usually realized by controlling key parameters such as well inclination angle and azimuth angle, which in turn affect the depth, curvature and direction of the borehole[8]. The setting of these control parameters is directly related to the accuracy of the borehole trajectory and the overall safety of the drilling operation, especially in complex formations and deep well drilling, the stability and controllability of the trajectory is particularly important[9]. The non-chronological features such as the structure of the bottom drilling tool combination, the nature of the formation, and the drilling method are important influencing parameters of the borehole trajectory[10]. Borehole trajectory control is an indispensable part of drilling operations, and one of the 216 decisive factors affecting the drilling cost and efficiency. Objective Function for Wellbore Deviation: 𝑓 𝑥 ∑ 𝑑 𝑑 (1) The nature of borehole trajectory control is a multi- objective optimization problem, in which multiple competing objectives need to be coordinated under restricted conditions. For example, in the process of controlling the borehole trajectory, minimizing the borehole deviation, maximizing the drilling efficiency, and prolonging the service life of the drilling tools need to be considered at the same time. Traditional optimization methods are difficult to satisfy these objectives at the same time, so multi-objective optimization methods have gradually become the mainstream of borehole trajectory control research. Through the introduction of multi- objective optimization algorithms, borehole trajectory control can achieve dynamic balance of multiple performance indicators, thus providing a more accurate and controllable drilling path. Among many multi-objective optimization methods, non- dominated sequential genetic algorithm (NSGA) is widely used for its effectiveness in solving complex optimization problems. In particular, NSGA-III, as an improved version of NSGA, shows higher efficiency and adaptability in high- dimensional multi-objective optimization by introducing reference points and diversity maintenance mechanism. NSGA-III can not only effectively generate the set of Pareto optimal solutions, but also fully consider the trade-off relationship among the objectives in high-dimensional, multi- objective problems such as borehole trajectory control . Therefore, NSGA-III is very suitable for application in the intelligent control of complex borehole trajectories, and provides theoretical support for realizing high-precision and high-efficiency borehole trajectory control, showed in Figure 1 : Figure 1. Wellbore Deviation and Drilling Rate Over Iterations The implementation of NSGA-III in Matlab provides a convenient simulation platform for borehole trajectory control. Through the Matlab environment, parameter adjustment and algorithm validation can be carried out quickly, which makes it easy for researchers to analyze the effects of different control strategies on the borehole trajectory. In addition, the effectiveness of NSGA-III in dealing with high-dimensional targets makes it well scalable, and it can be further combined with machine learning or other intelligent algorithms to achieve real-time optimization and dynamic adjustment of the borehole trajectory. In the future, NSGA-III has a promising application in the field of borehole trajectory control, which can not only optimize the borehole path, but also provide intelligent decision-making support in the actual drilling process, thus promoting the continuous progress of borehole trajectory control technology. 3. Design and Implementation of Multi-objective Optimization Algorithm Based on NSGA-III To achieve intelligent control of complex borehole trajectories. The design and implementation of the algorithm includes the construction of the objective function, the setting of the algorithm parameters, and the verification of the results. To meet the multiple requirements of borehole trajectory control, multiple optimization objective functions are constructed. The following sections will introduce the specific implementation process of objective function design, algorithm parameter setting and tuning, as well as simulation experiments and result analysis in detail. 3.1. Theoretical background of multi-objective optimization with NSGA-III Multi-objective optimization is a mathematical method for studying how to optimize multiple conflicting objectives simultaneously. In engineering and scientific applications, many problems involve multiple performance metrics that often compete with each other. There are many factors affecting the borehole trajectory, which can be divided into four parts: formation properties, bottoming tool combinations, borehole shape (borehole inclination azimuth, borehole curvature, etc.), and drilling process parameters In the control of borehole trajectory, the optimization objectives may 217 include minimizing borehole deviation, maximizing drilling efficiency, and extending tool service life. In borehole trajectory control, the optimization objectives may include minimizing borehole deviation, maximizing drilling efficiency, and prolonging drilling tool life. Due to the mutual constraints among these objectives, it is difficult for the traditional single-objective optimization methods to effectively solve such complex problems. Therefore, multi- objective optimization provides an effective solution by generating a set of Pareto optimal solutions, which enables the decision maker to weigh the different objectives and select the most suitable solution to meet the actual needs,showed in Figure 2 : Figure 2. Performance Metrics of NSGA-III Algorithm Among the many algorithms for multi-objective optimization, genetic algorithms have attracted much attention because of their good global search ability and adaptability. Non-dominated sorting genetic algorithm, as an extension of genetic algorithms, is specifically used to solve multi-objective optimization problems. The core idea of NSGA is to maintain the diversity of the population through non-dominated sorting and crowding comparison, thus ensuring a balanced solution set among multiple objectives. Stratigraphy has a significant influence on the trajectory of the borehole, which can be summarized as the stratigraphic inclination force, but the downhole stratigraphy is often very complex, and the stratigraphic inclination force is not only related to the nature of the stratigraphy itself such as inclination, strike, etc., but is also closely related to the type of drilling bit, the well inclination azimuth, the drilling pressure, and other external conditions, which makes it difficult to characterize the stratigraphic inclination force accurately up to now, and there are some limitations on NSGA's performance in high-dimensional goal optimization, in particular When dealing with multi-dimensional complex problems, it is difficult to balance the solution quality and computational efficiency. In order to address the shortcomings of NSGA in high- dimensional multi-objective optimization, the researchers proposed the non-dominated sorting genetic algorithm III (NSGA-III).NSGA-III introduces the concept of reference point, which improves the performance of the algorithm in high-dimensional space by steering the distribution of Pareto frontiers. The algorithm is able to effectively generate a uniformly distributed set of Pareto optimal solutions by maintaining the diversity and convergence of solutions, which in turn improves the optimization efficiency. In addition, the flexibility of NSGA-III in dealing with multiple objectives enables it to be widely applied to various types of complex engineering problems, and it is especially suitable for scenarios of complex borehole trajectory control. Drilling Rate Objective Function: 𝑓 𝑥 (2) NSGA-III can be effectively implemented by simulation platforms such as Matlab, which provides powerful tools and libraries to help researchers quickly construct and validate multi-objective optimization models. Through the flexible setting of objective functions and constraints, NSGA-III is able to show excellent performance in a variety of engineering environments. This makes NSGA-III an important tool for realizing intelligent control of complex borehole trajectories, and provides important support for research and practice in related fields. The multi-objective optimization method combined with NSGA-III will help promote the development of intelligent drilling technology and realize more efficient and controllable borehole trajectory design and management. 3.2. Objective function construction for borehole trajectory control In borehole trajectory control, the construction of the objective function is a key step in the optimization process, which directly affects the effectiveness and practicality of the final control strategy. Usually, the objective function of borehole trajectory control needs to comprehensively consider several factors, such as the geometry of the borehole, the service life of the drilling tools, the drilling efficiency and the construction safety. In order to achieve these objectives, the drilling method, stratigraphic layering, and the type of bottom drilling tool combination need to be numericalized. 218 The most widely used method is the solo thermal coding, it directly impacts the effectiveness and practicality of the final control strategy. This objective function must integrate multiple factors, such as borehole geometry, tool lifespan, drilling efficiency, and construction safety. By quantifying drilling methods, stratigraphic layers, and drill bit configurations, the objective function ensures that all performance indicators are fully represented in the optimization process, laying a solid foundation for multi- objective optimization. which defines different values of features by two values of "0" and "1" for effective solution in the optimization algorithm. By establishing a reasonable objective function, it can ensure that the performance indicators of the borehole trajectory are fully reflected in the optimization process, providing a solid foundation for the subsequent multi-objective optimization. The expression of the objective function defined as follows, the optimization variable: 𝑓 𝑥 𝑤deviation ⋅ Deviation 𝑥 𝑤rate ⋅ DrillingRate 𝑥 𝑤wear ⋅ ToolWear 𝑥 Penalty 𝑥 (3) When constructing an objective function for borehole trajectory control, it is usually necessary to introduce several performance metrics to meet different needs in practical applications. The most commonly used objectives include minimizing borehole deviation, maximizing drilling rate, and minimizing drilling tool wear. Borehole deviation refers to the deviation between the actual drilling trajectory and the predetermined trajectory, which is usually expressed in terms of geometric distance; whereas drilling rate reflects the depth of drilling per unit time, which is directly related to the economy of the operation; and the wear of drilling tools affects the safety and economy of drilling. Therefore, reasonable design of these objective functions is a prerequisite for realizing efficient borehole trajectory control. In order to achieve multi-objective optimization, there are often conflicting relationships between objective functions, and minimizing borehole deviation and maximizing drilling rate may affect each other. In this case, a weighting method or objective normalization technique is needed to deal with the relationship between different objectives. By appropriately weighting the objective function, the priority of each objective can be balanced to a certain extent, thus forming a comprehensive optimization objective. By introducing a gating mechanism to control the retention and discard of information, it is used to solve the problem of information loss during the training of long sequences, and is more capable of extracting time series information than the traditional BP neural network, and a penalty factor is introduced to constrain certain non-compliant solutions in order to improve the effectiveness and stability of optimization. In Matlab, the construction of the objective function can be realized by writing the corresponding code. With Matlab's powerful computational and visualization tools, researchers can debug and verify the objective function. When constructing the objective function, it is necessary to ensure that the function can accept the input of the optimization algorithm and return the corresponding performance index. Through continuous iteration and adjustment, the structure of the objective function can be optimized to ensure its adaptability and effectiveness in different application scenarios. Ultimately, the reasonably constructed objective function will provide effective support for the application of NSGA-III in borehole trajectory control, and ensure that the optimization results can meet the actual needs. 3.3. Specific implementation process of NSGA- III algorithm The initialization of the population and evaluation of the objective function stage randomly generates an initial population, with each individual representing a potential solution, which is usually encoded in real or binary encoding. After generating the initial population, its objective function value needs to be computed for each individual for subsequent non-dominated sorting and congestion calculations. In borehole trajectory control applications, these objective functions will reflect the performance of different individuals in terms of borehole deviation, drilling rate, and drilling tool wear. Ensuring the diversity of the population is an important goal in the initialization phase so that the search capability of the algorithm can be improved. The NSGA-III algorithm performs non-dominated sorting in order to hierarchize populations. The core idea of non- dominated sorting is to categorize individuals into multiple ranks based on their relative dominance relationship in the objective space. The lower the non-dominance rank of each individual, the higher the priority it occupies in the optimization process. Meanwhile, NSGA-III maintains the diversity of the population by calculating the crowding degree of each individual. The crowding degree measures how sparse the individuals are in the target space, and individuals with higher crowding degree will have more chances to be retained in the selection process. In this way, the algorithm is able to maintain the diversity of the population while ensuring the transfer of excellent solutions. After completing the non-dominated sorting and crowding calculations, NSGA-III performs selection, crossover and mutation operations to generate a new population of offspring. Selection operations are usually performed using tournament selection to select suitable individuals from the current population for reproduction. Crossover and mutation are then used to introduce new genetic information to explore the search space. In applications of borehole trajectory control, crossover operations can be performed by methods such as linear combination or uniform crossover, while variation operations can be realized by perturbing the parameters of individuals. These operations aim to increase the breadth and depth of the search and thus generate more competitive offspring. After a certain number of iterations, the algorithm will output the Pareto optimal solution set. By selecting the optimal individuals, the researchers can find a borehole trajectory control solution from them that meets the actual needs. In this process, Matlab's visualization tools can help researchers analyze all kinds of data in the optimization process and visualize the distribution of Pareto frontiers. In addition, the analysis of the output results can also provide guidance for further research, exploring the effects of different parameter settings on the optimization results. Through this specific implementation process, the NSGA-III algorithm provides an effective solution for the intelligent control of complex borehole trajectories. 219 MatLab % Iterative Update Process for generation = 1:num_generations % Evaluate Fitness of the Population fitness_values = EvaluateFitness(population, num_objectives); % Non-Dominated Sorting and Selection [sorted_population, Pareto_Front] = NonDominatedSorting(population, fitness_values); % Crossover and Mutation Operators offspring = GeneticOperators(sorted_population); 4. Algorithm Performance Validation and Experimental Analysis In order to verify the effectiveness of the NSGA-III based multi-objective optimization algorithm in complex borehole trajectory control, a series of experimental designs are first needed. These experiments will evaluate the performance of the algorithm under different optimization objectives and constraints. Since the input features contain two different types of data: temporal and non-temporal, the model needs to design a dual-input structure: the encoder is divided into temporal and non-temporal encoders, and the temporal features are directly inputted into the temporal encoder; the non-temporal features are firstly numericalized by the solo thermal encoding, and then transformed into low-dimensional dense vectors inputted into the non-temporal encoder through the embedding layer. the experimental setup consists of selecting a typical borehole trajectory control problem , and defining a set of specific objective functions and constraints for it. Based on this, the researchers will evaluate the performance of the algorithms in meeting the multi-objective optimization requirements using a combination of standard test functions and real-world working conditions. These tests will cover key performance metrics such as convergence, distribution and computational efficiency of the algorithm. The performance of the NSGA-III algorithm is evaluated through simulation experiments. Borehole trajectory control under different experimental conditions is simulated using Matlab, and the change of Pareto frontier in each iteration is recorded. The data collected include the value of each objective function, the number of generations in the optimization process, and the distribution of the Pareto optimal solution set. By comparing the experimental results with different parameter settings and optimization objectives, it is possible to analyze which factors have the most significant impact on the performance of the algorithm. This process not only helps to evaluate the effectiveness of the algorithm, but also provides data support for further algorithm improvement. The analysis of the experimental results focuses on two aspects, convergence and diversity. The convergence index is used to measure whether the algorithm can gradually approach the real Pareto frontier in the optimization process, while the diversity index reflects the uniform distribution of the solutions. An ideal algorithm should ensure the diversity of the solution set while ensuring high convergence, so as to meet the needs of different decision makers. In the experiments, the use of graphs to visualize the convergence process and the change of the Pareto frontier can help researchers understand the algorithm performance more clearly and identify the areas that need further improvement. Based on the results of the experimental analysis, researchers can suggest improvements to the algorithm. The non-temporal encoder adds an embedding layer (Embedding) on the basis of the temporal encoder to deal with high- dimensional unique thermal coding features. The non- temporal features, such as drilling mode and stratigraphic layering, are first numericalized by the unique thermal coding, and then the features are high-dimensional sparse, and this high-dimensional sparse matrix is input into the embedding layer for dimensionality reduction, and then transformed into dense numerical vectors and inputted into the LSTM coding unit, and the parameters of the algorithm are adjusted for specific application scenarios in order to improve the speed of convergence or the diversity of the solutions, or other evolutionary operations are tried to enhance the exploration ability of the algorithm. . In addition, the study can also explore the possibility of combining NSGA-III with other optimization methods in order to obtain better performance. Through this series of validation and analysis process, the application of NSGA-III algorithm in complex borehole trajectory control will be further deepened to provide more scientific and reasonable decision support for practical engineering. 220 5. Conclusion In this study, a multi-objective optimization algorithm based on the non-dominated genetic algorithm NSGA-III is proposed for the complex borehole trajectory control problem, and the systematic algorithm design and experimental verification are carried out. The practicality and effectiveness of the optimization results are ensured by constructing a reasonable objective function and comprehensively considering multiple indicators such as borehole deviation, drilling rate and drilling tool wear. In the process of algorithm implementation, the methods of non-dominated sorting and congestion calculation are adopted to effectively improve the diversity of populations and optimization efficiency. The experimental results show that the multi-objective optimization algorithm based on NSGA-III exhibits good convergence and diversity of solutions in complex borehole trajectory control. By comparing with the traditional optimization algorithm, the advantages of NSGA-III in dealing with multi-objective optimization problems are verified, and it can effectively provide the Pareto optimal solution set to meet the needs of different decision makers. In addition, the experimental analysis also reveals the key factors affecting the performance of the algorithm, which provides guidance for future research and improvement. In future research, the combination of NSGA-III algorithm with other intelligent algorithms is further explored to enhance its performance. Meanwhile, the objective function and constraints can be optimized for the complex situations in practical engineering to better adapt to the variable operating environment. Overall, this study provides a new solution for the intelligent control of complex borehole trajectories and promotes the development of intelligent drilling technology. References [1] Liu Q , Li Z , Wang E ,et al.A New Method for Determining Coal Seam Permeability based on a Gas–Solid Coupling Model and PSO+LM Hybrid Optimization Algorithm [J]. Natural Resources Research, 2023, 32 (3): 1265- 1282.DOI:10.1007/s11053-023-10182-8. [2] Soltani S , Hezarkhani A .Additional exploratory boreholes optimization based on three-dimensional model of ore deposit[J].Archives of Mining Sciences, 2009, 54(3):495- 506.DOI:10.1002/hyp.6173. [3] Mansouri M A , Dabiri R .A new optimal model for evaluating liquefaction-induced lateral spreading based on the advanced ant colony optimization (ACO)[J].Arabian Journal of Geosciences, 2021, 14(24):1-18.DOI:10.1007/s12517-021- 08894-3. [4] Zhang Y , Li T , Yi J .Adaptive Neural Network Sliding Mode Control based on Particle Swarm Optimization for Rotary Steering Drilling Stabilized Platform[J].International Journal of Advancements in Computing Technology, 2012, 4 (19) :107-114.DOI:10.4156/ijact.vol4.issue19.14. [5] Guo J , Zheng J ,Qing Lü,et al.Estimation of fracture size and azimuth in the universal elliptical disc model based on trace information[J].Journal of Rock Mechanics and Geotechnical Engineering, 2023, 15(6):1391- 1405.DOI:10.1016/j.jrmge.2022.07.018. [6] Seung-Hoon P , Jung-Yeol K , Yong-Sung J ,et al.Development of a Multi-Objective Sizing Method for Borehole Heat Exchangers during the Early Design Phase[J].Sustainability, 2017, 9(10):1876.DOI:10.3390/su9101876. [7] Wenxue C , Xiaoming N , Bing J .Optimization of borehole spacing of gas extraction based on the method of structure curvature[J].Disaster Advances, 2013, 6(11):15-21. [8] Jin C X .A Deterministic Gamma-Type Geomorphologic Instantaneous Unit Hydrograph Based on Path Types[J].Water Resources Research, 1992, 28(2):479- 486.DOI:10.1029/91WR02577. [9] Singer B S .Electromagnetic integral equation approach based on contraction operator and solution optimization in Krylov subspace[J].Geophysical Journal International, 2010, 175(3):857-884.DOI:10.1111/j.1365-246X.2008.03930.x. [10] Akca I , Guenther T , Mueller-Petke M ,et al.Joint parameter estimation from magnetic resonance and vertical electric soundings using a multi-objective genetic algorithm[J].Geophysical Prospecting, 2014, 62(2):364- 376.DOI:10.1111/1365-2478.12082.