1 Introduction

The polar coordinate systems have applications in many fields such as mathematics, physics, and engineering. In the scene where the angle and distance between two points can be easily expressed, the polar coordinates can have a good representations effect, this kind of scene can only be obtained by trigonometric formula in Cartesian coordinate system. Polar equations are the simplest and easiest representation methods for a great deal of curves [1]. For the solution of some complex mathematical problems, the expression of polar coordinate equation is the most time-saving and labor-saving, such as spirals [2, 3]. In physics, for some special physical phenomena, for instance, objects in a plane physical system moving around a center point, or trajectory motion at a certain point, the use of polar coordinate modeling often simplifies complex problems and is more conducive to understand and solve, and even get unexpected results. Some geometric trajectory problems are simpler to be solved by polar coordinate method than by Cartesian coordinate method. For the expressions of some curves, it is difficult to express in the Cartesian coordinate system, but the use of polar coordinate equations will make the expressions of the curves more intuitive and clearer [4]. Now, the polar coordinate system is widely used in a number of science computation and engineering fields [5,6,7].

Metaheuristic algorithms are methods to derive the optimal and satisfactory solution of complex problems based on the bio-inspired mechanism [8]. Bio-inspired optimization explains the basic principle of optimization algorithm through the understanding of related behaviors, experiences, rules and action mechanisms in biological, physical, chemical, social and artistic systems, extracts corresponding feature models under the guidance of specific problem characteristics, and designs intelligent iterative search optimization algorithm [9]. Meta heuristic algorithm can solve NP hard problems effectively and search the optimal solution of the problem accurately [10, 11]. In general, the metaheuristic optimization methods are divided into the following four types according to different division criteria: evolution-based [12], swarm intelligence-based [13], physics and chemistry-based [14], and other methods. The first is based on evolutionary algorithms, such as genetic algorithm (GA) [15], differential evolution algorithm (DE) [16], evolutionary deduction algorithm (ED) [17]. The second is based on swarm intelligence and is generally based on the behavior of fauna in nature, such as particle swarm optimization (PSO) [18], ant colony optimization (ACO) [19], artificial bee colony (ABC) [20], firefly algorithm(FA) [21], bat algorithm(BA) [22], cuckoo search (CS) [23], dragonfly algorithm (DA) [24], moth-flame optimization (MFO) [25], salp swarm algorithm (SSA) [26], marine predators algorithm (MPA) [27] and slime mould algorithm (SMA) [28]. The third type is based on physics and chemistry, such as gravity search algorithm (GSA) [29], artificial electric field algorithm (AEFA) [30], equilibrium optimizer (EO) [31], artificial chemical reaction optimization algorithm (ACROA) [32] and henry gas solubility optimization (HGSO) [33]. The last category is based on some other classical algorithms, such as sine cosine algorithm (SCA) [34], harmony search (HS) [35], teaching–learning-based optimization (TLBO) [36], etc.

In many industrial and practical application fields, curve approximation is a crucial research object [37]. Recently, many scholars are also studying the problem of curve approximation. Li [38] presented an adaptive knot placement algorithm for B-spline curve approximation to dense and noisy data points. The algorithm can be used for initial knot vector estimation for error-bounded curve approximation. The convergence speed of curve approximation iteration is faster than that of traditional methods. However, this method is not easy to understand, and the operation is troublesome. Carlos [37] used the simulated annealing algorithm to solve Bezier curve approximation problem. This study combined the advantages of traditional methods and heuristic algorithms, used Bezier curves to approximate the fitting data, and obtained better experimental results. But, no single simulated annealing pattern generates optimal values for all examples of benchmark. Moreover, different configurations show different effects in different applications, depending on the complexity and noise of the model. In [39], Laube presented a method using deep learning to compute parametrizations for B-spline curve approximation. This paper demonstrated that neural networks can successfully predict the parameters of B-spline curve approximation problems, but are constrained by the training set and limited by segmentation and sampling. Bureick [40] proposed an elitist genetic algorithm that solved the nodal adjustment problem in b-spline curve approximation in a faster and more accurate way than existing methods. However, outliers will appear in this study.

Due to the traditional methods still have problems such as insufficient precision, cumbersome operation, and long time in the curve approximation, the advantages of the metaheuristic algorithms are that it is more efficient than the blind search method, and a search problem can be obtained in a very short time. The optimal solution, for NP problems, can also get a better solution in a shorter time. Therefore, it is necessary to solve the curve approximation problem through a metaheuristic algorithm. The bald eagle search (BES) algorithm is a novel bio-inspired metaheuristic algorithm proposed by Alsattar et al. [41]. The BES algorithm imitates the hunting strategies and smart social behavior of bald eagles during fishing. Bald eagles achieve their predation through three stages. The three stages are selecting stage, searching stage, and swooping. Taking salmon as an example, bald eagles will first select the search space based on the concentration of individual and population to salmon and fly towards a specific area; second, search the water surface in the selected search space until suitable prey is found, and finally, the bald eagles will gradually change their flight altitude, swoop quickly, and successfully catch salmon and other prey from the water [42]. BES algorithm simulates this hunting method of bald eagles. Moreover, this method has been proved to be an excellent nature-inspired solution [43]. Recently, some improved BES has been proposed as follows: Angayarkanni [43] proposed a new hybrid algorithm, which mixed the grey wolf optimization (GWO) and bald eagle search (BES) algorithm and optimized the parameters of the support vector regression for the prediction of traffic flow. Ramadan applied an improved bald eagle search (IBES) algorithm to PV model parameters [44]. Karthik [45] adopted BES to solve the practical application problem of dual-combustion reactivity control combustion ignition based on engine characteristics by changing low-activity fuel. Sarkar [46] introduced a hybrid salp swarm algorithm (HSSA) and bald eagle search (BES) algorithm to optimize the phase factor of OFDM system by using the PTS method. In [47], Zhou utilized the bald eagle search (BES) algorithm to improve the ELM in predicting carbon price which was used for optimizing and adjusting the values in the experiment. And Palanivel proposed the hybrid deep belief network (DBN) based BES algorithm to optimize and predict the pulsating heat pipe compound in parabolic solar collectors [48]. The bald eagle search algorithm was improved by using levy flight strategy and simulated annealing mechanism to solve simultaneous feature selection optimization problem [42]. Kang [49] proposed a transformer winding fault classification method based on BES algorithm to optimize the kernel parameter g and the penalty coefficient C in the SVM model, denoted as BES-SVM. In biomedicine, Sayed [50] came up with a prediction model for melanoma with imbalanced data based on optimized squeeze net by the BES and so on.

In order to strengthen the population diversity of the algorithm, some of improving the coding methods of algorithm have been proposed [51, 52]. Xiang proposed the polar coordinate salp swarm algorithm (PSSA) [53], which omitted the transformation process of coordinate system. Different from the traditional coding methods proposed before, PSSA updates position directly in polar coordinate space. However, the convergence speed and optimization accuracy of PSSA need to be improved and it gets easily to fall into local optimization. To solve these problems, the polar coordinate bald eagle search algorithm (PBES) is proposed; its initialization stage is modified to make the distribution of initialized individuals more uniform, and some parameters are introduced to strengthen the exploration and exploitation capabilities of PBES. PBES improves the performance of the algorithm by increasing population diversity and enhancing the exploration ability. This paper introduces a modified PBES algorithm and applied it to three aspects as follows: polar coordinate transcendental equation, curve approximation, and robotic manipulator.

The rest of this paper is structured as follows: Sect. 2 is the preparation of related work: methods of polar coordinate coding and introduction of the BES algorithm. Section 3 will introduce the PBES algorithm. The results and discussion that combine polar transcendental equations and curve approximate design are given in Sect. 4. Section 5 is the inverse kinematics solution of a 7-DOF manipulator. We introduce the conclusion and future work in Sect. 6.

2 Related Work

2.1 Polar Coordinate Coding

Nowadays, there are various coding versions of metaheuristic algorithms have been proposed, such as binary conversion, four-element encoding, complex encoding, quantum coding, polar encoding, etc. They will strengthen the population diversity of the algorithm and enhance the search space by changing the coding modes. Matthysen [51] modified the particle swarm optimization (PSO) algorithm through the appropriate mapping function so that it can search and optimize in the polar coordinate space and put forward the polar coordinate version of PSO algorithm. For some evolutionary algorithms (EAs), corresponding scholars have continuously proposed polar coordinate versions. For instance, the polar evolutionary strategy (Polar ES) [52]. Yang [54] proposed a novel style particle swarm optimization (SPSO) algorithm based on polar coordination system, polar coordinate system and complex number operation, the design of the overlap space searching method and parameter of w. Shan [55] proposed a new selecting strategy in polar coordinates for multi-objective particle swarm optimization; some scholars [56] designed an improved NSGA-II algorithm based on polar coordinates transform that made pareto optimal solutions distribution more uniform. Al-Sayyed [57] proposed a new optimization algorithm named POLARPSO, which can search more points by using the polar coordinate function, which not only enhanced the performance of PSO algorithm, but also avoided local optimal traps. Recently, some researchers put forward an improved polar-coded version of the artificial fish swarm algorithm (PC-AFSA) [58]. And Wu came up with a polar coordinate coding of fruit fly optimization algorithm (PCFOA) [59]. Lin [60] adopted a local clustering mode based on high-order histogram in polar coordinate; some achievements have been made in face recognition and retrieval problems.

Polar coordinate coding can further enrich the application range of the algorithm and achieve good results. However, the polar coordinate coding all use mapping functions to transform between polar coordinate space and Cartesian space, that is, the encoding and decoding process, which greatly increases the workload and brings distortion in the conversion process. In order to solve this problem, Xiang et al. proposed the PSSA [53]. The proposed PSSA can omit the coordinate system transformation process. PSSA does not need to use the mapping function to convert between the Cartesian system and the polar coordinate system, but directly initializes the individual in the polar coordinate system, and PSSA updates the position of the individual by renewing the polar angles and polar diameters, respectively. Owing to the population initialization, search process and position update are carried out in polar coordinate system directly, so PSSA reduces the computational complexity of the algorithm [53]. But, in PSSA, uneven initialization distribution gets easily to occur in the initialization stage, and the exploration ability of the algorithm needs to be strengthened. Moreover, the convergence speed and search accuracy of PSSA need to be improved as it can easily get stuck in local optimization. So, in this paper, the coding method of PSSA is improved, and its initialization stage is modified to make the distribution of initialized individuals more uniform, and some parameters are introduced to strengthen the exploration and exploitation capabilities of the BES algorithm. During calculating fitness function values, PBES does not need to be converted to Cartesian coordinates. On the contrary, the polar angle and the polar diameter are regarded as two variables, and the individual is judged by calculating the fitness function value. PBES increases the population diversity so that the algorithm can perform better under the same conditions. Accordingly, this makes the exploration ability of the algorithm greatly strengthened.

2.2 Bald Eagle Search Algorithm (BES)

The bald eagle search algorithm (BES) imitates the hunting strategies and smart social behavior of bald eagles during fishing [41]. BES has three stages during predation, as shown in Fig. 1. In the select stage, bald eagles will select the space with the largest number of prey for search. Then, in the search stage, bald eagles search for prey by moving within the select space in the previous stage. Finally, in the swooping stage, bald eagles move and dive from the best position identified in the search stage and decide the best position for hunting. The swooping stage starts at the best point, to which all other movements are directed.

Fig. 1
figure 1

The three main stages of hunting by BES [41]

2.2.1 Select Stage

In the selection stage, bald eagles will first select the search space and then identify and select the best predation area, which is determined based on the number and concentration of prey. And then the bald eagles will prey in this area, as shown in Eq. (1).

$$ P_{{\text{i,new}}} = P_{{{\text{best}}}} + \alpha * r(P_{{{\text{mean}}}} - P_{i} ), $$
(1)

where \(\alpha\) is the parameter that controls the position change, the value range is 1.5–2, and \(r\) is a random number between 0 and 1. \(P_{{{\text{best}}}}\) represents the determined best location for the bald eagles to pick an area in the previous search. Meanwhile, \(P_{{{\text{mean}}}}\) is the position of the average distribution of bald eagles after the previous search. \(P_{i}\) denotes the position of the ith bald eagles. \(P_{{i,{\text{new}}}}\) is the new location of the bald eagles.

2.2.2 Search Stage

During the search stage, the bald eagles constantly search for prey in the search space selected in the previous phase, flying in a spiral shape and moving in different directions. The mathematical formula for the location update is as follows:

$$ P_{{i,{\text{new}}}} = P_{i} + y(i) * (P_{i} - P_{i + 1} ) + x(i) * (P_{i} - P_{{{\text{mean}}}} ), $$
(2)
$$ x(i) = \frac{xr(i)}{{\max (\left| {xr} \right|)}}{, }y(i) = \frac{yr(i)}{{\max (\left| {yr} \right|)}}, $$
(3)
$$ xr(i) = r(i) * \sin \left( {\theta (i)} \right){, }yr(i) = r(i) * \cos \left( {\theta (i)} \right), $$
(4)
$$ \theta (i) = a * \pi * rand\;{\text{and}}\;r(i) = \theta (i) + R * rand, $$
(5)

where \(\theta (i)\) is the polar angle and \(r(i)\) is the polar diameter. \(a\) and \(R\) are the parameters that control the spiral trajectory, and their variation ranges are 5–10 and 0.5–2, respectively. And \(rand\) is a random number between 0 and 1. \(x(i)\) and \(y(i)\) represent the position of the bald eagle in polar coordinates, both ranging from −1 to 1. \(P_{i + 1}\) is the next updated position of the ith bald eagles.\(\left| {xr} \right|\) is the absolute value of xr. \(\left| {yr} \right|\) means the same as \(\left| {xr} \right|\).

2.2.3 Swooping Stage

During the swooping stage, the bald eagles are constantly moving, swooping towards the prey from the best location in the previous search, while other individuals also swoop from the best position to hunt the prey. Equation (6) simulates this behavior of bald eagles as follows:

$$ P_{{i,{\text{new}}}} = rand * P_{{{\text{best}}}} + x1(i) * (P_{i} - c_{1} * P_{{{\text{mean}}}} ) + y1(i) * (P_{i} - c_{2} * P_{{{\text{best}}}} ), $$
(6)
$$ x1(i) = \frac{xr(i)}{{\max (\left| {xr} \right|)}}{, }y1(i) = \frac{yr(i)}{{\max (\left| {yr} \right|)}} $$
(7)
$$ xr(i) = r(i) * \sinh \left( {\theta (i)} \right){, }yr(i) = r(i) * \cosh \left( {\theta (i)} \right), $$
(8)
$$ \theta (i) = a * \pi * rand\;{\text{and}}\;r(i) = \theta (i), $$
(9)

where \(c_{1}\) and \(c_{2}\) increase the movement intensity of bald eagles towards the best and center points; they all take values between 1 and 2.

The pseudo-code of BES is shown in Algorithm 1 [41].

Algorithm 1

BES algorithm.

Pseudo-code of the BES algorithm

1.Random initialization Point \(P_{i}\)

2.Calculate the fitness values of initial Point: \(f(P_{i} )\)

3.While (the termination conditions are not met)

Select space

4.For (each point \(i\) in the population)

5.\(P_{{i,{\text{new}}}} = P_{{{\text{best}}}} + \alpha * rand(P_{{{\text{mean}}}} - P_{i} )\)

6.If \(f(P_{{{\text{new}}}} ) < f(P_{i} )\)

7.\(P_{i} = P_{{{\text{new}}}}\)

8.End If

9.If \(f(P_{{{\text{new}}}} ) < f(P_{{{\text{best}}}} )\)

10.\(P_{{{\text{best}}}} = P_{{{\text{new}}}}\)

11.End If

12.End For

Search in space

13.For (each point \(i\) in the population)

14.\(P_{{i,{\text{new}}}} = P_{i} + y(i) * (P_{i} - P_{i + 1} ) + x(i) * (P_{i} - P_{{{\text{mean}}}} )\)

15.If \(f(P_{{{\text{new}}}} ) < f(P_{i} )\)

16.\(P_{i} = P_{{{\text{new}}}}\)

17.End If

18.If \(f(P_{{{\text{new}}}} ) < f(P_{{{\text{best}}}} )\)

19.\(P_{{{\text{best}}}} = P_{{{\text{new}}}}\)

20.End If

21.End For

Swoop

22.For (each point \(i\) in the population)

23.\(P_{{i,{\text{new}}}} = rand * P_{{{\text{best}}}} + x1(i) * (P_{i} - c_{1} * P_{{{\text{mean}}}} ) + y1(i) * (P_{i} - c_{2} * P_{{{\text{best}}}} )\)

24.If \(f(P_{{{\text{new}}}} ) < f(P_{i} )\)

25.\(P_{i} = P_{{{\text{new}}}}\)

26.End If

27.If \(f(P_{{{\text{new}}}} ) < f(P_{{{\text{best}}}} )\)

28.\(P_{{{\text{best}}}} = P_{{{\text{new}}}}\)

29.End If

30.End For

31.Set \(k = k + 1\)

32.End While

3 Our Proposed PBES Algorithm

3.1 Inspiration

Inspired by Fig. 2, in view of the fact that the trajectory shape of bald eagle searching for preys is spiral and bald eagle dives spirally to capture the preys during the predation phase. Therefore, the BES algorithm can be applied to polar coordinate space. Therefore, the PBES algorithm is proposed. In the polar coordinate system, for each individual can be defined and initialized. In the initialization phase, each individual is defined as a binary array \((\rho_{n} ,\theta_{n} )\). This amounts to increasing the population diversity during initialization process. In this way, when calculating the fitness function, PBES omits the transformation process of coordinate system. In polar coordinates, the PBES algorithm updates the polar angle and polar diameter, respectively, and calculates the fitness value directly.

Fig. 2
figure 2

Bald eagles searching within a spiral space

3.2 PBES Mathematical Model

In the polar coordinate system, for the initialization phase of the PBES algorithm, the parameters of the individual, that is, the polar angle and the polar diameter are directly initialized and stored as an array. Furthermore, when the initial points are transformed between polar coordinate space and Cartesian space, they will produce a phenomenon of non-uniform distribution. To avoid the distortion happened in the transformation, we introduce the Archimedes theorem and cumulative density function (CDF) [61]. The CDF is inversed to obtain the initialization formula as follows:

$$ \rho = rand * (ub - lb) + lb, $$
(10)
$$ \theta = \beta * \cos^{ - 1} (2 * rand - 1), $$
(11)

where \(ub\) is the upper bound, \(lb\) is the lower bound in PBES, \(rand\) is a random number in the range of 0–1. \(\beta\) is the disturbance coefficient which takes a value between 0 and 2. The PBES algorithm also needs to control the boundary during initialization, and all individuals can be distributed in the whole search space. Therefore, the value range of polar angle \(\theta\) is (0, 2π). At the same time, polar diameter \(\rho\) also needs to be defined using boundaries so that the PBES algorithm does not exceed the boundary in the optimization process.

Next step, the location of each individual is updated. In PBES, the individual position is updated by renewing \(\rho\) and \(\theta\), respectively. Since BES has three stages, in PBES, the \(\rho\) is updated three times, respectively. The update formula of polar diameter \(\rho\) is given below as follows:

(1) Select stage

$$ \rho_{{i,{\text{new}}}} = \rho_{{{\text{best}}}} + \alpha * r(\rho_{{{\text{mean}}}} - \rho_{i} ), $$
(12)

where \(\alpha\) is called position change parameter, it is a parameter that controls the position change, the value range is (1.5, 2) and \(r\) is a random number with a value between 0 and 1. \(\rho_{{i,{\text{new}}}}\) is the updated polar diameter. \(\rho_{{{\text{best}}}}\) is the current best polar diameter. \(\rho_{{{\text{mean}}}}\) is the average polar diameter after the previous search. \(\rho_{i}\) denotes the ith polar diameter.

(2) Search stage

$$ \rho_{{i,{\text{new}}}} = \rho_{i} + m_{1} * (\rho_{i} - \rho_{{{\text{mean}}}} ) + n_{1} * (\rho_{i} - \rho_{i + 1} ), $$
(13)
$$ m_{1} = \frac{{\omega_{1} }}{{\max (\left| {\omega_{1} } \right|)}}, n_{1} = \frac{{\eta_{1} }}{{\max (\eta_{1} )}}, $$
(14)
$$ \omega_{1} = r_{1} * \sin (\theta ), \, \eta_{2} = r_{1} * \cos (\theta ), $$
(15)
$$ r_{1} = a * \pi * rand, $$
(16)

where \(a\) is a parameter that controls the spiral trajectory, and its variation range is 5 to 10. \(rand\) is a random number with a value between 0 and 1. \(r_{1}\) is a control parameter that can control the update range of the polar diameter. \(m_{1}\) and \(n_{1}\) represent the normalization of \(\omega_{1}\) and \(\eta_{1}\).

(3) Swooping stage

$$ \rho_{inew} = rand * \rho_{best} + m_{2} * (\rho_{i} - c_{1} * \rho_{mean} ) + n_{2} * (\rho_{i} - c_{2} * \rho_{best} ) $$
(17)
$$ m_{2} = \frac{{\omega_{2} }}{{\max \left( {\left| {\omega_{2} } \right|} \right)}} \, n_{2} = \frac{{\eta_{2} }}{{\max \left( {\left| {\eta_{2} } \right|} \right)}} $$
(18)
$$ \omega_{2} = r_{1} * \sinh (\theta ) \, \eta_{2} = r_{1} * \cosh (\theta ), $$
(19)

where \(c_{1}\), \(c_{2}\) is the enhancement coefficient, and they all take the value of 2. The pole diameter \(\rho\) is updated in three stages, after each iteration update, the updated polar diameter \(\rho\) requires to be contrasted with each other, if it is smaller than the current best polar diameter, the \(\rho\) will be changed. The mathematical formula for polar angle \(\theta\) is expressed as follows:

$$ \theta_{i + 1} = \beta * \theta_{i} \pm 2 * \cos^{ - 1} (2 * rand - 1), $$
(20)

where \(\beta\) is the disturbance coefficient which takes a value between 0 and 2. After each iteration update, the updated polar angle \(\theta\) requires to be contrasted with each other. If it is superior to the current optimal angle, the plus sign operation is performed; otherwise, the minus sign operation is performed.

After updating the values of \(\rho\) and \(\theta\) respectively, the new individual position is determined, and then the fitness function values of all individuals are calculated to find out the current best fitness function value, after that, contrast it with the global optimal fitness value F. There are two situations: one is replacement and the other is retention. If the new fitness function value is found to be superior to the current fitness value, perform the first operation; otherwise perform the second operation [53]. In the PBES, individual positions are updated in the polar coordinate system rather than in the Cartesian coordinate system; by updating \(\rho\) and \(\theta\) respectively, the position of the individual is obtained. This will greatly improve the updating speed of individuals and improve the convergence efficiency. Through the pseudo code of the PBES algorithm (Algorithm 2) and the flowchart of the PBES algorithm (Fig. 3), the PBES algorithm can be more easily to understand.

Fig. 3
figure 3

Flowchart of the PBES

Algorithm 2

PBES algorithm.

Pseudo-code of the PBES algorithm

Input population size N, maximum iteration number

Maxiter, dimension dim, upper up and lower bounds lb

Output the optimal solution

1.Initialization and load PBES parameters

2.Let N = population size

3.Each individual \(i\) = 1 to N

4.Calculate the fitness values of all the individuals

5.While (the termination conditions are not met)

6.for \(i\) = 1: dim do

7.for \(j\) = 1: Searchagents do

8.Initialize the \(S(\rho_{n} ,\theta_{n} )\) using the Eqs. (10) and (11)

9.Evaluate fitness value of each S

10.Find the best fitness value and set it as best search agent F

11.For (each Eagle (\(x_{i}\)) do

12.Update polar diameter through three stages

Select space

13.Update polar diameter using Eq. (12)

14.If \(f(\rho_{{{\text{new}}}} ) < f(\rho_{i} )\)

15.\(\rho_{i} = \rho_{{{\text{new}}}}\)

16.If \(f(\rho_{{{\text{new}}}} ) < f(\rho_{{{\text{best}}}} )\)

17.\(\rho_{{{\text{best}}}} = \rho_{{{\text{new}}}}\)

18.End If

19.End If

Search in space

20.Update polar diameter using Eq. (13)

21.If \(f(\rho_{{{\text{new}}}} ) < f(\rho_{i} )\)

22.\(\rho_{i} = \rho_{{{\text{new}}}}\)

23.If \(f(\rho_{{{\text{new}}}} ) < f(\rho_{{{\text{best}}}} )\)

24.\(\rho_{{{\text{best}}}} = \rho_{{{\text{new}}}}\)

25.End If

26.End If

Swoop

27.Update polar diameter using Eq. (17)

28.If \(f(\rho_{{{\text{new}}}} ) < f(\rho_{i} )\)

29.\(\rho_{i} = \rho_{{{\text{new}}}}\)

30.If \(f(\rho_{{{\text{new}}}} ) < f(\rho_{{{\text{best}}}} )\)

31.\(\rho_{{{\text{best}}}} = \rho_{{{\text{new}}}}\)

32.End If

33.End If

34.Update polar angle using Eq. (20)

35.Each particle \(i\) = 1 to N

36.Evaluate fitness

37.Eagle’ = \(x_{j}^{1}\)

38.Compare the values of Eagle’ and F

If F < Eagle’, replace the value of F with Eagle’

39.Update the Eagles position based on

the upper and lower bounds of variables

40.Termination conditions are met

41.Ultimately, the Eagle’ is the optimal solution

42.End While

3.3 PBES Complexity Analysis

In PBES, the population size is N, the dimension of problem is d, and the amount of iterations is t. For time complexity, first, during population initialization and parameter setting, time complexity is O (N*d); then, when updating the polar diameters, since BES has three stages, the algorithm has a three-layer loop, therefore, the time complexity is O (N*d*t); For termination criteria, the relevant time complexity is O (1). Finally, the time complexity of PBES is O (N*d*t). For the space complexity, the search agents of the proposed PBES are N and the problem’s dimension is d. Thus, the space complexity of PBES is ultimately obtained: O (N*d).

4 Results and Discussion

4.1 Experiment Settings

So as to verify the effectiveness of the PBES algorithm, PBES was tested in polar transcendental equations, curve approximation design. All algorithms are run under the environment of MATLAB R2017b and the experiment was performed on an Inter(R) Core (TM) i7-97000 CPU@ 3.00 GHz 64-bit operating system with a 16 GB RAM PC. PBES is compared with the polar teaching–learning-based optimization algorithm (PTLBO), polar coordinate salp swarm algorithm (PSSA) [53], polar marine predators algorithm (PMPA) in the best value, mean value, and standard deviation. The parameter settings of each algorithm are shown in Table 1. In order to avoid accidental results during the experiment, each function is run ten times independently. Furthermore, in this simulation experiment, the population size is set to 200 and the amount of iterations is 500.

Table 1 Parameter setting of the comparison algorithm

4.2 Testing Complex Polar Equations

Transcendental equations are equations that contain transcendental functions, that is, functions that cannot be expressed by polynomials or square roots of independent variables, as opposed to algebraic equations [62]. Transcendental equations cannot be solved by algebraic geometry. There is no general formula for solving most transcendental equations and it is difficult to get analytical solutions [63]. In order to verify the performance of the PBES algorithm, PBES was tested in polar transcendental equations and the transcendental equations are shown in Table 2, where \(\rho\) denotes the polar diameter, and \(\theta\) denotes the polar angle. The data results of the four transcendental equations tested by all algorithms are shown in Table 3, including the best value, the mean value and the standard deviation.

Table 2 Set of diverse polar equation
Table 3 Experimental results with comparison algorithms

In Table 3, we tested four transcendental equations F1, F2, F3 and F4. For equations F1 and F3, the best value of PBES is 1–2 orders of magnitude better than other algorithms, especially the PTLBO algorithm. For the mean value, PBES also outperforms other comparison algorithms. This shows that PBES is more accurate than other algorithms and can obtain better solutions. The performance of PBES standard deviation is also excellent. So PBES can not only obtain optimal solutions but also be more stable when solving transcendental equations F1 and F3. Towards equation F2, PBES is smaller than other comparison algorithms in the best value and mean value. There is little difference between PBES and PMPA in mean value. But, the standard deviation of PTLBO is better than other algorithms, including PBES. For F4, the performance of PBES is superior to other algorithms, but in the mean value, it is not much different from other algorithms and is inferior to PMPA.

The convergence curve of F1, F2, F3 and F4, is shown in Fig. 4. The first picture of Fig. 4 shows that PBES has better convergence accuracy for F1. The fluctuation of PTLBO and PSSA is relatively large before the F1 converges. Before the convergence of PMPA and PBES, the fluctuations are relatively small, but PBES can find more excellent solution. While, the convergence time of PBES and PSSA is almost the same. They all begin to converge at about 200 generations. For F2, the situation of the PSSA and PBES is basically consistent with that of F1. For the four algorithms, PBES has a slow convergence speed and low accuracy in the early stage, but in the later stage, PBES finds the smallest optimal solution. In the system of equations F3, the convergence effect of PBES is the best, both in terms of convergence speed and accuracy. This is the same as the data in Table 3. Look at F4; the convergence speed of PBES is the slowest, and it only converges when it is close to 300 generations. Like other equations, the best value obtained by PBES is also better than other algorithms.

Fig. 4
figure 4

The convergence curves of F1–F4

To sum up, these results show that PBES is superior to PTLBO, PSSA and PMPA both in convergence precision, average value and standard deviation. These results verify that PBES has better performance in solving polar transcendental equation problems. The exploration capability and exploitation capability of the PBES algorithm is better than other comparison algorithms. Conventional methods are not suitable for solving polar transcendental problems. Although PSSA can also solve polar transcendental problems [53], PBES performs better than PSSA. Compared with other algorithms that can solve transcendental equations, PBES can get better solutions in most aspects.

4.3 Testing of Curve Approximation

4.3.1 The Curve Approximation Design Problem

Intuitively, the curve can be seen as the trace left by the movement of a certain point [64]. This definition of a curve is formalized in modern mathematics as: a curve is a graph of an interval from a continuous function to a topological space [65]. Generally speaking, a curve often refers to a set of consecutive points in Euclidean space. Any continuous line can be called a curve, including straight lines, polylines, line segments, arcs, etc.

The curve approximation design is very similar to curve fitting, but there are some theoretical differences. The mathematical definition of Curve Fitting [66, 67] refers to the use of continuous curves to approximately and it is the process of constructing a simulation curve or mathematical function expression, by fitting a series of data points that may be constrained, and requiring the final effect to achieve the best. Finally, an approximately smooth function curve is constructed to approximate these fitted data [68]. Also, another related topic is regression analysis, but it focuses more on statistical inference problems.

In engineering analysis and scientific research, it is often necessary to obtain approximate function relations between independent variables and dependent variables based on some test data to complete other design calculations [69]. For the function \(F(x)\) given in function class A, denoted as \(F(x) \in A\), it is required to find the function in another class of simple and calculable functions B so that the error of \(P(x)\) and \(F(x)\) is minimized in some metric sense. Function class A is usually a continuous function on the interval \([a,b]\), denoted by \(C[a,b]\), called function approximation space. And the function B is usually n-degree polynomial, rational function or piecewise low-degree polynomial, etc. [70]. In short, it is to replace the function \(F(x)\) with a simple function \(P(x)\) approximately. This approximate substitution is called function approximation design, which is one of the most basic concepts and methods in computational mathematics and is widely used in image processing, reverse engineering and test data processing [71]. The traditional methods of function approximation include Lagrange interpolation polynomial, Spline interpolation, Ordinary least squares and Chebyshev approximation; the calculation process is complicated. Nowadays, the latest approximation is the neural network approximation.

4.3.2 Curve Approximation Design

In this section, the PBES algorithm proposed above is applied to the curve approximation design to verify the superiority of the PBES algorithm.

Table 4 tests some familiar polar equations of different types of curves, including Conic section, Pascal spiral, Spiral line and Special curve. Table 4 shows the polar coordinate equations of different curves and some necessary parameter settings. Table 5 shows the optimization results and comparison for curves in terms of best value, mean value and standard deviation. From Table 5, we can see that compared with other algorithms, PBES had achieved higher accuracy in most equations. For most curves, PBES shows an excellent effect in terms of maximum accuracy (best value). This indicates that PBES has strong exploitation ability. For the mean value and standard deviation, the four algorithms have their own advantages and disadvantages, but overall, PBES can achieve the best results in the three indicators. Standard deviation can reflect the degree of dispersion of a data set. In Table 5, PBES has the best performance in terms of standard deviation, which shows that the PBES algorithm has less fluctuation and strong stability in solving the curve approximation problem and has the best fitting approximation effect. And PBES can easily solve various curve problems. In Table 6, the original image of the function is obtained by selecting 500 points between 0 and 2π on the equation of the function curve. These uniform points obtained between 0 and 2π constitute the data set of curve approximation. After the iterative approximation of the algorithm, the image of the curve is preserved.

Table 4 Set of classic spirals
Table 5 Optimization results and comparison for curves
Table 6 Curve approximation design effect diagram

4.3.3 Results and Analysis

Table 6 shows the results of the curve approximation test, including curve approximation diagrams of PTLBO, PSSA, PMPA, PBES and curve’s original image. For conic section, PBES is obviously better than other comparison algorithms in curve approximation of Parabola. For these algorithms, the tails of the Parabola curve cannot fit and approximate well, there are many missing pieces. PSSA and PMPA approximate the upper or lower half of the Ellipse well; correspondingly they lose a lot of detail in the other half. PTLBO and PBES can approximate the upper and lower parts of the Ellipse greatly. But PTLBO is still lacking in the accuracy of curve approximation. This shows that PSSA and PMPA can easily fall into local optima, while PBES can jump out of local optimum. The points approximated by PBES are more uniform. On the Cardioid, the approximation effect of PBES is more obvious. Like Ellipse, PSSA and PMPA also lost some points on the curve approximation. And PTLBO has the worst performance. For some spiral lines, such as Archimedes spiral, the curve approximation effect of PBES is more competitive than other algorithms and PBES can be far away from the local optimum, so it can better approximate the curve. However, according to the NFL theorem, no single algorithm can be perfectly applied to all problems. For Logarithmic spiral, the approximation effects of PBES and PSSA are almost the same. This indicates that both PBES and PSSA have good approximation effects. For example, in Hyperbolic spiral curve, the effect of PMPA and PBES is similar. On the vast majority of curves, PBES can achieve good results. For Fermat spiral, the accuracy of PTLBO and PMPA still needs to be improved, and there are many noise points around the curve that were not successfully fitted. This situation also exists on other curves. For most curves, these curves fitted by the PBES algorithm are basically consistent with the original curve image and the effect of PBES is much better than other algorithms. In some special curves like the Water droplets curve, the approximation effects of the PSSA and PBES made no difference. Their fitting effects are better than PTLBO and PMPA. PBES also achieved good results on Lemniscate, Plum blossom curve and Moppet curve. However, in some complex graphs, for instance, Rose curve and Butterfly curve, the approximation graphs of those four algorithms are partially missing, and the pattern of the graphic cannot be fully displayed. The effect of PBES is still superior to others.

In summary, from the curve approximation diagram, we can see that PBES has achieved very effective results in curve approximation. For most of the curves, PBES can approach the curves very well and gets the results with high fit to the original curve. However, like other algorithms, PBES cannot achieve very efficient results on complex curves; they will have the phenomenon of missing graphs in some curve parts. Despite this, the PBES still performs better than others in curve approximation design problem.

4.3.4 Error Analysis

Figures 5 and 6, respectively, show the absolute error diagram and relative error diagram for solving each test curve. Absolute error represents the absolute value of the difference between the measured value and the real value. Relative error refers to the ratio of the absolute error caused by measurement to the measured true value and the value obtained by multiplying by 100%, expressed as a percentage. In general, relative error is a better indicator of the reliability of the measurement. From Fig. 5, the absolute errors of four algorithm curves are compared, where the yellow circle represents the curve approximation points obtained by the algorithm, and the blue point represents 500 points generated from 0 to 2π on the function curve. When the yellow circle and the blue point are denser and uniform, the error is smaller, and when the algorithm matches the original curve better, the approximation effect of algorithm is better. For relative error, it means the error between the approximation point obtained by the algorithm and the point on the original curve during the iterative process. The relative error is smaller means the approximation effect of algorithm is better, more stable of the algorithm, and the accompanied by smaller fluctuations.

Fig. 5
figure 5figure 5figure 5

Absolute error diagram of all curves

Fig. 6
figure 6

Relative error diagram of all curves

Fig. 7
figure 7

The histogram of p-value

Fig. 8
figure 8

Friedman rank test for the mean performances obtained

From the absolute error diagram, we can see that PTLBO performs poorly; there are some points that are not fitted, and the error is large. PMPA performs well on some curves, such as Parabola, Logarithmic spiral, Lemniscate, Rose curve. But there is still some gap compared with PBES. The absolute error diagram of PSSA is relatively clean, and there is no large area of noise, which shows that the fitting accuracy of PSSA is high, but the effect is general. For most curves, the relative error of PBES is smaller than others and absolute error performs better, especially in conic section, Lituus, KeNu spiral, Round involute, Water droplet curve, Lemniscate. For the Parabola and Logarithmic spiral, Plum blossom curve, the relative error of PBES is not the best, but the gap with them is very small. And the relative errors of these algorithms are not very different in Butterfly curve. For the Plum blossom curve and Moppet curve, PTLBO, PSSA and PMPA show poor performance. Furthermore, for some complex curves, such as Rose curve, Butterfly curve, the relative error difference is small, but PBES still performs better in absolute error.

Through testing the absolute error and relative error, it can be proved that PBES has better performance in curve approximation problem, and it can have strong stability while approximating the curve. In this section, by solving the curve approximation problem, it is proved that the PBES algorithm has excellent performance and strong exploration and exploitation capabilities. This is due to the introduction of polar coordinates and the adjustment of some parameters. In addition, polar angle and polar diameter are updated directly in polar coordinate space, which simplifies the position updating formula and reduces the calculation process of the algorithm.

4.3.5 Wilcoxon Rank Sum Test

To verify the effect of PBES on statistical test, we performed nonparametric Wilcoxon rank sum test analysis. On account of the heuristic algorithms have great contingency and randomness, similar statistical tests are needed to ensure the reliability and effectiveness of the experimental data. This will facilitate meaningful comparison between the proposed PBES and PTLBO, PSSA and PMPA. Generally, Wilcoxon's p-value test [72] is a method to verify whether there are significant differences between the two groups of data and it is widely used in statistical hypothesis testing. The smaller the p value, the greater the difference between the data. When p < 0.05, it indicates that there is a significant difference between the data considered within the 95% confidence interval.

Figure 7 shows the p-value comparison results among PBES and PTLBO, PSSA and PMPA. It records the comparison results of 16 curves between PBES and other three algorithms. It can be seen that the p value of each curve is much lower than 0.05, and all are below 10E−10. This indicates that there are significant differences between PBES and other three algorithms in all curves. Especially for the Archimedes spiral, between PBES and PSSA, the p value is the smallest of the 16 curves and it reached 10E−46, indicating that the difference between PBES and PSSA is the largest for the Archimedes spiral. For PMPA, the p value of Butterfly curve spiral is the highest, but it is much lower than 0.05. This indicates that there are significant differences in Butterfly curve. Therefore, the p-value test proved that in all curves there were significant differences between PBES and PTLBO, PSSA and PMPA. As well as, the performance of the PBES algorithm is more excellent than other algorithms.

4.3.6 Friedman Rank Test

Friedman's test is tested with SPSS software, and the following three parts are obtained: variables, average ranking size, and average ranking size [73]. The smaller the average ranking, the better the results obtained by the algorithm. We use Friedman rank test to further verify the performance of the PBES algorithm. Figure 8 presents the mean ranks obtained by Friedman rank test from the mean performances of the algorithms for each curve. The value obtained by PBES is the smallest, which proves that the PBES algorithm has better performance in solving curve approximation problems.

5 Inverse Kinematics Solution of a 7-DOF Robotic Manipulator

5.1 Background of the Inverse Kinematics

Inverse kinematics (IK) is a fundamental discipline of robotics and is applied to many practical problems; it plays a vital role in some scenarios such as trajectory planning, dynamics analysis, and motion control [74]. Inverse kinematics is used for solving the angle of each joint when the end position of the manipulator is known. The IK problem requires moving the end effector to the desired location, and our job is to move the end of the robotic manipulator to the desired location as precisely as possible and take the least time. When the joint arrangement of the manipulator meets Pieper’s criterion: the adjacent three axes are parallel or intersect at one point, the IK problem has an analytical solution [74]. The equations of inverse kinematics are complex, highly nonlinear, and coupled, so it is difficult to solve them quickly and accurately by general methods [74]. For the IK problem, there are some traditional solutions including analytical algorithms and numerical iterative algorithms. It is difficult for traditional algorithms to obtain accurate solutions, and it is time-consuming, with unsatisfactory stability and real-time performance. In contrast, intelligent algorithms have great advantages. First, there is no need to establish a complex kinematic model. Second, the use of random or meta-heuristic search strategies can effectively solve the global optimization problem and obtain the optimal solution in a shorter time [74]. Owing to that the intelligent algorithms can solve the inverse kinematics problem effectively, it is necessary to use the intelligent algorithms, for example, the PBES algorithm.

5.2 Mathematical Model of the Robotic Manipulator

At present, the most popular ones in the field of robotics are the 6-DOF and 7-DOF robotic manipulators, which arouse the interest of related researchers and scholars [75]. This kind of manipulator has many characteristics, such as flexible movement, easy to avoid obstacles, large working space, and low latency. In general, the higher the degree of freedom of the manipulator, the more complex the structure, and these manipulators also have the problem of complex structure and difficult operation [76]. We use a 7-DOF robotic manipulator to conduct experimental simulations to verify the performance of the PBES algorithm. As shown in Fig. 9, the manipulator has seven revolute joints.

Fig. 9
figure 9

The 7-DOF robotic manipulator [76]

In this subsection, the PBES algorithm presented in this paper is applied to the computational simulation experiment of inverse kinematics is carried out on the 7-DOF robot manipulator to verify its accuracy and efficiency. In the inverse kinematics problem, DH parameters [77] are indispensable in the inverse kinematics calculation and analysis process of 7-DOF robot manipulator. They use four parameters to represent the relationship between the two joints as shown in Table 7.

$$ {}_{i - 1}^{i} T = \left[ {\begin{array}{*{20}c} {\cos \theta_{i} } & { - \cos \alpha_{i} \cdot \sin \theta_{i} } & {\sin \alpha_{i} \cdot \sin \theta_{i} } & {a_{i} \cdot \cos \theta_{i} } \\ {\sin \theta_{i} } & {\cos \alpha_{i} \cdot \cos \theta_{i} } & { - \cos \theta_{i} \cdot \sin \alpha_{i} } & {a_{i} \cdot \sin \theta_{i} } \\ 0 & {\sin \alpha_{i} } & {\cos \alpha_{i} } & {d_{i} } \\ 0 & 0 & 0 & 1 \\ \end{array} } \right] $$
(21)
$$ A_{{\text{End - Effector}}} = {}_{0}^{7} T = {}_{0}^{1} T \cdot {}_{1}^{2} T \cdot {}_{2}^{3} T \cdot {}_{3}^{4} T \cdot {}_{4}^{5} T \cdot {}_{5}^{6} T \cdot {}_{6}^{7} T = \left[ {\begin{array}{*{20}c} {n_{x} } & {s_{x} } & {a_{x} } & {P_{x} } \\ {n_{y} } & {s_{y} } & {a_{y} } & {P_{y} } \\ {n_{z} } & {s_{z} } & {a_{z} } & {P_{z} } \\ 0 & 0 & 0 & 1 \\ \end{array} } \right] $$
(22)
$$ \begin{gathered} {}_{0}^{1} T=\left[ {\begin{array}{*{20}c} {c\theta_{1} } & 0 & { - s\theta_{1} } & 0 \\ {s\theta_{1} } & 0 & {c\theta_{1} } & 0 \\ 0 & { - 1} & 0 & {l_{1} } \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]; \, {}_{1}^{2} T=\left[ {\begin{array}{*{20}c} {c\theta_{2} } & 0 & {s\theta_{2} } & {l_{2} c\theta_{2} } \\ {s\theta_{2} } & 0 & { - c\theta_{2} } & {l_{2} s\theta_{2} } \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]; \, {}_{2}^{3} T=\left[ {\begin{array}{*{20}c} {c\theta_{3} } & 0 & { - s\theta_{3} } & {l_{3} c\theta_{3} } \\ {s\theta_{3} } & 0 & {c\theta_{3} } & {l_{3} s\theta_{3} } \\ 0 & { - 1} & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]; \hfill \\ {}_{3}^{4} T=\left[ {\begin{array}{*{20}c} {c\theta_{4} } & 0 & {s\theta_{4} } & {l_{4} c\theta_{4} } \\ {s\theta_{4} } & 0 & { - c\theta_{4} } & {l_{4} s\theta_{4} } \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]; \, {}_{4}^{5} T=\left[ {\begin{array}{*{20}c} {c\theta_{5} } & 0 & { - s\theta_{5} } & {l_{5} c\theta_{5} } \\ {s\theta_{5} } & 0 & {c\theta_{5} } & {l_{5} s\theta_{5} } \\ 0 & { - 1} & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]; \hfill \\ {}_{5}^{6} T=\left[ {\begin{array}{*{20}c} {c\theta_{6} } & { - s\theta_{6} } & 0 & {l_{6} c\theta_{6} } \\ {s\theta_{6} } & {c\theta_{6} } & 0 & {l_{6} s\theta_{6} } \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]; \, {}_{6}^{7} T=\left[ {\begin{array}{*{20}c} {c\theta_{7} } & { - s\theta_{7} } & 0 & {l_{7} c\theta_{7} } \\ {s\theta_{7} } & {c\theta_{7} } & 0 & {l_{7} s\theta_{7} } \\ 0 & 0 & 1 & {d_{7} } \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]. \hfill \\ \end{gathered} $$
(23)
$$ \begin{gathered} \begin{array}{*{20}l} {Px = \left( {c\theta_{1} c\theta_{2} c\theta_{3} c\theta_{4} - s\theta_{1} s\theta_{3} c\theta_{4} - c\theta_{1} s\theta_{2} s\theta_{4} } \right)} \hfill \\ { \, \left( {c\theta_{5} c\theta_{6} l_{7} c\theta_{7} - c\theta_{5} s\theta_{6} l_{7} s\theta_{7} - s\theta_{5} d_{7} + c\theta_{5} l_{6} c\theta_{6} + l_{5} c\theta_{5} } \right)} \hfill \\ { \, \left( { - c\theta_{1} c\theta_{2} s\theta_{3} - s\theta_{1} c\theta_{3} } \right)\left( {s\theta_{5} c\theta_{6} l_{7} c\theta_{7} - s\theta_{5} s\theta_{6} l_{7} s\theta_{7} + c\theta_{5} d_{7} + s\theta_{5} c\theta_{6} l_{6} + l_{5} s\theta_{5} } \right)} \hfill \\ { \, \left( {c\theta_{1} c\theta_{2} c\theta 3s\theta_{4} s\theta_{1} s\theta_{3} s\theta_{4} c\theta_{1} c\theta_{4} s\theta_{2} } \right)\left( { - s\theta_{6} l_{7} c\theta_{7} - c\theta 6l_{7} s\theta_{7} - l_{6} s\theta_{6} } \right)} \hfill \\ { \, + c\theta_{1} c\theta_{2} \left( {c\theta_{3} c\theta_{4} l_{4} + l_{3} c\theta_{3} } \right) - s\theta_{1} \left( {s\theta_{3} c\theta_{4} l_{4} + l_{3} s\theta_{3} } \right) - c\theta_{1} s\theta_{2} l_{4} s\theta_{4} + c\theta_{1} c\theta_{2} l_{2} } \hfill \\ \end{array} \\ \begin{array}{*{20}l} {Py = \theta_{1} c\theta_{2} c\theta_{3} c\theta_{4} + c\theta_{1} s\theta_{3} c\theta_{4} - s\theta_{1} s\theta_{2} s\theta_{4} )} \hfill \\ { \, \left( {c\theta_{5} c\theta_{6} l_{7} c\theta_{7} - c\theta_{5} s\theta_{6} l_{7} s\theta_{7} - s\theta_{5} d_{7} + c\theta_{5} c\theta_{6} l_{6} + l_{5} c\theta_{5} } \right)} \hfill \\ { \, + \left( { - s\theta_{1} c\theta_{2} s\theta_{3} + c\theta_{1} c\theta_{3} } \right)\left( {s\theta_{5} c\theta_{6} l_{7} c\theta_{7} - s\theta_{5} s\theta_{6} l_{7} s\theta_{7} + c\theta_{5} d_{7} + s\theta_{5} c\theta_{6} l_{6} + l_{5} s\theta_{5} } \right)} \hfill \\ { \, + \left( {s\theta_{1} c\theta_{2} c\theta_{3} s\theta_{4} + c\theta_{1} s\theta_{3} s\theta_{4} + s\theta_{1} s\theta_{2} c\theta_{4} } \right)} \hfill \\ { \, \left( { - s\theta_{6} l_{7} c\theta_{7} - c\theta_{6} l_{7} s\theta_{7} - l_{6} s\theta_{6} } \right) + s\theta_{1} c\theta_{2} \left( {c\theta_{3} c\theta_{4} l_{4} + l_{3} c\theta_{3} } \right)} \hfill \\ { \, + c\theta_{1} \left( {s\theta_{3} c\theta_{4} l_{4} + l_{3} s\theta_{3} } \right) - s\theta_{1} s\theta_{2} s\theta_{4} l_{4} + s\theta_{1} c\theta_{2} l_{2} } \hfill \\ \end{array} \\ \begin{array}{*{20}l} {Pz = \left( { - s\theta_{2} c\theta_{3} c\theta_{4} - c\theta 2s\theta_{4} } \right)\left( {c\theta_{5} c\theta_{6} l_{7} c\theta_{7} - c\theta_{5} s\theta_{6} l_{7} s\theta_{7} - s\theta_{5} d_{7} + c\theta_{5} c\theta_{6} l_{6} + l_{5} c\theta_{5} } \right)} \hfill \\ { \, + s\theta_{2} s\theta_{3} \left( {s\theta_{5} c\theta_{6} l_{7} c\theta_{7} - s\theta_{5} s\theta_{6} l_{7} s\theta_{7} + c\theta_{5} d_{7} + s\theta_{5} c\theta_{6} l_{6} + s\theta_{5} l_{5} } \right)} \hfill \\ { \, + \left( { - s\theta_{2} c\theta_{3} s\theta_{4} + c\theta_{2} c\theta_{4} } \right)\left( { - s\theta_{6} l_{7} c\theta_{7} - c\theta_{6} l_{7} s\theta_{7} - s\theta_{6} l_{6} } \right)} \hfill \\ { \, - s\theta_{2} \left( {c\theta_{3} c\theta_{4} l_{4} + l_{3} c\theta_{3} } \right) - c\theta_{2} s\theta_{4} l_{4} - s\theta_{2} l_{2} + l_{1} } \hfill \\ \end{array} \\ \end{gathered} $$
(24)
Table 7 DH parameters for 7-DOF robot manipulator [78]

where \({}_{i - 1}^{i} T\) is the transformation matrix from joint \(i - 1\) to joint \(i\) as found by using Eq. (21) and the position of the robot manipulator end controller can be calculated using formula in Eq. (22). In Eq. (22)\(P_{x} ,P_{y} ,P_{z}\) denote the specific components of the position vector of the end-effector. \(n_{x} ,n_{y} ,n_{z} ,s_{x} ,s_{y} ,s_{z} ,a_{x} ,a_{y} ,a_{z}\), represents the rotation components of the transformation matrix \(A_{{\text{End - Effector}}}\) represents the homogeneous transformation matrix of the end-effector. The transformation matrices Eq. (23) of the 7-DOF robot manipulator are continuously multiplied to obtain \(A_{{\text{End - Effector}}}\). \(s\) represents the sine function, and \(c\) is the cosine function.

5.3 Fitness Function for 7-Dof Robot Manipulator

The FK formula is used to calculate the position of joint angle and the corresponding pose. In the experiment, the position of the robotic manipulator is obtained by using PBES, that is, the predicted position. By using PBES, making the predicted position is as close as possible to the desired position. For a desired position, the mathematical formula of the fitness function is as follows:

$$ {\text{Error}} = \sqrt {(x_{2} - x_{1} )^{2} + (y_{2} - y_{1} )^{2} + (z_{2} - z_{1} )^{2} } $$
(25)

Suppose \(P_{1} = (x_{1} ,y_{1} ,z_{1} )\) is the predicted point calculated by PBES, \(P_{2} = (x_{2} ,y_{2} ,z_{2} )\) is the desired point derived from forward kinematics formula. The position error is the Euclidean distance between \(P_{1}\) and \(P_{2}\), which is obtained by Euclidean equation (Eq. 25). The smaller of the position error, the algorithm’s effect will be better. Our goal is to obtain each joint angle and optimize the position error under the condition of minimum time-consuming.

5.4 Simulation Results and Analysis

In this experiment, PBES algorithm is compared with other four intelligent algorithms: PSO, ABC, FA and PSSA, by solving the inverse kinematics problem. Each algorithm runs independently for 10 times with 150 individual populations and 500 iterations. The comparison results of end effector position points and position errors are shown in Table 8. PSO, ABC, FA and PSSA have been produced effective results in the IK problem, but PBES produced better results in the positions of end effector and error.

Table 8 Comparison of PBES with positions of end effector

As shown in Table 9, the population size of PSO, ABC and FA are 300, 100 and 50, respectively, the population size of PSSA and PBES is set to 150. The maximum number of iterations of each algorithm is 500. Solution time is also a standard factor for comparison of robotic manipulator. It is critical for robotic manipulator. Only when the manipulator reaches the target position in the shortest time, can the algorithm have good competitiveness in solving the IK problem. In Fig. 10, they were all able to reach their positions of end effector in a relatively short time. But, compared with PBES, the performance of PSO, ABC and FA is not very good. There are still differences between PBES and PSSA, PBES took less time than PSSA, whereas, under the same conditions, it took the least time for PBES to reach the target position among these algorithms.

Table 9 Comparison of PBES with other techniques
Fig. 10
figure 10

The histogram of solution time

In fact, each algorithm has a certain accuracy and short solution time in solving the IK problem, but the PBES performs best. And the desired point is almost the same as the target position by using PBES. Compared with PSO, ABC, FA and PSSA, its position error is several orders of magnitude smaller. In addition, the PBES took the shortest solution time in solving the IK problem. From the above results, it is proved that the PBES algorithm can be applied to the IK problem of a 7-DOF robotic manipulator successfully.

6 Conclusions and Future Work

This paper presents a bio-inspired PBES algorithm to solve the different problems of polar coordinate. Firstly, the polar transcendental equations of four different types of polar coordinates are tested. PBES is superior to PSSA in both the convergence speed and accuracy, which reflects the excellent performance of the PBES algorithm. Then, PBES is applied to the curve approximation design problem. The results show that PBES can approach the curve well and the approximation effect is satisfactory. It is superior to PSSA in both precision and stability of curve design problem. In addition, the error of PBES is kept small while good effect is achieved. Furthermore, Wilcoxon rank sum test was performed on PBES, the statistical results showed that PBES and PSSA were significantly different, besides, PBES has better performance. Finally, PBES is used to solve the robotic manipulator problem. Compared with other algorithms, PBES performs best and has strong competitiveness. At present, PBES has only been applied in polar transcendental equations, curve approximation inverse kinematic manipulator problems. In the future, PBES can be used to solve some more complex curve approximation problems. Of course, we can also try to use the PBES algorithm for target detection [79], face recognition [80] and the current popular auto-driving [81] problems. In addition, we can establish different polar coordinate mathematical models according to different practical application problems, improve PBES more effectively, and make PBES more widely used in polar coordinate problems.