Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 14, No. 1, 2025 283 Optimization Design of Double Donkey Head Pumping Unit Based on Artificial Fish Swarm Algorithm Pengfei Zhang1, * 1Xi 'an shiyou College, Mechanical Engineering University, CO 710065, China *Corresponding author: ZHANG Peng-fei (Email: z1220501772@163.com) Abstract: The difference between the double donkey head beam pumping unit and the traditional beam pumping unit lies in the latter's utilization of a four-link transmission system with varying parameters, and the characteristics of multiple constraints should be considered when establishing the mathematical model to reduce energy consumption. Artificial fish swarm algorithm has global search ability. It simulates the behaviors of fish in the natural environment, such as foraging, clustering, rear-end pursuit and obstacle avoidance, and maps these behaviors into optimization strategies in the search space, so as to find the optimal solution of the objective function. In this paper, the rear donkey head surface of CYJS6-3-18HB double donkey head pumping unit is optimized and designed. The dynamics and energy consumption of the double donkey head pumping unit are studied by artificial fish school algorithm, and the final optimization results are compared with other optimization algorithms. The results show that the maximum net torque of the reducer decreases by 18.6% compared with the original data. Torque balance increased by 23%. It can be seen that the artificial fish swarm algorithm is effective for the energy saving and consumption reduction of the double donkey head pumping unit, and provides an effective reference for the optimization of the double donkey head pumping unit. Keywords: Double donkey head pumping unit; artificial fish swarm algorithm; hind donkey head; energy saving and consumption reduction; optimal design. 1. Establishment of Energy Saving Optimization Mathematical Model With the progress of technology, a variety of new types of pumping units are emerging, especially the double donkey head beam pumping unit. The difference between the beam type double horsehead pumping unit and the conventional unit is that the original connecting rod is replaced by a flexible rope, and a rear horsehead is added on the rear arm of the beam. The key reform of the double horsehead pumping unit is to change the "four-bar linkage" of the general beam pumping unit into a "variable parameter four-bar linkage" [1], so that the rear arm of the beam is turned into a variable diameter arc to generate a new motion relationship, which overcomes the conventional "dead angle" constraint, increases the Horsehead swing angle, increases the stroke by 34% -52%, and improves the system efficiency by more than 30% [2-3]. Without changing the structure, the double horsehead pumping unit has the following advantages: long stroke and low impact times, ensuring efficient pumping effect; Its balance performance is better than other types of pumping units, reducing vibration and failure rate; The required matching power is low and the operation cost is reduced; At the same time, it has two working modes of forward and reverse, which can meet the viscosity requirements of crude oil in different regions[4]. In this paper, the double arc is selected to analyze the rear horsehead surface of double horsehead pumping unit, and the mathematical model of energy consumption of the surface and pumping system is established[5]. Then, the artificial fish swarm algorithm is used to optimize the parameters of the rear horsehead curve to obtain the best parameters of the double horsehead pumping unit. The purpose is to reduce the energy consumption of the pumping unit system, and then improve the overall efficiency of the pumping system[6-8]. Through the study of the double horsehead beam pumping unit, it can be found that the curve of the Horsehead behind it will have a significant impact on its suspension point load, balance load and the net torque of the reducer. In order to realize the effective operation of the pumping unit, a perfect mathematical model must be built to determine the effective optimization strategy, carry out accurate evaluation and adjustment, in order to realize the effective operation of the pumping unit and realize the purpose of cost saving. 1.1. Design Variable In this paper, the influence of energy consumption on double horsehead pumping unit with double horsehead curve is analyzed, so the following relevant design variables are selected: eccentricity el , Affect the movement track and energy loss of the rear donkey head; Curve arc radius cl ,determines the smoothness and efficiency of motion; Eccentricity and included angle of traveling beam  , it affects the inclination angle and working performance of the traveling beam[9-12].   1 c1 2 c2 3 1 4 2 5 1 6 2 l l l l e e X X X X X X X                                          (1) 284 1.2. Constructing an Optimization Objective Function The root mean square value of the net torque of the reducer refers to the effective output torque at the crank shaft of the reducer of the pumping unit [13-14], and its calculation formula is as follows: 22 2 ni 0 0 2 N n i e MM d M N       (2) In the formula: nM —Net torque of reducer. ( ) sin( )n CM TF W B QR      (3) In the formula: TF —Torque Factor; W —Suspension Point Load, N ; B—Weight of Structural Unbalanced Load, N ; Q—Weight of Crank Counterbalance, N ;  —Balancing Phase Angle,  . The root mean square (RMS) torque is positively correlated with the effective output power of the motor. A larger torque value indicates a higher output power, which reflects better overall dynamic performance of the beam pumping unit [15]. This leads to reduced energy consumption in the pumping system. The RMS torque is one of the most important comprehensive dynamic performance indicators for beam pumping units. Reducing the RMS torque is a crucial way to achieve energy saving, consumption reduction, and enhanced overall performance of the pumping unit. 1.3. Constraint Conditions (1) Maximum Stroke Constraint maxS :  max 1 x2x aS l   (4) In the formula: al —Length of the Front Arm of the Beam Pumping Unit; 1x —The angle between the beam and the X-axis when the pumping unit is at the top dead center,°; x2 —The angle between the beam and the X-axis when the pumping unit is at the bottom dead center,°. (2) Extreme Position Angle  greater than 6°less than 10°; 6 10    (5) (3) When the beam swings to the top and bottom dead center positions of the pumping unit, the swing angle of the beam is equal to the angle between the beam and the horizontal line of the crossbeam.; 1 x2x  (6) (4) The balance ratio of the torque of the reducer should be between 70% and 105%, with the constraint expressed as: 1max 2max 1max 0.7 1 1.05n n n M M M     (7) In the formula: 1maxnM —Maximum Net Torque of the Reducer During the Upstroke; 2maxnM —Maximum Net Torque of the Reducer During the Downstroke. 2. Algorithm Principles 2.1. Artificial Fish Swarm Algorithm The state of each fish is represented as a vector. nX x 1 2(x ,x , ),Wherein i=1, 2, …, n,represents the optimization variable in the algorithm; the food concentration in the water area where the artificial fish are currently located is expressed as ( )Y f X ;The distance between each artificial fish is set as iij jd X X   ;perception distance, Visual ;the maximum step length for each artificial fish to move, step ;congestion factor, 错误!未找到引用源。. The position of the next state for each artificial fish individual is defined as: * ( )next i j i j i step rand X X X X X X      (8) In the formula rand is a random number between 0 and 1, jX is a position within the current artificial fish's visual range. 2.2. Flowchart of Artificial Fish Swarm Algorithm The flowchart for implementing the Artificial Fish Swarm Algorithm is shown in Figure 1: 1) Set initial parameters: perception distance Visual 、Maximum moving step length Step 、Population Size or Scale of Population N 、Dimension Dim 、Iteration Count Try number 、Congestion Factor  ; 2) Initialize the artificial fish swarm and select the optimal state; 3) Execute typical behaviors of the artificial fish swarm, including foraging, schooling, following, and random movement; 4) The algorithm terminates when the optimal solution reaches a result within the error range or when the maximum number of iterations is reached; otherwise, proceed to step 3. 285 Figure 1. Flowchart of artificial fish swarm algorithm 3. Analysis of Optimization Results When setting parameters, it is necessary to configure them accurately based on the unique roles and requirements of each parameter: Increasing the perception distance of artificial fish Visual,increasing the perception distance of artificial fish helps enhance their exploration capability, making it easier for them to discover and capture the global optimal solution and accelerate the convergence process; optimizing the step length Step can effectively improve the overall convergence speed of the artificial fish swarm and ensure search efficiency; increasing the number of artificial fish N not only enhances the ability to escape from local optimal traps but also achieves the purpose of accelerating convergence speed. However, this will also be accompanied by a significant increase in computational burden. The foraging behavior ability and convergence efficiency of artificial fish increase as the number of iterations increases. The allowed degree of congestion is inversely proportional to the congestion factor and directly proportional to the ability of artificial fish to escape from local optimal solutions. The parameters set for the Artificial Fish Swarm Algorithm are shown in Table 1. Table 1. Parameters of artificial fish swarm algorithm Perception Distance Maximum Movement Step Length Number of Artificial Fish Dimension of Artificial Fish Iteration count Crowding factor maximum iteration count 25 3 50 15 50 27 500 The variation of the reducer's net torque during the optimization process of the Artificial Fish Swarm Algorithm is illustrated in Figure 2. Throughout the entire optimization process, as the number of iterations increases, the maximum net torque of the reducer gradually decreases. When the number of iterations reaches 276, the maximum net torque of the reducer is 17.03 kN·m, and this value remains constant as the number of iterations continues to increase. Figure 2. Optimization process of artificial fish swarm algorithm The torque of the suspension point load and the torque of the balanced load for the reducer optimized by the Artficial Fish Swarm Algorithm are shown in Figure 3. 286 Figure 3. Torque diagram of reducer after optimization by artificial fish swarm algorithm Figures 4 and 5 present the comparison of suspension point load torque and balanced load torque optimized by three different algorithms. As can be seen from the figures, the curve optimized by the Artificial Fish Swarm Algorithm exhibits higher symmetry compared to the other two algorithms, which allows the reducer to achieve better balancing effects. Figure 4. Comparison diagram of suspension load torque Figure 5. Balance load torque comparison diagram The comparison chart of the reducer's net torque optimized by three algorithms and the original data is shown in Figure 6. The maximum net torque of the reducer optimized by the Artificial Fish Swarm Algorithm is 17.03 kN·m, and the minimum is 1.48 kN·m. It can be concluded that, the fluctuation amplitude of the reducer's net torque curve is smaller after optimization using the Artificial Fish Swarm Algorithm. Figure 6. Comparison of net torque of reducer The optimization scheme for the CYJS6-3-18HB double- horsehead pumping unit using the Artificial Fish Swarm Algorithm selected in this paper is compared with the data from Domestic Factory A and the data optimized using the Iterative Method and Bat Algorithm, as shown in Table 3. The data in the table is based on the double-arc rear horsehead curve, comparing the design parameters and dynamic performance of domestic beam pumping units with the same or similar stroke lengths. Compared to the original data from Factory A, the results optimized by the Artificial Fish Swarm Algorithm show a decrease in the maximum net torque of the reducer by 3.9 kN·m. Compared to the Iterative Method and Bat Algorithm, the maximum net torque of the reducer decreases by 2.8 kN·m and 0.77 kN·m, respectively, which implies a reduction in the maximum starting torque of the electric motor. Additionally, the root mean square torque decreases by 0.62 kN·m, indicating a reduction in energy consumption of the pumping system; simultaneously, the torque balance rate improves by 23%. As can be seen from Table 2, the performance parameters of the double-horsehead pumping unit optimized by the Artificial Fish Swarm Algorithm are reduced, and the torque balance rate is increased. Furthermore, the data optimized by the Artificial Fish Swarm Algorithm is superior to that of the other two algorithms. 4. Conclusion (1) The Artificial Fish Swarm Algorithm proposed in this paper optimizes the rear horsehead surface of the CYJS6-3- 18HB double-horsehead pumping unit by establishing a mathematical model. With the net torque of the reducer as the objective function, the dynamics and energy consumption issues are optimized, resulting in a reduction of 18.6% in the maximum net torque of the reducer compared to the original factory data, and an increase in the balance rate by 23%. (2) After optimization using the Artificial Fish Swarm Algorithm, the symmetry of the suspension point load torque and balanced load torque is significantly improved, enabling the double-horsehead pumping unit to achieve better balancing effects. (3) The net torque curve of the reducer exhibits smaller fluctuations after optimization using the Artificial Fish Swarm Algorithm. 287 In summary, the optimization goal is to minimize the root mean square value of the reducer's net torque. Through optimization, the performance of the pumping unit is improved, energy consumption is reduced, and pumping efficiency is increased, achieving the goal of energy saving and consumption reduction. Table 2. Comparison of parameters before and after optimization of a double arc pumping unit with rear donkey head Parameters Factory A's Data Iterative Method Bat Algorithm Artificial Fish Swarm Algorithm S tr uc tu ra l P ar am et er s R /m 0.835 0.835 0.835 0.835 Il /m 2.4 2.4 2.4 2.4 Hl /m 3.71 3.71 3.71 3.71 al /m 3.00 3.00 3.00 3.00 1cl /m 1.86 1.84 1.90 1.88 2cl /m 1.56 1.55 1.54 1.57 1el /m 0.612 0.602 0.595 0.6 2el /m 0.672 0.674 0.678 0.675 1 /° 110 111 113 112 2 /° 136.5 136.4 136.1 136.2 P er fo rm an ce P ar am et er s maxnM /kN·m 20.93 19.83 17.80 17.03 minnM /kN·m 3.15 2.13 1.89 1.48 eM /kN·m 13.15 12.92 12.65 12.53 m 0.76 0.91 0.98 0.99 References [1] Cui Zhenhua, Yu Guoan. Sucker-Rod Pumping Equipment and Technology: Sucker-Rod Pumping System [M]. Beijing: Petroleum Industry Press,1994. [2] Feng Li, Zhang Xuejing, Jiang Guobin, etal. Design and practice of cost reduction and efficiency increase for oil production engineering in Daqing Oilfield [J]. Oil Drilling and Production Technology, 2022, 44 (5): 574-578. [3] Wang Zenglin, Jiang Dong, Su Qiuhan, et al. Design of Self- balancing beam Pumping Unit Driven by Disk Motor [J]. Oil Field Machinery, 2023, 52 (2): 81-89. [4] Dong Ping, Yang Yonghong, Wang Qingxin. Design and Analysis of Automatic Balancing Mechanism for Beam Pumping Unit [J]. Science Technology and Engineering, 2016, 16 (33): 189-192+226. [5] Xu J ,Wang W ,Li W , et al. Kinematic and Dynamic Analysis of Eccentric Balanced Positive Torque Pumping Unit [J]. Machines, 2024, 12 (4): [6] Fu Sheng. Analysis of Influencing Factors of energy efficiency of pumping unit System and Application of Energy saving Technology [J]. Petroleum and petrochemical Energy Conservation and Metrology, 2024, 14 (7): 26-31. [7] Liu Yuguo, Yang Liping, Peng Zhenhua, et al. Research and application of efficiency improvement technology for pumping units in Tahe Oilfield [J]. Petroleum and Petrochemical Energy Conservation and Metrology, 2023, 13 (10): 1-5. [8] Zhenhe L ,Zhicheng W ,Changjian Z , et al. Design, system modeling and energy management for a novel hydraulic pumping unit [J]. Proceedings of the Institution of Mechanical Engineers, Part I: Journal of Systems and Control Engineering, 2022, 236 (1): 200-211. [9] Yu Yan-qun,Chang Zong-yu,Qi Yao-guang,et al.Study of a new hydraulic pumping unit based on the offshore platform[J].Energy Science and Engineering,2016,4(5):352- 360. [10] Gu Xinyi, Zhou Huanbo, Cui Huanyong, et al. Development and application of Long Ring Rack pumping Unit [J]. China Petroleum Machinery, 2009, 37 (5): 38-40+101. [11] Du Fan, Zhu Guo, Lu Hui, et al. Improve the safety risk management level of oil field double donkey head pumping unit [J]. Petrochemical Safety and Environmental Protection Technology, 2023, 39 (2): 14-16+5. [12] DU Yuheng. Research on Suspension Load and Torque of Double donkey head Swimming beam pumping Unit [J]. Energy Conservation Technology, 2009, 27 (3): 236-237+283. [13] Jinchao X ,Wei L ,Siyuan M . Kinematic and Dynamic Simulation Analysis of Modified Conventional Beam Pumping Unit [J]. Energies, 2022, 15 (15): 5496-5496. [14] Shao Jun, Hu Guodong, Wang Dewei. Design and Dynamic Performance Analysis of Eccentric wheel Pumping Unit [J]. China Petroleum Machinery, 2020, 48 (10): 117-122. [15] Sun Wen, Ren Tao, Wang Sanmin. Research and application of a new cluster well pumping unit in low permeability reservoir [J]. Science Technology and Engineering, 2016, 16 (35): 69-76+82. 288 [16] Li Xiaolei, Shao Zhijiang, Qian Jixin. An optimization model based on animal autonomy: fish swarm algorithm [J]. Systems Engineering Theory & Practice, 2002, (11): 32-38. [17] Zhu Hongxiang, Sui Gulei. Gasoline blending optimization based on artificial fish swarm algorithm [J]. Contemporary Chemical Industry, 2022, 51 (8): 1912-1915+1947. [18] Chen Jing-jing, Liu Sheng. Adaptive artificial fish swarm optimization algorithm based on tabu search [J]. Journal of Computer Technology and Development, 2021, 31 (3): 8-13.