A Modiﬁed Shu ﬄ ed Frog Leaping Algorithm for the Topology Optimization of Electromagnet Devices

: The memetic algorithms which employ population information spreading mechanism have shown great potentials in solving complex three-dimensional black-box problems. In this paper, a newly developed memetic meta-heuristic optimization method, known as shu ﬄ ed frog leaping algorithm (SFLA), is modiﬁed and applied to topology optimization of electromagnetic problems. Compared to the conventional SFLA, the proposed algorithm has an extra local search step, which allows it to escape from the local optimum, and hence avoid the problem of premature convergence to continue its search for more accurate results. To validate the performance of the proposed method, it was applied to solving the topology optimization of an interior permanent magnet motor. Two other EAs, namely the conventional SFLA and local-search genetic algorithm, were applied to study the same problem and their performances were compared with that of the proposed algorithm. The results indicate that the proposed algorithm has the best trade-o ﬀ between the results of objective values and optimization time, and hence is more e ﬃ cient in topology optimization of electromagnetic devices.


Introduction
Topology optimization (TO) is the process of determining the material distribution for devices that could yield the best performance under given constraints. TO has shown great potential in the device design and optimization process and has become a new paradigm to provide a quantitative design method for modern industries in multiple disciplines [1]. To enhance the speed of the TO process, numerous modern mathematical algorithms have been proposed and developed, and proved to be efficient in solving complicated three-dimensional (3D) problems [2]. Based on the optimization searching methodologies, these methods can be categorized as the deterministic method, where the searching process is based on the gradient information, such as the Newton method; and the meta-heuristic method, where the searching process is guided by the information gathered from random or designed population, such as the evolutionary algorithms, or those from the related disciplines such as the bidirectional evolution structural optimization algorithm (BESO) [3,4].
Evolutionary algorithms (EA) imitate the evolution process of population existing in the natural environment. The population could be species, flock of birds or fishes, or any other possible group of candidates that could share experience and intelligence. EAs have been adopted widely in optimizing the shape and size of electromagnetic devices because of their simplicity in applications and high optimization efficiency [5]. For instance, genetic algorithms (GA) are applied together with the finite element method (FEM) in the design and parameter optimization of interior permanent-magnet motors in various studies [6][7][8], and they have proved to be efficient in solving these problems. However, in the

The Modified Shuffled SFLA
The SFLA was proposed by Eusuff and Lansey in 2006 [13]. Similar to the other algorithms in the memetic family, the evolution process in SFLA also contains both local exploitation mechanism and global exploration mechanism. An initial population is randomly generated, evaluated, and sorted. Based on the objective function values, the individuals in the initial population are partitioned into different subgroups of equal size named memeplexes. Within each memeplex, individuals will evolve via moving towards either the local best or the global best in the memeplex. After certain iterations of local evolvement, the entire population will be re-shuffled for the spreading of the memes. These steps will be repeated until the stopping criteria are met [16]. In the ordinary SFLA algorithm, in each iteration, the best candidate, i.e., frog, of each memeplex will not update its position. As each candidate will always remain at the same position, especially for the best frog in the entire population, it is easy for the algorithm to be trapped in some local optima found at the early stage of the optimization process and hence ending prematurely. To avoid this problem, a local search process for the best frog in each memeplex is added to the algorithm to help it escape from false best solutions. The flowchart of the proposed SFLA is given in Figure 1. For an optimization problem with n control parameters, each frog in the algorithm is an n dimension vector, At the beginning of the optimization, N frogs are generated using the Latin-hypercube sampling method to ensure the entire design space can be well explored. Based on the objective value of each individual frog, the initial population is then sorted, and evenly partitioned into m memeplexes S 1 , S 2 , . . . , S m , with each memeplex containing p frogs, where N = m × p. For instance, if m = p = 3, then S 1 contains X 1 , X 4 , X 7 , S 2 contains X 2 , X 5 , X 8 , and S 3 contains X 3 , X 6 , X 9 , given all X i have been sorted. The number of frogs in each memeplex is set to be n + 1 based on the Nelder-Mead method [17]. Following the partition process, a local search is conducted in memeplexes. A random vector with 1/10 upper and lower bound is added firstly to the best frog in the memeplex, X b,k : Appl. Sci. 2020, 10, x FOR PEER REVIEW 3 of 10 search process for the best frog in each memeplex is added to the algorithm to help it escape from false best solutions. The flowchart of the proposed SFLA is given in Figure 1. For an optimization problem with n control parameters, each frog in the algorithm is an n dimension vector, [ , , ,..., ] At the beginning of the optimization, N frogs are generated using the Latin-hypercube sampling method to ensure the entire design space can be well explored. Based on the objective value of each individual frog, the initial population is then sorted, and evenly partitioned into m memeplexes 1 2 , ,..., m S S S , with each memeplex containing p frogs, where N m p = × . For instance, if 3 m p = = , then 1 S contains 1 4 7 , , X X X , 2 S contains 2 5 8 , , X X X , and 3 S contains 3 6 9 , , X X X , given all i X have been sorted. The number of frogs in each memeplex is set to be 1 n + based on the Nelder-Mead method [17]. Following the partition process, a local search is conducted in memeplexes. A random vector with 1/10 upper and lower bound is added firstly to the best frog in the memeplex,   The objective function value of the new frog is evaluated. If it is better than the original frog, then X b,k is replaced by X b,k . After the update of the best frog in the k th memeplex S k , a small portion of frogs are selected to form a sub-memeplex. The selection probability of each frog in the memeplex is derived based on their objective value ranking in the memeplex using the triangular probability function [11]: where P i,k is the frog selection probability in the k th memeplex and i is the ranking of the frog. Inside the sub-memeplex, the frog with the best objective value, X b,k , and the frog with the worst objective value, X w,k , are identified. To imitate the process of sharing information, the worst frog will learn from both the best frog in the sub-memeplex and from the global best in the entire population, which is a process similar to the PSO algorithm [13]. Mathematically, the position of the worst frog is updated by: where S is the predefined step size, and w is the random weight between [0,1]. If the new position X w,k is within the design space, its objective value is evaluated. If the result is not better than the original objective value of the same frog, the position of the worst frog will be updated again using the position of the global best frog, X b,overall , instead of the position of the best frog in the sub-memeplex: If the new position X w,k is within the design space, again its objective value is evaluated. If in both cases there is no improvement in the objective value, the worst frog is mutated according to: The local search process will repeat for t times, and then the entire population is shuffled and moved to the next iteration. As extra numbers of function evaluations are required, the optimization time for each iteration is longer than that in conventional SFLA. These steps repeat until the stop criterion is met.

Normalized Gaussian Radial Basis Function Formulation
In the TO process for the electromagnetic devices, a commonly practiced method when constructing the topology of the model is to divide the design space into a number of small elements, and assign material to each element based on the value of its topology function controlled by the design variables of the problem. Because the position vectors of the frogs can be any arbitrary numbers in the design space, the design variables in SFLA should be continuous. Therefore, in this paper, the normalized RBF modeling method [16] is employed to reconstruct the topology of the electromagnetic devices. In the normalized RBF method, the value of topology function at location x in the design space can be described as: where M is the total number of RBFs in the model, · is the multidimensional norm, w i is the weight of each RBFs and is the design parameter, and the function φ is the predefined radial function. The value Appl. Sci. 2020, 10, 6186 5 of 11 of s(x) determines the material type of the element x e located at the position x, which is either iron or air in this paper: where Mat(x e ) defines the material type of element x e . Because only the weight of each RBF is controlled during the optimization process, the number of control parameters as well as the complexity of the problem can be significantly reduced. Moreover, the usage of RBFs helps to transfer the discrete topology matrix into function of continuous variables. The radial function used in this paper is the normalized Gaussian function with zero mean. For a RBF centered at x e , its value at any point x in the design space is: The radius of the RBFS is determined by its variance σ. To ensure that the entire design domain can be reconstructed, the RBFs are set to be evenly distributed, and their radii are larger than the distance between any two consecutive RBFs. In the proposed TO process, both the position and the radius of RBFs are predefined to reduce the number of control variables with a less complicated reproduction process. The design parameter, which is the weight of each RBF, is set to be positive to avoid any possible conflict in the topology definition, and is bounded between [0,1] to reduce the design space. After the calculation of the topology function, the material type of the element is also determined and assigned in order to create a topology matrix accordingly. To further remove the checkerboard pattern in the topology, a 2D filter is used to refine the topology matrix. The actual FEM evaluation is then conducted using the created model.

Problem Formulation and Numerical Experiments
In this paper, the proposed SFLA is applied to the topology optimization of the iron part in the rotor of a benchmark IPM. To reduce the time for objective value evaluation, the 2D model of the 1/4 cross-section of the prototype machine with periodic boundary condition is used for FEM evaluation, and the stack length is set to be 120 mm. All other parameters in the model are set to be constants. Table 1 lists all the fixed parameters. The design space of the problem is the 1/16th portion of the rotor which is then replicated with two mirror processes to re-construct the quarter model. The usage of smaller design space helps to improve the resolution of the obtained topology with the same number of elements, as well as ensuring a symmetrical rotor structure. The entire design domain is divided into 990 elements, 22 in a row and 45 in a column, with each element occupying 0.5 • in width and 1 mm in length and is filled with either iron or air. Numerical experiments were conducted to search for the best number of RBFs and Gaussian variance for the RBF modeling process. To obtain a smooth topology with relatively small number of design variables, (4 × 9) = 36 RBFs are used to cover the entire design domain. Each RBF is set to be fiveelements from its neighbor RBF, in both radial direction and along the arcs, and the variance of the Gaussian function is set to 1. The control parameters, which are the weight of each RBF, are set to be bounded within [0, 1]. Figure 2 depicts the initial design domain and the 36 RBFs are used to construct the topology. The red circles in the design domain indicate the RBFs and their effective area, where inside the effective area the values of RBFs are positive, and outside the effective area their values are assumed to be zero. Hence, each RBF controls only the topology of a small region in the design domain, and a large variety of topology can be generated using the RBF method. The aim of the topology optimization is to maximize the average torque and minimize the torque ripple, and hence the objective function of the TO problem is defined as the weighted sum of the normalized average torque and the torque ripple of the IPM evaluated using Ansys Maxwell, evaluated by the virtual work method employed in the software: where c 1 and c 2 are two predefined weight coefficients and equal to 1 in this paper, Area iron is the area of iron part in the IPM of the design, and Area design is the area of the design space, which has a fixed size in the optimization problem, and hence can serve as the volume constraint of the TO problem.
ensuring a symmetrical rotor structure. The entire design domain is divided into 990 elements, 22 in a row and 45 in a column, with each element occupying 0.5° in width and 1 mm in length and is filled with either iron or air. Numerical experiments were conducted to search for the best number of RBFs and Gaussian variance for the RBF modeling process. To obtain a smooth topology with relatively small number of design variables, (4 9) 36 × = RBFs are used to cover the entire design domain. Each RBF is set to be fiveelements from its neighbor RBF, in both radial direction and along the arcs, and the variance of the Gaussian function is set to 1. The control parameters, which are the weight of each RBF, are set to be bounded within [0, 1]. Figure 2 depicts the initial design domain and the 36 RBFs are used to construct the topology. The red circles in the design domain indicate the RBFs and their effective area, where inside the effective area the values of RBFs are positive, and outside the effective area their values are assumed to be zero. Hence, each RBF controls only the topology of a small region in the design domain, and a large variety of topology can be generated using the RBF method. The aim of the topology optimization is to maximize the average torque and minimize the torque ripple, and hence the objective function of the TO problem is defined as the weighted sum of the normalized average torque and the torque ripple of the IPM evaluated using Ansys Maxwell, evaluated by the virtual work method employed in the software: where 1 c and 2 c are two predefined weight coefficients and equal to 1 in this paper,  Moreover, a transient analysis in Ansys Maxwell is used to compute the average torque and the torque ripple. Consequently, the length of the time step has a significant impact on the computational results. To address this issue, one first conducts a numerical experiment to decide the time step before the optimization, i.e., for a fixed topology, one incrementally reduces the length of time step until the errors of the computed average torque and the torque ripple between two successive time step reductions are smaller than a given tolerance. From this numerical experiment, the time step is finally set as period/100 for this case study.
The prototype IPM design and its performance are given in Figure 3. The average torque of the prototype, Tprototype, is 117.6 Nm, and the torque ripple of the machine is 9%. The algorithm stops when the best solution stays unchanged for five consecutive iterations or the iteration number exceeds 1000. To determine the appropriate algorithm parameters including the sub-memeplex size, local search times for the worst frogs and for the best frogs in the memeplex, the SFLA is run twice, using two Moreover, a transient analysis in Ansys Maxwell is used to compute the average torque and the torque ripple. Consequently, the length of the time step has a significant impact on the computational results. To address this issue, one first conducts a numerical experiment to decide the time step before the optimization, i.e., for a fixed topology, one incrementally reduces the length of time step until the errors of the computed average torque and the torque ripple between two successive time step reductions are smaller than a given tolerance. From this numerical experiment, the time step is finally set as period/100 for this case study.
The prototype IPM design and its performance are given in Figure 3. The average torque of the prototype, T prototype , is 117.6 Nm, and the torque ripple of the machine is 9%. The algorithm stops when the best solution stays unchanged for five consecutive iterations or the iteration number exceeds 1000. To determine the appropriate algorithm parameters including the sub-memeplex size, local search times for the worst frogs and for the best frogs in the memeplex, the SFLA is run twice, using two sets of parameters, for each single objective optimization of the prototype IPM when optimizing its average torque. The parameter values and the corresponding algorithm performances are listed in Table 2. For both cases, the sizes of the population, memeplex, and sub-memeplex are identical. In the SFLA algorithm, the best frog local search step and the worst frog improvement step are the two core steps responsible for the exploration of the design domain. In the first run, the algorithm concentrates more on the directed search, and in each memeplex, the update of worst frog's position towards the best frog's position is repeated thrice, while the random local search for the best frog is only conducted once. In the second run, the algorithm focuses on the random search, and hence the random local search for the best frog in each memeplex is conducted thrice, and the worst frog improvement step is only done once. The results of two runs indicate that, with comparable numbers of FEM evaluations, the second run can obtain a better optimization result. This is because in the first run more computing resources are used to improve the overall objective values of the entire population, which is not necessary in the case of TO of electromagnetic devices. In the second run, the addition of randomness to the population via the best frog in each memeplex significantly improves the algorithm's ability to escape from the local optimum, and hence the optimized result is better than that of the first run. Hence, in the actual multi-objective TO problem for the IPM, the second set of parameters is chosen. sets of parameters, for each single objective optimization of the prototype IPM when optimizing its average torque. The parameter values and the corresponding algorithm performances are listed in Table 2. For both cases, the sizes of the population, memeplex, and sub-memeplex are identical. In the SFLA algorithm, the best frog local search step and the worst frog improvement step are the two core steps responsible for the exploration of the design domain. In the first run, the algorithm concentrates more on the directed search, and in each memeplex, the update of worst frog's position towards the best frog's position is repeated thrice, while the random local search for the best frog is only conducted once. In the second run, the algorithm focuses on the random search, and hence the random local search for the best frog in each memeplex is conducted thrice, and the worst frog improvement step is only done once. The results of two runs indicate that, with comparable numbers of FEM evaluations, the second run can obtain a better optimization result. This is because in the first run more computing resources are used to improve the overall objective values of the entire population, which is not necessary in the case of TO of electromagnetic devices. In the second run, the addition of randomness to the population via the best frog in each memeplex significantly improves the algorithm's ability to escape from the local optimum, and hence the optimized result is better than that of the first run. Hence, in the actual multi-objective TO problem for the IPM, the second set of parameters is chosen.  After determining the algorithm parameters, the proposed modified SFLA is applied to the multi-objective TO problem formulated in the afore-section. To showcase the merit of the proposed method, its performance is compared with the performance of other two EAs, namely the original SFLA and LS-GA. Based on the famous no free lunch theorem, one cannot improve the performance of an optimization algorithm without sacrificing its performance in other aspects [18], and hence both the optimization time and the optimized results are compared as an indication of algorithm efficiency. The optimized topology designs and their corresponding torque plots of the three algorithms are   After determining the algorithm parameters, the proposed modified SFLA is applied to the multi-objective TO problem formulated in the afore-section. To showcase the merit of the proposed method, its performance is compared with the performance of other two EAs, namely the original SFLA and LS-GA. Based on the famous no free lunch theorem, one cannot improve the performance of an optimization algorithm without sacrificing its performance in other aspects [18], and hence both the optimization time and the optimized results are compared as an indication of algorithm efficiency. The optimized topology designs and their corresponding torque plots of the three algorithms are given in Figures 4-6. The details of their performances are summed up in Table 3. All three algorithms are repeated three times and their performances are averaged to make the results more reliable. Among all three algorithms, the conventional SFLA has the fastest optimization speed, and the overall optimization requires only 600+ FEM evaluations to locate the optimum. However, because there is a lack of escape mechanism, the optimized result found by the SFLA has a relative low objective value, with an average torque of 100.8 Nm, torque ripple of 28.2%, and weighted objective value of 0.539. The population size is 185, and the number of cycles to find the optimum is two and does not go through any evolvement for the remaining optimization process, making the result of the algorithm highly dependent on the initial guess of the optimization process. On the other hand, the LS-GA algorithm has the longest optimization time, as well as the best optimization results. It can successfully locate the solution with the largest average torque value of 130.8 Nm, as well as the best weighted objective values of 0.91. In view of the material consumptions, the ratios of the volumes of the material to that of the entire design domain under the optimized topologies of the conventional SFLA, the LS-GA, and the proposed SFLA are, respectively, 67.7%, 60%, and 63.5%. However, the average number of FEM evaluations for LS-GA is about 1800, which is three times the optimization time of the conventional SFLA algorithm. The performance of the proposed algorithm falls in between the conventional SFLA algorithm and the LS-GA algorithm. The average time cost of the proposed algorithm is 950 FEM evaluations, which is 1.5 times of the conventional SFLA and almost half of the LS-GA, and the optimized result found by the proposed method is 0.88, with an average torque of 126.8 Nm and torque ripple of 19.8%. The tradeoff between the optimization speed and the result performance of the proposed algorithm is the most efficient among all three EAs. Comparing with the LS-GA algorithm, the proposed algorithm sacrifices only a small degradation in the quality of the optimization result (96.7% objective value) in return for a shorter optimization time (50% optimization time). On the other hand, the local search step in the proposed algorithm enhances the algorithm's ability for exploration, and the number of cycles to find the optimum is found is 6, which is the last iteration. Because the design space is more extensively explored, the optimization time is relatively longer (1.5 times of the conventional SFLA), but with a much better optimization results (1.27 times the objective value of the conventional SFLA).
of the optimization result (96.7% objective value) in return for a shorter optimization time (50% optimization time). On the other hand, the local search step in the proposed algorithm enhances the algorithm's ability for exploration, and the number of cycles to find the optimum is found is 6, which is the last iteration. Because the design space is more extensively explored, the optimization time is relatively longer (1.5 times of the conventional SFLA), but with a much better optimization results (1.27 times the objective value of the conventional SFLA).

Conclusions
In this paper, a modified shuffled frog-leaping algorithm that is suitable for complex electromagnetic problem is proposed. Compared with conventional SFLA, the proposed algorithm adds a local search step to the global best in each memeplex formed during the optimization and discards some repetitions in the worst candidates improvement process, and hence the algorithm has a better exploitation abilities with comparable time cost. To examine the performance of the proposed algorithm, it was applied to the topology optimization of an IPM prototype, and the results were then compared with the TO results of two other evolutionary algorithms, namely the conventional SFLA and the LS-GA. The LS-GA finds the best result with the longest optimization time, while the conventional SFLA finds the result with the least objective value using the shortest time. The

Conclusions
In this paper, a modified shuffled frog-leaping algorithm that is suitable for complex electromagnetic problem is proposed. Compared with conventional SFLA, the proposed algorithm adds a local search step to the global best in each memeplex formed during the optimization and discards some repetitions in the worst candidates improvement process, and hence the algorithm has a better exploitation abilities with comparable time cost. To examine the performance of the proposed algorithm, it was applied to the topology optimization of an IPM prototype, and the results were then compared with the TO results of two other evolutionary algorithms, namely the conventional SFLA and the LS-GA. The LS-GA finds the best result with the longest optimization time, while the conventional SFLA finds the result with the least objective value using the shortest time. The

Conclusions
In this paper, a modified shuffled frog-leaping algorithm that is suitable for complex electromagnetic problem is proposed. Compared with conventional SFLA, the proposed algorithm adds a local search step to the global best in each memeplex formed during the optimization and discards some repetitions in the worst candidates improvement process, and hence the algorithm has a better exploitation abilities with comparable time cost. To examine the performance of the proposed algorithm, it was applied to the topology optimization of an IPM prototype, and the results were then compared with the TO results of two other evolutionary algorithms, namely the conventional SFLA and the LS-GA. The LS-GA finds the best result with the longest optimization time, while the conventional SFLA finds the result with the least objective value using the shortest time. The optimized result found by the proposed method is 95% of the result found by LS-GA using 50% of its optimization time, and hence the proposed algorithm has the most efficient trade-off between the optimization time and the objective values, making it suitable for the optimization of electrical machine.

Conflicts of Interest:
The authors declare no conflict of interests.