A CHAOTIC BAT ALGORITHM FOR SOLVING DEFINITE INTEGRAL

5592 | P a g e J a n u a r y 1 5 , 2 0 1 5 A CHAOTIC BAT ALGORITHM FOR SOLVING DEFINITE INTEGRAL Khalil AL-Wagih* Faculty of Computer science & Information System, Thamar University, Thamar, Republic of Yemen E-mail: khalilwagih@gmail.com ABSTRACT In this paper, an Improved Bat Algorithm with Chaos (IBACH) is presented for solving definite integral. The IBACH satisfies the question of parallel calculating numerical integration in engineering and those segmentation points that are adaptive. Several numerical simulation results show that the algorithm offers an effective way to calculate numerical value of definite integrals; it has a high convergence rate, a high accuracy and robustness.


INTRODUCTION
The definite integral has wide ranging applications in operation researching, computer science, mathematics, physical sciences and engineering. Numerical integration is the study of how numeric values of an integral can be found. Which refers to finding a square whose area is the same as the area under a curve, it is one of the classical topics of numerical analysis [1].The basic problem considered by numerical integration is to compute an approximate solution to a definite integral . Different situations arise, which means the analytical method we have developed so far cannot be used to evaluate a definite integral. For example an integrand may not have an obvious antiderivative such as cos x2 or linx 1 or maybe the integrand is represented by an individual data points, which makes finding an antiderivative impossible. When analytical methods fail, we often turn to numerical methods [2], which are typically done on a calculator or computer.
These methods do not produce exact values of the definite integrals, but provide approximations that are generally accurate. Some of the most advanced methods for which software is widely available are rectangle rule method, trapezoidal rule method, Simpson's rule method, Newton-Cotes method, Romberg method, Gauss method and so on [3][4][5][6]. However, these traditional methods have limitations: the rectangle rule method, trapezoidal rule method, Simpson's rule method are suitable for the bad smooth integrand, but their precisions are low; Newton-Cotes method is one of the constructing integrand based on the interpolating functions, but the convergence is not guaranteed for higher order Newton-Cotes method; for the Romberg method and Gauss method, their convergent speeds are quick and the computational precisions are high, but their computations are complex.
Echolocation is an important feature of bat behavior. This means, bats emit a sound pulse and listen to the echo bouncing back from obstacles whilst flying. This phenomenon has inspired Yang [7] to develop the Bat Algorithm (BA). The algorithm obtained good results dealing with lower-dimensional optimization problems, but may become problematic for higher-dimensional problems because it tends to converge very fast. This paper introduces an improved Bat Algorithm by integrating it with chaos to improve the reliability of the global optimality, and they also enhance the quality of the results.
This paper is organized as follows: after introduction, the original Bat Algorithm is briefly introduced in section 2. Section 3 introduces the meaning of chaos. In section 4, the proposed algorithm is described, while the results are discussed in section 5. Finally, conclusions are presented in section 6.

THE ORIGINAL BAT ALGORITHM
Bat Algorithm has been developed by Xin-She Yang in 2010 [7]. The algorithm exploits also called echolocation of bats; bats use sonar echoes to detect and avoid obstacles. It is generally known that sound pulses are transformed to frequency which is reflected from obstacle. Bats can use time delay from emission for reflection and use it for navigation. They typically emit short and loud sound impulses and the pulse rate is usually defined as 10 to 20 times per second. After hitting and reflecting, bats transform their own pulses to useful information to gauge how far away the prey is. Bats use wavelengths, that vary from range (0.7,17) mm or inbound frequencies (20,500) kHz. By implementation, pulse frequency and pulse rates have to be defined. Pulse rate can be simply determined from range 0 to 1, where 0 meaning there is no emission and 1 meaning bats are emitting maximum (5)(6)(7)(8). This behavior can be used to formulate the new bat algorithm. Yang [7] used three generalized rules for Bat Algorithms: i. All bats use echolocation to sense distance, and they also predict the difference between food/prey and background barriers in some magical way.
ii. Bats fly randomly with velocity vi at position xi with a fixed frequency fmin, varying wavelengthand loudness A0 to search for prey. They can automatically adjust the wavelength (or frequency) of their emitted pulses and adjust the rate of pulse emission r [0,1], depending on the proximity of their target.
iii. Although the loudness can vary in many ways, we assume that the loudness varies from a large (positive) A0 to a minimum constant value Amin.
Initialization of the bat population is performed randomly. Generating the new solutions is performed by moving virtual bats according the following equations: where β ∈ [0, 1] is a random vector drawn from a uniform distribution. Here X is the current global best solution which is located after comparing all the solutions among all the bats.
For the local search part, once a solution is selected among the current solutions, a new solution for each bat is generated located using random walk [8][9][10][11][12].
xnew=xold+ At (4) J a n u a r y 1 5 , 2 0 1 5 Where  is the scaling factor, and Ait is the loudness, the loudness A0 and the rate ri of pulse emission have to be updated accordingly as the iterations proceed. These equations are: Where α and γ are constants.
The basic steps of BA can be summarized as the pseudocode shown in Figure 1.

Bat algorithm
Begin Accept the new solutions

End if
Rank the bats and find the current best

End while
Post process results and visualization End Fig. 1 Pseudo code of the bat algorithm

CHAOS
Generating random sequences with longer periods and good consistency is very important for easily simulating complex phenomena, sampling, numerical analysis, decision making and especially in heuristic optimization [13]. Its quality determines the reduction of storage and computation time to achieve a desired accuracy [14]. Chaos is a deterministic, random-like process found in a nonlinear, dynamical system, which is non-period, non-converging and nonbounded. Moreover, it depends on its initial condition and parameters [15][16][17]. Applications of chaos has several disciplines including operations research, physics, engineering, economics, biology, philosophy and computer science [18][19][20].
Recently chaos has been extended to various optimization areas because it can more easily escape from local minima and improve global convergence in comparison with other stochastic optimization algorithms [16][17][18][19][20][21]. Using chaotic sequences in Bat Algorithm can be helpful to improve the reliability of the global optimality, and they also enhance the quality of the results.

Chaotic maps
At random-based optimization algorithms, the methods using chaotic variables instead of random variables are called chaotic optimization algorithms (COA) [16]. In these algorithms, due to the non-repetition and ergodicity of chaos, it can carry out overall searches at higher speeds than stochastic searches that depend on probabilities [22][23][24][25][26][27][28][29][30][31]. To resolve this J a n u a r y 1 5 , 2 0 1 5 issue, herein one-dimensional and non-invertible maps are utilized to generate chaotic sets. We will illustrate some of wellknown one-dimensional maps as:

Logistic map
The Logistic map is defined by:

The Sine map
The Sine map is written as the following equation:

Iterative chaotic map
The iterative chaotic map with infinite collapses is described as:

Circle map
The Circle map is expressed as: (10)

Chebyshev map
The family of Chebyshev map is written as the following equation:

Sinusoidal map
This map can be represented by (12)

Gauss map
The Gauss map is represented by:

Sinus map
Sinus map is formulated as follows:

Dyadic map
Also known as the dyadic map, bit shift map, 2x mod 1 map, Bernoulli map, doubling map or sawtooth map. Dyadic map can be formulated by a mod function:

Singer map
Singer map can be written as: (16)  between 0.9 and 1.08 J a n u a r y 1 5 , 2 0 1 5

Tent map
This map can be defined by the following equation: (17)

THE PROPOSED ALGORITHM (IBACH) FOR SOLVING NUMERICAL INTEGRATION
Suppose that segmentation S splits an integral interval [a,b] into n-subintervals: [x0,x1],[x1,x2],…,[xk-1,xk],[xn-1,xn], where xj<xj+1for j = 1,2,…,n-1; x0 = a, and xn= b, also define xk= xk -xk-1 for k = 1,2,…,n. Using this notation, the integral f(x) in [a,b] can be approximated as [32]: (18) In the proposed chaotic Bat algorithm, we used chaotic maps to tune the Bat algorithm parameters and improve the performance [19]. The steps of the proposed chaotic Bat Algorithm for solving definite integral are as follows: Step 1 Set the initial conditions: population xi (i = 1, 2 ...n) and Vi, pulse frequency fi at xi and pulse rates ri and the loudness Ai Step 2 Calculate the average position and the optimal position of the bat colony.
Step 3 Using the equations 2 to 4 update velocities and locations/solutions and Generate new solutions by adjusting frequency.
Step 4 If (rand > ri) then select a solution among the best solutions and generate a local solution around the selected best solution with the following equation xnew=xold+At (22) Where[-1,1] If not, skip this step. Step If not, skip this step.
Step 6 Rank the bats and find the current best X.
Step 7 If the iterations attain to the maximum number, then stopped and output the global optimal solution. If not, go to step 2 to continue the search.

NUMERICAL RESULTS
Several examples have been done to verify the weight of the proposed algorithm. The initial parameters are set at n= 40,fmin=0 ,fmax= 2, A0 = (1,2) ,r=(0,0.1). The results of IBACH algorithm are conducted from 25 independent runs for each integrand. The selected chaotic map for all examples is the Sinusoidal map, whose equation is shown below: (25) Where n is the iteration number, all the experiments were performed on a Windows 7 Ultimate 64-bit operating system; processor Intel Core i5 760 running at 2.81 GHz; 4 GB of RAM and code was implemented in MATLAB.  Table 1 shows the results of IBACH algorithm are privileged compared with the results of Standard Monte Carlo method, trapezoidal rule, Simpson's rule and midpoint rule. In comparison with exact values we find that the results of IBACH algorithm are very close to the exact values of selected functions under the study. If a large number of wellbehaved one-dimensional integrands are to be integrated, and the user is willing to do some analytic analysis to obtain efficiency, then it would be hard to go past the classical methods; usually though, users will choose to use IBACH algorithm to save their own time and to gain reliability.
The reason for getting better results than the other algorithms considered is that the search power of bat algorithm. Adding to this, using chaos helps the algorithms to escape from local solutions.

CONCLUSIONS
This paper introduced an improved Bat Algorithm by blending with chaos for calculation of the numerical value of definite integrals. This algorithm has the ability to trounce the shortage that the segmentation points are uniform in traditional methods. Several simulation examples show that the algorithm can converge to be the best solution, and it has a high convergence rate and high accuracy.