Anda di halaman 1dari 6

A Joint Optimization Method of Genetic Algorithm

and Numerical Algorithm Based on MATLAB


Jingjun Zhang, Jitao Zhong, Ruizhen Gao, Lili He
Department of Science Research, College of Civil Engineering, College of Mechanical and Electrical Engineering
Hebei University of Engineering
Handan, China
santt88@163.com, zhongjitao@126.com, ruizhenemail@163.com, helili0910@163.com
AbstractThe mathematic model of a two-bar truss is built in
MATLAB and the analysis is carried out by the genetic algorithm
toolbox. In order to compare with each other, the parametric
model of the planar truss is also established by the ANSYS
Parametric Design Language and solutions are obtained using
the first-order method native to ANSYS. The comparison of the
results shows that genetic algorithms do not always display better
properties than other algorithms for some problems. Finally, a
joint optimization method which combines MATLAB genetic
algorithm toolbox and the numerical algorithm based on the
quasi-Newton method is proposed. Then the method is identified
through the numerical example of the two-bar truss. The
simulation results indicate that the joint optimization method can
always converge to the global optimal solution.
Keywords-genetic algorithm; numerical algorithm;
optimization; MATLAB; ANSYS
I. INTRODUCTION
Genetic algorithms, based on the mechanics of natural
selection and genetics, combine Darwins theory of evolution
based on survival of the fittest and a systematic information
exchange guided by random operators to form a robust search
procedure. The optimization process gets its dynamic by
developing new generations of potential solutions and
evaluating the degree of fitness of each generation and
allowing it to proceed if it satisfies specific selection criterion
which is usually based on a fitness-proportional selection [1].
Felipe P. Espinoza et al. [2] discussed the effects of local
search on hybrid genetic algorithm performance and
population sizing. A. Kaveh and H. Rahami [3] employed a
genetic algorithm to perform design and optimization of
structures considering material and geometric nonlinearity.
John S. Gero and Somwrita Sarkar [4] proposed an alternate
approach to design optimization based on the situatedness
paradigm. Felipe P. Espinoza et al. [5] presented a self-
adaptive hybrid genetic algorithm and compared its
performance to a non-adaptive hybrid genetic algorithm and
the simple genetic algorithm on two multi-modal test functions
with complex geometry. Meghna Babbar et al. [6]
demonstrated the use of interactive genetic algorithms for long
term groundwater monitoring problems, which have multiple
numerical and subjective objectives. Jaehong Lee et al. [7]
developed a micro genetic algorithm to find optimum cross-
section of cold-formed steel beams. Rachel Arst et al. [8]
tested the extended compact genetic algorithm to determine
whether it would decrease computational time compared with
simple genetic algorithms. Eknarin Sriprasert and Nashwan
Dawood [9] gave an overview of a genetic algorithm for
multi-constraint optimization problem. Amr Kandil et al. [10]
presented the development of a parallel multi- objective
genetic algorithm framework to enable an efficient and
effective optimization of resource utilization in large-scale
construction projects.
The desire to improve a design without compromising the
structural integrity has been a strong driving force behind the
development of various optimum design methods [11]. Genetic
algorithm toolbox provides some algorithms for problems that
are difficult to solve with traditional optimization techniques.
You can use it when computation of the objective function is
discontinuous, highly nonlinear and so on. However,
algorithms included in the genetic algorithm toolbox are fixed,
so they are not always applicable to all problems. In this paper,
a joint optimization method which combines the genetic
algorithm toolbox and the traditional numerical algorithm is put
forward. The method is a natural extension to genetic
algorithms, combining the genetic algorithms global search
capabilities with the strengths of local search algorithms.
Finally, this method is identified through the numerical
example of two-bar truss and the analysis results show that the
joint optimization method can always converge to the global
optimal solutions.
II. PROCEDURE OF GA(GENETIC ALGORITHM) AND
PARAMETER SETTINGS
A. Basic process flow of GA
The genetic operation of GA is random during the evolution
process, while the expressive characteristics of it are not totally
a stochastic search. The genetic operation can effectively use
the historical information to search for better solutions. At each
step, the genetic algorithm selects individuals at random from
the current population to be parents and uses them produce the
children for the next generation. Over successive generations,
the population evolves toward an optimal solution [12]. The
evolution process of GA can be described as follows:
) , , , , , , ), 0 ( ( t f p g s L N P GA = , 1
1490 978-1-4244-5046-6/10/$26.00 c 2010 IEEE

where
N
n
I p p p P = )) 0 ( ), 0 ( ), 0 ( ( ) 0 (
2 1
is the initial
population;
L N
B I } 1 , 0 { = = is the encoding space of
binary strings, whose length is L; N is the population size; L is
the length of binary strings;
N N
I I s = is the selection
strategy; g are genetic operators, including the selection
operator
r
Q , the crossover operator
c
Q and the mutation
operator
m
Q ; p are the operated probabilities of genetic
operators, including the selection probability
r
P , the crossover
probability
c
P and the mutation probability
m
P ; f is the fitness
function; t is the stop criterion. The flow chart of 0047A is as
shown in Fig.1.
Fig.1 Flow chart of the genetic algorithm
B. Parameter settings of genetic operators
1) Population size setting: Population size is the first
significant factor for the solving ability of the genetic
algorithm. Suppose that the schema number of the population
is
3 3
) ( n n O = . Then, according to
L
n n O 2 ) (
3
= ,
2 /
2
L
n = is obtained. Consider the schema set of k orders, in
which the number of the schema is 2
k
. Then the approximate
expression of the population size is
2
2
1 2
) 2 2 ( ) (
d
z n
f
L k

+
= , 2
where
) / (
) (
2
2
2
n
d
z
M

= ,
2 1
H H
f f d = ,
2 2 2
2 1
H H M
+ = ;
1
H
f ,
2
H
f and
2
1
H
,
2
2
H
denote the
mean and variance of the fitness value of schema H
1
and H
2
,
respectively;
2
f
denotes the variance of fitness value of bit
strings in the encoding space; k denotes the number of the
schema order; L denotes the length of binary strings.
2) Selection operator: Selection operators have great
significance for monotone decreasing of the population
diversity, which guarantee the survival of the fittest during
the iteration of genetic algorithms. In this paper, stochastic
uniform operator based on the ranking is adopted. Suppose
that the number of the optimal individual a
1
in the current
population becomes
+
after selecting operation and the
number of the worst individual a
n
becomes

after selecting
operation. Then, the selection probability of individuals is

=
+
+
) 1 (
1
1
j
n n
p
j

, 3
in which n denotes the population size. Clearly, the selection
probability of the optimal individual is
n p /
1
+
= . 4
The average value of the set n p
c
t
/
, 1
+
= , c>1 is taken,
considering the difference of selection probability among
different excellent individuals. Then, the survival probability
formula of excellent individuals is obtained, as shown in (5).
c
t
c
t t
P
n
n P P
/ 1
, 1
/ 1
, 1 1 , 1
) (
) (
+
+
+
= =

, 5
in which t is the evolutionary generation; c is a constant
greater than two.
3) Crossover operator: In this paper, the scattered
operator is adopted. The operator exchanges each gene on
chromosomes between two offspring with equal probability.
Then, two new individuals will be generated. With respect to
the concrete operations, a binary vector can be created to
determine that which parent the genes of new individuals
come from[13]. The scattered crossover operation is shown in
Fig.2.
Fig.2 Schematic diagram of the crossover operation
4) Mutation operator: Mutation operators simulate the
natural mutation by randomly flipping some of the bits in a
chromosome. Mutation fills the gap that the crossover operator
does not guarantee the reachability of the entire search space
with a finite population size. However, just like living nature,
the mutation probabilityp
m
is low in genetic algorithms. If
it is too high, too much random perturbation will occur and the
offspring will lose their resemblance to the parents. Generally
speaking, the mutation operation is executed averagely
L p n
m
times in each generation. Its value range is
always set as
) 1 /( ) 1 (
7 . 0
= e e p
x
m
} 7 . 0 , 2 . 0 , 1 . 0 { x . (6)
III. NUMERICAL ALGORITHM BASED ON THE QUASI-
NEWTON METHOD
The approximate location of the optimal solution has been
found by using the MATLAB genetic algorithm toolbox. Next,
a numerical algorithm based on the quasi-Newton method will
be used to determine the optimal solution further.
2010 5th IEEE Conference on Industrial Electronics and Applicationsis 1491

Consider the constrained nonlinear optimization problem

=
+ + =
= =
. ,..., 2 , 1 ,
, ,..., 2 , 1 , 0 ) (
, ,..., 2 , 1 , 0 ) ( . .
) ( min
n i l x
m l l i x g
l i x g t s
x f
i i
i
i
, 7
where ) (x f is the objective function; ) (x g
i
are the
nonlinear constraint functions. Considering the possible
complexity of (7), it is replaced by a quadratic programming
model at a certain point. Then a series of solutions gained by
the quadratic programming method are applied to approach the
accurate solution of (7). The approximate quadratic
programming problem is called subproblem, whose Hessian
matrix of objective function is the Hessian matrix of Lagrange
function. The model of subproblem is as follows:

=
+ + = +
= = +
+
. ,..., 2 , 1 ,
, ,... 2 , 1 , 0 ) ( ) (
, ,..., 2 , 1 , 0 ) ( ) ( . .
) ( ) , , (
2
1
min
) (
) ( ) (
) ( ) (
) ( ) ( ) ( ) ( 2
n i x l s
m l l i x g s x g
l i x g s x g t s
s x f s x L s
k
i i i
k
i
T k
i
k
i
T k
i
T k k k k
x
T

,8
where ) , , (
) ( ) ( ) ( 2 k k k
x
x L is the Hessian matrix of
Lagrange function (hereinafter referred to as
k
H );
) (k
x x s = . The KT condition of subprolem is as shown
in (9).
( )

+ + = +
= = +
+ + = = +
= +

=
. 0
, ,... 2 , 1 , 0 ) ( ) (
, ,..., 2 , 1 , 0 ) ( ) (
, ,... 2 , 1 , 0 ) ( ) (
), ( ) (
) (
) (
) (
1
) ( ) (
i
k
i
T k
i
k
i
T k
i
k
i
T k
i i
m
i
k
i i
k
k
m l l i x g s x g
l i x g s x g
m l l i x g s x g
x g x f s H

9
The matrix
k
H needs to be converted into an approximate
positive definite matrix
k
B to calculate further, for
k
H may
not be positive definite. The BFGS method is adopted here,
whose modified formula of matrixes is
) ( ) (
) ( ) (
) ( ) (
) ( ) (
1
) (
) (
) (
) (
k T k
T k k
k
k
T k
k
T k k
k
k k
B
B B
B B




+ =
+
, (10)
k
T
k
T
k k
k
T
k
k k
T
k
k
T
k
k
T
k k
T
k k k
k k
H H H
H H





+ +
+
=
+
1
1
, (11 )
in which
k k k
x x =
+ ) 1 ( ) (
;
) (k
is a linear combination of
) (k
and
) (k
k
B . Here,
) , , ( ) , , (
) ( ) ( ) ( ) ( ) ( ) 1 ( ) ( k k k
x
k k k
x
k
x L x L =
+
. 12
IV. NUMERICAL EXAMPLE
A two-bar truss shown in Fig.3 is designed to support
the loading condition given in Table . The material constants
and constraint values are also given in Table . The structure
is subject to constraints in geometry, area, stress[14]. The
maximum tensile stress is restricted to 150MPa, while the
maximum compressive stress is restricted to 100MPa. The
three design variables are A
1
, A
2
and y
B
. Obviously, this is a
minimization problem.
Fig.3 Diagram of the two-bar planar truss
TABLE I. DESIGN VARIABLES AND CONSTANTS FOR THE TWO-BAR
PLANAR TRUSS
Name Symbol Value
Nodal load P 100KN
Volume density 7.7KN/m
3
Length l 2000mm
Width xB 1000mm
Allowable tensile stress [t] 150MPa
Allowable compressive stress [c] 100MPa
Cross-sectional area of bar 1 A1 0 mm
2
A11000mm
2
Cross-sectional area of bar 2 A2 0 mm
2
A11000mm
2
Y coordinate of node B yB 500mmyB1500mm
The optimization model of the two-bar truss is as follows:
1492 2010 5th IEEE Conference on Industrial Electronics and Applicationsis

( )
[ ]
[ ]

+
+ + + =
5 . 1 5 . 0
) (
. .
) ( min
2
2 2
1
2 2
2 2
2
2 2
1
B
c
B B
t
B B
B B B B
y
lA
y x P
lA
y l x P
t s
y x A y l x A W

.13
The solving can be executed after parameter settings in
the MATLAB genetic algorithm toolbox have been finished.
Note here that we must choose Adaptive feasible mutation
function but not Gaussian mutation function in the
Mutation option, for the latter is only suitable for
unconstraint optimization problems. The genetic algorithm
converges within 28 generations. It takes 35 seconds of CPU
time to complete the calculation. The solving results are as
follows: W=128.1N, A
1
=520mm
2
, A
2
=680mm
2
, y
B
=0.73m.
The plot of iteration of truss weight is shown in Fig.4 and
the plot of scores at each generation is shown in Fig.5.
Fig.4 Iteration process of the objective function
Fig.5 Best, worst and mean scores at each generation
The global optimal solutions of this planar truss problem
are as follows: W=125.8N, A
1
=521mm
2
, A
2
=640mm
2
,
y
B
=0.80m. From above, it can be gleaned that the genetic
algorithm native to MATLAB is not effective enough in
finding the optimum size of this structure. In consideration of
this, the numerical algorithm based on quasi-Newton method
is programmed in MATLAB to solve the problem further. The
final results are as follows: W=125.77N, A
1
=520.7mm
2
,
A
2
=640.3mm
2
, y
B
=0.80m. When the results are rounded off,
the exact same results will be gained comparing with the
global optimal solutions. So, it is obviously that the purposed
method provided better results than the single genetic
algorithm.
Let the design variable y
B
be 0.8m. Then, the figure of the
objective function could be obtained by MATLAB, as shown
in Fig.6.
Fig.6 Image of the objective function at yB=0.80m
Next, the parametric model of the two-bar planar truss is
built in finite analysis software ANSYS10.0 also. The
mathematical optimization tools native to ANSYS are adopted
to solve the problem. The first-order algorithm converges
within 11 generations. It takes 165 seconds of CPU time to
complete the calculations. The solving results are as follows:
W=126.46N, A
1
=497.9mm
2
, A
2
=671.5mm
2
, y
B
=0.89m.
The iteration curves of the objective function and
variables are shown from Fig.7 to Fig.10.
Fig.7 Iteration curves of the objective function
Fig.8 Iteration curves of the cross-sectional areas
2010 5th IEEE Conference on Industrial Electronics and Applicationsis 1493


Fig.9 Iteration curves of the Y coordinate of node B Fig.10 Iteration curves of the axial stress
A comparison of the results between the joint optimization method and other algorithms mentioned before is presented in
Table 2.
TABLE II. COMPARISON OF THE RESULTS USING DIFFERENT ALGORITHMS FOR THE TWO-BAR PLANAR TRUSS PROBLEM
Algorithm
Design variable
A1 (mm
2
)
Design variable
A2 (mm
2
)
Y coordinate of node B
yB (m)
Weight
W(N)
Running time
t (s)
Genetic algorithm
native to MATLAB
520 (0.19%)
a
680 (6.25%) 0.73 (8.75%) 128.1 (1.83%) 35
Joint optimization method 521 (0%) 640 (0%) 0.80 (0%) 125.8 (0%) 40
First-order method in ANSYS 498 (4.41%) 671 (4.84%) 0.89 (11.25%) 126.5 (0.56%) 165
Global optimal solutions 521 640 0.80 125.8 --
(a. Absolutely value of the relative error)
It can be seen from Table that the first-order method in
ANSYS yields better results than that of the genetic algorithm
native to MATLAB, although the GA takes less time. Thus,
the genetic algorithm individual is not always the best solution.
However, the joint optimization method, identified repeatedly
by the authors, can always converge to the global optimal
solution of the problem. Hence the purposed technique is
arguably an efficient method for optimizing many structures.
The chart of the comparison of results obtained by different
algorithms is shown in Fig.11.
0
!00
?00
300
+00
00
b00
00
^! ^? Yb "
Global optimal
solution
First-order method
in ANSYS
Genetic algorithm
native to MATLAB
Joint optimization
method
Fig.11 Comparison of the results under different algorithms
V. CONCLUSION
The genetic algorithm provides a robust solution
approach for many challenging problems, while it is not a
universal method for all optimization problems. In this paper,
the mathematical model of a two-bar truss is built in
MATLAB and analyzed by the genetic algorithm toolbox.
The genetic algorithm converges within 28 generations and
takes 35 seconds of CPU time to solve the problem. For the
purpose of comparison, the parametric model of the two-bar
truss is also established by ANSYS and solved using the first-
order method native to ANSYS. The algorithm converges
within 11 generations. It takes 165 seconds of CPU time to
complete the calculation. Comparison of the two results
shows that the individual genetic algorithm is not always the
best approach for some problems. Finally, a joint optimization
method is proposed by combining the genetic algorithm and
the numerical algorithm based on the quasi-Newton method.
Then, it is identified by the example of the two-bar truss. The
simulation results demonstrate the robustness of the joint
optimization method to find feasible optimum designs. More
importantly, it can always converge to the global optimal
solution of the problem, which has significant reference value
for the combination of genetic algorithms and other
optimization methods.
ACKNOWLEDGEMENT
The research work is supported by the Hebei natural
science foundation(E2008000731) and the Hebei education
1494 2010 5th IEEE Conference on Industrial Electronics and Applicationsis

department scientific research project (2006107). The authors
gratefully acknowledge the support given.
REFERENCE
[1] M. A. Hassanain, M. M. Reda Taha, A. Noureldin, N. El-Sheimy,
"Automization Of An INS/GPS Integrated System Using Genetic
Optimization," 5th International Symposium on Intelligent Automation
and Control, Seville, Spain, June.2004.
[2] Felipe P. Espinoza, Barbara S. Minsker, David E. Goldberg,
"Performance Evaluation and Population Reduction for a Self Adaptive
Hybrid Genetic Algorithm(SAHGA)," Engineering Structures, Vol.30,
2007, pp.197-208.
[3] A. Kaveh, H. Rahami, "Nonlinear Analysis and Optimal Design of
Structures via Force Method and Genetic Algorithm," Computers and
Structures, Vol.84, 2006, pp.770-778.
[4] John S. Gero, Somwrita Sarkar, "How to Make Design Optimization
More Useful to Designers," Achitectural Design, Vol.23, 2006, pp.43-
50.
[5] Felipe P. Espinoza, Barbara S. Minsker, "Genetic Algorithms-A Self
Adaptive Hybrid Genetic Algorithm," Engineering Structures, Vol.30,
2007, pp.210-215.
[6] Meghna Babbar, Barbara Minsker, Hideyuki Takagi, "Interactive
Genetic Algorithm Framework for Long Term Groundwater Monitoring
Design," Civil Engineering, Vol.21, 2006, pp.102-111.
[7] Jaehong Lee, Sun-Myung Kim, Hyo-Seon Park, Byung-Hun Wood,
"Optimum design of cold-formed steel channel beams using micro
Genetic Algorithm," Engineering Structures, Vol.27, 2005, pp.1724.
[8] Rachel Arst, Barbara Minsker, David E. Goldberg, "Comparing
Advanced Genetic Algorithms and Simple Genetic Algorithms for
Groundwater Management," Engineering Structures, Vol.30, 2007,
pp.54-63.
[9] Eknarin Sriprasert, Nashwan Dawood, "Genetic Algorithms for Multi-
constraint Scheduling: An Application for the Construction Industry,"
civil engineering and construction, Vol.45, 2007, pp.341-352.
[10] Amr Kandil, Khaled El-Rayes, "Parallel Genetic Algorithms for
Optimizing Resource Utilization in Large-Scale Construction Projects,"
Journal of Construction Engineering and Management, Vol.132, 2006.
[11] R.Pandia Raj, V.Kalyanaraman, "GA based Optimal Design of Steel
Truss Bridge," 6th World Congresses of Structural and
Multidisciplinary Optimization, Rio de Janeiro, Brazil, May.2005.
[12] Naorem Giridhar Singh, Makarand Joshi, "Strategy for Health
Monitoring of Bridge Superstructure," Advances in Bridge Engineering,
Vol.31, March.2006, pp.24-25.
[13] Hugues Rivard, Radu Zmeureanu, "An Object-oriented Framework for
Simulation-based Green Building Design Optimization with Genetic
Algorithms," Advanced Engineering Informatics, Vol.19, 2005, pp.5-
23.
[14] Nicholas Ali, Kamran Behdinan, Zouheir Fawaz, "Applicability and
Viability of a GA based Finite Element Analysis Architecture for
Structural Design Optimization," Computers and Structures, Vol.81,
2003, pp.22592271.
2010 5th IEEE Conference on Industrial Electronics and Applicationsis 1495

Anda mungkin juga menyukai