# Borehole Trajectory Optimization Design Based on the SAC Algorithm with a Self-Attention Mechanism
## 4 Experimental Design and Result Analysis
### Wellbore Trajectory Design Under Vertical Obstacle Interference Scenarios
Color lines: Lines of different colors represent the well trajectory of multiple wells or different sections of the same well (vertical depth profile along the east coordinate), and the color is used to distinguish the trajectory sequence of different wells, construction stages or design schemes. Red shadow area: Red rectangle area marks the key layers of engineering or geological concern, target reservoir interval, lithologic/physical anomaly zone (such as fault, fracture development zone). Figure 7 shows the trajectory avoidance training process in a borehole initial obstacle environment. The figure includes four subfigures: (a) 3D spatial trajectory distribution; (b) North-east horizontal projection (showing planar position relationship between trajectories and obstacles); (c) North height projection (reflecting vertical depth changes of trajectories); and (d) East height projection (showing eastward displacement and depth correlation). Figure 7 is a display of the highest reward trajectory. From a three-dimensional perspective, it can be clearly seen that this trajectory actively adopts an avoidance strategy at the initial position of the obstacle (vertical cylinder), and the obstacle avoidance performance is very clear and effective. The trajectory is continuous and smooth without obvious curvature mutation, showing good trajectory construction characteristics. It shows that the reinforcement learning strategy fully considers the actual engineering requirements of wellbore trajectory continuity and stability in the path optimization process. From the perspective of horizontal projection, the optimal trajectory has obvious lateral avoidance action in front of the obstacle (about North coordinate 200-400 m range). By properly adjusting the obstacle avoidance area to the East side (East direction), the avoidance strategy is very accurate, the obstacle avoidance range is moderate, and there is no obvious redundant offset. In the process of obstacle rounding, the turning radius of the path is relatively flat, and there is no sharp turning, which reflects that the model has good smoothness and stability. It can be seen from the vertical projection clock that the trajectory shows that the initial section quickly enters the horizontal well section from the vertical well section. The whole deflection process is very smooth and the curvature is continuous, indicating that the path design of the enhanced learning strategy is smooth in the vertical direction. The transition fully meets the curvature and smoothness requirements of wellbore design. Figure 6: Trajectory avoidance training process in a borehole initial obstacle environment. In Figure 8, Trajectory distribution in mid-borehole obstacle environment. The figure includes a 3D view and two orthogonal projections (North-east, North height). A scale bar is added at the bottom right, indicating a spatial scale of 0-1000 m. As shown in Figure 8, when the obstacle is located in the middle transition area where the borehole gradually turns to the horizontal, the trajectory distribution is more dispersed, and the obstacle avoidance strategy is no longer a single advance offset, but presents diversified obstacle avoidance paths, and some of the trajectories have obvious curve adjustments before and after the obstacle, which indicates that the strategy possesses a stronger ability of local reconfiguration and flexible bypass avoidance in the mid-range, and the trajectory disturbance brought by the obstacle in the mid-range is more challenging, but the strategy is capable of The trajectory perturbation caused by obstacles in the middle section is more challenging, but the strategy is able to dynamically adjust the path based on the environmental feedback, showing enhanced spatial adaptive ability. The east-direction adjustment before and after the trajectory crossing the obstacle is more obvious.