1 Introduction

For years engineering fields have been developing tools to reach optimum performance designs, savings and costs. This brings significant benefits, such as the reduced use of raw material, manufacturing cost, transport, storage, and others. All these aspects should be considered in the optimization problems.

Constrained optimization can be defined as the study of problems that aims to minimize (or maximize) a function searching for the values of variables from a set of options (continuous, discrete or mixed) which satisfy the set of constraints of the problem. Increasingly, optimization has been used in a number of problems in engineering, chemistry, physics, mathematics, economics, and other areas of science.

EAs, widespread in the literature, are search algorithms which can be directly applied to unconstrained problems, searching for a set of variables that minimizes (or maximizes) one or more objective functions. Inspired by the natural processes of the real world, computational models are developed based on the concept of collective intelligence. In the nineties, studies led to the creation of a new area in computational intelligence, the swarm intelligence.

In this context, an algorithm that has been successfully applied is Particle Swarm Optimization (PSO) (Eberhart and Kennedy 1995), which is based on the simulation of the social behavior of some species of birds and fish, to solve complex problems. PSO has two main advantages: fast convergence and few parameters to be tuned, which make this technique particularly easy to implement. However, the performance of the algorithm when applied to a given problem depends on its parameters, as in many others EAs (Dobslaw 2010). In this paper a modified PSO called Craziness based Particle Swarm Optimization (CRPSO) proposed by Kar et al. (2012) is adopted in order to avoid premature convergence using a new velocity expression and an operator called “craziness velocity”.

The application of EAs to constrained problems cannot be made directly. To solve this problem, the more traditional strategy used is to incorporate a penalty function into the objective function transforming a constrained problem into an unconstrained one. Notice, that other types of constraint handling techniques can be found in the literature. For instance, Monson and Seppi (2005) solves optimization problems with linear constraints using a PSO by transforming the search space into an unconstrained one.

In general, the main challenge when building penalty strategies is to create functions with less dependence on parameters set by the user, which can affect the search for the optimal solutions. For example, many works in the literature discuss techniques to handle constraints, such as Barbosa (1999), Hinterding and Michalewicz (1998), Kampen et al. (1996), Koziel and Michalewicz (1998), Koziel and Michalewicz (1999), Orvosh and Davis (1994) and Runarsson and Yao (2000) propose penalty strategies with parameters chosen by the user. Choosing the right parameters may require an exhaustive process of trial and error. On the other hand, parameter-free techniques have become more attractive to provide robustness when applied to problems of various degrees of complexity.

One of these parameterless techniques is APM (Adaptive Penalty Method), which was proposed by Barbosa and Lemonge (2002) to handle constrained optimization problems conceived for a generational Genetic Algorithm (GA). This strategy has shown to be efficient and robust (Gallet et al. 2005; Rocha and Fernandes 2009; Silva et al. 2011; Venter and Haftka 2010). APM does not require the knowledge of the explicit form of the constraints as a function of the design variables and was developed based on information obtained from the population, such as the average of objective function and the level of violation of each constraint. The idea is to observe how each constraint is being violated (or not) by the candidate solutions in the population and then to set a higher penalty coefficient for those constraints which seem to be more difficult to satisfy. In addition to the original method, Barbosa and Lemonge (2008) introduced four new variants.

Several works applying PSO to constrained optimization problems can be found in the literature. Liu and Hui (2012) proposed a new method with a PSO to solve the well-known 24 benchmark constrained optimization problems (Liang et al. 2006). Those authors developed a method called Numerical Gradient (NG) to find the feasible region. Numerical results are presented and compared with the results from the existing PSO variants dealing with constraint optimization problems.

PSO algorithm for solving constrained optimization problems was introduced by Elsayed et al. (2013). The algorithm uses two new mechanisms to guarantee that PSO will perform consistently well for all problems and will not be trapped in local optima. The first one to maintain a better balance between intensification and diversification and the second one to escape from local solutions. The performance of the proposed algorithm is analyzed by solving the CEC2010 (Tang et al. 2010) constrained optimization problems and shows consistent performance, and is superior to other state-of-the-art algorithms.

Applications of PSO in FACTS (Flexible Alternating Current Transmission System) optimization problem have been explained and analyzed by Jordehi et al. (2013). They used a basic PSO variant, parameter selection, multi-objective handling, constraint handling, and discrete variable handling. Some hints and proposals for future research in that area were provided in that paper. Mazhoud et al. (2013) presented a specific constraint-handling mechanism to solve engineering problems using an adapted particle swarm optimization algorithm. The resulting objective problem is solved using a simple lexicographic method. The new algorithm is called CVI-PSO (Constraint Violation with Interval arithmetic PSO) and the authors provide numerous experimental results based on a well-known benchmark and comparisons with previously reported results.

Innocente et al. (2015) developed a robust particle swarm algorithm coupled with a novel adaptive constraint-handling technique to search for the global optimum of management of petroleum fields aiming to increase the oil production during a given concession period of exploration. A hybrid PSO and GA, named as a PSO-GA, for solving the constrained optimization problems was present by Garg (2016). The constraints are handled with the help of the parameter-free penalty function. The results of constrained optimization problems are superior to those reported with the typical approaches exist in the literature.

This paper aims to explore the capability of APM and some of its variants coupled to CRPSO, for the first time, as an optimization method to find solutions of constrained structural optimization problems. It is important to note that new variants, not analyzed in previous studies, are proposed in this paper.

In the next section, the general optimization problem is described. Section 3 presents a particle swarm algorithm. A brief discussion of techniques to handle constrained optimization problems is presented in Sect. 4. Numerical experiments, with several test problems from the literature, are presented in Sect. 5. Finally, in Sect. 6, the conclusions and proposed future works are presented.

2 The structural optimization problem

Typically, a structural optimization problem can be formulated in many ways. For structures made of bars (trusses, frames, etc), the constrained dimensional optimization problem consists of finding the set of areas \(\mathbf a =\{A_1, A_2, ..., A_n\}\) which minimizes the weight \(W(\mathbf a )\) of the truss structure.

$$W(\mathbf a ) = \sum _{i=1}^{n}\rho {A_i}{L_i}$$
(1)

subject to the normalized displacement constraints and the normalized stress constraints

$$\frac{u_{j,k}}{\bar{u}} - 1 \le 0, \quad 1 \le j \le m, \quad 1 \le k \le n_l$$
(2)
$$\frac{\sigma _{l,k}}{\bar{\sigma }} - 1 \le 0, \quad 1 \le l \le n, \quad 1 \le k \le n_l$$
(3)

where \(\rho\) is the specific mass of the material, \(A_i\) and \(L_i\) are the cross-sectional area and the length of the i-th member of the structure, \(u_j\) and \(\sigma _l\) are, respectively, the nodal displacement of the j-th degree of freedom and the stress of the l-th member, n is the total number of members, m is the number of degree of freedom of the structure and \(n_l\) is the number of load cases to which the structure is submitted. The allowable displacements and stresses are defined as \(\bar{u}\) and \({\bar{\sigma }}\), respectively. Additional constraints such as the minimum natural vibration frequency or buckling stress limits can also be included.

Usually, equality constraints are transformed into inequality constraints as follows

$$|h(x)| - \epsilon \le 0$$
(4)

where h is a equality constraint and \(\epsilon\) is a tolerance.

3 Particle swarm optimization

Particle Swarm Optimization (PSO) was originally introduced by Eberhart and Kennedy (1995). The algorithm was inspired by the social behavior of animals such as fish schooling, insects swarming and birds flocking.

PSO is a population-based algorithm with fewer parameters to be set and is easier to implement than other EA’s. PSO also shows a faster convergence rate than other EAs for solving some optimization problems (Kennedy et al. 2001). Each particle of the swarm represents a potential solution of the optimization problem. The particles fly through the search space and their positions are updated based on the best positions of individual particles in each iteration. The objective function is evaluated for each particle and the fitness value of particles is obtained in order to determine which position in the search space is the best.

In each iteration, the swarm is updated using the following equations:

$$v^{(i)}_j(t+1)= {} v^{(i)}_j(t) + c_1 \cdot r_1(x^{(i)}_{pbest}-x^{(i)}_j) + c_2 \cdot r_2(x_{gbest}-x^{(i)}_j)$$
(5)
$$x^{(i)}_j(t+1)= {} x^{(i)}_j(t) + v^{(i)}_j(t+1)$$
(6)

where \(v^{(i)}_j\) and \(x^{(i)}_j\) represent the current velocity and the current position of the j-th design variable of the i-th particle, respectively. \(x^{(i)}_{pbest}\) is the best previous position of the i-th particle (called pbest) and \(x_{gbest}\) is the best global position among all the particle in the swarm (called gbest); \(c_1\) and \(c_2\) are coefficients that control the influence of cognitive and social information, respectively, and \(r_1\) and \(r_2\) are two uniform random sequences generated between 0 and 1.

The basic PSO algorithm can be briefly described using the following steps:

  1. 1.

    Initialize a random particle swarm (position) and velocity distributed within the search space.

  2. 2.

    Initialize \(x_{pbest}\) and \(x_{gbest}\).

  3. 3.

    Calculate the objective function value of each particle of the swarm.

  4. 4.

    Update the position and velocity of each particle in the iteration \(j+1\) using Eqs. (5) and (6).

  5. 5.

    Update \(x_{pbest}\) and \(x_{gbest}\).

  6. 6.

    Repeat the steps 3 to 5 until a stop condition is satisfied.

A change in the conventional PSO algorithm, called CRPSO and proposed by Kar et al. (2012), is used in this study and aims to improve PSO behavior in order to avoid premature convergence. It introduces an entirely new velocity expression \(v_i\) associated with many random numbers and an operator called “craziness velocity”. The operator has a predefined probability of craziness.

In this case the velocity can be expressed as follows (Kar et al. 2012):

$$\begin{aligned} \begin{aligned} v^{(i)}_j(t+1) =&\; r_2 \cdot sign(r_3) \cdot v^{(i)}_j(t)+(1-r_2)c_1 \cdot r_1(x^{(i)}_{pbest}-x^{(i)}_j) + (1-r_2) \cdot c_2 \; \cdot \\&\; (1-r_1)(x_{gbest}-x^{(i)}_j) + P(r_4) \cdot sign2(r_4) \cdot v_j^{craziness} \end{aligned} \end{aligned}$$
(7)

where \(r_1\), \(r_2\), \(r_3\) and \(r_4\) are the random parameters uniformly taken from the interval [0,1), \(sign(r_3)\) is a function defined as

$$sign(r_3) = \left\{ \begin{array}{cc} -1,&{}\quad r_3 \le 0.05\\ 1, &{}\quad r_3 > 0.05 \end{array}\right.$$
(8)

\(v_j^{craziness}\), the craziness velocity, is a user define parameter from the interval [\(v^{min}\), \(v^{max}\)] and \(P(r_4)\) and \({ sign}2(r_4)\) are defined, respectively, as

$$P(r_4)= \left\{ \begin{array}{cc} 1,&{}\quad r_4 \le Pcr\\ 0, &{}\quad r_4 > Pcr \end{array}\right.$$
(9)
$$sign2(r_4)= {} \left\{ \begin{array}{rc} -1,&{}\quad r_4 \ge 0.5\\ 1, &{}\quad r_4 < 0.5 \end{array}\right.$$
(10)

and \({ Pcr}\) is a predefined probability of craziness. Although the parameter \({ Pcr}\) is fixed, \(P(r_4)\) is defined every time the velocity is calculated.

4 Handling constraints

The constrained optimization problems are exhaustively studied in the literature. The usual approach when using evolutionary algorithms is to define strategies to handle constraints by adopting penalty functions Barbosa et al. 2015. The main idea is to transform a constrained optimization problem into an unconstrained one by adding a penalty function.

Penalty techniques can be classified as multiplicative or additive. In the multiplicative case, a positive penalty factor is introduced in order to amplify the value of the objective function of an infeasible individual in a minimization problem. In the additive case, a penalty function is added to the objective function in order to define the fitness value of an infeasible individual. They can be further divided into interior and exterior techniques (Barbosa et al. 2015). The idea in both cases is to amplify the value of the fitness function of an infeasible individual.

Penalty methods can be also classified as static, dynamic and adaptive. Static penalty depends on the definition of an external factor to be added to or multiplied by the objective function. Dynamic penalty methods, in general, have penalty coefficients directly related to the number of generations, and the adaptive penalty considers the level of violation of the population by constraints during the evolutionary process. This paper does not attempt to cover the current literature on constraint handling and the reader is referred to survey papers or book chapters of e.g. Barbosa et al. (2015), Coello (2002), Mezura-Montes and Coello (2011), Michalewicz (1995) and Michalewicz and Schoenauer (1996).

An adaptive penalty method (APM) was originally introduced by Barbosa and Lemonge (2002) for application in constrained optimization problems. That method does not require any type of user defined penalty parameter and uses information from the population, such as the average of the objective function and the level of violation of each constraint during the evolution. The fitness function is written as

$$f(\mathbf x )=\left\{ \begin{array}{ll} f(\mathbf x ),&\quad \text{ if } \,\mathbf x \, \text{ is } \text{ feasible }\\ \bar{f}(\mathbf x )+\sum _{j=1}^{m}k_jv_j(\mathbf{x }), &\quad \text{ otherwise } \end{array}\right.$$
(11)

where

$${\bar{f}}(x)=\left\{ \begin{array}{ll} f(\mathbf{x }),&{}\quad \text{ if } \quad f(\mathbf{x })>\left\langle f(\mathbf{x }) \right\rangle \\ \left\langle f(\mathbf{x }) \right\rangle , &{}\quad \text{ if } \quad f(\mathbf{x })\le \left\langle f(\mathbf{x }) \right\rangle \end{array}\right.$$
(12)

and \(\left\langle f(\mathbf{x }) \right\rangle\) is the average of the objective function values in the current population.

The penalty parameter \(k_j\) is defined at each generation by

$$k_j=|\left\langle f(\mathbf{x }) \right\rangle |\frac{\left\langle \delta _j(\mathbf{x }) \right\rangle }{\sum _{l=1}^{m}[\left\langle \delta _{l}(\mathbf{x }) \right\rangle ]^2}$$
(13)

where \(\left\langle \delta _j(\mathbf{x }) \right\rangle\) is the violation of the jth constraint averaged over the current population.

Barbosa and Lemonge (2008) presented 4 variants for APM, written as

  • Variant 1: the method (1) computes the constraint violation \(v_j\) in the current population, (2) updates all penalty coefficients \(k_j\) and (3) keeps them fixed for a number of generations.

  • Variant 2: the method (1) accumulates the constraint violations for t generations, (2) updates the penalty coefficients \(k_j\) and (3) keeps the penalty coefficients \(k_j\) fixed for t generations.

  • Variant 3: no penalty coefficient \(k_j\) is allowed to have its value reduced along the evolutionary process, so \(k_j^{new} < k_j^{current}\) then \(k_j^{new} = k_j^{current}\);

  • Variant 4: the method is defined as \(k_j^{new}=\theta k_j^{new}+(1-\theta )k_j^{current}\), where \(\theta \in [0,1]\).

New variants for APM have been proposed and the main variations occur in the calculation of \({\bar{f}}\) and the calculation of the penalty coefficient \(k_j\). A combination of these two variations with some characteristics of the variants proposed by Barbosa and Lemonge (2008) generated three new variants and they are outlined as follows

  • Variant 5: \({\bar{f}}(x)\) is modified as follows

    $${\bar{f}}(x)=\left\{ \begin{array}{ll} f(\mathbf{x }),&{}\quad \text{ if }\quad f(\mathbf{x }) > \left\lfloor f(\mathbf{x }) \right\rfloor \\ \left\lfloor f(\mathbf{x }) \right\rfloor , &{}\quad \text{ otherwise. } \end{array}\right.$$
    (14)

    where \(\left\lfloor f(\mathbf{x }) \right\rfloor\) is the value of the objective function of the worst feasible individual. The average of the objective function is used when no feasible individual exist.

  • Variant 6: \(\left\langle \delta _j(\mathbf{x }) \right\rangle\), which originally represented the average of the violations of all individuals at each constraint, is defined here as the sum of the violation of all individuals which violate the j-th constraint divided by the number of individuals which violate this constraint.

  • Variant 7: \(\left\langle \delta _j(\mathbf{x }) \right\rangle\), which originally represented the average of the violations of all individuals at each constraint, is defined here as the sum of the violation of all individuals which violate the j-th constraint divided by the number of individuals which violate this constraint. And \(\left\langle f(\mathbf{x }) \right\rangle\), which represented the average of the objective function, now denoted by \(\left\langle \langle f(\mathbf{x }) \right\rangle \rangle\), is the sum of the objective function of all individuals of the current population divided by the number the infeasible individuals, given by Eq. (15).

    $$k_j=|\left\langle \langle f(\mathbf{x }) \right\rangle \rangle | \frac{\left\langle \delta _j(\mathbf{x }) \right\rangle }{\sum _{l=1}^{m}[\left\langle \delta _{l}(\mathbf{x }) \right\rangle ]^2}$$
    (15)

5 Numerical experiments

In this section, two set of numerical experiments are performed. The parameters of CRPSO are: \(c_1\), \(c_2\), \(v_j^{craziness}\) and \({ Pcr}\).

The choice of these parameters was based on the reference Kar et al. (2012). The values for \(c_1\) and \(c_2\) were defined as 2.05 and \(v_j^{craziness}\) and Pcr in the reference are 0.0001 and 0.3, respectively. Based on these values, firstly some test were made leading to \(v_j^{craziness} = 0.001\) and \({ Pcr} = 0.5\).

5.1 First set of numerical experiments

In order to assess the performance of the proposed algorithm, firstly, nine examples taken from the optimization literature are used. The examples are: Pressure Vessel (Mezura-Montes et al. 2003), Welded Beam (Mezura-Montes et al. 2003), Tension/Compression Spring (Mezura-Montes et al. 2003), 3 of 24 test problems known as G-Suite (Liang et al. 2006): G04 (P4), G06 (P2) and G09 (P3), and 3 problems taken from Parsopoulos and Vrahatis (2002): Problem 1 (P1), Problem 5 (P5) and Problem 6 (P6).

In all experiments the swarm size is 20 and the maximum generations is 10000. The results presented in Hu et al. (2003) and Parsopoulos and Vrahatis (2002) are compared to those obtained here in the preliminary experiments. Hu et al. (2003) proposed a modified PSO for engineering optimization problems with constraints. Parsopoulos and Vrahatis (2002) also presented a PSO algorithm in coping with constrained optimization problems.

Table 1 presents the results for the three first experiments. It can be observed that “This study” achieved similar or higher results when compared to the reference. Table 2 presents the results for the Problems 1 to 7. The results for these experiments are competitive when compared with those obtained from the literature. It is important to note that the sums of constraint violations are zero in all the results found in Table 2 for “This study”.

A last example (P7) in this first set of experiments is G11 (Liang et al. 2006):

$$\begin{aligned}\min f(x)= {} x_1^2 + (x_2 - 1)^2 \\ \text{ subject } \text{ to } h(x)= {} x_2 - x_1^2 = 0 \end{aligned}$$

where \(-1 \le x_1 \le 1\) and \(-1 \le x_2 \le 1\). The optimum solution is \(f(x^*) = 0.7499\).

A total of 60 particles and a budged of 300000 objective function evaluations were used. The results of 30 independent runs are shown in the last row of Table 2. The results presented in Wang and Cai (2009) are used in the comparisons. The equality constraints were transformed to inequality constraints (Eq. 4) using a tolerance equal to \(10^{-4}\).

Finally, the fitness values of the best solutions achieved in a given independent run are plotted in Figs. 1, 2, and 3. These figures illustrate the convergence observed, respectively, in the problems Tension/Compression Spring, Problem 1 and Problem 6 when using CRPSO. Figure 1a shown that the best solution found when 10,000 iterations are allowed is 0.012715; this fitness value is slightly smaller (0.07%) than that obtained at iteration 100, 0.012724 (Fig. 1b). Thus, one can see that CRPSO is able to produce good solutions with few objective function evaluations.

Figures 2 and 3 indicate the same behavior with respect to Problems 1 and 6. In Fig. 2a, the best solution found for the Problem 1 at iteration 10000 is 1.3941, which is the same value obtained at iteration 100 (as observed in Fig. 2b). When analyzing the results achieved in Problem 6 (Fig. 3), the best solution found at iteration 10000 and 100 were \(-213.000\).

These results encourage the use of CRPSO in a second set of numerical experiments presenting more complexity in terms of the number of constraints and in this case they are implicit.

Table 1 Comparison of the results of the minimization of the weight of a pressure vessel, welded beam and tension/compression spring
Table 2 Comparison of the results of the minimization of the weight of problems 1 to 7
Fig. 1
figure 1

Convergence for the tension/compression spring. a Using 10000 generations (best \(=\) 0.012715) and b using 100 generations (best = 0.012724)

Fig. 2
figure 2

Convergence for the Problem 1. a using 10,000 generations (best \(=\) 1.3941) and b using 100 generations (best \(=\) 1.3941)

Fig. 3
figure 3

Convergence for the Problem 6. a using 10,000 generations (best = -231.0000) and b using 100 generations (best = -213.0000)

5.2 Second set of numerical experiments

Several engineering problems, commonly analyzed in the literature, were addressed here. The problems correspond to 5 sizing structural optimization of plane and spatial trusses: 10-, 25-, 52-, 60- and 72-bar trusses, displayed in Figs. 4, 5, 6, 7 and 8. All these truss structures are analyzed by the Finite Element Method (FEM) during the evolutionary process.

The standard mono-objective sizing structural optimization problem, in the second set of numerical experiments, reads: find the set of cross-sectional areas of the bars \(x=\{ A_1, A_2,\) \(\ldots , A_N\}\) which minimizes the weight W of the structure

$$W =\sum _{i=1}^N \rho _i A_i l_i ,$$
(16)

where \(\rho _i\) is the density of the material, \(l_i\) is the length of the i-th bar of the truss and N is the number of bar. The problem is usually subject to inequality constraints \(g_p(x) \le 0, \, p=1,2,\ldots ,{{\bar{p}}}\).

Table 3 presents some details of each test problem. In this table, \({ ndv}\) and \({ type}\) mean the number and type of design variable (c—continuous or d - discrete), respectively, \({ nc}\) is the number of constraints and \({ nfe}\) means the number of function evaluations. Test Problem 1 has the discrete case and TP2 has the continuous case. In this table there are references where it is possible to obtain the complete data for each structural optimization problem.

Table 3 Second set of numerical experiments
Fig. 4
figure 4

10-bar truss, taken from Lemonge and Barbosa (2004)

Fig. 5
figure 5

25-bar truss, taken from Lemonge and Barbosa (2004)

Fig. 6
figure 6

52-bar truss, taken from Lemonge and Barbosa (2004)

Fig. 7
figure 7

60-bar truss, taken from Barbosa and Lemonge (2003)

Fig. 8
figure 8

72-bar truss, taken from Lemonge and Barbosa (2004)

In all experiments the swarm size is 50. It should be understood that continuous design variables are considered as the nearest integer of the corresponding variable of the vector solution (particle), as used for Vargas et al. (2015). It points to either an index of a table of discrete values or an integer. In all analyses feasible solutions were found in the 35 independents runs. A preliminary analysis involving all the APM variants, given in Sect. 4, is proposed in Sect. 5.4 in order to find those that obtained the best performance in all experiments. Subsequently, only the best ones are used in the comparisons.

5.3 Performance analysis of experiments

The experiments are compared using the performance profiles proposed by Dolan and Moré (2002). Performance profiles are proposed as an analytical resource for the visualization and interpretation of the results of numerical experiments in order to define which algorithm provides a better performance considering a given set of problems.

Consider the set P of test problems \(p_j\), with \(j=1,2,\ldots ,n_p\), a set of algorithm \(a_i\) with \(i=1,2,\ldots ,n_a\) and \(t_{p,a} > 0\) a performance metric (for example, computational time, average, etc.). The performance ratio is defined as:

$$r_{p,a} = \frac{t_{p,a}}{min\left\{ t_{p,a}: a \in A\right\} .}$$
(17)

Thus, the performance profile of the algorithm is defined as:

$$\rho _{a}(\tau )=\frac{1}{n_p}\left|\left\{ p \in P: r_{p,a} \le \tau \right\} \right|$$
(18)

where \(\rho _a(\tau )\) is the probability that the performance ratio \(r_{p,a}\) of algorithm \(a \in A\) is within a factor \(\tau >= 1\) of the best possible ratio. If the set P is representative of problems yet to be addressed, then algorithms with larger \(p_a (\tau )\) are to be preferred. The performance profiles have a number of useful properties (Barbosa et al.  2010; Dolan and Moré 2002). Other analyses using performance profiles in algorithm performance comparison can be found in Barbosa et al. (2010) and Bernardino et al. (2011).

5.4 Analysis of APM variants

Performance profiles, introduced in the previous section, are used as a tool for a more detailed and conclusive analysis of the large volume of results.

Figure 9a, in which \(\tau \in [1;1.00009]\), shows the performance profiles curves, where APM presented the highest value of \(\rho _a(1)\), which means that the method had the best performance considering all problems. Figure 9b shows the performance profiles where the Variant 7 had the lowest value of \(\tau\), such that \(\rho _a(\tau )=1\), and, therefore, this is considered the most robust variant. Table 4 shows the areas under the curves of the normalized performance profiles, where Variant 7, Variant 5, APM and Variant 3 had the highest area values and they are considered the methods with the best global performance. Therefore, these methods will be used in a later comparison of results.

Fig. 9
figure 9

Performance profiles of the variants used

Table 4 Normalized areas under the curves of the performance profiles in Fig. 9 for each variant

It is worth remembering that not all curves come in \(\rho _a(\tau )=1\). This is because for this comparison a suite composed of 35 test problems was used: 24 test functions known as G-Suite (Liang et al. 2006), 5 mechanical engineering problems: Tension/Compression Spring, Speed Reducer, Welded Beam, Pressure vessel (Mezura-Montes et al. 2003) and Cantilever beam (Erbatur and Hasançebi 2000) and 6 structural engineering problems set out in this paper in the beginning of Sect. 5. Thus, as shown in Fig. 9, feasible results for all analyzed problems were not obtained.

5.5 Results

In all experiments, 35 independent runs were performed and only the feasible solutions were considered. The results are presented in Tables 5, 6, 7, 8, 9, 10, 11, 12, 13 and 14 and the best ones are displayed in boldface. The tables present the method, the best solutions, the values of median, average and the std (standard deviation) and, finally, the worst solutions.

Table 5 presents the results for the 10-bar truss (discrete and continuous case) and the 25-bar truss. For the 10-bar truss (discrete case), the four methods analyzed achieved the same final weight of 5509.7173 lbs. However, APM has the best value of the median 5528.0869 lbs and Variant 5 has the best average value and the lowest value for the standard deviation, 5624.9286 lbs and 1.3148e \(+\) 03, respectively. For the continuous case, Variant 5 has the best value for the final weight of 5060.9067 lbs and the best value for median, average, standard deviation and worst are found by Variant 7.

For the 25-bar truss, the four methods had the same weight of 484.8541 kg and the same median value of 485.0487 lbs. The best average and the lowest standard deviation was found by Variant 5, which stands out above the other methods for this problem.

Table 5 Results for the 10-bar truss (discrete and continuous case) and the 25-bar truss

The results for the 52-, 60- and 72-bar trusses are presented in Table 6. For the 52-bar truss all methods reached the same final weight of 1902.6058 kg. APM presented the best median 1904.1270 kg and Variant 7 presented the best average, the smallest standard deviation and the lowest worst value, and, thus, was the method that stood out among the methods analyzed for this problem.

For the 60-bar, the method which obtained the best performance was Variant 3, with a final weight of 311.9716 lbs and median of 319.6148 lbs. Finally, for the 72-bar truss, Variant 7 obtained the best final weight, 379.6535 lbs. However, the other methods also presented similar values. Variant 5 presented the best median value and Variant 3 is the variant with the best average and the smallest standard deviation.

Table 6 Results for the 52-, 60- and 72-bar trusses

5.6 Analysis of the results

The best and average values obtained by the variants are used here as performance metrics. The choice among these values depends on what the designer wants. The first analysis using the value of the best, Fig. 10a, in the range \(\tau \in [1;1.00005]\), shows the performance profile graphic, where Variant 7 presented the highest value of \(\rho _a(1)\) and, therefore, had the best performance in a larger number of problems. In Fig. 10b, all variants had the lowest value of \(\tau\), such that \(\rho _a(\tau )=1\). However, Variant 3 was the method which presented the highest robustness. The areas under the performance profile curves are shown in Table 7. Variant 3, followed by Variant 7, obtained the highest values, 1 and 0.92846, respectively. Thus, Variant 3 should be considered the method with the best global performance using the best value.

Fig. 10
figure 10

Performance profiles using the best value

Table 7 Normalized areas under the performance profiles curves using the best value

The performance profiles using the average values show interesting behavior among the variants analyzed. It can be observed that Variant 7 is the variant with better performance in the majority of problems (Fig. 11a), but it is not considered robust. On the other hand, APM and Variant 3 do not present the best performance in the majority of problems but presented the best performance in general (more robustness) (Fig. 11b).

Fig. 11
figure 11

Performance profiles using the average value

Table 8 Normalized areas under the performance profiles curves using the average value

In summary, Variant 3 is the variant that performed better when the best value of the objective function is considered, followed by Variant 7. Using the average value as the performance metric, the original APM found the best result among the variants analyzed, followed by Variant 3. Thus, considering the best value as performance metric commonly used among designers, Variant 3 is the variant with the best global performance among the set of methods analysed.

Tables 9, 10, 11, 12, 13 and 14 show the final design variables, the objective function (W) and the number of function evaluations (nfe) for the Test Problems 1–6 using Variant 3 compared with results found in the literature. The stop criteria adopted here is the maximum number of objective function evaluations (indicated by nfe). The values presented in Tables 9, 10, 11, 12, 13 and 14 indicate that Variant 3 obtained results competitive with those found in the literature. One can notice that the results obtained by the proposed technique are: (1) better than the result presented in Lemonge et al. (2015) and equal to those from the other references, when using the same number of function evaluations and when TP3 (Table 11) is solved; (2) equal to that presented in Sadollah et al. (2012) and better than those obtained by the other references, when TP4 (Table 12) is considered; (3) better than those presented by the references used in the comparisons, when solving TP6 (Table 14); and (4) worse, but competitive, than the results found in the literature, when TP1, TP2, and TP5 are considered.

Figure 12 plots the fitness value of the best solution found in every iteration for the 72-bar truss. In Fig. 12a, one can seen that the best solution found at iteration 700 is 379.655920. When 70 iterations are considered, the value obtained is 387.312588 (Fig. 12b).

Table 9 Final design variables and objective function (weight—W) found for the 10-bar truss - discrete case (TP1)
Table 10 Final design variables and objective function (weight—W) found for the 10-bar truss—continuous case (TP2)
Table 11 Final design variables and objective function (weight—W) found for the 25-bar truss (TP3)
Table 12 Final design variables and objective function (weight—W) found for the 52-bar truss (TP4)
Table 13 Final design variables and objective function (weight—W) found for the 60-bar truss (TP5)
Table 14 Final design variables and objective function (weight—W) found for the 72-bar truss (TP6)
Fig. 12
figure 12

Convergence for the 72-bar truss. a Using 700 generations (best = 379.655920) and b using 70 generations (best = 387.312588)

New comparisons were provided in this paper. Plots were generated using the values of normalized constraints, obtained from the solutions displayed in Tables 9, 10, 11, 12, 13 and 14. The constraints in the analyzed structural optimization problems presented in this paper are given by the Eq. (2) (\({u_{j,k}}/{{\bar{u}}} - 1 \le 0\), node displacements) and Eq. (3) (\({\sigma _{l,k}}/{{\bar{\sigma }}} - 1 \le 0\), normal stress). It can be expected, a value equal to “0” for active constraints. The desirable solutions are those where the constraints are active, i.e., equal to “0” or very close to it. The plots of Figs. 13 14, 15, 16, 17 and 18 show these constraints for each compared solution (Tables 9, 10, 11, 12, 13, 14).

From these curves, it is possible to observe those constraints that are active or close to it and the inactive ones. Besides, the curves show the similarities of the solutions used for comparisons.

In these figures there are vertical lines dividing the x axes in two parts: the left part (including the point at the vertical line) corresponds to the displacement constraints, and the right one to the stresses constraints.

Furthermore, the curves presented in the plots inform the active constraints and the natures of them, displacements (left part) or normal stresses (right part). For example, observing the plots of Figs. 13 and 14, it is easy to note that two displacement constraints (2 and 4) and one stress constraint (13) are active (very close to “0”). From Fig. 15, two constraints (2 and 4) with respect to the displacements are active. From Fig. 16, there are five active or almost active constraints, and so on, when observing the other curves. Also, for each solution, it was calculated the sum of the absolute values of the constraints (SC) and, as expected, comparing the solutions, the solution that has the highest value for this sum will be the best among them. These plots are presented in Figs. 13, 14, 15, 16, 17 and 18.

It is very important to observe that the results presented in references Farshi and Alinia-Ziazi (2010) and Li et al. (2014), although slightly better than those, rigorously feasible, presented in this study and in the references Barbosa and Lemonge (2003) and Lemonge et al. (2015), are infeasible as shown in the curves displayed in Fig. 17. There are several constraints in these solutions greater than zero. Also, it is important to remark the difficulties to handle constraints either using a deterministic method such as in the reference Farshi and Alinia-Ziazi (2010) or an evolutionary algorithm such as in the reference Li et al. (2014).

Fig. 13
figure 13

Constraints for TP1—10-bar truss (discrete case). In this figure, and in Figs. 14, 15, 16, 17 and 18 the vertical lines (where it exists), divides the x axes in two parts: the left part (including the point at the vertical line) corresponds to the displacement constraints, and the right one to the stresses constraints

Fig. 14
figure 14

Constraints for TP2—10-bar truss (continuous case)

Fig. 15
figure 15

Constraints for TP3—25-bar truss

Fig. 16
figure 16

Constraints for TP4—52-bar truss

Fig. 17
figure 17

Constraints for TP5—60-bar truss

Fig. 18
figure 18

Constraints for TP6—72-bar truss

A new metric is proposed in this paper where several solutions can be compared using the SC. It provides a way to verify a “distance” between the final design variables, the cross-sectional areas of the bars in the engineering optimization problems analyzed in this paper. One can observe from these curves that the solutions are quite similar since the curves are practically the same. Using this new metric, SC indicates how close are the solutions. Tables 15 and 16 show the values of SC for each test problem showing that the solutions are quite similar.

Table 15 Sum of the absolute values of the constraints (SC) for TP1, TP2 and TP3
Table 16 Sum of the absolute values of the constraints (SC) for TP4, TP5 and TP6

6 Concluding remarks and future work

This paper discusses a particle swarm algorithm (PSO) to solve constrained structural optimization problems. An adaptive penalty method (APM) and several variants of it are used. The PSO used in this work presents a change from the conventional algorithm. An operator called “craziness velocity” is adopted and the new algorithm is denoted CRPSO.

Firstly, seven APM variants are proposed and analyzed in order to discover which ones present the best performance. Subsequently, the three best variants and the original APM are used in the second analysis. It is important to note that the new variants proposed in this paper have not been analyzed in previous works.

Considering that this paper has the major focus on the engineering optimization problems, the main interest of a designer is to find the best solution sometimes neglecting other metrics. In this way, from the results presented in Table 7, the Variant 3 achieved the best performance and its use is recommended.

Take note that the best variant found in Lemonge et al. (2015) was not the same as obtained in this study. However, the robustness of these two variants is very similar, presenting very competitive results. A further important point is that the proposed algorithm performs better when the problems have continuous variables (Test Problems 5 and 6) and the algorithm proposed in Lemonge et al. (2015) performed better when the variables are discrete (Test Problem 1).

For future work the development of a multi-objective PSO to solve structural optimization problems in which, for example, the maximum displacement of the nodes is a further objective to be minimized in searching for the minimum weight of the structure, is intended, as is testing the new suite of functions available in the literature (Liang et al. 2013), and checking the performance of the variants highlighted in this paper. Finally, it is intended to apply APM to structural optimization problems considering frequency constraints and optimum solutions considering the best member groupings via cardinality constraints (Barbosa et al. 2008).