Professional Documents
Culture Documents
A Particle Swarm Optimization Algorithm For Mixed Variable Nonlinear Problems
A Particle Swarm Optimization Algorithm For Mixed Variable Nonlinear Problems
*Corresponding Author
Abstract Many engineering design problems involve a combination of both continuous and
discrete variables. However, the number of studies scarcely exceeds a few on mixed-variable
problems. In this research Particle Swarm Optimization (PSO) algorithm is employed to solve mixed-
variable nonlinear problems. PSO is an efficient method of dealing with nonlinear and non-convex
optimization problems. In this paper, it will be shown that PSO is one of the best optimization
algorithms for solving mixed-variable nonlinear problems. Some changes are performed in the
convergence criterion of PSO to reduce computational costs. Two different types of PSO methods are
employed in order to find the one which is more suitable for using in this approach. Then, several
practical mechanical design problems are solved by this method. Numerical results show noticeable
improvements in the results in different aspects.
ﺑﺎ ﺍﻳﻦ.ﭼﻜﻴﺪﻩ ﺩﺭ ﺑﺴﻴﺎﺭﻱ ﺍﺯ ﻣﺴﺎﺋﻞ ﻃﺮﺍﺣﻲ ﻣﻬﻨﺪﺳﻲ ﺗﺮﮐﻴﺒﻲ ﺍﺯ ﻣﺘﻐﻴﺮ ﻫﺎﻱ ﭘﻴﻮﺳﺘﻪ ﻭ ﮔﺴﺴﺘﻪ ﺑﻪ ﮐﺎﺭ ﻣﻲ ﺭﻭﺩ
ﺩﺭ ﺍﻳﻦ ﺗﺤﻘﻴﻖ ﺍﺯ ﺭﻭﺵ ﺣﺮﮐﺖ ﺩﺳﺘﻪ ﺟﻤﻌﻲ.ﻭﺟﻮﺩ ﻣﻄﺎﻟﻌﺎﺕ ﮐﻤﻲ ﺑﺮ ﺭﻭﻱ ﺍﻳﻦ ﮔﻮﻧﻪ ﻣﺴﺎﺋﻞ ﺍﻧﺠﺎﻡ ﭘﺬﻳﺮﻓﺘﻪ ﺍﺳﺖ
ﺭﻭﺷﻲPSO .( ﺑﺮﺍﻱ ﺣﻞ ﻣﺴﺎﺋﻞ ﺑﻬﻴﻨﻪ ﺳﺎﺯﻱ ﻏﻴﺮ ﺧﻄﻲ ﺩﺍﺭﺍﻱ ﻣﺘﻐﻴﺮ ﻫﺎﻱ ﺗﺮﮐﻴﺒﻲ ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺍﺳﺖPSO) ﺫﺭﺍﺕ
ﺩﺭ ﺍﻳﻦ.ﺍﺳﺖ ﮐﻪ ﻣﻲ ﺗﻮﺍﻧﺪ ﺑﺮﺍﻱ ﻳﺎﻓﺘﻦ ﺟﻮﺍﺏ ﺑﻬﻴﻨﻪ ﻣﻄﻠﻖ ﻣﺴﺎﺋﻞ ﺑﻬﻴﻨﻪ ﺳﺎﺯﻱ ﻏﻴﺮ ﺧﻄﻲ ﻭ ﻏﻴﺮ ﻣﺤﺪﺏ ﺑﻪ ﮐﺎﺭ ﺭﻭﺩ
ﺑﺎ ﺗﻐﻴﻴﺮﺍﺗﻲ. ﻳﮑﻲ ﺍﺯ ﺑﻬﺘﺮﻳﻦ ﺭﻭﺵﻫﺎ ﺑﺮﺍﻱ ﺣﻞ ﻣﺴﺎﺋﻞ ﺑﺎ ﻣﺘﻐﻴﺮﻫﺎﻱ ﺗﺮﮐﻴﺒﻲ ﺍﺳﺖPSO ﻣﻘﺎﻟﻪ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﻣﻲﺷﻮﺩ ﮐﻪ
ﺑﻪ ﮐﺎﺭ ﺭﻓﺘﻪ ﻭ ﺍﺯ ﺭﻭﺵPSO ﺩﻭ ﻧﻮﻉ ﻣﺨﺘﻠﻒ ﺍﺯ ﺭﻭﺵ.ﺩﺭ ﺍﻳﻦ ﺭﻭﺵ ﺯﻣﺎﻥ ﺍﺟﺮﺍﻱ ﺍﻟﮕﻮﺭﻳﺘﻢ ﮐﺎﻫﺶ ﻳﺎﻓﺘﻪ ﺍﺳﺖ
.ﺩﻗﻴﻖﺗﺮ ﺩﺭ ﺣﻞ ﺗﻌﺪﺍﺩﻱ ﺍﺯ ﻣﺴﺎ ﺋﻞ ﻃﺮﺍﺣﻲ ﻣﻬﻨﺪﺳﻲ ﺍﺳﺘﻔﺎﺩﻩ ﺷﺪﻩ ﺍﺳﺖ
www.SID.ir
Archive of SID
www.SID.ir
Archive of SID
k 1 x k vk 1
x id (1) w max 1 , w min 0 (4)
id id
k 1
Sometimes as particle oscillations become wider,
vid the system will gain tendency to explode [12]. The
(2)
k c r (pbestk x k ) c r (gbest x k ) usual means of preventing explosion is simply to
wvid 11 id id 22 id define a parameter v max and curb the velocity of
every individual i from exceeding that velocity on
In Equation 2 w is the inertia weight, c1 and c 2 each dimension d. In the case that velocity violates,
are positive constants called cognitive and social it will be modified as follows:
parameters, respectively, and r1 and r2 are random
numbers selected in the interval [0 1]. The If vid vmax then vid vmax
constants c1 and c 2 represent the weighting of the
stochastic acceleration terms that pull each particle If vid vmax then vid vmax (5)
towards pbest and gbest positions and usually are
set c1 c 2 2 . The effect of this is to allow particles to oscillate
In the second method gbest is replaced within the bounds [12].
by gbest k . As will be shown later, in the numerical
2.1. Mathematical Formulation of Constraint
examples of mixed-variables or in the problems Problems Problem definition:
that only have discrete variables, usage of gbest k
is more suitable compared to the use of gbest . In Minimize f(x)
other words, the success rate of gbest k is higher Subject to
than that of gbest . The reason is firstly due to the
fast convergence of gbest and secondly, the x iL x i x iU i 1,2,....., n (6)
inability of particles to escape from local minima
in gbest method. In other words, since the discrete g h (x ) 0 h 1,2,....., m (7)
variables are rapidly converged the continuous
variables will be obliged to search in a limited where n is the number of continuous variables, x iL
specific area which might not be the optimum area.
The role that inertia weight w plays in the and x iU are the lower and upper bounds of
convergence behavior of PSO is very important. continuous variables, respectively, g h (x) are
The inertia weight is employed to control the effect applied constraints and m is the number of
of the previous velocities on the current velocity. constraints.
This way, the parameter w makes a compromise Penalty function is defined as:
between global and local exploration abilities of
the swarm. In PSO, when the search continues, the m 2n
F( x ) f ( x ) r max{0, g h ( x )} (8)
inertia term decreases linearly as: h 1
www.SID.ir
Archive of SID
the number of discrete variables in the problem is s: specific part of problem’s space and with
subsequent iterations, particles only oscillate in
x n i Di that region. These oscillations only increase the
precision of results. Most of the times such high
Di {d i,1, d i,2 ,....., d i, f } i 1,2,..., s (9) precision is unnecessary so, a convergence
criterion is introduced based on the required
At first these variables are treated as continuous accuracy. When the results attained such accuracy,
and similar to above, the following supplemental iterations will be terminated and do not need to
constraints are applied for the upper and lower reach k max . This can decrease the number of fitness
bounds calls and as a result reduce the computational
costs. This reduction is more significant in the
d i,1 x n i d i, f i 1,2,.........., s (10) cases of mixed or discrete variable problems. The
convergence criterion is determined as:
The new objective function incorporates the
behavior constraints as: vmin min( Vij ) i 1, 2....,c j 1, 2,....,d
m 2n 2s
F( x ) f ( x ) r max{0, g h ( x )} (11) Terminate if v min < e (13)
h 1
where c and d are the number of variables and
At any iteration, after finding the new position of particles, respectively, and e is the required
particles ( x k 1 ) , appropriate variables can be made accuracy.
discrete using two methods. The first method is to
find the nearest discrete value to the current 2.4. Optimization Algorithm of Mixed
continuous variable as follows: Discrete Variables Problems The algorithm
min x n i di,1 , x n i di,2 ,......., of the proposed method is as follows:
(12)
1. The number of particles and maximum
x n i di, f x n i di, q xn i di, q
number of iterations are determined. The
iteration number k is set to k = 1.
The second method is to check the upper and lower 2. The position and velocity for every
discrete values of the current continuous variable particle are set at random.
and determine which one is the best. It is obvious 3. The due variables are made discrete.
that second method imposes additional fitness calls 4. The values of pbest k , gbest k and gbest
to the solution and accordingly increases
are determined.
computational costs. However, when the range
5. The value of inertia weight is calculated.
of discrete variables is vast, usage of second
6. The position and velocity of every
method leads more accurate results and better
convergence [19]. particle are updated by pbest k and
Using these two methods, at any iteration, all of gbest k .
discrete variables that are treated as continuous 7. If the velocity of particles violate v max
become discrete. These methods are very simple
and efficient and do not have the complexities of and v max they are modified.
the penalty approach. They also surmount 8. If the minimum value of the particle’s
shortcomings existing in the methods that adopt absolute velocity is lower than what was
discrete values near the optimal solution or use chosen; jump to 11.
discrete values obtained by rounding off. 9. k=k+1
10. The number of iterations is checked. If
2.3. Convergence Criterion In practice, after k k max , then return to 3. Otherwise:
some iterations all of the particles converge to a 11. The value of gbest is displayed.
www.SID.ir
Archive of SID
x 22
x x3 2
J 2{ 2 x1x 2 [ ( 1 ) ]} (27)
12 2
6PL
( x ) (28)
x 4 x 32
4PL3
( x ) (29)
Ex 3
3x 4
4.013 E( x 32 x 64 / 36) x E
Pc ( x ) (1 3 ) (30)
L2 2L 4G
www.SID.ir
Archive of SID
In this example, the number of particles, 3.2. Example 2. Pressure Vessel Design
maximum iterations number and convergence Optimum design of a pressure vessel is one of
criterion value are assumed to be 30, 1000 and 10- the most famous benchmarks for mixed discrete
6
, respectively. The results are obtained through 30 nonlinear programming (MDNLP) problems and
independent runs. Table 1 lists the welded beam several studies of it are available. The pressure
design results obtained by different researchers. vessel is an air storage tank (as shown in Figure 2)
As can be seen, the objective function value with a working pressure of 3000 psi and a minimum
gained in this research is the best compare to the volume of 750 ft3 . The cylindrical pressure vessel
results of other researches. The statistical results is capped at both ends by hemispherical heads.
are shown in Table 2. It is evident that not only the Using rolled steel plate, the shell is to be made in
best feasible solution obtained in this paper is the two halves that are joined by two longitudinal
best among other researches also, the average welds to form a cylinder. Each head is forged and
searching quality and the worst solution is better then welded to the shell. Four design variables are
than those of other techniques. The standard
considered as X [ x1 , x 2 , x3 , x 4 ] [ Ts , Th , R , L ]
T T
deviation of the results of this research is very
small. which indicate thickness of the shell, Ts, thickness
TABLE 1. Comparison of the Best Solution for Example 1 Found by Different Methods.
www.SID.ir
Archive of SID
25 x 3 150 (37)
25 x 4 240 (38)
www.SID.ir
Archive of SID
TABLE 3. Results of Example 2 using Particle Swarm Optimization as the Basic Solution Technique.
This
Guo He He Kitayama Zhang
Research
g1 0 0 0 -0.004 0 0
TABLE 4. Results of Example 2 Obtained by Different Methods Excluding Particle Swarm Optimization Technique.
www.SID.ir
Archive of SID
www.SID.ir
Archive of SID
2 x 3x 22 ( x1 2) where
f (x) (39)
4
8Pmax x 33 x1
The following constraints, defined in [2], are (48)
Gx 42
considered
S 8K s Pmax x 3 x
g1 ( x ) 0 (40) C 3 (49)
x 32 x2
(4C 1) 0.615
g 2 (x) ( 1.05(x1 2)x 2 ) l max 0 (41) Ks (50)
(4C 4) C
g 3 ( x ) d min x 2 0 (42)
Gx 2 4
K (51)
g 4 ( x ) x 3 D max 0 (43) 8x1x 33
5 x1 20 ; x1 5 k; k 0, 1, ... , 15 (52)
x 2 {0.207,0.225,0.244,0.263,0.283,
(54)
0.307,0.331,0.362,0.394,0.4375,0.5}
1 x3 3 (55)
www.SID.ir
Archive of SID
27 5.0 x 7 5.5
g1 ( x ) 1 0 (57) (74)
x1x 22 x 3
The problem is solved with 10 particles and 500
397.5 maximum iterations. As mentioned in the previous
g 2 (x) 1 0 (58) sections, when the problem only consists of
x1x 2 x
2 3
2
discrete variables, using the second approach is
more efficient, so this method is used to solve
1.93x 34 this problem. The optimum solution obtained is
g3 (x) 1 0 (59) X* = [3.5,0.7,17,7.3,7.8,3.36,5.29] and the optimum
x 2 x 3 x 64
objective function value is 3000.8. This solution is
www.SID.ir
Archive of SID
N 10 9 9 9 9 9
www.SID.ir
Archive of SID
www.SID.ir
Archive of SID
25. He, S., Prempian, E. and Wu, Q.H., “An Improved Proc. ASME/DETC/DAC, Paper No. 1601, in CDROM,
Particle Swarm Optimizer for Mechanical Design (1996).
Optimization Problems”, Eng. Optimization, Vol. 36, 27. Coello, C.A.C., “Theoretical and Numerical Constraint
No. 5, (2004), 585-605. Handling Techniques used with Evolutionary Algorithms:
26. Lewis, K. and Mistree, F., “Foraging-Directed Adaptive A Survey of the State of the Art”, Computer Methods
Linear Programming: An Algorithm for Solving in Applied Mechanics and Engineering, Vol. 191, No.
Nonlinear Mixed Discrete/Continuous Design Problems” 11-12, (2002), 1245-1287.
www.SID.ir