A New Study on Optimization of Four-Bar Mechanisms Based on a Hybrid-Combined Differential Evolution and Jaya Algorithm

: In mechanism design with symmetrical or asymmetrical motions, obtaining high precision of the input path given by working requirements of mechanisms can be a challenge for dimensional optimization. This study proposed a novel hybrid-combined differential evolution (DE) and Jaya algorithm for the dimensional synthesis of four-bar mechanisms with symmetrical motions, called HCDJ. The suggested algorithm uses modiﬁed initialization, a hybrid-combined mutation between the classical DE and Jaya algorithm, and the elitist selection. The modiﬁed initialization allows generating initial individuals, which are satisﬁed with Grashof’s condition and consequential constraints. In the hybrid-combined mutation, three differential groups of mutations are combined. DE/best/1 and DE/best/2, DE/current to best/1 and Jaya operator, and DE/rand/1, and DE/rand/2 belong to the ﬁrst, second, and third groups, respectively. In the second group, DE/current to best/1 is hybrid with the Jaya operator. Additionally, the elitist selection is also applied in HCDJ to ﬁnd the best solutions for the next generation. To validate the feasibility of HCDJ, the numerical examples of the symmetrical motion of four-bar mechanisms are investigated. From the results, the proposed algorithm can provide accurate optimal solutions that are better than the original DE and Jaya methods, and its solutions are even better than those of many other algorithms that are available in the literature.


Introduction
Symmetrical motion mechanisms in which the forward and return strokes are the same movement have been applied in many mechanical systems. Four-bar mechanisms with symmetrical and asymmetrical motions are commonly used in mechanical devices such as sewing machines, round balers, and suspension systems of automobiles [1,2]. Achieving higher precision design of four-bar mechanisms, whose symmetrical motions satisfy the input path of a point in the coupling link, is still a challenge for the kinematic dimensional calculation. It results from the highly nonlinear objective function with many constraints.
Regarding methods for designing four-bar mechanisms, Zhang [3] proposed the graphical method, and Freudenstein [1] has been used in analysis to compute the kinematic dimensions of linkages. However, this method resulted in low precision and waste time [4]. In recent decades, random search algorithms such as differential evolution [2,[5][6][7][8], genetic algorithm [4,9], simulated annealing algorithm [10], and particle swarm optimization [2,11,12] have been used to solve kinematic dimensions of the mechanisms to increase accuracy in mechanism design.
The synthesis of four-bar mechanisms has been mentioned in recent years due to their wide applications in mechanical systems. Fernandez et al. [13] proposed the determination of kinematic dimension in order to minimize the objective function based on the dimensional constraint equation of mechanisms. The design of a four-bar mechanism used for the shadow robot is presented in [14]. Ramon et al. [15] applied the combination of difference evolution and local search algorithms for synthesis planer mechanisms, in which the four-bar mechanism is one of the examples in this work. These works, however, have limited the application cases of four-bar mechanisms. The teaching-learning based optimization algorithm has been used to determine the kinematic dimension of four-bar mechanisms [16,17]. In these researches, the signed timing has not been considered. Varedi-Koulaei [18] synthesized four-bar mechanisms using graphical and analytical methods.
With random search algorithms, the Jaya algorithm is also a newly proposed approach [19]. This method has been applied for solving numerous optimization problems [20,21]. In order to obtain an optimal solution by using the Jaya algorithm, a high computational cost is essentially required. Thus, to improve its performance, the Jaya algorithm has been combined with other algorithms [5,22,23]. Up until now, the application of the Jaya algorithm in designing four-bar mechanisms is still limited [24].
One of the most well-known random search algorithms is DE algorithm which can be found in [25]. DE algorithm has been used to find the optimal solution for a lot of problems [26][27][28]. It is similar to the other random search, as an optimal solution is found by using the DE algorithm, which also requires a considerable computation cost. For this reason, several modifications of DE were proposed [29][30][31][32][33][34][35]. The combination of DE and other algorithms such as GA [36,37], PSO [38,39], and fireworks algorithm (FA) [40,41] was proposed. Furthermore, some additional modifications of DE were also proposed for path synthesis of four-bar mechanisms such as Cabrera [6], Ortiz [7], Lin [8]. Concretely, Cabrera [6] proposed a modified crossover to change the values of genes in the mutant and target vectors to achieve better values of objective functions for the next generation. Based on the work of Cabrera, Ortiz [7] suggested a tuning technique for the control parameters of F, CP, MP, and range to avoid the multiple executions of the algorithm until their proper values are found. Furthermore, Lin [7] proposed a new combined mutant operator of DE. In the combined mutation, DE/best/1, DE/current to best/1, and DE/rand/1 are used in the first k% ranking parents, middle-ranking parents (ranked between (k%, m%]), and other inferior parents, respectively.
From the discussions mentioned above, the investigation of a hybrid algorithm between DE and Jaya for improving the optimal dimensional synthesis of the four-bar mechanism has not yet been reported. Thus, this study proposes a novel hybrid-combined differential evolution and Jaya algorithm (called HCDJ) to fill the above research gap. The current hybrid algorithm combines DE and Jaya to improve the accuracy of optimal solutions. By combining the mutation operator DE with a Jaya operator, the global exploration ability of HCDJ is significantly enhanced, and thus the solution accuracy is also improved. Concretely, in the modified mutation stage, three groups of mutations are used in the first k%, middle, and remaining populations, respectively. DE/best/1 and DE/best/2, DE/current to best/1 and Jaya operator, and DE/rand/1, and DE/rand/2 belong to the first, second, and third groups, respectively. Additionally, the refined initialization stage is applied to choose individuals that are satisfied with Grashof's condition and consequential constraints. Finally, the elitist selection technique is used in the selection phase to determine the best solutions for the next generation. To prove the effectiveness and robustness of the HCDJ algorithm in terms of accuracy, five numerical examples for the dimensional synthesis of four-bar mechanisms with symmetrical motions are performed, and outcomes obtained by the proposed methodology are compared with those of some available algorithms in the literature. The rest of this article is arranged as follows. Section 2 presents the optimization problem of four-bar mechanisms. In Section 3, a brief review of the classical DE and Jaya is presented firstly, and then a perspective scheme of the proposed HCDJ is discussed. In Section 4, five commonly examined numerical examples for the dimensional synthesis of the four-bar mechanisms are performed to validate the effectiveness and robustness of HCDJ. Then, results obtained in five cases are discussed in Section 5. Finally, some conclusions are provided in Section 6.

Dimensional Synthesis of the Four-Bar Mechanisms
In this study, we focus on the dimensional synthesis of the four-bar mechanisms and the optimization problem, which is used to determine the kinematic dimensions of linkages and positions of pin-joints denoted by O 2 and O 4 (see Figure 1) by giving the input path of the coupler point C in link 3. C i and C i d are set as target points indicated by the input point and the designed point, respectively, i.e., Yd . Therefore, the objective function can be written as follows [4] : where N is the number of points in the path of the coupler, and X is preventative for the design variables' vector characterized by kinematic dimensions and positions of the linkages and can be expressed as where r 1 , r 2 , r 3 , and r 4 denote the kinematic dimensions of links 1, 2, 3, and 4, respectively; a, b, x 02 , y 02 , and θ 1 are shown in Figure 1; θ 1 2 , θ 2 2 , ..., θ n 2 are preventative for the angle positions of link 2 at input positions of coupler C, respectively. In Equation (1), the position of the coupler C in the reference frame O 2 xy can be computed based on the closure loop as found in [5]. It can be calculated as C x = r 2 cos θ 2 + a cos θ 3 − b sin θ 3 , C y = r 2 sin θ 2 + a sin θ 3 + b cos θ 3 .
The angle positions of links 3, i.e., θ 3 can be computed as where G, H and J are calculated as the following equations in which, The position of the point C in the global coordinate OXY, as shown in Figure 1, can be simply computed as It should be noted that the i th design variable (X i ) is in the range of X min i , X max i with its upper bound of X min i and lower bound of X max i . In addition to the constraint on the design variable, there are also two more constraints, namely the Grashof's condition and the sequence of input angles. These constraints can be displayed as follows.
The Grashof's condition allows the mechanism to have an entire ration link that is connected with the frame (link 1); this condition is denoted by h 1 (X). If Grashof's condition is true, h 1 (X) = 0, in contrast h 1 (X) = 1. Mathematically, this constraint could be given as in which, [s, l, p, q] ∈ [r 1 , r 2 , r 3 , r 4 ]; s and l denote the shortest and longest lengths, respectively; p and q are other lengths. The constraint for the sequence of input angles is that the angle-position values of link 2 are in sequence; this condition is denoted by h 2 (X). If this condition of input angles is true, h 2 (X) = 0, in contrast h 2 (X) = 1. Mathematically, this constraint is expressed as in which, θ m 2 is equal to min{θ n 2 }; θ n 2 is the value of θ 2 in its nth position; Z is the number of input angles and mod(n, m) is the remainder of the quotient of n/m.
These conditions need to be put into the objective function; thus, the objective function in Equation (1) can be rewritten as where 1 is the penalty constant.

Differential Evolution Algorithm
In each generation of the DE algorithm, there are four main stages, which are initialization, mutation, crossover, and selection [25].

• Initialization
For each optimization problem, NP is presentative of the number of individuals in the population and its initial values are randomly selected in a predefined continuous search space. In which, each i th individual (i = 1, 2, . . . , NP) is a vector of design variables denoted by D and is given by where L j and H present the lower and upper boundary vectors; NP denotes the number of individuals in the population; D characterizes the number of design variables; rand[0, 1] creates a random value within 0 and 1. The superscripts, i.e., (g = 0) and g show the initial and current iterations, respectively. The i th individual vector with (g = 0, 1, . . . , g max ) can be written as X • Mutation After the first stage, to increase the variety of the entire population, a mutant vector V g i is generated from the target vectors by using a mutation. The four most frequently used mutation schemes are "DE/rand/1", "DE/rand/2", "DE/best/1"and "DE/best/2". Two former DE operators have a good ability in terms of the global search but their convergence speed is slow. In contrast, two latter DE operators have a good local searching ability, yet obtained solutions may be trapped into local optima [42]. These four DE/operators are shown as in which R 1 , R 2 , R 3 , R 4 and R 5 are differential numbers selected in [1, 2, 3, .., NP]; F is a random number between 0 and 1, and X g best is the best individual vector in the current iteration.
Owing to using such mutation schemes, the vector V g i might be violated at its lower and higher bounds. Thus, for satisfying the boundary constraints, this vector is returned to its search space by using the following formulas • Crossover To obtain good optimal solutions, the crossover stage is performed. The i th trial vector is generated by mixing the target vector X g i and the mutant vector V g i as follows in which Rand is a random number chosen in [1,NP], and the crossover value Cr is randomly selected in [0.7, 1].

• Selection
This stage compares the trial individual, U g i , with the target individual, X g i , and then chooses the better ones for the next iteration based on their objective function values. This strategy can be expressed as

Jaya Algorithm
The Jaya algorithm can be found in [19]. There are three steps to solve the optimization problem, which are: initial solutions, generating new solutions, and selection. The first and last steps of the Jaya algorithm are similar to the DE algorithm. In the generating new solutions, the best and worst solutions at g, denoted by X g best and X g worst , are created based on the tendency of one moving closer to success or reaching the best solution and trying to avoid failure or moving away from the worst solution [19]. Mathematically, this tendency can be expressed as follows: where R 1 , R 2 , and R 3 are differential numbers selected in [1, 2, 3, . . . , NP]; rand[0, 1] is a random number between 0 and 1.

Hybrid Differential Evolution and Jaya Algorithm
This section presents a novel hybrid-combined differential evolution (DE) and Jaya algorithm (HCDJ) for the kinematic dimension synthesis of four-bar mechanisms . Like the classical DE and Jaya algorithms, the proposed-hybrid algorithm has four main stages, which include: initialization, the hybrid-combined mutation, crossover, and selection. The crossover in DE and HCDJ is the same, and the other stages in HCDJ have some modifications, which are given in great detail as follows.

Modified Initialization
In the dimensional synthesis of four-bar mechanisms, the highly constrained objective function depends on the constraints related to Grashof's condition and the sequences of input crank angles. Consequently, a random initialization stage might generate a small number of individuals that satisfy these above mentioned-constraints. Hence, the poor quality of the initial population might be generated. To tackle this problem, the refinement of the initialization is proposed in [2,8]. In this refinement, the first four variables related to the link lengths of the mechanism and crank angles of the input link are randomly chosen in the given range. Regarding the lengths, if they are not satisfied with Grashof's condition, they are randomly generated until Grashof's condition is true. For crank angles of the input link, if the consequential condition is false, these angles are rearranged counter-clockwise or clockwise. For example, in one problem, six input crank angles are needed and the vector of these values is generated as follows: [θ 1 2 , θ 2 2 , θ 3 2 , θ 4 2 , θ 5 2 , θ 6 2 ] = [2π, π, π/4, π/2, π/5, π/6]. It shows that these crank angles violate the consequential condition. Thus this vector could be rearranged as follows: [π/5, π/4, π/2, π, 2π, π/6] or [2π, π, π/2, π/4, π/5, π/6]. As a result, the initial population can provide much more feasible solutions for finding the optimal solutions. Concretely, this modified initialization is illustrated in Figure 2.
Rearranging q 2 (CCW or CW) X i Figure 2. The modified initialization in HCDJ.

Hybrid-Combined Mutation
This section presents the mutation of HCDJ to increase the solution accuracy in which a hybrid-combined mutation strategy is proposed. In the proposed mutation, DE/best/1 and DE/best/2, DE/current to best/1 and Jaya operator, DE/rand/1 and DE/rand/2 belong to the first, second, and third groups of individuals, respectively. The first, second, and third groups contain the first, middle, and remaining individuals, respectively. The ratios of these groups in mutation are x%, y% and z% (with z% = 100% − x% − y%), respectively, in which the total sum of them is 100%. In each group of mutation operators, to switch between two operators, a constant value of sigma, called σ, is used. Concretely, if a random value in the range of [0, 1], called rand(), is bigger than σ, a new location is updated by using DE/best/1 or DE/current to best/1 or DE/rand/1; otherwise, it is updated by using DE/rand/1 or Jaya operator or DE/rand/2, respectively. Thus, a perspective view of the hybrid-combined mutation of HCDJ is provided in Figure 3, in which, a is a round number of x%.NP, b is a round number of y%.NP; c is the total sum of a and b.

Elitist Selection
In the classical DE and Jaya algorithms, finding the next population is based on the comparison of the cost function values of the old and new individuals. Even though the worse individual is better than the others in the current population, some good individuals may be neglected, and thus the convergence rate and the accuracy of the solutions are not optimized yet so far. To improve this, an elitist selection [43] is used to choose the best individuals for the next iteration. Hence, the process of the HCDJ algorithm is shown in Figure 4.

Numerical Examples
This section presents several examples in design kinematic dimensions of four-bar mechanisms with symmetrical motions, which have been investigated in [2,4,7,8,44] by using GA, DE, and PSO, respectively. Thus, results obtained by HCDJ are compared with those of GA, DE, and PSO in such algorithms. The four-bar mechanisms with symmetrical motions must satisfy the Grashof's condition, as shown in Section 2 in order to make the symmetrical motion of the mechanisms. In Cases 1 and 5, the problem is the path generation without prescribed timing. In contrast, in Cases 2, 3, and 4, the problems are known by the input of the coupler point. In this work, Jaya, DE, and HCDJ algorithms are applied for finding the optimum solutions, as shown in Figure 1, and the optimal results of these algorithms are compared with the other algorithms that have been used in the previous studies. The population sizes (NP) in Cases 1 and 5 are equal to 100, and the population sizes are equal to 50 in both Cases 2, 3, and 4. The maximum iterations in Cases 1, 4, and 5 are equal to 1000 and are equal to 100 in Cases 2 and 3. By investigations, the values of

Case 1
In this case, the input data of the coupler point are presented in [2,4,7]. The design variables' vector, input path and boundaries for design parameters are respectively provided in Equations (18) to Equations (20).

Effects of the Parameters of F and σ in HCDJ on the Optimal Solutions
This section investigates the effects of the parameters of F and σ in HCDJ on the optimal solutions. Firstly, the mutant factor (F) used in HCDJ is investigated by considering the following five cases: 0.4, 0.5, 0.6, 0.7, and the range [0.7, 1]. In this examination, the values of σ, x% and y% are equal to 0.3, 30% and 30%, respectively. Obtained results are shown in Table 1. It can be seen that when F is equal to 0.7, the HCDJ algorithm yields the best optimal solutions compared to other cases of F. Next, the seven different cases of σ are investigated in which the values of F, x% and y% are equal to [0.7, 1], 30% and 30%, respectively. Obtained results are shown in Table 2. It can be seen that when σ is equal to 0.2, the HCDJ algorithm yields the best optimal solutions compared to other cases of σ. From the obtained results in Tables 1 and 2, the suitable values of F and σ are set to 0.7 and 0.2, respectively, and are recommended for the HCDJ.

Effects of the Parameters of x% and y% in HCDJ on the Optimal Solutions
Next, the effects of the parameters of x% and y% in HCDJ on the optimal solutions are studied. In this examination, the values of F and σ are set to 0.7, and 0.2, respectively. The values of x% and y% used in HCDJ are investigated by considering 16 different cases. The obtained results are shown in Tables 3 and 4. It can be seen that when x% and y% are equal to 20% and 30%, the HCDJ algorithm yields best optimal solutions compared to other cases of x% and y%. From the obtained results in Tables 3 and 4, the suitable values of x% and y% are chosen as 20% and 30%, respectively, in HCDJ operators and are recommended for the HCDJ.   Table 5 provides the optimal results obtained by HCDJ, and other approaches. It can be seen that HCDJ gives the best optimal solutions in all algorithms, 8.84 × 10 −29 for HCDJ. Additionally, Figure 5 shows the best path traced by the coupler in Case 1 by using HCDJ and there is a very good traced path of the point C. Additionally, the convergence rates of the HCDJ, DE, and Jaya are shown in Figure 6. The HCDJ reaches the optimal solutions faster than the DE and the Jaya.

Case 2
In this case, path generation with a prescribed timing of four-bar mechanism is performed, which is also investigated in [2], the inputs for the optimization problem are six coupler points and these points belong to a semi-circular arc. Thus, the design variables' vector is defined as follows: The six input coupler points are chosen as follows: The boundary conditions of the design parameters can be expressed as follows: r 1 , r 2 , r 3 , r 4 ∈ 0, 50 ; a, b ∈ −50, 50 .
(23) Table 6 shows the optimal solutions obtained by HCDJ and other algorithms. It can see that HCDJ gives the best optimal solutions in all algorithms, 1.92392270 × 10 −6 for HCDJ. Additionally, Figure 7 shows the best path traced by the coupler in Case 2 with using HCDJ and there is a very good traced path of the coupler (point C in link 3). Furthermore, the convergence speed of the HCDJ, DE, and Jaya are also illustrated in Figure 8. The HCDJ algorithm reaches the optimal solutions much faster than the DE and the Jaya.
The boundary conditions of the design parameters can be expressed as follows: r 1 , r 2 , r 3 , r 4 ∈ 0, 50 ; a, b, x 02 , y 02 ∈ −50, 50 ; θ 1 ∈ 0, 2π . Table 7 shows the optimal solutions obtained by HCDJ and other algorithms. It can be seen that HCDJ gives the best optimal solutions in all algorithms, 0.016077817 for HCDJ. Additionally, Figure 9 shows the best path traced by the coupler in Case 3 using HCDJ, and there is a very good traced path of the coupler (point C in link 3). Furthermore, the convergence speed of the HCDJ, DE, and Jaya are also illustrated in Figure 10. The HCDJ reaches the optimal solutions much faster than the DE and the Jaya.

Case 4
In the Case 4, a path generation problem with prescribed timing is performed. Six coupler points in a vertical straight line are used as inputs. Then, the vector of design variables is given as follows X = r 1 r 2 r 3 r 4 a b x 02 y 02 θ 1 .
The 18 desired coupler points are selected as follows: Lower and upper boundary for design variables is taken in an interval as the following equation which is given as follows: r 1 , r 2 , r 3 , r 4 ∈ 0, 50 ; a, b, x 02 , y 02 ∈ −50, 50 ; θ 1 ∈ 0, 2π .
(29) Table 8 shows the optimal solutions obtained by HCDJ and other algorithms. It can be seen that HCDJ gives the best optimal solutions in all algorithms, 1.21621220 for HCDJ. Additionally, Figure 11 shows the best path traced by the coupler in Case 4 using HCDJ and there is a very good traced path of the coupler (point C in link 3). Furthermore, the convergence speed of HCDJ, DE, and Jaya is also illustrated in Figure 12. The HCDJ algorithm reaches the optimal solutions much faster than the DE and Jaya algorithms.

Case 5
In the fifth case, an elliptical path generation problem without prescribed timing is investigated. The path consists of 10 target points. The elliptical path with a major axis of 20 units and a minor one of 16 units is considered. The center's coordinate is at (10, 10) and the major axis is kept horizontal.
(32) Table 9 shows the optimal solutions obtained by HCDJ and other algorithms. It can be seen that HCDJ and DE in [8] give the best optimal solutions in all algorithms, 4.201438 × 10 −04 for HCDJ and 4.01992 × 10 −04 for DE [8]. Additionally, Figure 13 shows the best path traced of the coupler in Case 5 using HCDJ, and there is a very good traced path of the coupler (point C in link 3). Furthermore, the convergence speed of the HCDJ, DE, and Jaya are also illustrated in Figure 14. The HCDJ algorithm reaches the optimal solutions much faster than the DE and the Jaya algorithms.

Discussion
The obtained results in five cases show that the optimal results of HCDJ are better than those of other algorithms. Except in Case 5, the best error in [8] is slightly lighter than those of HCDJ. In addition, the statistical results in terms of the maximum, mean, and standard deviation of best errors in 50 runs are also reported. HCDJ and DE are more stable than Jaya in all five cases. However, the statistical values of classical DE are smaller than those of HCDJ in Cases 1, 4, and 5. In contrast, the performances of HCDJ, in terms of statistical results, are better than those of DE in Cases 2 and 3. It should be noted that the synthesis of the mechanism is an engineering problem, and the key objective is to find the best and most optimal results. In addition, as stated by "No free lunch theorems for optimization" in [45], no optimization algorithm is the best for all problems. Thus, HCDJ outperforms other methods in the dimensional synthesis of the four-bar mechanism in terms of optimal solutions.

Conclusions
This study proposed a newly hybrid-combined algorithm, called HCDJ, as a combination of the classical DE and Jaya algorithms for the optimally dimensional design of four-bar mechanisms with symmetrical motions. The combined algorithm has a good global search to improve the optimal solution quality by using modified initialization, a hybrid-combined mutation between the classical DE and Jaya algorithm, and the elitist selection. The modified initialization generates initial individuals that are satisfied with Grashof's condition and consequential constraints. In the hybrid-combined mutation, three different groups of mutations are combined. DE/best/1 and DE/best/2, DE/current to best/1 and Jaya operator, and DE/rand/1, and DE/rand/2 belong to the first, second, and third groups, respectively. In the second group, DE/current to best/1 is hybrid with the Jaya operator. Additionally, in the selection stage, the best candidates are produced for the next generation by using the elitist selection technique. Five numerical examples, including two path generations with prescribed timing and three without prescribed timing, are performed to find the optimal designs of the four-bar mechanisms. The obtained solutions of HCDJ are compared with those of the original DE, Jaya, and other algorithms existing in the literature. The optimal results using the HCDJ algorithm have indicated that it can achieve better performances in terms of the solution accuracy than the original DE and Jaya, even in many other algorithms. Accordingly, the proposed HCDJ algorithm is expected to apply not only to symmetrical motion mechanisms, but also asymmetrical motions of mechanisms and various engineering problems.
Author Contributions: S.N.-V.: Conceptualization, methodology, investigation, resources, software, writing-original draft, funding acquisition. Q.X.L.: investigation, writing-review and editing. N.X.-M.: conceptualization, methodology, software, writing-original draft, writing-review and editing, supervision. T.T.N.N.: conceptualization, methodology, software, writing-original draft, writing-review and editing, project administration, supervision. All authors have read and agreed to the published version of the manuscript.