# Application of Genetic Algorithms in Nonlinear Heat Conduction Problems

Authors: Muhammad Bilal Kadri; Waqar A. Khan
Journal: The Scientific World Journal
 (2014)

---

## Abstract

Genetic algorithms are employed to optimize dimensionless temperature in nonlinear heat conduction problems. Three common geometries are selected for the analysis and the concept of minimum entropy generation is used to determine the optimum temperatures under the same constraints. The thermal conductivity is assumed to vary linearly with temperature while internal heat generation is assumed to be uniform. The dimensionless governing equations are obtained for each selected geometry and the dimensionless temperature distributions are obtained using MATLAB. It is observed that GA gives the minimum dimensionless temperature in each selected geometry.


---

## Body

## 1. Introduction

In many engineering and biological systems, conduction heat transfer plays a vital role. The basic information on conduction heat transfer can be found in any text book [1–3]. Many researchers, including [4–16], have investigated analytically/numerically the problems of steady/unsteady conduction heat transfer in different geometries with different boundary conditions.Davalos and Rubinsky [17] incorporated, perhaps for the first time, the ideas from the fields of evolution and genetics in a new approach to solve heat transfer problems. They also demonstrated the feasibility of this new approach to solving problems in physics. Later on, Rubinsky and Davalos [18] solved the conduction heat transfer equation by using genetic algorithms. But their analysis was limited to very coarse meshes. Tsourkas and Rubinsky [19] not only resolved this problem but also extended their analysis to fine meshes. They also studied the effect of different parameters and operators on the accuracy of the results. Tsourkas and Rubinsky [20] developed genetic algorithms for implementation on parallel computers to solve heat conduction problems. Their algorithm involved a novel local search operator that greatly improves its accuracy. Gosselin et al. [21] presented a comprehensive review of the application of genetic algorithms in heat transfer problems. They presented a number of papers in which heat conduction was optimized. They identified three main types of heat transfer problems related to thermal systems, inverse heat transfer problems and development of heat transfer correlations. Felczak and Wicek [22] implemented genetic algorithm for electronic devices placement optimization. They assumed that nine electronic devices can be positioned randomly on a substrate surface and created a 2-level optimization algorithm. They optimized the positions of nine electronic devices with respect to thermal criteria and wiring length.Genetic Algorithm is based on the Darwinian principle of evolution and it follows the principle of “survival of the fittest.” Genetic algorithms, proposed by Holland [23] and enhanced by others [24, 25], have shown exponential growth in various fields of engineering and technology ranging from control theory, signal processing, antenna design, biomedical signal processing, and so forth [26–28]. Genetic algorithms have been successfully applied in the field of heat transfer since mid-1990s [29, 30]. Complex optimization involving nonlinear constraints can be easily solved using genetic algorithms [31]. Conventional deterministic optimization techniques have immense computational requirement and can only be applied when the objective function is differentiable and continuous [32]. Conventional optimization schemes have a drawback of converging in local minima; hence, the solution is compromised [33]. Deterministic optimization schemes often fail when the objective function is multiextremal [34, 35].


## 2. Genetic Algorithm

Genetic algorithms have been successfully applied in the field of heat transfer since mid-1990s. Complex optimization involving nonlinear constraints can be easily solved using genetic algorithms. Optimization problems that cannot be solved because of the extremely massive computational requirements can be easily solved using genetic algorithms. Genetic algorithms are based on heuristic approach and searches for the best individuals. A generation consists of randomly generated population. The members of the population are tested for fitness. The most suitable candidates are allowed to reproduce the new generation. The next generation consists of the best individuals from the previous generation and their offspring. The chromosomes of each member are also mutated to generate a more suitable candidate in the next generation.The fitness function (the function to be minimized) is the entropy generation in all the cases. The simulation is developed in MATLAB. The fitness scores, returned by the fitness function, are ranked on the basis of their scores. The rank of the fittest individual is set to “1” and the next fittest is assigned a rank of “2” and so on. Rank fitness scaling removes the effect of raw scores. “Stochastic uniform” scaling function is used for selection of parents in the next generation. The parents are selected based on the rank as determined earlier. Stochastic uniform algorithm lays out a line in which each parent corresponds to a section of the line of length proportional to its expectation. The algorithm moves along the line in steps of equal size, one step for each parent. At each step, the algorithm allocates a parent from the section it lands on. The first step is a uniform random number less than the step size. Reproduction algorithm determines how the offspring are generated. The elite count is set to “2” which guarantees that a maximum of two individuals will survive in the next population. Crossover generates member of the new generation by combining genes from two individuals from the previous generation. The crossover process used is “scattered” which first creates a random binary vector. A “1” in the random binary vector is replaced by genes from the first parent and a “0” in the random binary vector is replaced by a gene from the second individual. Crossover fraction is a factor which determines how many individuals in the next generation will be generated by mixing genes from two different chromosomes. The crossover fraction has a value of 0.8. The remaining members of the generation will be generated by the mutation process. In the mutation process one or two genes are inverted in order to generate a better diversity in the population. The mutation function used in our experiment is “Gaussian.” Gaussian adds a random number to each individual; the random number is derived from a Gaussian distribution having zero mean and a standard deviation of 1. In all the experiments the size of the population in each generation was set to 10. Total generations were set to 10. The optimized values from the genetic algorithm for the three selected geometries are shown in Table1.Table 1
Comparison of entropy generation rates for the three selected geometries when-
3
≤
Q
˙
≤
3
and
R
*
=
1.8.
a
θ
*
S
˙
gen
GA
Numerical
Plane wall
−0.4
0.2
3.16
3.12
0
2.62
2.61
0.4
2.07
2.09
−0.4
0.4
0.957
0.95
0
0.84
0.84
0.4
0.723
0.72
Hollow cylinder
−0.1
0.2
4.65
4.73
0
4.46
4.50
0.1
4.28
4.28
−0.1
0.4
1.47
1.48
0
1.43
1.43
0.1
1.38
1.39
Hollow sphere
−0.1
0.2
6.33
6.36
0
6.07
6.06
0.1
5.8
5.77
−0.1
0.4
1.95
1.97
0
1.89
1.91
0.1
1.85
1.84


## 3. Mathematical Analysis

Consider one-dimensional steady conduction in a plane wall of thicknessL, a hollow cylinder of inside radius r
1, outside radius r
2, and length L or a hollow sphere of inside radius r
1 and outside radius r
2 with temperature dependent thermal conductivity k
=
k
1
[
1
+
β
(
T
-
T
1
)
], where β
(
K
-
1
) is a measure of the thermal conductivity variation with temperature and k
1 is the thermal conductivity at temperature T
1. Each geometry is experiencing a uniform volumetric heat generation at the rate q
˙. The temperature on the left face of the wall or at the inner radius is T
1 while the temperature on the right face or at the outer radius is T
2, where T
2
>
T
1. The dimensionless governing equations for a plane wall, hollow cylinder, and hollow sphere with temperature dependent thermal conductivity and uniform volumetric heat generation can be written as
(1)
d
d
X
{
[
1
+
a
(
θ
-
1
)
]
d
θ
d
X
}
+
Q
˙
=
0
(
Plane wall
)
,
1
R
d
d
R
{
[
1
+
a
(
θ
-
1
)
]
R
d
θ
d
R
}
+
Q
˙
=
0
(
Hollow cylinder
)
,
1
R
2
d
d
R
{
[
1
+
a
(
θ
-
1
)
]
R
2
d
θ
d
R
}
+
Q
˙
=
0
(
Hollow sphere
)
,
with boundary conditions
(2)
θ
(
0
)
=
1
,
θ
(
1
)
=
θ
*
(
Plane wall
)
,
θ
(
1
)
=
1
,
θ
(
R
*
)
=
θ
*
(
Hollow
cylinder
and
sphere
)
,
where
(3)
θ
=
T
T
1
,
θ
*
=
T
2
T
1
,
a
=
β
T
,
X
=
x
L
(
Plane wall
)
,
R
=
r
r
1
,
R
*
=
r
2
r
1
(
Hollow cylinder or sphere
)
,
Q
˙
=
q
˙
L
2
k
T
1
(
Plane wall
)
,
Q
˙
=
q
˙
r
1
2
k
T
1
(
Hollow cylinder or sphere
)
.
The governing equations given in (1) are nonlinear due to temperature dependent thermal conductivity and do not have exact analytical solutions. In this study, numerical solution is obtained by using MATLAB. The equations were solved using MATLAB built-in function “bvp4c.” In order to use this function (1) was transformed into a system of equations. The boundary conditions were specified in each case. The mesh size (used to solve the boundary value problem) was set to 10, that is, 10 equidistant points between initial and final values of temperatures.


### 3.1. Entropy Generation Rates

Once the dimensionless temperature distribution is known, the entropy generation rate for the selected geometries can be calculated using the expressions for the volumetric entropy generation rates given by Bejan [36]. In dimensionless form, the entropy generation rates S
˙
gen for the selected geometries can be written as
(4)
S
˙
gen
L
k
A
=
S
gen
*
=
∫
0
1
[
1
+
a
(
θ
-
1
)
]
(
1
θ
d
θ
d
X
)
2
d
X
(
Plane
wall
)
,
S
˙
gen
2
π
k
1
L
=
S
gen
*
=
∫
1
R
*
[
1
+
a
(
θ
-
1
)
]
R
(
1
θ
d
θ
d
X
)
2
d
R
(
Hollow
cylinder
)
,
S
˙
gen
4
π
k
1
r
1
=
S
gen
*
=
∫
1
R
*
[
1
+
a
(
θ
-
1
)
]
R
2
(
1
θ
d
θ
d
X
)
2
d
R
(
Hollow
sphere
)
.
These expressions were also evaluated numerically using MATLAB. The solution of the dimensionless temperature, that is, θ
(
X
) or θ
(
R
) (depending upon the geometry) is obtained by utilizing “bvp4c”. A third order polynomial was approximated from the solution. The integral for the entropy generation rates in (4) for each of the three cases was solved by invoking MuPad facility from the MATLAB environment. The solution for the definite integral was found to be very accurate. The variation of entropy generation rate with respect to "a" and "Q" for three geometries are shown in Figures 3, 5 and 7 respectively.The optimization process is shown in Figure1. An initial population is generated which should lie within the constraints defined on the parameters. The constraints are applied on a,Q
˙, and θ
*, respectively. Each member of the population is evaluated for fitness. The most suitable individuals (having the best fitness values) are allowed to breed. The breeding process (in a broad sense) consists of crossover and mutation; the bad individuals are replaced by the best offspring. The genetic algorithm checks for the convergence. If the algorithm converges then it terminates otherwise it generates a new set of population [37]. In our experiment the maximum number of generations are set to 10. If 10 generations is produced then the algorithm terminates giving the best value of S
˙
gen (objective function) in the 10th generation.Figure 1
Flowchart for the optimization process.


## 3.1. Entropy Generation Rates

Once the dimensionless temperature distribution is known, the entropy generation rate for the selected geometries can be calculated using the expressions for the volumetric entropy generation rates given by Bejan [36]. In dimensionless form, the entropy generation rates S
˙
gen for the selected geometries can be written as
(4)
S
˙
gen
L
k
A
=
S
gen
*
=
∫
0
1
[
1
+
a
(
θ
-
1
)
]
(
1
θ
d
θ
d
X
)
2
d
X
(
Plane
wall
)
,
S
˙
gen
2
π
k
1
L
=
S
gen
*
=
∫
1
R
*
[
1
+
a
(
θ
-
1
)
]
R
(
1
θ
d
θ
d
X
)
2
d
R
(
Hollow
cylinder
)
,
S
˙
gen
4
π
k
1
r
1
=
S
gen
*
=
∫
1
R
*
[
1
+
a
(
θ
-
1
)
]
R
2
(
1
θ
d
θ
d
X
)
2
d
R
(
Hollow
sphere
)
.
These expressions were also evaluated numerically using MATLAB. The solution of the dimensionless temperature, that is, θ
(
X
) or θ
(
R
) (depending upon the geometry) is obtained by utilizing “bvp4c”. A third order polynomial was approximated from the solution. The integral for the entropy generation rates in (4) for each of the three cases was solved by invoking MuPad facility from the MATLAB environment. The solution for the definite integral was found to be very accurate. The variation of entropy generation rate with respect to "a" and "Q" for three geometries are shown in Figures 3, 5 and 7 respectively.The optimization process is shown in Figure1. An initial population is generated which should lie within the constraints defined on the parameters. The constraints are applied on a,Q
˙, and θ
*, respectively. Each member of the population is evaluated for fitness. The most suitable individuals (having the best fitness values) are allowed to breed. The breeding process (in a broad sense) consists of crossover and mutation; the bad individuals are replaced by the best offspring. The genetic algorithm checks for the convergence. If the algorithm converges then it terminates otherwise it generates a new set of population [37]. In our experiment the maximum number of generations are set to 10. If 10 generations is produced then the algorithm terminates giving the best value of S
˙
gen (objective function) in the 10th generation.Figure 1
Flowchart for the optimization process.


## 4. Theoretical Foundation of Genetic Algorithms

Genetic algorithm is used for optimizing functions. Let the objective function to be minimized be denoted byf
(
x
)
=
S
˙
gen, where x
=
{
x
t
∣
t
=
1,2
,
…
.
,
N
k
}. “t” denotes the parameter space of the optimization problem. N
k is the maximum number of parameters to be considered in the optimization process. “x
t” can be continuous or discrete, real or imaginary [26]. The genetic algorithm transforms the parameter’s values x
t into a symbolic representation “d” which is termed as a chromosome. Many genes combine to form a chromosome. The number of genes in a chromosome determines the quantization level of the parameters (used in optimization process). The chromosome “d” can be represented by
(5)
d
=
{
e
j
∣
j
=
1,2
,
…
,
N
d
l
}
,
where N
d
l is the length of the chromosome. The encoding of a parameter value “x
t” into “d” can be represented by
(6)
x
t
=
x
t
min
⁡
+
2
-
N
t
-
1
x
t
max
⁡
-
x
t
min
⁡
2
N
t
-
N
t
-
1
-
1
∑
j
=
N
t
-
1
+
1
N
t
e
j
2
j
-
1
,
where x
t
min
⁡ and x
t
max
⁡ are the minimum and maximum values of the parameter x
t. A generation Z consists of randomly generated population:
(7)
Z
=
{
z
i
∣
i
=
1,2
,
3
,
…
,
R
}
,
where “R” is the maximum number of members in the population. The members of the population are tested for fitness. In our specific case the members are tested so that they lie within the bounds defined on the parameters. The filtered individuals are used to determine the cost (of the objective function). Production of new members in the next population consists of three major steps, namely, selection, crossover, and mutation. the most suitable candidates are selected as parents and are allowed to reproduce the new generation. The selectionoperation can be represented by Z
S
k
=
S
(
Z
k
) which produces a population of size “R.” Various selection schemes have been proposed such as ranking, roulette-wheel, and stochastic uniform methods [25]. The next generation consists of the best individuals from the previous generation and their offspring. Chromosomes from two parents are combined to generate an offspring; this process is termed as crossover process. Crossover can be denoted as the union over a composition of operators and is given by
(8)
C
(
Z
S
k
)
=
⋃
i
=
1
R
/
2
c
[
t
y
(
Z
S
k
)
,
t
y
(
Z
S
k
)
]
,
where the operator “t
y” chooses a random chromosome from Z and the operator “c” maps a pair of chromosomes z
1
=
{
e
1
j
∣
j
=
1
,
…
,
N
d
l
} and z
2
=
{
e
2
j
∣
j
=
1
,
…
,
N
d
l
} to another pair such that:
(9)
c
(
z
1
,
z
2
)
=
{
z
-
1
,
z
-
2
with
probability
p
cross
z
1
,
z
2
with
probability
1
-
p
cross
,
where the newly produced offspring are given by
(10)
z
-
1
=
{
e
11
,
e
12
,
…
,
e
1
k
,
e
2
(
k
+
1
)
,
e
2
(
k
+
2
)
,
…
,
e
2
N
d
l
}
,
z
-
2
=
{
e
21
,
e
22
,
…
,
e
2
k
,
e
1
(
k
+
1
)
,
e
1
(
k
+
2
)
,
…
,
e
1
N
d
l
}
.
The chromosomes of each member are also mutated (the value of a randomly selected gene is inverted from 0 to 1 or 1 to 0) to generate a more suitable candidate in the next generation. The mutation process is given by Z
M
k
=
M
(
Z
C
k
) and mathematically it can be represented as
(11)
M
(
Z
C
k
)
=
⋃
i
=
1
R
m
(
z
~
i
k
)
.
For a chromosome z
=
{
e
j
∣
j
=
1
,
…
,
N
d
l
}, m
(
z
)
=
{
ψ
(
z
j
)
∣
j
=
1
,
…
,
N
d
l
}, and
(12)
ψ
(
z
)
=
{
z
~
with
a
probability
p
mut
z
with
a
probability
1
-
p
mut
.


## 5. Simulation Setup

The fitness function (the function to be minimized) is the entropy generation rate in all the cases. The simulation is developed in MATLAB. The fitness scores returned by the fitness function are ranked on the basis of their scores. The rank of the fittest individual is set to “1” and the next fittest is assigned a rank of “2” and so on. Rank fitness scaling removes the effect of raw scores. “Stochastic uniform” scaling function is used for selection of parents in the next generation. The parents are selected based on the rank as determined earlier. Stochastic uniform algorithm lays out a line in which each parent corresponds to a section of the line of length proportional to its expectation. The algorithm moves along the line in steps of equal size, one step for each parent. At each step, the algorithm allocates a parent from the section it lands on. The first step is a uniform random number less than the step size. Reproduction algorithm determines how the offspring are generated. The elite count is set to “2” which guarantees that a maximum of two individuals will survive in the next population. The crossover process used is “scattered” which first creates a random binary vector. A “1” in the random binary vector is replaced by genes from the first parent and a “0” in the random binary vector is replaced by a gene from the second individual. Crossover fraction is a factor which determines how many individuals in the next generation will be generated by mixing genes from two different chromosomes. The crossover fraction has a value of 0.8. The remaining members of the generation will be generated by the mutation process. The mutation process generates a better diversity in the population. The mutation function used in our experiment is “Gaussian.” Gaussian adds a random number to each individual; the random number is derived from a Gaussian distribution having zero mean and a standard deviation of 1. In all the experiments the size of the population in each generation was set to 10, that is,N
d
l is set to 10. Total generations were set to 10. The optimized values from the genetic algorithm for plane wall, hollow cylinder, and hollow sphere are shown in Table 1.


## 6. Results and Discussion

The genetic optimization tool in the MATLAB environment was used to solve nonlinear heat conduction problem in three selected geometries. The most important task is to code the fitness function and to set all the constraints. The genetic algorithm calls the fitness function at each instant with random values of the parameters to be optimized. These random values are the members of the population. With each set of values, the boundary value problem is solved and the numerical solution is converted into a third degree polynomial. The polynomial is subsequently used (by invoking MUPAD from MATLAB) to determine the entropy generation rate. The entropy generation rate is determined for the complete population and the minimum value of the entropy generation rate is held and the remaining values are discarded.One case for each of the selected geometries that is, plane wall, hollow cylinder, and hollow sphere, is shown in Figures2–7, respectively. In Figure 2, initially the fitness function value is above 4 and the worst score varies between 3 and 9 but when more members of the population are generated, the fitness value converges. It can be observed that after the fourth generation the fitness value does not change. In the case of hollow cylinder, the fitness values converge in the sixth generation. There is a lot of variation in the initial generations as can be seen in Figure 4 but the solution gradually converges. For the case of hollow sphere (Figure 3), the solution converges in the fifth generation. The vertical lines in all the figures represent the maxima and minima generated in each generation. In all the cases there are vertical lines for the initial generations but the vertical lines do not appear in the later generations. This clearly shows that only the best individuals are retained and they migrate from one generation to another.Figure 2
Best, worst, and mean values of fitness function (S
˙
gen) for plane wall.Figure 3
Variation ofS
˙
gen with respect to “a” and “Q.”Figure 4
Best, worst, and mean values of fitness function (S
˙
gen) for hollow cylinder.Figure 5
Variation ofS
˙
gen with respect to “a” and “Q.”Figure 6
Best, worst, and mean values of fitness function (S
˙
gen) for hollow sphere.Figure 7
Variation ofS
˙
gen with respect to “a” and “Q.”


## 7. Conclusions

Genetic algorithms are successfully employed to optimize the dimensionless temperature in the selected geometries. The concept of minimum entropy generation was used to obtain the minimum dimensionless temperature. It is found that, for the same constraints, the minimum dimensionless temperature and hence the minimum entropy generation rates are obtained in case of plane wall.



---

*Source: 451274-2014-02-17.xml*