Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

4.1 Introduction

This chapter consists of two parts. In first part, the standard Magnetic Charged System Search (MCSS) is presented and applied to different numerical examples to examine the efficiency of this algorithm. The results are compared to those of the original charged system search method [1].

In the second part, an improved form of the MCSS algorithm, denoted by IMCSS, is presented and also its discrete version is described. The IMCSS algorithm is applied to optimization of truss structures with continuous and discrete variables to demontrate the performance of this algorithm in the field of structural optimization [2].

4.2 Magnetic Charged System Search Method

One of the most recent metaheuristic algorithms is the Charged System Search (CSS) presented in Chap. 3, which uses the Coulomb and Gauss laws from physics and Newtonian laws from mechanics to guide the Charged Particles (CPs) to explore the locations of the optimum [3].

In this chapter, an improved CSS algorithm which is called Magnetic Charged System Search (MCSS) is presented. The new algorithm utilizes the governing laws for magnetic forces, and includes magnetic forces in addition to electrical forces. The movements of CPs due to the total force (Lorentz force) are determined using Newtonian mechanical laws.

4.2.1 Magnetic Laws

4.2.1.1 Magnetic Fields

There is a relation between electric and magnetic forces and these forces are called electromagnetic forces. The region surrounding any stationary or moving charged particle contains electric fields. In addition to electric field, the region surrounding any moving charged particle also contains magnetic fields. The existence of the magnetic field near the moving charged particles was Oersted’s discovery in 1819. He has shown that a compass needle deflected by a current-carrying conductor. Shortly after this discovery, Biot and Savart proposed a mathematical expression so-called Biot-Savar law that provides the magnitude of magnetic field at any point of the space in terms of the electric current that produces the field, Fig. 4.1. Biot-Savar law is expressed [4] as:

Fig. 4.1
figure 1

The magnitude of the magnetic field d B at point P due to current I through a length element d s given by Biot-Savar law [1]

$$ d\mathbf{B}=\frac{\mu_0}{4\pi}\frac{ Id\mathbf{s}\times \widehat{\mathbf{r}}}{r^2} $$
(4.1)

Here, d B is the magnetic field at point P and μ 0 is a constant called the permeability of free space, and r is the distance between d s to P.

Consider a straight wire with radius of R carrying electric current of magnitude I which is uniformly distributed through the cross-section of the wire, Fig. 4.2a . By utilizing Biot-Savar law, the magnetic field produced by wire at a point like P outside the wire, can be determined as:

Fig. 4.2
figure 2

(a) A wire carrying electric current I that is uniformly distributed in its cross-section. (b) A plot of distribution of magnetic field produced by a wire in the space [1]

$$ B=\frac{\mu_0}{2\pi}\frac{I}{r}\kern1em \mathrm{when}\kern0.5em r\ge R $$
(4.2)

The magnitude of the magnetic field inside the wire can be obtained using Ampère’s law,

$$ B=\left(\frac{\mu_0}{2\pi}\frac{I}{R^2}\right)\times r\kern1em \mathrm{when}\kern0.5em r<R $$
(4.3)

With this formulation for magnetic field, the magnitude of the field inside the wire increases linearly from r = 0 to r = R (B ∝ r), and outside of the wire, it is inversely proportional to the distance (B ∝ 1/r), and decreases by increasing the distance. When r = R, the (4.2) and (4.3) have an overlap, and both give identical magnitude for the magnetic field. A plot of these two equations from [4] is shown in Fig. 4.2b.

If there are many wires in a space, in order to calculate the total magnitude of the magnetic field in a specified point, the equivalent magnetic field should be calculated by considering the principle of superposition, and summing the magnetic fields produced by each wire. Therefore, the total magnetic field at a specified point P, due to a group of wires, can be obtained as:

$$ {B}_P={\displaystyle \sum_{i=1}^n{B}_{ip}} $$
(4.4)

where B P is the total magnetic field at point P, n is the number of wires in the space, and B ip is the magnetic field created by the ith wire at point P which can be expressed as:

$$ {B}_{ip}=\left\{\begin{array}{cc}\frac{\mu_0}{2\pi}\frac{I}{r}\hfill & \hfill for\kern0.48em r\ge R\hfill \\ {}\left(\frac{\mu_0}{2\pi}\frac{I}{R^2}\right)\times r\hfill & \hfill for\kern0.48em r<R\hfill \end{array}\right. $$
(4.5)

4.2.1.2 Magnetic Forces

When a charged particle moves in a magnetic field, a magnetic force F B will be imposed on that moving charged particle. Experiments on charged particles moving in a magnetic field results in the following:

  • The magnitude of the magnetic force F B exerted on the charged particle is proportional to the charge q and to the speed v of the particle.

  • The magnitude and direction of the magnetic force F B depend on the velocity of the particle and magnitude and direction of magnetic field B.

By summarizing these observations, an expression for calculating the magnetic force is obtained [4] as:

$$ {\mathbf{F}}_B=q\mathbf{v}\times \mathbf{B} $$
(4.6)

where B is the magnetic field exerted on the particle. Here, the only source of the magnetic field is the magnetic field produced by the wires. Thus, the magnitude of the B can be calculated using (4.5).

4.2.2 A Brief Introduction to Charged System Search Algorithm

The Charged system search (CSS) algorithm, as explained in Chap. 3, takes its inspiration from the physic laws governing a group of charged particles, CPs. These charge particles are sources of the electric fields, and each CP can exert electric force on other CPs. Using the Newtonian mechanic laws, the movement of each CP due to the electric force can be determined. The CSS algorithm is summarized in a step-by-step form as follows:

  • Step 1. Initialization

    The initial positions of the CPs are randomly determined using a uniform source, and the initial velocities of the particles are set to zero. A memory is used to save a number of best results. This memory is called the Charged Memory (CM).

  • Step 2. Determination of electric forces and the corresponding movements

    • Force Determination. Each charged particle imposes electric forces on the other CPs according to the magnitude of its charge. The charge of the each CP is:

      $$ {q}_i=\frac{ fit(i)- fitworst}{ fit best- fitworst} $$
      (4.7)

      where fit(i) is the objective function value of the ith CP, fitbest and fitworst are the so far best and worst fitness among all of the CPs, respectively.

      In addition to electric charge, the magnitude of the electric forces exerted on the CPs is depended on their separation distance that is,

      $$ {r}_{ij}=\frac{\left|\left|{\mathbf{X}}_i-{\mathbf{X}}_j\right|\right|}{\left|\right|\left({\mathbf{X}}_i+{\mathbf{X}}_j\right)/2-{\mathbf{X}}_{best}\left|\right|+\varepsilon } $$
      (4.8)

      where X i and X j are the position of the ith and jth CPs, and r ij is the separation distance these CPs. X best is the position of the best current CP, and ε is a small positive number to prevent singularity.

      The probability of the attraction of the ith CP by the jth CP is expressed as:

      $$ {p}_{ij}=\left\{\begin{array}{l}1\iff \frac{ fit(i)- fit best}{ fit(j)- fit(i)}> rand, or, fit(j)> fit(i)\\ {}0\iff else.\end{array}\right. $$
      (4.9)

      The electric resultant force F E,j , acting on the jth can be calculated by the following equation:

      $$ {\mathbf{F}}_{E,j}={q}_j{\displaystyle \sum_{i,i\ne j}\left(\frac{q_i}{a^3}{r}_{ij}\cdot {w}_1+\frac{q_i}{{r_{ij}}^2}\cdot {w}_2\right)}\cdot {p}_{ji}\cdot \left({\mathbf{X}}_i-{\mathbf{X}}_j\right),\kern0.5em \left\{\begin{array}{l}{w}_1=1,{w}_2=0\iff {r}_{ij}<R\\ {}{w}_1=0,{w}_2=1\iff {r}_{ij}\ge R\\ {}j=1,2,\dots, N\end{array}\right. $$
      (4.10)
    • Movements Calculations. According to the determined forces, each CP moves to its new position, and attain velocity as:

      $$ {\mathbf{X}}_{j, new}= ran{d}_{j1}\cdot {k}_a\cdot \frac{{\mathbf{F}}_j}{m_j}\cdot \Delta {t}^2+ ran{d}_{j2}\cdot {k}_v\cdot {\mathbf{V}}_{j, old}\cdot \Delta \mathrm{t}+{\mathbf{X}}_{j, old}, $$
      (4.11)
      $$ {\mathbf{V}}_{j, new}=\frac{{\mathbf{X}}_{j, new}-{\mathbf{X}}_{j, old}}{\Delta \mathrm{t}} $$
      (4.12)

      where rand j1 and rand j2 are two random numbers that uniformly distributed in the range (0, 1). k a is the acceleration coefficient, k v is the velocity coefficient, and m j is the mass of particle that is considered equal to q j . The magnitudes of the k a and k v are set to 0.5 which are linearly increased and decreased as:

      k a  = 0.5(1 + iter/iter max),  k v  = 0.5(1 − iter/iter max) (4.13)

      where iter is the current iteration number, and iter max is the maximum number of iterations.

  • Step 3. Charged Memory (CM) Updating

    If among all of the new CPs, there are better CP or CPs that have better objective function value than the worst ones in the CM, these should be included in the CM, and the worst ones in the CM are excluded from the CM.

  • Step 4. Checking the Termination Criteria

    Steps 2 and 3 are reiterated until one of the specified terminating criteria is satisfied.

4.2.3 Magnetic Charged System Search Algorithm

4.2.3.1 Combination of Magnetic and Electric forces

The inspiration of the standard CSS algorithm is based on a group of charged particles that exert electric forces on each other based on their charges and their separation distances. After computing the electric forces, each particle moves and its movement is calculated by using Newtonian mechanics laws. Therefore, we have charged particles that move in the search space. In physics, it has been shown that when a charged particle moves, it produces magnetic field. This magnetic field can exert a magnetic force on other charged particles. Thus, in addition to the electric forces we should consider magnetic forces. In physics, when a charged particle moves with velocity v in the presence of both an electric field E and a magnetic field B, experiences both an electric force q E and a magnetic force q v × B. The total force, known as the Lorentz force [4], exerting on the charged particle is:

$$ {\displaystyle \sum \mathbf{F}=}{\mathbf{F}}_B+{\mathbf{F}}_E=q\mathbf{v}\times \mathbf{B}+q\mathbf{E}=q\cdot \left(\mathbf{v}\times \mathbf{B}+\mathbf{E}\right) $$
(4.14)

Where F is the Lorentz force. Thus, MCSS, considers the magnetic force as an additional force with the purpose of making the new algorithm closer to the nature of the movement of charged particles. From optimization point of view, this new force records additional information about the movement of the CPs, and it improves the performance of the standard CSS.

4.2.3.2 MCSS Algorithm

The MCSS algorithm is based on its original version, standard CSS. The difference between these two algorithms is that CSS only considers the electric force, but MCSS includes magnetic forces besides electric forces. The main structure of the algorithm is the same as the standard CSS, but in MCSS changes are made in part of the algorithm where the forces are computed. By using the aforementioned physical laws about magnetic fields and forces, the magnetic forces are determined. Each solution candidate X i known as CP (charged particle) contains electrical charge. These CPs produce electric fields, and exert electric forces on each other. When a CP moves, it creates a magnetic field in the space, and this magnetic field imposes magnetic forces on other CPs.

As explained previously, the source of the magnetic fields is the movement of the CPs. For computing these fields, we assumed that CPs move in virtual straight wires with radius of R. Thus, the path of movement of each particle consists of straight wires. These straight wires change their directions by each movement of the CPs, but during the movement, each wire remains straight, Fig. 4.3. The places that a wire changes its direction, is the position of the CP at the end of its movement. When the CP starts a new movement, the direction of its movement may differ from its previous one, so the direction of the wire which includes the CP during its movement also changes. According to magnetic laws presented in Sect. 4.2.1, a conducting wire carrying electric current can creates magnetic fields in the space. Now our virtual wires contain charged particles that move on them. By each movement of the CPs, their charges are altered, so during the movement the magnitude of the charge is not constant, and changes during the movement. This movement of CPs can be comprehended as an electric current in the virtual wire. The current of a wire is the rate at which charge flows through one specified cross-section of the wire. If Δq is the amount of charge that passes through this area in a time interval Δt, the average current I avg will be equal to the charge that passes through the cross-section per unit time:

Fig. 4.3
figure 3

The schematic view of a virtual wire (movement path of a CP), q i k is the charge of the ith CP at end of the kth movement (kth iteration) [1]

$$ {I}_{avg}=\frac{\varDelta q}{\varDelta q} $$
(4.15)

Since the time intervals of each movement are set to unity, the average current will be equal to the variation of the charge. For computing the variation of the charges, we consider the start and the end points of the movement of CPs. By taking these assumptions into account, (4.15) can be written as:

$$ {\left({I}_{avg}\right)}_{ik}={q_i}^k-{q_i}^{k-1} $$
(4.16)

where (I avg ) ik is the average current in the ith wire of ith CP in the kth movement (iteration), and q i k − 1 and q i k are the charges of the ith CP at the start and end of its kth movement, respectively. Equation (4.16) shows that by this definition for the electric current, the concept of quantity represents the variation of the objective function of each CP in each movement. By this definition, the electric current can be both positive and negative values. A positive one indicates that the movement produced an improvement in the charge of the CP. In other words, since the charge of a CP is a quantity of its quality or objective function value, a positive electric current means an improvement and a negative electric current means an deterioration in the quality of the CP.

Charge of the CPs is defined by (4.7). This expression for computing electric charges results in values between 0 to 1. This is due to normalization of the objective function of each CP in that expression. Therefore, the charges of the worst and best CP are always zero and unity, respectively. Now, consider the situation that the worst CP moves in the search space, at the end of the movement, it may attain a better objective function value, but it may still be the worst CP, so its charge will still be zero. This means that there may be some situations that the objective function of a CP improves but its charge does not change because charge is a relative quantity. It seems necessary to modify the electric current expression in a way that the concept of electric current is saved, and the aforementioned problem is solved. In relation with this problem, two alternative expressions for computing electric current are proposed. The first one is:

$$ {\left({I}_{avg}\right)}_{ik}=\frac{q_{i,k}-{q}_{i,k-1}}{q_{i,k}} $$
(4.17)

Where q i,k and q i,k − 1 are the charge of the ith CP at the start of the kth and k –1th iterations, respectively. This equation gives a normalized value for the variation of the ith CP. The second proposed relation is expressed as:

$$ {\left({I}_{avg}\right)}_{ik}= sign\left(d{f}_{i,k}\right)\times \frac{\left|d{f}_{i,k}\right|-d{f}_{\min, k}}{d{f}_{\max, k}-d{f}_{\min, k}} $$
(4.18)
$$ d{f}_{i,k}= fi{t}_k(i)- fi{t}_{k-1}(i) $$
(4.19)

where df i,k is the variation of the objective function in the kth movement (iteration). fit k (i) and fit k − 1(i) are the values of the objective function of the ith CP at the start of the kth and k –1th iterations, respectively. The quantity df i,k can attain both positive and negative values. If we consider absolute values of df for all of the current CPs, df max,k and df min,k will be the maximum and minimum values among these absolute values of df, respectively. Therefore, df max,k and df min,k are always positive quantities. It should be noted that here the second expression (4.18) and (4.19) is utilized for the computation of the electric current.

For computing the magnetic field in place of each particle, one must compute the distance of that particle from the virtual wire. This distance is assumed to be the same as (4.8). Thus, r ij now means the distance between the ith wire and ith virtual CP to the jth charged particle.

In the expression for computing the magnetic force, (4.6), we should consider the velocity of the movement of CPs. In this case, due to the movements of both CPs (CP in the virtual wire and CP in the space) the relative velocity, v rel , is considered as:

$$ {\mathbf{v}}_{rel}=\frac{{\mathbf{X}}_i-{\mathbf{X}}_j}{\Delta \mathrm{t}} $$
(4.20)

where X i and X j are the positions of the ith and jth CPs, the Δt is the time step that is set to unity. Therefore the relative velocity can be rewritten as:

$$ {\mathbf{v}}_{rel}={\mathbf{X}}_i-{\mathbf{X}}_j $$
(4.21)

By considering these assumptions, the magnetic force F B,ji exerted on the jth CP due to the magnetic field produced by the ith virtual wire (ith CP) can be expressed as:

$$ {\mathbf{F}}_{\mathbf{B}, ji}={q}_j\cdot \left(\frac{I_i}{R^2}{r}_{ij}\cdot {z}_1+\frac{I_i}{r_{ij}}\cdot {z}_2\right)\cdot p{m}_{ji}\cdot \left({\mathbf{X}}_i-{\mathbf{X}}_j\right),\kern1em \left\{\begin{array}{l}{z}_1=1,{z}_2=0\iff {r}_{ij}<R\\ {}{z}_1=0,{z}_2=1\iff {r}_{ij}\ge R\end{array}\right. $$
(4.22)

where q i is the charge of the ith CP, R is the radius of the virtual wires, I i is the average electric current in each wire, and pm ji is the probability of the magnetic influence (attracting or repelling) of the ith wire (CP) on the jth CP. This term can be computed by the following expression:

$$ p{m}_{ji}=\left\{\begin{array}{l}1\iff fit(i)> fit(j)\\ {}0\iff else\end{array}\right. $$
(4.23)

where fit(i) and fit(j) are the objective values of the ith and jth CP, respectively. This probability determines that only a good CP can affect a bad CP by the magnetic force. This magnetic probability is slightly different from the electric probability expressed by (4.9). The electric probability considers a chance for both good and bad CPs to attract each other, but the magnetic probability has allocated this chance only to good CPs. The purpose of this definition of magnetic probability is to reduce the parasite magnetic fields and reinforce the efficiency of the magnetic forces.

Investigating different terms of the magnetic force shows how this force can help the standard CSS algorithm. If I i , electric current in virtual ith virtual wire is negative, according to the concept of the electric current, a negative value means that the ith CP did not experienced an improvement in the value of its objective function. Thus, a negative value will be multiplied by (X i  − X j ), so this produces a repelling force. In this case, it is an ideal force. On the other hand, if the ith CP experiences an improvement in its movement, it will attract the jth CP. From optimization point of view, this kind of force can help the algorithm. It stores and applies the information of the movement of each CP. This information is lost in the standard CSS, but MCSS utilizes this information and increases the efficiency of algorithm.

Now by considering the group of the charged particles, the resultant magnetic force acting on each CP can be calculated using the following expression:

$$ {\mathbf{F}}_{\mathbf{B},j}={q}_j\cdot {\displaystyle \sum_{i,i\ne j}\left(\frac{I_i}{R^2}{r}_{ij}\cdot {z}_1+\frac{I_i}{r_{ij}}\cdot {z}_2\right)}\cdot p{m}_{ji}\cdot \left({\mathbf{X}}_i-{\mathbf{X}}_j\right),\kern0.5em \left\{\begin{array}{l}{z}_1=1,{z}_2=0\iff {r}_{ij}<R\\ {}{z}_1=0,{z}_2=1\iff {r}_{ij}\ge R\\ {}j=1,2,\dots, N\end{array}\right. $$
(4.24)

where F B,j is the resultant magnetic force exerted on the jth charged particle.

The quantity R is the radius of the virtual wires, and if a charged particle places outside or inside of a virtual wire, the magnetic force that exerted on it is computed differently. With this formulation for magnetic force, in the early iterations where the agents are far from each other, their distances will be large values, and the magnetic force in this case will be inversely proportional to the distances. As a result, the magnitude of the magnetic force is relatively small, and this feature of the algorithm provides a good situation for search ability of the CPs in the early iterations which is ideal for optimization problems. After a number of iterations, CPs search the search space and most of them will be gathered in a small space. Now, the distances between CPs are decreased and a local search starts. In this case, if the magnetic force computed based on the inverse relation between distances, the magnitude of the forces will be increased due to decrease of the distances. These large forces may prevent the convergence of the algorithm in the local search. One of the solutions that can be proposed is that when the distances are relatively small, the magnetic force should be computed using the linear formulation of magnetic fields (4.3). This means that the formulation of the magnetic force for global and local phases should be separated, (4.24). A suitable value for R in (4.24) can be unity. However, by more investigating in the magnetic force formulation, it could be understood that the aforementioned problem can be solved automatically. If the value of the R is taken as zero, all of the magnetic fields produced by virtual wires can be calculated based on (4.2) Using this equation for small distances gives large values for the magnetic field, but when the values of distances are small, it means that the CPs are collected in a small space and their movements are small (Local Search). Thus, both X i  − X j and I i are small values. By considering (4.24) for calculating the magnetic forces, it can be noted that a large value is multiplied by two small values, so the final value (magnetic force) is a normal value which helps the algorithm. Due to the ease of implementation, and better convergence rate the second solution is selected in this part and the magnetic force is revised in (4.25).

The term pm ji , in the expression for calculating the magnetic force, provides competition ability for the CPs. According to the concept of the magnetic force in this algorithm, when a CP experience an improvement in its value of the objective function, should attract another CPs, regardless to its previous and current charge. However, by considering the term pm ji , CPs with larger charges have more tendency to attract other CPs. The reason is that by considering this term, the redundant and parasite magnetic fields made by bad CPs are eliminated and it helps the efficiency of the algorithm.

It should be noted that in implementing the MCSS, the part of CSS algorithm related to computing forces should be changed. Both magnetic and electric forces should be computed, and superposed. The Lorentz force (total force) will be expressed as:

$$ {\displaystyle \sum {\mathbf{F}}_j=}{\mathbf{F}}_{B,j}+{\mathbf{F}}_{E,j}={q}_j{\displaystyle \sum_{i,i\ne j}\left(\frac{I_i}{r_{ij}}\cdot p{m}_{ji}+\left(\frac{q_i}{a^3}{r}_{ij}\cdot {w}_1+\frac{q_i}{{r_{ij}}^2}\cdot {w}_2\right)\cdot {p}_{ji}\right)}\cdot \left({\mathbf{X}}_i-{\mathbf{X}}_j\right),\kern0.5em \left\{\begin{array}{l}{w}_1=1,{w}_2=0\iff {r}_{ij}<R\\ {}{w}_1=0,{w}_2=1\iff {r}_{ij}\ge R\\ {}j=1,2,\dots, N\end{array}\right. $$
(4.25)

where F j is the resultant Lorentz force (total force) acting on the jth CP.

Consider the ith CP among all of the CPs; this CP has a charge which is larger than a number of other CPs charge. Considering the rules of the CSS, the ith CP attracts all other CPs that have smaller charges. After computing the electric forces, all of the CPs move around the search space. Now, the ith CPs also moved to a new position. In this movement, the ith particle may experience deterioration in its objective function value. Due to this decrease, the new charge of the ith particle will be decreased, but its charge may still be larger than a number of CPs. According to the CSS algorithm, the ith particle still attracts all other CPs with smaller charges regardless of the failure of the ith CP in its last movement. From one perspective, this is logical that a good CP can attract bad CPs. This feature ensures the competition ability of the algorithm. However, from another point of view, if no attention is paid to the success or failure of the CPs in their last movement, a lot of useful information in optimization process will be lost. Thus, in the MCSS algorithm, magnetic forces are included to prevent the loss of this kind of information which benefits the algorithm. By this concept, the ith particle which has experienced a failure in its last movement, exerts repelling magnetic forces on the other CPs. In this situation, the direction of the magnetic forces and electrical ones that are acted on CPs by the ith CP is opposite.

That was a special case that the magnetic and electric forces were against each other. Most of the times, the magnetic and electric forces are in the same direction and they reinforce the effect of each other. Consequently, the exploitation ability of the algorithm is mostly reinforced. Because of this increase in exploitation ability, we can slightly modify k v in (4.14) to increase the exploration ability of the algorithm. In fact, the MCSS algorithm guides the CPs with more information and the efficiency of the algorithm including a fast convergence is improved, and in comparison to the standard CSS, a better exploitation and exploration are provided.

4.2.4 Numerical Examples

In order to ensure the efficient performance of the MCSS algorithm, some numerical examples are solved and the results are compared to those of the standard CSS algorithm. The examples consist of 18 mathematical functions. The numerical examples are presented in Sect. 5.2.4.1. In Sect. 5.2.4.2 the results of the MCSS are presented and compared to those of the CSS and other optimization algorithms in the literature. Finally, in Sect. 5.2.5 three well-studied engineering design problems are solved by MCSS and the results are compared to those of the CSS.

4.2.4.1 Mathematical Benchmark Functions

4.2.4.1.1 Comparison Between MCSS, CSS and a Set of Genetic Algorithms

In this section, some mathematical benchmarks are chosen from [5], and optimized using the MCSS algorithm. The description of these mathematical benchmarks is provided in Table 4.1.

Table 4.1 Description of the mathematical benchmarks
4.2.4.1.2 Numerical Results

In this section, the numerical results of optimization for the mathematical benchmarks are presented. In this investigation, some parameters of the algorithm such as, HMCR, PAR, CM size (CMS), the number of CPs, and the maximum number of iteration are modified. For eliminating the effect of such parameters in studying the performance of the algorithm, these parameters are considered the same as those of [6]. It should be noted that the number of CPs is set to 20, and the maximum number of iterations is considered as 200 for both CSS and MCSS algorithm. In Table 4.2, the results of the MCSS are compared to the results obtained by the CSS from [6], and GA and some of its variants derived from [5]. For a fair comparison between MCSS and CSS, the random initial solutions of each runs are the same. The numbers in Table 4.2 indicate the average number of function evaluation from 50 independent runs. The numbers in parenthesis, demonstrate the fraction of the unsuccessful to successful runs. The absence of a parenthesis means that the algorithm was successful in all of the runs. Each run of the algorithm is successful when that run determines a local minimum with predefined accuracy, i.e., ε = |f min − f final | = 10− 4. The results verify the efficiency of the MCSS algorithm compared to the CSS and other Genetic algorithms. The existence of the magnetic forces in the MCSS provides a better exploration and exploitation for the algorithm. Thus, the convergence is speeded up. One of the important features of the MCSS algorithm is its ability to converge to the desired optimum with a few number of CPs and a small value for maximum number of iterations. The difference between the CSS algorithm and MCSS algorithm becomes more obvious when the number of CPs and the number of iterations are set to small values. Thus, another comparison is performed to show the difference between the CSS and MCSS algorithm in unsuitable situations, i.e., small number of CPs and maximum number of permitted iterations. Therefore, the number of CPs is set to 10 and the maximum number of permitted iterations is considered as 100. This means that the computational cost is one quarter of the previous comparison. The results of this comparison are presented in Table 4.3. The numbers in the Table 4.3 are the optimum found by each algorithm. These are the average of 100 independent runs. The accuracy of the solutions in some cases may be unsatisfactory, but it should be noted that the number of CPs and maximum number of iterations are small. The purpose of this comparison is to magnify the difference between the CSS and MCSS algorithm, and verify the better performance of the MCSS in this situation. For more detailed presentation, Fig. 4.4 illustrates the optimization process and convergence.

Table 4.2 Performance comparison for the benchmark problems
Table 4.3 Numerical comparison of CSS and MCSS algorithms
Fig. 4.4
figure 4figure 4figure 4

Comparison of the convergence rate of optimizing mathematical benchmarks [1]: (a) AP, (b) Bf1, (c) Bf2, (d) BL, (e) Branin, (f) Camel, (g) Cb3, (h) CM, (i) Dejoung, (j) Exp2, (k) Exp4, (l) Exp8, (m) Goldstein and price, (n) Griewank, (o) Hartman3, (p) Hartman6, (q) Rastrigin, (r) rosenbrock

4.2.4.1.3 Statistical Test

Now in the following we want to ensure that the results of MCSS in Table 4.3 are better than CSS algorithm. For this purpose, we apply a multi-problem analysis using statistical tests. We apply the test on the obtained errors by each algorithm. If we have the normality condition for our sample of results, a parametric pair t-test can be suitable. We first analyze a safe usage of parametric tests. We utilized two normality tests including: Kolmogorov-Smirnov, and Shapiro-Wilk test. The p-values of the normality tests over the sample results obtained by CSS and MCSS are shown in Table 4.4. If we consider a significance level α = 0.05, all of the p-values in Table 4.4 will be less than 0.05. Thus the sample results do not follow a normal distribution. The Q–Q plot for sample results is illustrated in Fig. 4.5, and it can be understood that the normality conditions is not satisfied in both CSS and MCSS algorithms. This result was predictable because the sample size (the number of problems) is small. Therefore, a parametric test such as pair t-test is not appropriate in this case. Therefore we use Wilcoxcon test that is a non-parametric test for pairwise comparisons. The method of this test is described in [7]. The result of this test can be summarized as:

Table 4.4 Normality tests and their p-values over multiple-problem analysis
Fig. 4.5
figure 5

Normal Q–Q plots of the sample results of the CSS and MCSS algorithms [1]

  • The p-value obtained by Wilcoxcon test is 0.00. Consequently, the Wilcoxcon test considers a difference between the performance of these two algorithms assuming a significance level α = 0.05. Therefore, because of better mean value of the MCSS algorithm results, MCSS outperforms its predecessor, CSS algorithm.

4.2.4.2 Comparison Between MCSS and Other State-of-Art Algorithms

4.2.4.2.1 Description of Test Functions and Algorithms

In the following section, the set of test functions designed for Special Session on Real Parameter Optimization organized in the 2005 I.E. Congress on Evolutionary Computation (CEC 2005) are solved by the MCSS algorithm. The detailed description of test functions is presented by Suganthan et al. [8]. The set of these test functions consists of the following functions:

  • 5 displaceUnimodals functions (f1–f5)

  • Sphere function d.

  • Schewefel’s problem 1.2 displaced.

  • Elliptical function rotated widely conditioned

  • Schwefel’s problem 1.2 displaced with noise in the fitness.

  • Schwefel’s problem 2.6 with global optimum in the frontier.

  • 20 Multimodals functions (f6–f7)

  • 7 basic functions

  • Rosenbrock function displaced.

  • Griewank function displaced and rotated without frontiers.

  • Ackley function displaced and rotated with the global optimum in the frontier.

  • Rastrigin function displaced.

  • Rastrigin function displaced and rotated.

  • Weierstrass function displaced and rotated.

  • Schewefel’s problem 2.13.

  • 2 expanded functions.

  • 11 hybrid functions. Each one of these has been defined through compositions of 10 out of 14 previous functions (different in each case).

The characteristics of this experiment is the same as what has been suggested by Suganthan et al. [8]. Each function is solved by MCSS in 25 independent runs, and the average error of the best CP is recorded. The number of CPs is set to 25. The dimension of the test functions is set to 10 (D = 10), and algorithm performs 10,000 function evaluation. The termination criterion is either reaching the maximum number of function evaluation or achieving error less than 10−8. Table 4.5 shows the official results of the participated algorithms obtained from Garcia et al. [9]. The description of each algorithm is given in [19]. The results of the MCSS algorithm are added to Table 4.5. The values of Table 4.5 indicate the average error rate of each algorithm. This value can be considered as a means for measuring the performance of each algorithm.

Table 4.5 Average error rates of the algorithms in CEC’2005 and MCSS algorithm
4.2.4.2.2 Numerical Results and Statistical Test

As the results in Table 4.5 show, MCSS has a good performance and its average error rates are good, however, there are some cases that MCSS performs slightly weaker than some other algorithms. For a fair comparison, we have to use statistical test to judge about the performance of MCSS in comparison to other algorithms. We want to find out whether the results of MCSS have a significant difference in comparison to the other algorithms. This analysis is multiple-problem analysis; therefore, a non-parametric test is more suitable in this case. We utilized the Welcoxon’s test. This test performs pairwise comparisons between two algorithms. In this test, MCSS is compared to some other remaining algorithms.

Table 4.6 summarizes the results of applying the Wilcoxin test. Table 4.6 includes sum of ranking and p-value of each comparison. The method of this test is simply described in [7]. The significance level α is considered as 0.05. In each comparison when the corresponding p-value is less than 0.05, it means that two compared algorithms behave differently, and the one with smaller mean value of error rate has a better performance.

Table 4.6 The Wilcoxcon test results

The p-value in pairwise comparison is independence from another one. If we draw a conclusion involving more than one pairwise comparison in Wilcoxcon’s analysis, an accumulated error which is merged up by combination of pairwise comparisons will be obtained. In statistics terms, the Family Wise Error Rate (FWER) will be lost. FWER is defined as the probability of making one or more false discoveries among all the hypotheses when performing multiple pairwise tests (Garcia et al. [9]). The true statistical significance for combining pairwise comparisons is given by:

$$ p=1-{\displaystyle \prod_{i=1}^{i=k-1}\left(1-p{H}_i\right)} $$
(4.26)

where k is the number of pairwise comparisons considered, and pH i is the p-value of each comparison. For more information, the reader may refer to [9].

Considering the values of Table 4.6, the p-value of all of the comparisons except MCSS vs. G-CMA-ES is less than significance level α = 0.05, it cannot be concluded that MCSS is better than all of algorithms except G-CMA-ES because we have to consider FWER in making a conclusion in multiple pairwise comparisons. The MCSS outperforms all of the algorithms except G-CMA-ES considering independence pairwise comparisons due to the fact that the achieved p-values are less than α = 0.05. The true p-value for multiple pairwise comparisons can be computed using (4.26):

$$ \begin{array}{l}p=1-\left(\left(1-0.16\right)\cdot \left(1-0.0\right)\cdot \right(1-0.0\left)\cdot \right(1-0.05\left)\cdot \right(1-0.24\left)\cdot \right(1-0.001\Big)\\ {}\cdot \left(1-0.025\right)\cdot \left(1-0.048\right)\cdot \left(1-0.027\right)\cdot \left(1-0.001\right)\Big)=0.17765\end{array} $$
(4.27)

Based on this algorithm, it can be claimed that the MCSS algorithm has a better performance in relation with all of the algorithms except G-CMA-ES with a p-value of 0.17765. As a result, if we consider a significance level α = 0.17765, the confidence interval for the mentioned claim will be 100(1−α) = 82.23 %.

4.2.5 Engineering Examples

Three well-studied engineering design problems that have been solved by various optimization methods in the literature are used to examine the efficiency of the MCSS algorithm, and compare the results with those obtained by the CSS. For handling constrains, a simple penalty function is utilized to prevent adding the effect of a robust constrain handling method on the performance of the algorithm.

Example 1

A tension/compression spring design problem

This is a well-known optimization problem which has been used to evaluate the efficiency of different optimization methods [6]. This problem is defined by Belegundu [10] and Arora [11] as depicted in Fig. 4.6. The objective of this optimization problem is to minimize the weight of tension/compression spring. This minimization involves some constrains, i.e., shear stress, frequency, and minimum deflection.

Fig. 4.6
figure 6

A tension/compression spring

The design variables are the mean coil diameter D(=x 1 ); the wire diameter d(=x 2 ), and the number active coils N(=x 3 ). By considering these decision variables, the cost function can be formulated as:

$$ {f}_{\cos t}\left(\mathbf{X}\right)=\left({x}_3+2\right){x}_2{x_1}^2 $$
(4.28)
$$ \begin{array}{l}{g}_1\left(\mathbf{X}\right)=1-\frac{{x_2}^3{x}_3}{71785\cdot {x_1}^4}\le 0,\\ {}{g}_2\left(\mathbf{X}\right)=\frac{4{x_2}^2-{x}_1{x}_2}{12566\cdot \left({x}_2{x_1}^3-{x_1}^4\right)}+\frac{1}{5108\cdot {x_1}^2}-1\le 0,\\ {}{g}_3\left(\mathbf{X}\right)=1-\frac{140.45{x}_1}{{x_2}^2{x}_3}\le 0,\\ {}{g}_4\left(\mathbf{X}\right)=\frac{x_1+{x}_2}{1.5}-1\le 0.\end{array} $$
(4.29)

The decision variables are limited as:

$$ \begin{array}{l}0.05\le {x}_1\le 2,\\ {}0.25\le {x}_2\le 1.3,\\ {}2\le {x}_3\le 15.\end{array} $$
(4.30)

This problem has been solved with various methods by different researchers, Belegundu [10], Arora [11], Coello [12], Coello and Montes [13], He and Wang [14], Montes and Coello [15], and Kaveh and Talathari [14,26]. The results of the best solutions found by different methods are presented in Table 4.7. From Table 4.7 it can be understood that the best solution found by MCSS is better than other methods. The statistical simulation results of 30 independent runs for MCSS are illustrated in Table 4.8 and compared to other methods.

Table 4.7 Optimum results for the tension/compression spring design
Table 4.8 Statistical results of different methods for the tension/compression spring

Example 2

A welded beam design

One of the practical design problems which has been widely used as a benchmark to test the performance of different optimization methods, is the welded beam design problem as illustrated in Fig. 4.7. The goal of this optimization problem is to minimize the constructing cost of a welded beam that is subjected to different constrains, such as shear (τ) and bending (σ) stresses, buckling load (P c ), end deflection (δ), and end side constraint. Design variables are h(= x 1 ),l(= x 2), t(= x 3 ) and b(= x 4 ). By considering the set-up, welding labor, and the materials costs, the cost function can be expressed as:

Fig. 4.7
figure 7

A welded beam system

$$ {f}_{\cos t}\left(\mathbf{X}\right)=1.1047{x_1}^2{x}_2+0.04811{x}_3{x}_4\cdot \left(14.0+{x}_2\right) $$
(4.31)

Subjected to the following constrains:

$$ \begin{array}{l}{g}_1\left(\mathbf{X}\right)=\tau \left(\left\{x\right\}\right)-{\tau}_{\max}\le 0,\\ {}{g}_2\left(\mathbf{X}\right)=\sigma \left(\left\{x\right\}\right)-{\delta}_{\max}\le 0,\\ {}{g}_3\left(\mathbf{X}\right)={x}_1-{x}_4\le 0,\\ {}{g}_4\left(\mathbf{X}\right)=0.10471{x_1}^2+0.04811{x}_3{x}_4\cdot \left(14.0+{x}_2\right)-5.0\le 0,\\ {}{g}_5\left(\mathbf{X}\right)=0.125-{x}_1\le 0,\\ {}{g}_6\left(\mathbf{X}\right)=\delta \left(\left\{x\right\}\right)-{\delta}_{\max}\le 0,\\ {}{g}_7\left(\mathbf{X}\right)=P-{P}_c\left(\left\{x\right\}\right)\le 0.\end{array} $$
(4.32)

Where

$$ \begin{array}{l}\tau \left(\mathbf{X}\right)=\sqrt[]{{\left({\tau}^{\prime}\right)}^2+2{\tau}^{\prime}\cdot {\tau}^{{\prime\prime}}\frac{x_2}{2R}+{\left({\tau}^{{\prime\prime}}\right)}^2},\\ {}{\tau}^{\prime }=\frac{P}{\sqrt{2}{x}_1\cdot {x}_2},{\tau}^{{\prime\prime} }=\frac{ MR}{J},\\ {}M=P\cdot \left(L+\frac{x_2}{2}\right),R=\sqrt{\frac{{x_2}^2}{4}+{\left(\frac{x_1+{x}_2}{2}\right)}^2},\\ {}J=2\left\{\sqrt{2}{x}_1{x}_2\left[\frac{{x_2}^2}{12}+{\left(\frac{x_1+{x}_3}{2}\right)}^2\right]\right\},\\ {}\sigma \left(\mathbf{X}\right)=\frac{6 PL}{x_4\cdot {x_3}^2},\delta \left(\mathbf{X}\right)=\frac{4P{L}^3}{E{x}_3^2{x}_4},\\ {}{P}_c\left(\mathbf{X}\right)=\frac{4.013E\sqrt{\frac{x_3^2{x}_4^6}{36}}}{L^2}\left(1-\frac{x_3}{2L}\sqrt{\frac{E}{4G}}\right),\\ {}P=6,000\ \mathrm{lb},\kern0.75em L=14\ \mathrm{in},E=30\times 1{0}^6\mathrm{psi},\kern0.5em G=12\times 1{0}^6\mathrm{psi}\end{array} $$
(4.33)

And variable boundaries are:

$$ \begin{array}{l}0.1\le {x}_1\le 2,\\ {}0.1\le {x}_2\le 10,\\ {}0.1\le {x}_3\le 10,\\ {}0.1\le {x}_3\le 2.\end{array} $$
(4.34)

This is a well-studied problem that is solved by different researchers using different approaches. Regsdell and Phillips [17] solved it using mathematical-based methods. Deb [18], Coello [12], and Coello and Montes [13], solved it using GA-based algorithms. Also, He and Wang [14] solved it by CPSO, Montes and Coello [15] by Evolutionary strategies, and Kaveh and Talathari [16] by ACO. This problem is also solved by Kaveh and Talathari [6] utilizing the CSS algorithm. The results of the best solution found by each method are listed in Table 4.9. The best solution found by MCSS is better than other results in literature. The result of the MCSS is slightly better than that of the CSS, but the speed of the convergence is much higher compared to the CSS. The results of statistical simulation are presented in Table 4.10. Similar to the CSS algorithm MCSS has a small value for the standard deviation.

Table 4.9 Optimum results for the design of welded beam
Table 4.10 Statistical results of different methods for the design of welded beam

Example 3

A pressure vessel design problem

The objective of this optimization is to minimize the cost of fabricating a pressure vessel which is clapped at both ends by hemispherical heads as depicted in Fig. 4.8. The construction cost consists of the cost of materials, forming and welding [19]. The design variables are the thickness of the shell T s (= x 1 ), the thickness of the head T h (= x 2 ), the inner radius R (= x 3 ), and the length of cylindrical section of the vessel L (= x 4 ). T s and T h are integer multiples of 0.0625in, the available thickness of the rolled steel plates, but R and L are continuous variables. The mathematical expression of the cost function is:

Fig. 4.8
figure 8

A pressure vessel, and its design variables

$$ {f}_{\cos t}\left(\mathbf{X}\right)=0.6224{x}_1{x}_3{x}_4+1.7781{x}_2{x}_3^2+3.1661{x}_1^2+19.84{x}_1^2{x}_3, $$
(4.35)

The constrain areas are as follows:

$$ \begin{array}{l}{g}_1\left(\mathbf{X}\right)=-{x}_1+0.0193{x}_3\le 0,\\ {}{g}_2\left(\mathbf{X}\right)=-{x}_2+0.00954{x}_3\le 0,\\ {}{g}_3\left(\mathbf{X}\right)=-\pi \cdot {x}_3^2{x}_4-\frac{4}{3}\pi \cdot {x}_3^3+1,296,000\le 0,\\ {}{g}_4\left(\mathbf{X}\right)={x}_4-240\le 0.\end{array} $$
(4.36)

The search space is defined as:

$$ \begin{array}{l}0\le {x}_1\le 99,\\ {}0\le {x}_2\le 99,\\ {}10\le {x}_3\le 200,\\ {}10\le {x}_3\le 200.\end{array} $$
(4.37)

Various types of methods have been used to solve this problem. Some of these approaches are as: a branch and bound method [19], an augmented Lagrangian multiplier approach [20], genetic adaptive search [21], a GA-based algorithm [12], a feasibility-based tournament selection scheme [13], a co-evolutionary particle swarm method [14], an evolution strategy [15], an improved ant colony optimization [16], and the CSS algorithm [6]. The results of the best solution found by different methods are presented in Table 4.11. MCSS algorithm found better solution compared to other techniques and the standard CSS. In Table 4.12 the results of statistical simulations are listed. The mean value of the 30 independent runs for MCSS is slightly weaker than that of the CSS, however, the best solution and speed of the convergence for MCSS is much higher.

Table 4.11 Optimum results for the design of welded beam
Table 4.12 Statistical results of different methods for the design of welded beam

4.3 Improved Magnetic Charged System Search

In this part, the improved version of magnetic charged system search (IMCSS) is presented and also utilized for optimization of truss structures. As mentioned earlier, the standard CSS and MCSS algorithms use harmony search-based approach for process of position correction of CPs. In this process, the CMCR and PAR parameters help the algorithm to find globally and locally improved solutions, respectively [22]. PAR and bw in HS scheme are very important parameters in fine-tuning of optimized solution vectors, and can be potentially useful in adjusting convergence rate of algorithm to optimal solution.

The traditional HS scheme uses fixed value for both PAR and bw. Small PAR values with large bw values can led to poor performance of the algorithm and increase the iterations needed to find optimum solution, also on the other hand small bw values in final iterations increase the fine-tuning of solution vectors, but in the first iterations bw must take a bigger value to enforce the algorithm to increase the diversity of solution vectors. Furthermore, large PAR values with small bw values usually led to the improvement of best solutions in final iterations and converged algorithm to optimal solution vector. To improve the performance of the HS scheme and eliminate the drawbacks lies with fixed values of PAR and bw, IMCSS algorithm uses an improved form of HS algorithm with varied PAR and bw for the step of position correction. PAR and bw change dynamically with iteration number as shown in Fig. 4.9 and expressed as follow [22]:

Fig. 4.9
figure 9

Variation of (a) PAR and (b) bw versus iteration number [2]

$$ PAR(iter)= PA{R}_{\min }+\frac{\left( PA{R}_{\max }- PA{R}_{\min}\right)}{ ite{r}_{\max }}\cdot iter $$
(4.38)

and

$$ bw(iter)=b{w}_{\max } \exp \left(c\cdot iter\right), $$
(4.39)
$$ c=\frac{ Ln\;\left(\raisebox{1ex}{$b{w}_{\min }$}\!\left/ \!\raisebox{-1ex}{$b{w}_{\max }$}\right.\right)}{ ite{r}_{\max }}, $$
(4.40)

where PAR(iter) and bw(iter) are the values of the PAR and bandwidth for each iteration, respectively, Subscripts min and max denote the minimum and maximum values for each parameter, respectively, and iter is the current iteration number.

4.3.1 A Discrete IMCSS

The IMCSS algorithm can be also applied to optimal design problem with discrete variables. One way to solve discrete problems using a continuous algorithm is to utilize a rounding function which changes the magnitude of a result to the nearest discrete value [23], as follow:

$$ {X}_{j, new}= Fix\;\left( ran{d}_{j1}\cdot {k}_a\cdot \frac{F_j}{m_j}\cdot \Delta {t}^2+ ran{d}_{j2}\cdot {k}_v\cdot {V}_{j, old}\cdot \Delta \mathrm{t}+{X}_{j, old}\right), $$
(4.41)

where Fix(X) is a function which rounds each elements of vector X to the nearest allowable discrete value. Using this position updating formula, the agents will be permitted to select discrete values.

4.3.2 An Improved Magnetic Charged System Search for Optimization of Truss Structures with Continuous and Discrete Variables

4.3.2.1 Statement of the Optimization Problem

The aim of size optimization of truss structures is to find the optimum values for cross-sectional area of members A i , in order to minimize the structural weight W, satisfying the constraints corresponding to the response of the structure. Thus, the optimal design problem can be expressed as:

$$ \begin{array}{l}\mathrm{Find}\kern3.5em \mathrm{X}=\left[{\mathrm{x}}_1,{\mathrm{x}}_2,{\mathrm{x}}_3,\dots, {\mathrm{x}}_{\mathrm{n}}\right]\\ {}\mathrm{to}\ \mathrm{minimize}\kern0.5em \mathrm{Mer}\left(\mathrm{X}\right)={\mathrm{f}}_{\mathrm{penalty}}\ \left(\mathrm{X}\right)\times \mathrm{W}\left(\mathrm{X}\right)\\ {}\mathrm{subject}\ \mathrm{to}\kern1.5em {\sigma}_{\min }<{\sigma}_{\mathrm{i}}<{\sigma}_{\max}\kern1.5em \mathrm{i}=1,2,\dots, \mathrm{nm}\\ {}\kern5.25em {\delta}_{\min }<{\delta}_{\mathrm{i}}<{\delta}_{\max}\kern2em \mathrm{i}=1,2,\dots, \mathrm{nn}\kern0.5em \end{array} $$
(4.42)

where X is the vector containing the design variables; for a discrete optimum design problem, the variables x i are selected from an allowable set of discrete values; n is the number of member groups; Mer(X) is the merit function; W(X) is the cost function, which is taken as the weight of the structure; f penalty (X) is the penalty function which results from the violations of the constraints; nm is the number of members forming the structure; nn is the number of nodes; σ i and δ i are the stress of members and nodal displacements, respectively; min and max mean the lower and upper bounds of constraints, respectively. The cost function can be expressed as:

$$ W(X)={\displaystyle \sum_{i=1}^{nm}{\rho}_i}\cdot {A}_i\cdot {L}_i $$
(4.43)

where ρ i is the material density of member i, L i is the length of member i, and A i is the cross-sectional area of member i.

The penalty function can be defined as:

$$ {f}_{penalty}(X)={\left(1+{\varepsilon}_1\cdot {\displaystyle \sum_{i=1}^{np}\left({\phi}_{\sigma (i)}^k+{\phi}_{\delta (i)}^k\right)}\right)}^{\varepsilon_2}, $$
(4.44)

where np is the number of multiple loadings. Here ε 1 is taken as unity and ε 2 is set to 1.5 in the first iterations of the search process, but gradually it is increased to 3 [24]. ϕ k σ and ϕ k δ are the summation of stress penalties and nodal displacement penalties for kth charged particle which are mathematically expressed as:

$$ {\phi}_{\sigma }={\displaystyle \sum_{i=1}^{nm} \max \left(\left|\frac{\sigma_i}{{\overline{\sigma}}_i}\right|-1,0\right)}, $$
(4.45)
$$ {\phi}_{\delta }={\displaystyle \sum_{i=1}^{nn} \max \left(\left|\frac{\delta_i}{{\overline{\delta}}_i}\right|-1,0\right)}, $$
(4.46)

where σ i , \( {\overline{\sigma}}_i \) are the stress and allowable stress in member i, respectively, and δ i , \( {\overline{\delta}}_i \) are the displacement of the joints and the allowable displacement, respectively.

4.3.2.2 Numerical Examples

In this section, common truss optimization examples as benchmark problems are used for optimization using the proposed algorithm. This algorithm is applied to problems with both continuous and discrete variables. The final results are compared to those of previous studies to demonstrate the efficiency of the present method. The discrete variables are selected from American Institute of Steel Construction (AISC) Code [25], listed in Table 4.13.

Table 4.13 The allowable steel pipe sections taken from AISC code

In the proposed algorithm, for all of examples a population of 25 CPs is used and the value of CMCR is set to 0.95.

Example 1

A 10-bar planar truss structure

The 10-bar truss structure is a common problem in the field of structural optimization to verify the efficiency of a proposed optimization algorithm. The geometry and support conditions for this planar, cantilevered truss with loading condition is shown in Fig. 4.10.

Fig. 4.10
figure 10

Schematic of a10-bar planar truss structure

There are 10 design variables in this example and a set of pseudo variables ranging from 0.1 to 35.0 in2 (0.6452 cm2 to 225.806 cm2).

In this problem two cases are considered:

Case 1, P1 = 100 kips (444.8 kN) and P2 = 0, and Case 2, P1 = 150 kips (667.2 kN) and P2 = 50 kips (222.4 kN).

The material density is 0.1 lb/in3 (2,767.990 kg/m3) and the modulus of elasticity is 10,000 ksi (68,950 MPa). The members are subjected to the stress limits of ±25 ksi (172.375 MPa) and all nodes in both vertical and horizontal directions are subjected to the displacement limits of ±2.0 in (5.08 cm). Figure 4.11 shows a comparison of the convergence history of both cases for MCSS and IMCSS algorithms.

Fig. 4.11
figure 11

Convergence history for the 10-bar planar truss structure using MCSS, IMCSS [2]

Tables 4.14 and 4.15 are provided for comparison of the optimal design results with those of the previous studies for both cases. In both cases the HS algorithm reach its best solutions after 20,000 analyses, and the PSO and PSOPC algorithms after 3,000 iterations (150,000 analyses). The HPSACO algorithm finds the best solution after 10,650 and 9,925 analyses, for Case 1 and Case 2, respectively.

Table 4.14 Optimal design comparison for the 10-bar planner truss (Case 1)
Table 4.15 Optimal design comparison for the 10-bar planner truss (Case 2)

The MCSS and IMCSS algorithms achieve the best solutions after 355 iterations (8,875 analyses) and 339 iterations (8,475 analyses), respectively. The best weights of IMCSS are 5,064.6 lb for Case 1 and 4,679.15 for Case 2.

As seen in both Tables, although the best weights of IMCSS in both cases are a little bigger than the HPSACO, but it has lower penalty values rather than HPSACO, and therefore IMCSS has a lower merit function than HPSACO.

Example 2

A 52-bar planar truss

The 52-bar planar truss structure shown in Fig. 4.12 has been analyzed by Lee and Geem [27], Li et al. [28], Wu and Chow [30] and Kaveh and Talatahari [31].

Fig. 4.12
figure 12

Schematic of a 52-bar planar truss

The members of this structure are divided into 12 groups: (1) A1–A4, (2) A5–A10, (3) A11–A13, (4) A14–A17, (5) A18–A23, (6) A24–A26, (7) A27–A30, (8) A31–A36, (9) A37–A39, (10) A40–A43, (11) A44–A49, and (12) A50–A52.

The material density is 7,860.0 kg/m3 and the modulus of elasticity is 2.07 × 105 MPa. The members are subjected to stress limitations of ±180 MPa. Both of the loads, Px = 100kN and Py = 200kN, are considered.

Table 4.16 and Fig. 4.13 are provided for comparison of the optimal design results with the previous studies and convergence rates for the 52-bar planar truss structure, respectively.

Table 4.16 Optimal design comparison for the 52-bar planar truss
Fig. 4.13
figure 13

Convergence history for the 52-bar planar truss structure using MCSS, IMCSS [2]

Table 4.16 shows that, the best weight of MCSS and IMCSS algorithms are 1,904.05 lb and 1,902.61 lb, respectively, while for DHPSACO is 1,904.83 lb.

The MCSS and IMCSS algorithms find the best solutions after 4,225 and 4,075 analyses respectively, but the DHPSACO reach a good solution in 5,300 analyses. As it can be seen in the results of Table 4.16, the IMCSS algorithm achieve good optimal results than previous methods like MCSS, PSO, PSOPC, HPSO and DHPSACO algorithms.

Example 3

A 72-bar spatial truss

In the 72-bar spatial truss structure which is shown in Fig. 4.14, the material density is 0.1 lb/in3 (2,767.990 kg/m3) and the modulus of elasticity is 10,000 ksi (68,950 MPa). The nodes are subjected to the displacement limits of ±0.25 in (±0.635 cm) and the members are subjected to the stress limits of ±25 ksi (±172.375 MPa).

Fig. 4.14
figure 14

Schematic of a 72-bar spatial truss

All members of this spatial truss are categorized into 16 groups using symmetry: (1) A1–A4, (2) A5–A12, (3) A13–A16, (4) A17–A18, (5) A19–A22, (6) A23–A30, (7) A31–A34, (8) A35–A36, (9) A37–A40, (10) A41–A48, (11) A49–A52, (12) A53–A54, (13) A55–A58, (14) A59–A66 (15), A67–A70, and (16) A71–A72.

Two optimization cases are implemented:

Case 1: The discrete variables are selected from the set D = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2} (in2) or {0.65, 1.29, 1.94, 2.58, 3.23, 3.87, 4.52, 5.16, 5.81, 6.45, 7.10, 7.74, 8.39, 9.03, 9.68, 10.32, 10.97, 12.26, 12.90, 13.55, 14.19, 14.84, 15.48, 16.13, 16.77, 17.42, 18.06, 18.71, 19.36, 20.00, 20.65} (cm2).

Case 2: The discrete variables are selected from AISC code in Table 4.13. Table 4.17 lists the values and directions of the two load cases applied to the 72-bar spatial truss.

Table 4.17 Loading conditions for the 72-bar spatial truss

Tables 4.18 and 4.19 are provided for comparison the results of MCSS and IMCSS algorithms with the results of the previous studies for both cases. The Convergence history for both algorithms is shown in Fig. 4.15.

Table 4.18 Optimal design comparison for the 72-bar truss (Case 1)
Table 4.19 Optimal design comparison for the 72-bar truss (Case 2)
Fig. 4.15
figure 15

Convergence history for the 72-bar truss structure using MCSS, IMCSS [2]. (a) Case 1 and (b) Case 2

In Case 1, the best weight of the IMCSS and DHPSACO algorithm are 385.54 lb (174.88 kg), while it is 389.49 lb, 388.94 lb, 387.94 lb, 400.66 lb for the MCSS, HPSO, HS, and GA, respectively. For the PSO and PSOPC algorithms, these algorithms do not get optimal results when the maximum number of iterations is reached. The IMCSS algorithm gets the best solution after 145 iterations (3,625 analyses) while it takes for MCSS and DHPSACO 216 iterations (5,400 analyses) and 213 iterations (5,330 analyses), respectively.

In Case 2, the best obtained weight from IMCSS is 389.60 lb, but it is 393.13 lb, 389.87 lb, 392.84 lb, 393.06 lb and 393.38 lb for MCSS, CS, ICA, CSS and HPSACO algorithms, respectively. IMCSS algorithm finds the best solutions after 173 iterations (4,325 analyses), while MCSS, CS, ICA, CSS and HPSACO algorithms, need 4,775, 4,840, 4,500, 7,000 and 5,330 analyses to find the best solutions.

Example 4

A 120-bar dome shaped truss

The 120-bar dome truss was first analyzed by Soh and Yang [34] to obtain the optimal sizing and configuration variables, but for this study only sizing variables are considered to minimize the structural weight in this example, similar to Lee and Geem [27] and Keleşoğlu and Ülker [35].

The geometry of this structure is shown in Fig. 4.16. The modulus of elasticity is 30,450 ksi (210,000 MPa) and the material density is 0.288 lb/in3 (7,971.810 kg/m3). The yield stress of steel is taken as 58.0 ksi (400 MPa).

Fig. 4.16
figure 16

Schematic of a 120-bar dome shaped truss

The allowable tensile and compressive stresses are used according to the AISC-ASD code [25], as follows:

$$ \left\{\begin{array}{l}{\sigma}_i^{+}=0.6{F}_y\kern0.48em for\kern0.24em {\sigma}_i\ge 0\\ {}{\sigma}_i^{-}\kern4.1em for\kern0.24em {\sigma}_i<0\end{array}\right. $$
(4.47)

where σ i is calculated according to the slenderness ratio

$$ {\sigma}_i^{-}=\left\{\begin{array}{l}\left[\left(1-\frac{\lambda_i^2}{2{C}_c^2}\right){F}_y\right]/\left(\frac{5}{3}+\frac{3{\lambda}_i}{8{C}_c}-\frac{\lambda_i^3}{8{C}_c^3}\right)\kern0.36em \mathrm{for}\kern0.5em {\lambda}_i<{C}_c\\ {}\frac{12{\pi}^2E}{23{\lambda}_i^2}\kern14.06em \mathrm{for}\kern0.5em {\lambda}_i\ge {C}_c\end{array}\right. $$
(4.48)

where E is the modulus of elasticity, F y is the yield stress of steel, C c is the slenderness ratio (λ i ) dividing the elastic and inelastic buckling regions (\( {C}_c=\sqrt{2{\pi}^2E/{F}_y} \)), λ i is the slenderness ratio (λi = kL i /r i ), k is the effective length factor, L i is the member length and r i is the radius of gyration. The radius of gyration (r i ) can be expressed in terms of cross-sectional areas, i.e., r i  = aA b i . Here, a and b are the constants depending on the types of sections adopted for the members such as pipes, angles, and tees. In this paper, pipe sections (a = 0.4993 and b = 0.6777) were adopted for bars [36].

All members of the dome are categorized into seven groups, as shown in Fig. 4.16. The dome is considered to be subjected to vertical loading at all the unsupported joints. These were taken as −13.49 kips (60 kN) at node 1, −6.744 kips (30 kN) at nodes 2–14, and −2.248 kips (10 kN) at the rest of the nodes. The minimum cross-sectional area of all members is 0.775 in2 (2 cm2).

In this example, two cases of constraints are considered:

Case 1, with stress constraints and no displacement constraints, and Case 2, with stress constraints and displacement limitations of ±0.1969 in (5 mm) imposed on all nodes in x- and y-directions. For two cases, the maximum cross-sectional area is 5.0 in2 (32.26 cm2).

Figure 4.17 shows the convergence history for all cases and Table 4.20 gives the best solution vectors and weights for both cases.

Fig. 4.17
figure 17

Comparison of the convergence rates between the MCSS and IMCSS for the 120-bar dome truss structure [2], (a) Case 1 and (b) Case 2

Table 4.20 Optimal design comparison for the 120-bar dome truss (two cases) optimal cross-sectional areas (in2)

In Case 1, the best weights of MCSS and IMCSS are 19,607.39 lb and 19,476.92 lb, respectively, while for the Ray, HPSACO and PSOPC are 19,476.19 lb, 19,491.30 lb and 19,618.7 lb. The MCSS and IMCSS find the best solutions in 314 iterations (7,850 analyses) and 299 iterations (7,475 analyses), respectively, but for Ray and HPSACO algorithms, it takes 19,950 and 10,025 analyses to reach the best solutions, respectively.

In Case 2, the MCSS and IMCSS algorithms need 386 iterations (9,650 analyses) and 324 iterations (8,100 analyses) to find the best solutions, respectively, while for Ray and HPSACO algorithms 19,950 and 10,075 analyses is required. The best weights obtained from MCSS and IMCSS algorithms are 19,928 lb and 19,796.71 lb, respectively, but from the Ray, HPSACO and PSOPC are 20,071.9 lb, 20,078 and 20,681.7 lb, respectively.

Some design examples as benchmark problems are optimized using the IMCSS algorithm for both continuous and discrete design variables. The aim of this study is to find the best merit function, i.e. considering both penalty and cost functions. In comparison the results with those of the previous studies for all examples, the IMCSS has the better merit function than all of previous algorithms, however for few examples the best weight obtained from IMCSS algorithm is not the best in the results. Also, the results demonstrate the effectiveness of improvement process for MCSS algorithm to achieve a better convergence and find better solutions especially in final iterations of the improved algorithm.