Abstract
This paper addresses the balancing of global and local searches in the recently proposed AO (Aquila Optimizer) algorithm. The original random algorithm is modified using normal-distribution parameters, and an adaptive function represented by a Weibull function is added to the motion law of the predator. Sixteen benchmark functions are used to test the improved algorithm against several recently developed algorithms. The results show that the accuracy and convergence speed of the modified algorithm are improved while the advantages of the original algorithm are retained. In solving the problems of a complex calculation and limited solution in the design of a hybrid electromagnetic structure based on a Halbach array, a prediction model based on the improved algorithm and generalized regression neural network (GRNN) is designed for improved prediction accuracy of the GRNN. Thirty groups of data are obtained using Ansoft, and the prediction accuracy of the improved GRNN is verified using the data. The mean squared error (MSE) of normalized prediction results reaches 0.1404. The improved prediction model has the prediction error less than 10% and its performance is better than the RBF and the KCV-GRNN.
Introduction
Optimization is a common problem in engineering whereby better results are obtained on the existing basis adopting certain processes and methods. Common optimization problems can be divided into linear, non-linear, single-objective, and multi-objective problems. Optimization algorithms are used to solve complex problems. And many algorithms have recently been proposed, broadening the application fields of algorithms [1].
The meta-heuristic (MH) algorithm [2] is the main research object of this study. Meta-heuristic algorithms are mainly divided into four types, the first being the swarm intelligence (SI) algorithm. The swarm intelligence algorithm applies the process of swarm optimization to computational optimization, and the most common algorithm of this type are particle swarm optimization (PSO) [3], artificial bee colony (ABC) [4], and ant colony optimization (ACO) [5]. The relatively new algorithms in the field of swarm intelligence include the bonobo optimizer (BO) [6] and aquila optimizer (AO) [7].
The second is the evolutionary algorithm (EA) that is based on imitating biological evolution to achieve optimization. The most common algorithms of this type are genetic algorithms (GA) [8] and differential evolution (DE) [9]. However, relatively new algorithms in the field of evolutionary algorithms include the invasive tumor growth optimization algorithm (ITGO) [10].
The third is a physics-based algorithm (PHA) that realizes optimization by simulating the laws of physics. The gravitational search algorithm (GSA) [11] is more common and is optimized by simulating the action law of gravity. However, relatively new physics-based algorithms include central force optimization (CFO) [12].
The last is a human-based algorithm (HBA) that computes based on human optimization behavior. Common algorithms in machine learning are teaching and learning-based optimization (TLBO) [13] and reinforcement learning algorithms (Q-learning [14], SARSA [15]), which mainly imitate human education and learning behavior. The relatively new algorithms in the field of human-based algorithms include the future search algorithm (FSA) [16] and deep Q-network (DQN) [17].
Although there are different types of algorithm, they have a common running process of a global development and a local search. The main task of global development is improving the convergence speed by preliminarily determining the range of optimal values. The main task of the local search is ensuring convergence accuracy by obtaining optimal results within the range of optimal values. The reasonable setting of the global search stage and the local search stage considering the balance between accuracy and speed.
At the same time, the main task of the algorithm is solving the optimization problem. It is best to use different optimization algorithms for different optimization problems. When the optimization problem is more complex or takes a long time to solve, the balance of the algorithm itself will need to be adjusted. An algorithm that places emphasis on the local search is suitable for a problem whose solution range is easy to determine, whereas the algorithm that places emphasis on the global search is suitable for a problem whose solution accuracy does not need to be high. The adaptive algorithm can adjust the balance as the characteristics of the problem change in the process of solving.
In summary, algorithms with different degrees of balance are generally required to solve diverse optimization problems. At present, there are two ways to solve a problem. One is to find a better algorithm to solve the problem and the other is to solve the problem by improving the algorithm. This paper mainly discusses the second method. As the optimization problem, this paper chooses the electromagnetic structural design of a Halbach hybrid array for application.
Maglev technology has been widely used in maglev bearing [18–23], train [24–26], and control platform [27–32], and so on. An electromagnetic actuator is the main mechanical structure that suspends objects in a contactless manner in a maglev system, and comprises a mix of electromagnets, permanent magnets, and electromagnetic permanent magnets. In an electromagnetic permanent-magnet hybrid structure, the permanent-magnet structure provides the main support force and the electromagnetic structure provides auxiliary control. A hybrid electromagnetic permanent-magnet structure represented by a Halbach array has been studied for its magnetic enhancement effect.
Owing to the physical coupling between the electromagnetic field and the structure, the relationship between the magnetic force variation in the permanent magnet-electromagnetic hybrid structure and the structural parameters shows a non-linear and strong coupling phenomenon, which adds complexity to the overall design of the structure. To solve these problems, researchers have proposed theoretical solutions [33–37], a simulation analysis [38], a combination of theory and finite elements [39], and experimental research [40,41]. The Halbach model was based on the accurate solution of Laplace’s and Poisson’s partial differential equations (PDEs) using a variable-separation method [34]. However, the model solution of the Halbach array has some errors and limitations, and the SVM-GS model adopted by Li et al. provides research ideas [42].
With the development of neural networks, artificial intelligence has been adopted to solve design problems in the maglev field [43–48]. In contrast with traditional numerical simulations, the neural network methodology adopts a training data set to obtain a law of the data input and output, thus avoiding the complexity of the actual structure in practical application design, establishing a structure prediction model, and achieving higher calculation accuracy. As a radial neural network, the Generalized Regression Neural Network (GRNN) obtains a better prediction model on the premise of training on a small sample dataset [49–51]. In [50], the K-folder cross validation (K-CV) was used to improve the generalized regression neural network (GRNN) to model and predict the lamellar spacing and mechanical properties of hypereutectoid steels with a small sample data. If an optimization algorithm is used to optimize the influencing parameters of the network structure, the accuracy of the prediction model can be greatly improved, providing convenience in the actual design of electromagnetic structures and shortening the design cycle [52–55].
The aquila optimizer (AO) algorithm has excellent algorithmic performance and has a wide range of applications, including neural networks and big data. The performance of the AO algorithm can be improved by introducing Lévy flight, interruptions, mutations, and other random components (relating to either local or global search methods) [7]. The present paper proposes a prediction model of a modified AO algorithm combined with the GRNN, applies the prediction model in the prediction of the electromagnetic force of a Halbach hybrid array, and verifies the effectiveness and feasibility of the prediction model by using test functions and conducting simulation experiments.
AO algorithm
This paper mainly discusses a new swarm intelligence algorithm, namely the AO algorithm [7]. The algorithm mimics the hunting behavior of a bird of the genus Aquila. In nature, the hunting process of Aquila can be divided into the following steps.
Aquila hovers in the sky. When they first find their prey, Aquila glide close to the prey. Prey that senses the approach of Aquila will run away, but Aquila do not attack rashly. Instead, Aquila track the prey through changes in flight altitude and distance.
Aquila wait until the tracking distance is sufficiently short. When the distance reduces to a certain threshold, Aquila attack their prey.
Aquila confirm the capture, completing the capturing process.
Therefore, compared with other meta-heuristic algorithms, the Aquila hunt has four main characteristics. First, Aquila do not hunt blindly. From the beginning to the end of the hunt, Aquila spend the first two-thirds of their time searching and determining the approximate range of their prey. In the remaining one-third of the capture time, Aquila make more precise captures in the general area. During the two periods, Aquila hunt in manner similar to global development and then a local search. From the point of view of the algorithm, this search method avoids Aquila falling into a local optimum, and the Aquila flying pursuit method based on Lévy flight enhances the global development of the algorithm. The running process of the specific algorithm can be divided into four stages. The first stage is the beginning stage of the algorithm, and the initial solution of the algorithm is obtained through Eq. (1).
x
i, j
in the equation is a value in the candidate solution X of the algorithm, and the correlation is expressed by Eq. (2). The solution was randomly generated between the upper bound (UB) and the lower bound (LB) of a given parameter. LB
j
denotes to the jth lower bound, and UB
j
denotes to the jth upper bound of the given problem. The rand represents a value randomly generated between 0 and 1.
It can also be observed from the equation that i (i = 1, 2, 3, … , N) and j (j = 1, 2, 3, … , dim) determine the position of x
i, j
in X. N, dim is the parameter of the algorithm population, where N is the population number of candidate solutions of the algorithm, and dim represents the dimension of the solution. Based on whether the iteration number of the algorithm is within the first two-thirds of the total number of iterations, the operation process of the algorithm is divided into the second and third stages. When the number of algorithm iterations is in the first two-thirds, that is, in the second stage, the algorithm equation is as follows:
δ is calculated using Eq. (7):
𝛽 is the parameter value set in the equation. In this paper and subsequent improvements, the setting was the same as that of the original algorithm, and the value size was 1.5.
In the third stage, the AO algorithm was based on the dynamic approach process of the distance between the Aquila and the prey. The prey exhibited a random escape mode. The Aquila pursued the prey faster with the progress of capture according to the operation mode of the prey. While approaching, the Aquila uses Levy flight for the capture, ensuring that the algorithm improves the capture accuracy and reduces the error rate of the Aquila. The relevant equations are as follows:
The change in QF can cause the distance between Aquila and prey to show a certain range of dynamic changes, which can avoid local optimization owing to very rapid convergence.
In the fourth stage, the algorithm obtains the optimal solution result and ends to obtain the final value. Based on the above, the basic flow of AO algorithm can be shown in Fig. 1. The fitness function value in the figure represents the value obtained by solving the fitness function of X.

The basic flow of Aquila Optimizer.
The AO algorithm has been used in predicting oil production because of its excellent optimization performance [56]. At the same time, the author compares the AO algorithm with several other optimization algorithms and finds that the AO algorithm has certain advantages. The AO algorithm could thus be popularized and used in various fields to some extent, and we can further develop the optimization potential of the algorithm itself.
It is thus considered that the advantage of the AO algorithm is that the algorithm realizes optimization through Eq. (3) with certain dynamic adaptive changes. The algorithm uses random parameters to balance the global development and local search. We can further improve the advantages of the algorithm as described in the following.
Random-parameter modification
The AO algorithm mainly imitates the process of Aquila catching prey. Equations (3), (4), (10), and (11) show that the use of random parameters determines the change in distance between Aquila and prey and the balance of the algorithm development and search. When considering natural or engineering practical problems, we find that the emergence of an optimal value generally follows a certain rule of parameters, such as the golden ratio or a normal distribution. Among these rules, taking a random number from a normal distribution is a common method of algorithm parameter optimization, which improves the search accuracy and performance of the algorithm [57–64]. The present paper thus uses this law to modify the parameters randomly in the AO algorithm, so as to ensure accuracy of the algorithm and optimize the balance of the algorithm. Here, randn represents the random number taken from a normal distribution. Consequently, Equations (3), (4), (10), (11) become the following:
Taking a random number from a normal distribution means that the generated random value follows a normal distribution in terms of probability, and the value range remains within [0, 1]. In the above equation, the addition of the normal-distribution random number can be understood as Aquila approaching a location at which the prey is more likely to appear in the process of catching prey. Additionally, Aquila will attack their prey when it is easy to catch the prey. The above improvement reduces the blindness of algorithm optimization and improves the search precision and speed of the algorithm to certain extents.
In the search process, Aquila constantly switch between global development and a local search, and changes in parameter values and variables will affect the running speed and accuracy of the algorithm. Adopting the time intervals used by Aquila, we divide the iteration of the AO algorithm into an early stage (two-thirds of the search time) and late stage (one-third of the search time). Through the division of the early and late stage, we hope that the AO algorithm conducts the global development as well as possible. Based on Eq. (13) and the principle of the algorithm, X can be viewed as the position of the Aquila in the algorithm’s search process, and X
best is denoted as the position of the prey. And
The g value decreases linearly with an increasing number of iterations, which means that the algorithm has the property of adaptive change to a certain extent. However, a basic linear change does not completely correspond to the nature of the change. The rate of change in the approaching degree should be consistent with a certain law for the physical energy to be allocated reasonably. This paper proposes that the variation law of g
w
follows a Weibull function based on the iteration cycle change, with the range still satisfying the variation range of Eq. (13). g
w
is calculated using Eq. (22).
A Weibull function, as a probability distribution function, agrees with the expression of natural law. The neutralization of the equation and the fixed parameters (𝜂, 𝛽) of the Weibull function determine the variation and rule of the probability value generated using the Weibull function. This paper takes S as 1. So, if the fixed parameters of the Weibull function are properly adjusted, the Weibull function values can show nonlinear variations, as illustrated in Fig. 2. The Weibull function value is widely used in related fields for this characteristic trend [65–72]. Equation (15) is thus rewritten as the following Eq. (23).
It is concluded from the characteristics of the Weibull function that in each iteration, the situation of Aquila themselves being close to the optimal value will change. A slower change in the g value increases the chance of observation. When Aquila approach the optimal value, the increase in the change speed accelerates the operation and search speed, such that there is an adaptive law of searching for the optimal value. On the basis of the corresponding adaptive distribution model, the balance of the global development and local search of the AO algorithm is improved.

The comparison of g values.
Through the addition of the Weibull function, the algorithm has a good balance between the global development and local search in the second and third stages. However, in the third stage, when Aquila are close to the final result, there tends to be faster convergence. Therefore, the original linearly varying G
2 is still used at this time, but an adaptive speed factor is added to accelerate convergence. To improve the hunting efficiency of Aquila during the final hunting period after full global development, this paper proposes adding an adaptive speed factor to Eq. (11) by referring to the particle swarm optimization algorithm. The equation is as follows:
Therefore, Equation (18) is transformed into the following:
Unlike the change in the Section 3.2, the change rule of the adaptive speed factor will increase with increase in time and the capture speed of the Aquila will improve in the later capture.
To verify the performance of the improved adaptive AO, the improved algorithm and the original algorithm adopted the performance parameters set in this study. The difference is that in the improved adaptive algorithm, in addition to setting the performance parameters, the values of the Weibull function parameters are set as 𝜂 = 230 and 𝛽 = 3. The benchmark functions used in the tests are listed in Table 1. Emulation software MATLABR2018a was selected and operated on a computer with an operating system of Win10pro, a CPU of Intel®core (TM) i5-4200H CPU@2.80 GHZ, 2794 MHZ.
Algorithms used for comparative analysis and their population settings. NFEs denotes the number of objective function evaluations
Algorithms used for comparative analysis and their population settings. NFEs denotes the number of objective function evaluations
To verify the superiority of the improved algorithm, we adopted some recently proposed algorithms. The benchmark functions are presented in Table 2. The algorithms used include the WHO [73], ACO [74], PSO [3], and the original AO. To ensure that each algorithm can show the corresponding excellent performance, the parameters adopted by the algorithm were subjected to the corresponding algorithm recommended by the author. Considering the importance of the population and iteration, the adopted population number is also based on the author’s suggested value. However, because a reasonable reference value has not been found for the population parameter values of some algorithms, to ensure the fairness of each algorithm in the operation, this section directly sets the NFEs (Number of Function Evaluations) value of each algorithm to 30 000 and the population number to 30. The results for each algorithm are presented in Table 3. f min denotes the optimal value of the benchmark function.
Standard benchmark functions used in this study
Simulation results of algorithm
We performed ten operations on the algorithm, and the average value of the results of the ten operations was considered as the representation of the algorithm’s accuracy, and the standard deviation was considered as the representation of the algorithm’s stability. It can be seen from the results that compared to the original algorithm, the accuracy and stability of the improved algorithm were further improved.
Although the improved algorithm exhibits results similar to other algorithms for some functions, the improved algorithm still has advantages in general. Comparing the calculation results in this paper, we consider that the improved algorithm enhances the performance without losing the excellent structure of the original algorithm. A comparison of the convergence curves for each algorithm is shown in Fig. 3. It can be seen from the figure that compared with the original algorithm, the improved algorithm has a faster convergence speed and better convergence effect in the optimization operation of each function.

Convergence curves of all the algorithms.
The general process of the design of the size of an electromagnetic structure is to obtain input and output data by conducting experiments, study the model relationship based on basic theory, verify the relationship by conducting simulations and experiments, and finally obtain the required size using the relationship. On the whole, the process is reasonable and effective. However, we need to make improvements and trade-offs in the process when we are at the design site for the following reasons. Our overall goal requires us to customize the preliminary reasonable size as soon as possible. The electromagnetic simulation settings are complex and the operational cost is high. The related theoretical research is complex. The related field data are correlated, and the input and output results are non-linear. There are limited experimental field data.
In brief, because of the limitations of the research conditions, we expect to use a certain volume of field data to make predictions using a simpler method. Through the rapid development of artificial intelligence, the use of a neural network provides us with more solutions, and the GRNN, as a small-sample prediction model, is initially suitable for the requirements of field structural design. If the accuracy of the model is improved on the basis of using the improved algorithm, the practicability of the prediction model is further enhanced. At the same time, a Halbach array as a hybrid permanent-magnet array, the effect of magnetic field enhancement has great research potential, and the final effect of different factors has a non-linear trend. Additionally, the GRNN is suited to solving structural design problems in the field. Therefore, in the structural design of the Halbach-array hybrid electromagnetic actuator, the modified AO algorithm is used to improve the accuracy of the GRNN prediction model, and the structural size is predicted. In this paper, an electromagnetic actuator comprising a Halbach array and coil is designed, as shown in the Fig. 4. The suspended substance is an iron block of fixed size, the coils are wrapped around the two permanent magnets, and the direction of the generated current is consistent with the magnetization direction of the permanent magnets. A GRNN is used to study the relationship between the electromagnetic force and the structural parameters of the electromagnetic actuator. The specific research subject is the magnetic force generated by the electromagnetic actuator structure at a certain distance for the structure size. The relationship between the structural parameters of the electromagnetic actuator is studied using a GRNN. Furthermore, the modified AO algorithm is used to optimize the GRNN and thus improve the accuracy of the prediction model of the GRNN.

Hybrid magnet based on Halbach array.
The GRNN was proposed by Donald F. Spect. The GRNN network has a strong nonlinear fitting ability and provides good prediction results even when there is a small amount of sample data, which is suitable for the situation in which the electromagnetic actuator designed in this study cannot obtain a large amount of collected data. The GRNN has four layers, as shown in Fig. 5; namely, Input Layer, Pattern Layer, Summation Layer and Output Layer from input to output. The network input is X = [x 1, x 2…, x n ] T and the output is Y = [y 1, y 2, …, y k ] T .

Generalized regression neural network structure.
Parzen non-parametric estimation is adopted in the GRNN, and the final network output value is expressed as
Data collection
The improved GRNN flow chart is shown in Fig. 6. Before the data are predicted, the normalized sample data are divided into a training group and testing group, and the smoothing factor is initialized as the input of the algorithm. The GRNN makes its prediction using the training group data in the dataset and the input smoothing factor, takes the mean square error of normalized prediction results as the fitness value of the corresponding solution (smoothing factor), and iterates within the algorithm until it finally outputs the prediction result and the corresponding mean squared error. This paper mainly discusses the effectiveness and feasibility of the field research method. Moreover, actual experiments require a lot of time and cost due to the problem of manufacturing permanent magnets of different sizes and shapes. The effectiveness of the algorithm is verified using Ansoft simulation experimental data. The same number of data available for real design are simulated, and 30 groups of experiments are set up. The dataset includes 30 groups of overall data. Twenty-two groups of data are selected as training data, another five groups of data are used as validation data, and the remaining three groups of data are used as testing data. The training data and validation data form the training group data. The training group data are used for training and optimization, and the testing group data is used to test the results. The output variable is the magnetic force F of suspended objects, and the input variable includes the length l, width w, and height (h) of Halbach array, the current intensity (I), the coil related size (h
2), the distance between suspended objects and the array surface (d), and the length (l
1), width w
1, and height (h
1) of suspended objects. Additionally, to prevent there being accidental errors in the simulation, we conduct the simulation 10 times for each group of data and take the average value of the results as the result for that group. The following measures are taken to prevent the overfitting of the prediction. The data are normalized before training. After the algorithm optimization, the training data and validation data are randomly adjusted in the training group data, and optimization is performed again until the validation count is reached.

Flow chart of the improved GRNN.
In the GRNN optimized by the algorithm, the iteration number of the algorithm is set as 1000, the population is set as 30, the number of validation is set to 10, and the smoothing factor (σ) range is set as [0, 2]. The algorithm was run ten times with consistent parameter settings during each run. The other factors in the algorithm remained unchanged after each run. The average of the run results was used as the final optimization result. After optimization, the optimal smoothing factor was 1.3037. The iterative process is illustrated in Fig. 7. However, it can be observed that the algorithm converges to the optimal value in the first 100 generations. The MSE value of the normalized prediction results corresponding to the smoothing factor was 0.1404.

The iterative process.
To further verify the prediction effect of the improved GRNN, the radial basis function (RBF) and KCV (K-fold Cross Verified)-GRNN network were compared. The radial basis function expansion speed is set to 30. Three datasets (A, B, C) were randomly selected from Table 4 with different amounts of data. The testing data in each dataset were the same. The amounts of each type of data in each dataset are shown in the Table 5. The prediction results of the three prediction models in dataset A, B, C and their relative errors are shown in Fig. 8. Table 6 shows the goodness of fit(R 2) and normalized mean square error of the prediction model.
The dataset
The dataset
Amounts of each type of data

Comparison of prediction.
Goodness of fit and mean square error of normalized prediction results
Figure 8 shows that the prediction results of the GRNN prediction model based on the improved algorithm are close to the real values for different datasets. It can be observed that the prediction results of improved GRNN for the testing data differed less in different numbers of datasets. The relative error of the prediction results of the modified GRNN is almost less than 10%, which outperforms KCV-GRNN and RBF. And the relative error of the prediction results of the KCV-GRNN model is around 35%. Looking at Table 6, it can be seen that: (1) the MSE and R 2 values of the improved GRNN model are relatively stable even in datasets with different amounts of data; (2) the R 2 values of each dataset of GRNN prediction models based on the improved algorithm is higher than that of KCV-GRNN and RBF, and the mean square error is lower than that of KCV-GRNN and RBF. Therefore, we know that GRNN has better prediction performance on a certain amount of data, and the limitation of the amount of data has less impact on improved GRNN. Collectively, the prediction performance of GRNN prediction models based on the improved algorithm exceeds that of other two prediction models.
The results show that the modified AO algorithm has improved accuracy of the GRNN and provides ideas for the improvement of the prediction model. In terms of efficiently designing an electromagnetic actuator, at present, the finite element method is mainly used to simulate and analyze the structure. However, considering the restrictions that we described earlier, there will be large errors in the theoretical design and simulation results. Therefore, in practical application, we usually design an electromagnetic actuator based on an empirical structure or simulation experiment size and build a test device to verify the results. However, it is considered that the complexity of variable combinations introduces difficulties in structural design. We therefore build a small number of experimental groups in the preliminary stage of the electromagnetic structural design, obtain the required experimental results, roughly determine the demand range, and train the GRNN to predict the experimental results for specific structural parameters using data and the improved algorithm, so as to provide effective guidance for the design of the electromagnetic actuator. Although the neural-network prediction method has limitations in data application, with the progress of science and technology and intelligent systems, the performance of the method can be continuously improved by expanding the calculation parameters and research fields.
This paper proposed a modified adaptive AO, whereby a normal distribution is adopted for the random parameter generation, and an adaptive speed factor and Weibull adaptive distribution function are included the Aquila capturing process. Benchmark function tests showed that the (Modified AO) algorithm has higher accuracy and efficiency than the WHO, ACO, and PSO algorithms and the original AO algorithm, and the improved method has certain effectiveness and thus provides a reference for improvements to other heuristic algorithms. In this paper, the modified AO algorithm was used to improve the GRNN. The algorithm was applied to the prediction of the electromagnetic force of an electromagnetic actuator. The algorithm was trained using 30 groups of simulation data, including twenty-seven groups of data for training and three groups of data for testing. The mean squared error of the improved GRNN prediction result reached 0.1404. The improved GRNN model was thus shown to be feasible and to have certain reference importance for the design of an electromagnetic actuator. The paper compared the improved GRNN with RBF and KCV-GRNN algorithm. The results show that the GRNN had advantages in prediction for small-sample data, and the use of the improved algorithm afforded the neural network better prediction performance. The relative error of the prediction results of the improved GRNN prediction model was almost less than 10%, with higher accuracy. The proposed method provides guidance and a research direction for the application of the AO algorithm in prediction.
Footnotes
Acknowledgements
This work is fully supported by the Nation Natural Science Foundation of China (51874004, 51904007), Key Research and Development Project of Anhui Province (202004a07020043), the Nature Science Foundation of Anhui Province (1908085QE227), National Key Research and Development Program Sub-Task(2020YFB1314203).
We thank Liwen Bianji (Edanz) (www.liwenbianji.cn) and Editage (
) for editing the language of a draft of this manuscript.
