<<

PARTICLE OPTIMIZATION STABILITY ANALYSIS

A Thesis

Submitted to

The School of Engineering of the

UNIVERSITY OF DAYTON

In Partial Fulfillment of the Requirements for

The Degree

Master of Science in Electrical Engineering

by

Ouboti Seydou Eyanaa Djaneye-Boundjou

UNIVERSITY OF DAYTON

Dayton, Ohio

December 2013 PARTICLE SWARM OPTIMIZATION STABILITY ANALYSIS

Name: Djaneye-Boundjou, Ouboti Seydou Eyanaa

APPROVED BY:

Raul´ Ordo´nez,˜ Ph.D. Russell Hardie, Ph.D. Advisor Committee Chairman Committee Member Professor, Electrical and Computer Professor, Electrical and Computer Engineering Engineering

Malcolm Daniels, Ph.D. Committee Member Associate Professor, Electrical and Computer Engineering

John G. Weber, Ph.D. Tony E. Saliba, Ph.D., P.E. Associate Dean Dean, School of Engineering School of Engineering & Wilke Distinguished Professor

ii c Copyright by

Ouboti Seydou Eyanaa Djaneye-Boundjou

All rights reserved

2013 ABSTRACT

PARTICLE SWARM OPTIMIZATION STABILITY ANALYSIS

Name: Djaneye-Boundjou, Ouboti Seydou Eyanaa University of Dayton

Advisor: Dr. Raul´ Ordo´nez˜

Optimizing a multidimensional function – uni-modal or multi-modal – is a problem that reg- ularly comes about in engineering and science. techniques, including

Evolutionary and Swarm Intelligence (SI), are biological systems inspired search meth- ods often used to solve optimization problems. In this thesis, the SI technique Particle Swarm

Optimization (PSO) is studied. Convergence and stability of swarm optimizers have been subject of PSO research. Here, using discrete-time adaptive control tools found in literature, an adaptive particle swarm optimizer is developed. An error system is devised and a controller is designed to adaptively drive the error to zero. The controller features a function approximator, used here as a predictor to estimate future signals. Through Lyapunov’s direct method, it is shown that the devised error system is ultimately uniformly bounded and the adaptive optimizer is stable. More- over, through LaSalle-Yoshizawa theorem, it is also shown that the error system goes to zero as time evolves. Experiments are performed on a variety of benchmark functions and results for comparison purposes between the adaptive optimizer and other found in literature are provided.

iii To my family Gbandi Djaneye-Boundjou, Akoua Maguiloube` Tatcho, Bilaal Djaneye-Boundjou

and Jamila Djaneye-Boundjou.

iv ACKNOWLEDGMENTS

First, I want to thank God for letting me live to see this thesis through. I am thankful to the members of my committee, Dr. Russell Hardie, Dr. Asari Vijayan and Dr. Malcolm Daniels for their time and agreeing to serve as members of my committee. Special thanks to my advisor Dr. Raul´

Ordo´nez˜ for being my advisor, for his exquisite attention to detail and for guiding me throughout

my graduate studies and this research. I am also grateful to Dr.Veysel Gazi, who along with Dr.

Ordo´nez,˜ helped me a great deal while I was working on my thesis.

It is only fitting that I thank Brother Maximin Magnan, SM, and Dr. Amy Anderson without

who I would in all probability not be attending this university in the first place.

Last but not least, I want to thank family and friends for their love, support and encouragements.

v TABLE OF CONTENTS

Page

Abstract ...... iii

Dedication ...... iv

Acknowledgments ...... v

List of Figures ...... viii

List of Tables ...... x

CHAPTERS:

I. INTRODUCTION ...... 1

1.1 Problem Statement and PSO Algorithm ...... 2 1.2 Literature Study on Stability and Convergence ...... 3 1.2.1 PSO Models ...... 3 1.2.2 Velocity Clamping ...... 4 1.2.3 Inertia Factor ...... 5 1.2.4 Theoretical Approach ...... 5

II. MOTIVATION ...... 10

III. STABILITY ANALYSIS ...... 13

IV. TEST FUNCTIONS ...... 25

V. THE ADAPTIVE PSO ...... 28

5.1 Designing the Adaptive PSO ...... 28 5.2 Pseudocode ...... 29 5.3 Understanding the Adaptive PSO ...... 30 5.3.1 Origin-Bias ...... 31 5.3.2 Predictor ...... 33

vi VI. PERFORMANCE EVALUATION ...... 37

VII. CONCLUSION ...... 53

7.1 APSO Characteristics ...... 53 7.2 On Being Biased ...... 54 7.3 Testing the Predictor ...... 54 7.4 APSO Performance ...... 54 7.5 Future Work ...... 55

Bibliography ...... 56

Appendices:

A. MATLAB CODE FOR ADAPTIVE PSO ...... 60

1.1 Main program ...... 60 1.2 Functions used ...... 65 1.2.1 Search space set up ...... 65 1.2.2 Computing the fitness ...... 66 1.2.3 Dead-zone modification ...... 67

B. MATLAB CODE FOR EXPOSING ORIGIN-BIAS ...... 69

2.1 Main program ...... 69 2.2 Functions used ...... 78

C. MATLAB CODE FOR PERFORMANCE COMPARISON TABLE ...... 81

3.1 Main program ...... 81 3.2 Functions Used ...... 86

D. MATLAB CODE FOR FIGURES OF MERIT: CONVERGENCE AND TRANSIENT COMPARISON ...... 87

4.1 Main program ...... 87 4.2 Functions used ...... 100

vii LIST OF FIGURES

Figure Page

4.1 Contour plots of the test functions ...... 26

5.1 Optimizing f1, n = 2 with the search space origin at xo5 ...... 33

5.2 Optimizing f2, n = 2 with the search space origin at xo5 ...... 34

5.3 Optimizing f3, n = 2 with the search space origin at xo5 ...... 34

5.4 Optimizing f4, n = 2 with the search space origin at xo5 ...... 35

5.5 Optimizing f5, n = 2 with the search space origin at xo5 ...... 35

5.6 Optimizing f6, n = 2 with the search space origin at xo5 ...... 36

6.1 Optimizing f1, n = 30 with the search space origin at xo1 ...... 40

6.2 Optimizing f1, n = 30 with the search space origin at xo2 ...... 40

6.3 Optimizing f1, n = 30 with the search space origin at xo3 ...... 41

6.4 Optimizing f1, n = 30 with the search space origin at xo4 ...... 41

6.5 Optimizing f2, n = 30 with the search space origin at xo1 ...... 42

6.6 Optimizing f2, n = 30 with the search space origin at xo2 ...... 42

6.7 Optimizing f2, n = 30 with the search space origin at xo3 ...... 43

6.8 Optimizing f2, n = 30 with the search space origin at xo4 ...... 43

6.9 Optimizing f3, n = 30 with the search space origin at xo1 ...... 44

viii 6.10 Optimizing f3, n = 30 with the search space origin at xo2 ...... 44

6.11 Optimizing f3, n = 30 with the search space origin at xo3 ...... 45

6.12 Optimizing f3, n = 30 with the search space origin at xo4 ...... 45

6.13 Optimizing f4, n = 30 with the search space origin at xo1 ...... 46

6.14 Optimizing f4, n = 30 with the search space origin at xo2 ...... 46

6.15 Optimizing f4, n = 30 with the search space origin at xo3 ...... 47

6.16 Optimizing f4, n = 30 with the search space origin at xo4 ...... 47

6.17 Optimizing f5, n = 30 with the search space origin at xo1 ...... 48

6.18 Optimizing f5, n = 30 with the search space origin at xo2 ...... 48

6.19 Optimizing f5, n = 30 with the search space origin at xo3 ...... 49

6.20 Optimizing f5, n = 30 with the search space origin at xo4 ...... 49

6.21 Optimizing f6, n = 30 with the search space origin at xo1 ...... 50

6.22 Optimizing f6, n = 30 with the search space origin at xo2 ...... 50

6.23 Optimizing f6, n = 30 with the search space origin at xo3 ...... 51

6.24 Optimizing f6, n = 30 with the search space origin at xo4 ...... 51

ix LIST OF TABLES

Table Page

4.1 Test functions ...... 25

∗ 5.1 Impact of moving xa inside Sx ...... 32

6.1 Performance comparison ...... 38

x CHAPTER I

INTRODUCTION

Optimizing a multidimensional function – uni-modal or multi-modal – is a problem that regu- larly comes about in engineering and science. Evolutionary Computation (EC) techniques – includ- ing and Swarm Intelligence (SI) – [1, 2, 3, 4, 5, 6] are biological systems inspired search methods often used in solving complex optimization problems. Developed in 1995 by Eberhart and Kennedy [7, 8, 9, 10], Particle Swarm Optimization (PSO) is a proven, powerful, efficient and effective SI technique [11, 12]. PSO is a population-based method encouraged from social interaction observed in bird flocking or fish schooling. Particles, in a swarm optimizer, are potential solutions to the optimization problem. Their positions and ve- locities are randomly initialized at the start of the search. Each particle then dynamically adjusts its velocity based on previous behaviors and moves about the problem space seeking an optimum solution. At every generation, each particle computes the best solution individually achieved so far, referred to as personal best, and the best solution achieved up to that point by the particles in its neighborhood, referred to as local best, when a local neighborhood topology is employed (not all

particles coexist in the same neighborhood), or global best, when a global neighborhood topology is employed (all particles are neighbors of one another). Particles are attracted towards weighted averages of their personal best and their local best or global best.

1 1.1 Problem Statement and PSO Algorithm

n Let the function f : R → R be a cost function. It is our desire to optimize the cost f using the PSO technique. To do so we can choose from various PSO algorithms studied in literature.

Here, we use the PSO variant with inertia factor, absent from the original algorithm [7, 8]. For i = 1, 2, ... , N, where N is the number of particles in the swarm, the dynamics of particle i, as

described in [13], are given by the equations

i i i i i i i i i v (t + 1) = ω v (t) + ϕ1(t)(p (t) − x (t)) + ϕ2(t)(g (t) − x (t)), (1.1) xi(t + 1) = xi(t) + vi(t + 1),

where all product operations are performed element-wise. The system in (1.1) is a discrete-time

system. The variable t denotes generation or iteration and not continuous time. The position

i i n and velocity vectors of particle i at generation t are respectively x (t), v (t) ∈ R . Moreover,

i i n p (t), g (t) ∈ R are the personal best position achieved by particle i and the local best or global

best position achieved by the neighbors of particle i up to generation t, respectively, such that

pi(t) = arg min f pi(k) , (1.2) k=0,...,t

gi(t) = arg min f pj(k) , (1.3) k=0,...,t j∈Si(k)

with Si(k) being the sets of all the neighbors of particle i at generations k = 0, . . . , t. Further,

i i ω is defined as the inertia factor, ω v (t) is defined as the inertia component, ϕ1 is defined as the

i i i cognitive coefficient, ϕ1(t)(p (t) − x (t)) is defined as the cognitive component, ϕ2 is defined as

i i i i the social coefficient and ϕ2(t)(g (t) − x (t)) is defined as the social component. The vectors ϕ1(t)

i and ϕ2(t) are independent, identically and uniformly distributed n-dimensional random vectors

i i n i i n such that ϕ1(t) ∈]0, ϕ1] and ϕ2(t) ∈]0, ϕ2] . We make sure, for all t, ϕ1(t) 6= 0 and ϕ2(t) 6= 0

for reasons that will become clearer later.

2 1.2 Literature Study on Stability and Convergence

PSO is a valuable optimization technique [14]. Angeline points out that the basic PSO algo- rithm (without the inertia factor), as in [7, 8], helps locates the region nearest to the optima fast but then stales to find it [15]. He thus suggests that adding hybrid components [16] to the basic

PSO algorithm might help it converge faster than other EC techniques. From the first disclosed studies on PSO in 1995 [7, 8], a lot more research has been done on the subject; unsurprisingly, since PSO is easily implementable and can potentially be applied in many ways [17, 18, 19, 20].

Several studies look into how the algorithm’s performance can be improved. Thanks to them, we have an insightful understanding of how parameters such as cognitive and social coefficients, ve- locity clamping (maximum velocity limitation), inertia factor or swarm size affect the algorithm’s performance [14, 20, 21, 22, 23, 24, 25, 26, 27, 28].

1.2.1 PSO Models

Kennedy studies four different models – the cognitive-only model, the social-only model, the full model and the selfless model – of PSO. The full model is as presented in (1.1) but without the inertia factor. The cognitive-only and social-only models omit respectively social component and cognitive component in the velocity update equation. In the selfless model, the local best or global best position of particle i is found by considering only neighboring particles to i while disregarding i itself. Results show that the social-only model generally converges faster than the other models but does so sometimes prematurely and therefore is not as reliable and robust as the full model is [25].

Carlisle and Dozier corroborate Kennedy’s results on dynamic changing environments [23] and propose that picking a larger cognitive coefficient upperbound ϕ1 compared to the social coefficient upperbound ϕ2, such that 0 < ϕ1 + ϕ1 < 4, might even prove to be better [24].

3 1.2.2 Velocity Clamping

At each generation, the velocity of particle i is updated dynamically by adding up its inertia component, its cognitive component and its social component, as shown in the first equation of

(1.1). The second equation in (1.1) shows how the position of particle i is adjusted according to its

updated velocity. The inertia component makes sure a portion of the current velocity information is

contained in the updated velocity. Because of the cognitive component, each particle is able to draw

on and make use of its own experience during the search process. The social component shows that

particles can also use the information received from their neighbors for help throughout the search

process. High cognitive coefficients favor a local search whereas high social coefficients favor a

global search. Summing up all three components can however yield high values of velocity. As a

consequence particles take bigger step sizes when updating their positions, with the risk of them

possibly leaving the search space. Convergence may thus either take longer or not even be possible.

A commonly used approach is to limit velocity within a range [−Vmax, Vmax], with Vmax > 0, such that

 i i i v (t + 1), if v (t + 1) ≤ Vmax, v (t + 1) = i i (1.4) sign(v (t + 1)) · Vmax, if v (t + 1) > Vmax, where sign(·) is the sign operator. This approach is called velocity clamping [21]. Picking a large

Vmax can result in particles searching far-removed regions and possibly straying away from regions with good solutions. On the other hand, if Vmax is too small, particles search smaller regions and can easily be trapped in local minima. It should be noted that velocity clamping does not stop par- ticles from escaping the search space. Nevertheless, restricting positions update step sizes prevents, in some way, particles to diverge. A constant Vmax is common procedure. However, adjusting Vmax dynamically might better the optimizer’s performance [29].

4 1.2.3 Inertia Factor

Shi and Eberhart introduce the inertia factor PSO variant [27]. As stated before, the inertia factor controls how much information contained in the velocity at generation t contributes to up- dating the velocity at generation t + 1. Empirical studies suggest that picking the proper inertia factor is necessary to guarantee a convergent optimizer [27, 28, 30]. If ω > 1, velocities grow larger as generations go by and particles diverge from regions with good solutions. If ω < 0 , velocities decrease gradually to zero over time contingent upon the values of the upperbounds ϕ1 and ϕ2. However, choosing the right inertia factor may also depend on the problem at hand [28].

With ω = 0.7298, ϕ1 = ϕ2 = 1.49618, N = 30 and by confining velocities within the same set

as the search space, Shi and Eberhart achieved good optimization results for some objective func-

tions [30]. Trelea also obtained good results for the same objective functions as used in [30] but

without velocity clamping, by setting w = 0.6, ϕ1 = ϕ2 = 1.7 [31]. Thomas Beielstein et al. provide shrewd information about parameters such as inertia factor, swarm size, cognitive coeffi- cient and social coefficient upperbounds by applying design of experiments (DOE) methods to the

PSO algorithm [22]. In general, researchers have successfully experimented with constant inertia factor. However, good results have also been obtained by adaptively changing the inertia factor

[26, 32, 33, 34, 35, 36].

1.2.4 Theoretical Approach

Most aforementioned studies nevertheless only offer empirical evidence. The issue of conver- gence and stability is formally tackled in [13, 31, 37, 38, 39, 40, 41, 42, 43]. A common approach is to analyze either the dynamics or the trajectory of a simplified PSO system so as to derive conditions for convergence and stability [31, 37, 38, 39, 40, 41, 43].

5 Ozcan and Mohan are the first researchers to do so [38, 39]. They analyze a single (N = 1),

scalar (n = 1), deterministic (ϕ1(t) = ϕ1 and ϕ2(t) = ϕ2 such that ϕ1 and ϕ2 are constant for all

t) particle, whose personal best and global best are equal to a constant scalar (p(t) = g(t) = s)

and later extend their findings to a more general swarm optimizer. For i = 1, 2, ... , N and

d = 1, 2, ... , n, where N is the number of particles in the swarm and n is the dimension of

each particle, particles update their positions such that

id  id id id id id id x (t) − 2 − ϕ1 − ϕ2 x (t − 1) + x (t − 2) = ϕ1p + ϕ2g . (1.5)

q q id id id id id id2 id 2 id id Let ϕ = ϕ1 + ϕ2 and δ = 2 − ϕ1 − ϕ2 − 4 = (ϕ ) − 4ϕ . By varying ϕ , different cases are studied in [38, 39]. For ϕid = 0, 4 and ϕid > 4, δid is real and particles have a tendency of leaving the search space and never returning. For 0 < ϕid < 4, δid is complex and

solutions to (1.5) are of the form

xid(t) = Λidsin(θidt) + Γidcos(θidt) + κid, (1.6)

 id  id |δ | id id id where θ = arctan id id and the constants Λ , Γ and κ are given by |2−ϕ1 −ϕ2 |

2vid(0) − ϕid + ϕid xid(0) + ϕidpid + ϕidgid Λid = 1 2 1 2 , (1.7) |δid| Γid = xid(0) − κid, (1.8)

id id id id id ϕ1 p + ϕ2 g κ = id id . (1.9) ϕ1 + ϕ2

Here, as suggested by (1.6) through (1.9), particles surf sine waves whose frequencies and ampli- tudes depend on initial conditions and the choice of the cognitive and social coefficients. What

Ozcan and Mohan analysis has shown is that particles’ trajectories inside the search space are sinu- soidal waves, provided 0 < ϕid < 4. To find an optimum, particles surf from waves to waves by randomly changing their frequencies and amplitudes.

Just like Ozcan and Mohan, Clerc and Kennedy provide a theoretical analysis of the trajectory

6 of a simple particle [37, 43]. They develop a 5-D attractor space that sums up the trajectory of the simple particle and furthers Ozcan and Mohan’s results. Their analysis is based on guaranteeing that particles converge to the stable point

ϕidpid + ϕidgid sid = 1 2 , (1.10) ϕid

id id id with ϕ = ϕ1 + ϕ2 , such that i = 1, 2, ... , N and d = 1, 2, ... , n. As a result of their study,

Clerc and Kennedy derive a constriction factor χid [37], which works just like velocity clamping

by keeping velocities bounded. The new velocity equation is given by

id h id id id id id id id i v (t + 1) = χ v (t) + ϕ1 (t)(p (t) − x (t)) + ϕ2 (t)(g (t) − x (t)) , (1.11) id id 2κ with χ = , (1.12) q 2 2 − ϕid − (ϕid) − 4ϕid

where the constant κid, such that 0 ≤ κid ≤ 1, determines how fast the algorithm converges. As

κid → 0 convergence of particle i along dimension d speeds up and conversely slows down as

κid → 1.

Van Den Bergh and Engelbrech analyze the PSO algorithm variant with inertia factor [40,

41]. They prove that particles converge to a stable point si over time, such that lim xi(t) = t→+∞ i i i i i ϕ1p + ϕ2g s = i i , with all operations performed element-wise, provided for all dimensions d = ϕ1 + ϕ2 n id id o 1, 2, ... , n, max ||λ1 ||, ||λ2 || < 1, where

1 + ωid − ϕid − ϕid + γid λid = 1 2 , (1.13) 1 2 1 + ωid − ϕid − ϕid − γid λid = 1 2 , (1.14) 2 2 q id id id id2 id with γ = 1 + ω − ϕ1 − ϕ2 − 4ω . (1.15)

As a guideline for convergence, Van Den Bergh proves that for all dimensions d = 1, 2, ... , n,

n id id o 1 max ||λ1 ||, ||λ2 || < 1 is achieved in general if ω > 2 (ϕ1 + ϕ2) − 1 [41].

7 A stricter analysis is performed in [42]. Unlike [31, 37, 38, 39, 40, 41, 43], Kardimanathan et al. present a Lyapunov stability analysis of the PSO system considering stochastic parameters.

The absolute stability of the “best” particle is proved and guidelines for picking the inertia factor and maximum gain K for stability are presented. The analysis is performed on a particle swarm optimizer with inertia factor. Because each dimension updates independently of others, the study can be done on a single, scalar particle without loss of generality. Considering a single, scalar particle, and removing the subscripts i and d for clarity, ϕ(t) = ϕ1(t) + ϕ2(t). The maximum gain

is defined as 0 < ϕ(t) < K. The analysis in [40, 41] requires that 0 < ω < 1 and K < 2(ω + 1)

for convergence. However, according to Kardimanathan et al.’s analysis, sufficient conditions for a

stable swarm optimizer considering stochastic parameters are such that |ω| < 1, with ω 6= 0, and

2 1 − 2|ω| + ω2 K < . (1.16) 1 + ω

Gazi refines the findings in [42]. He proves stochastic asymptotic stability of the “best” particle, derives a more relaxed upperbound on the maximum gain   27 1 − 2|ωi| + ωi2 K < , (1.17) 7 (1 + ωi) and shows stochastic global ultimate boundedness of the “non-best” particles [13]. He also proves the convergence of the personal best and global best function value sequences [13].

As Kardikamanathan et al. point out in [42], the main purpose of PSO is optimization, which is only possible if the PSO system remains stable. On one hand, empirical studies focus on devising or finding PSO control parameters for achieving the best possible result but cannot prove stability theoretically. On the other hand, theoretical studies, be it simplified or strict, to a certain extent or fully prove stability. In doing so, guidelines for picking some PSO parameters are derived.

However, in most cases, those guidelines only help achieving stability to the expense of convergence

8 or optimization. Should we just abandon the theoretical approach and computationally find the best

PSO control parameters?

In this thesis, we go the theoretical route. We develop an adaptive PSO based on the work in

[42] and discrete-system adaptive control tools in [44]. The particle dynamics are represented as a nonlinear feedback control system in canonical form. We use Lyapunov’s direct method to prove that our error system is ultimately uniformly bounded and hence the stability of our optimizer. For the chosen benchmark functions, we perform various experiments to further understand how our optimizer work and compare its performance to both previous purely empirical approach results and theoretical approach results.

This thesis is organized as follows: Chapter II describes the motivation behind the study, the stability analysis is done in Chapter III, for the test functions presented in Chapter IV, we investigate our adaptive PSO in Chapter V and compare its performance to other optimizers in Chapter VI, followed by the conclusion of the thesis in Chapter VII.

9 CHAPTER II

MOTIVATION

Considering a global neighborhood topology where all the particles composing the PSO system can exchange information, we can write

g1(t) = g2(t) = ... = gN (t) = g(t). (2.1)

According to (1.1), each of the n dimensions updates independently of others. The cost f is the only link between the dimensions. For each particle, the scalar case can thus be analyzed without loss of generality. Removing the index i for clarity purposes, consider for now a single, scalar particle whose dynamics are given by

v(t + 1) = ωv(t) + ϕ1(t)(p(t) − x(t)) + ϕ2(t)(g(t) − x(t)), (2.2) x(t + 1) = x(t) + v(t + 1).

We base our analysis on Chapter 13 in [44]. Therefore, we proceed by putting (2.2) in the canonical

form described in [44]. Let z1(t) = x(t − 1) and z2(t) = z1(t + 1) = x(t). We can also express

z2(t + 1) as

z2(t + 1) = z1(t + 2) = x(t + 1),

= x(t) + v(t + 1),

= x(t) + ωv(t) + u1(t), (2.3)

10 where, based on [42], we can define the control input signal u1(t) as

u1(t) = ϕ1(t)(p(t) − x(t)) + ϕ2(t)(g(t) − x(t)),

ϕ1(t) + ϕ2(t) = (ϕ1(t)p(t) + ϕ2(t)g(t)) − (ϕ1(t) + ϕ2(t)) x(t), ϕ1(t) + ϕ2(t) = ϕ(t)(s(t) − x(t)), (2.4)

with

ϕ(t) = ϕ1(t) + ϕ2(t) (2.5)

and

ϕ (t)p(t) + ϕ (t)g(t) s(t) = 1 2 . (2.6) ϕ1(t) + ϕ2(t)

Remark that if ϕ(t) = 0 then s(t) in (2.6) and consequently u1(t) in (2.4) become undefined. That

is why we require ϕ1(t) 6= 0 and ϕ2(t) 6= 0 so that ϕ(t) 6= 0 for all t. From (2.2), it can be inferred

that z1(t) = x(t − 1) = x(t) − v(t). Meaning v(t) = x(t) − z1(t). Therefore (2.3) becomes

z2(t + 1) = x(t) + ω(x(t) − z1(t)) + u1(t),

= −ωz1(t) + (1 + ω)z2(t) + u1(t). (2.7)

The single particle system in state-space form is written as         z1(t + 1) 0 1 z1(t) 0 = + u1(t), z2(t + 1) −ω 1 + ω z2(t) 1 (2.8)  z (t)  y(t) =  0 1  1 . z2(t)  0 1  We want A = to be non-singular. Hence, ω 6= 0 since the eigenvalues of A are z −ω 1 + ω z {1, w}. Notice that ω = 0, according to (2.2), means v(t + 1) is independent of v(t), which would

modify the PSO algorithm.

We define an error system

e(t) = s(t) − y(t) = s(t) − z2(t). (2.9)

11 If e(t) can somehow be driven to zero (e(t) → 0) then

ϕ1(t)p(t) + ϕ2(t)g(t) x(t) = z2(t) = s(t) = . (2.10) ϕ1(t) + ϕ2(t)

At any generation t, there always is at least one particle whose personal best is the same as its global best [13]. Such particle is called “best” particle [42]. Remember that the scalar case, given by (2.8) through (2.9), applies to each of the n dimensions and N particles independently. Going back to the n-dimensional, N-particle PSO system, the best particle j (j ∈ [1,N]) is such that pj(t) = gj(t) = g(t). If we can get the error to go to zero, according to (2.10), xj(t) = pj(t) =

j j j j j g (t) = g(t). Moreover, using (1.1), x (t + 1) = x (t) + ω v (t). There exists g ∈ R such that g = lim min gi(t) . Gazi proves that the sequence gi(t) converges [13]. Here, because we t→∞ 1≤i≤N use a global neighborhood topology, we can redefine g as

g = lim g(t). (2.11) t→∞

There is no guarantee that g is the position that globally optimizes the cost f. However, when gj(t) = g, the particle j should remain in the same position at the next iteration, meaning xj(t+1) =

j j j j j j j x (t) = g. In that case, for x (t + 1) = x (t) + ω v (t) to hold, ω v (t) = 0. Recall that for Az to be non-singular, ω 6= 0. Consequently, vj(t) = 0. After all, if xj(t) = g and vj(t) = 0 then the

cost f is optimized and the position at the optimum is xj(t) = gj(t) = g. As mentioned before, we can only hope xj(t) = g is the position of the global optimum. The question now that remains however is, how can the error system e(t) be driven to zero?

12 CHAPTER III

STABILITY ANALYSIS

In this chapter we present a stability analysis based on Lyapunov direct method. It is therefore only right that we define it.

Lyapunov Stability [45]: The equilibrium xe = 0 of a system is stable if there exists a nonneg- ative, scalar Lyapunov function V (t, x), with V (t, 0) = 0, which satisfies

V (t + 1, x) − V (t, x) ≤ 0. (3.1)

LaSalle-Yoshizawa Theorem [44]: Here also, let the xe = 0 be the equilibrium of a system.

Replacing V˙ (t, x) in [44] by V (t + 1, x) − V (t, x), if there exists a nonnegative, decrescent, scalar Lyapunov function V (t, x), with V (t, 0) = 0, such that

V (t + 1, x) − V (t, x) < −W (x) < 0, (3.2)

where W (x) is positive semi-definite then xe = 0 is uniformly bounded and lim W (x) = 0. t→+∞ Now, returning to the single particle case and considering only one of the n dimensions, we

design an adaptive controller to drive e(t) to zero. The original controller u1(t) in (2.4), which can

also be expressed as u1(t) = ϕ(t)e(t), is replaced by

u(t) = u1(t) + U(t), (3.3)

13 with U(t) being the adaptive controller. The new system is now given by

 z (t + 1)   0 1   z (t)   0  1 = 1 + u(t), z2(t + 1) −ω 1 + ω z2(t) 1 (3.4)  z (t)  y(t) =  0 1  1 . z2(t)

From (2.9), we compute e(t + 1) as

e(t + 1) = s(t + 1) − z2(t + 1),

= s(t + 1) − ϕ(t)e(t) + ωz1(t) − (1 + ω)z2(t) − U(t). (3.5)

Let

h(t) = s(t + 1), ϕ (t + 1)p(t + 1) + ϕ (t + 1)g(t + 1) = 1 2 . (3.6) ϕ1(t + 1) + ϕ2(t + 1)

It is uncertain what h(t) is at generation t as it happens at a generation in the future and cannot be computed until we know x(t + 1). However, we need to eliminate h(t) if we want to drive e(t) to

zero. We do so with a universal function approximator H(t, θ) used here as a predictor. Remark that s(t + 1) is random since ϕ1(t + 1) and ϕ2(t + 1) are random. However we can only hope to be able to predict s(t + 1) because particles are attracted towards the best particle(s). That is p(t) → g, g(t) → g and s(t) → g as t → ∞. We assume that there is a linear in the approximator

ˆ p H(t, θ(t)) such that for some ideal parameter θ ∈ R , |H(t, θ) − h(t)| ≤ L for all x ∈ Sx and ˆ v ∈ Sv, with Sx ⊂ R being the search space, Sv ⊂ R being the velocity space and θ(t) being  >   ∂H(t, θˆ(t)) the parameter estimate of the ideal parameter θ. That means H t, θˆ(t) = θˆ(t). ∂θˆ(t) We also assume that θ is time-invariant. Moreover, we want to make sure the error e stays inside

the error space Se ⊂ R to guarantee x ∈ Sx and v ∈ Sv. The goal here is to design an adaptive

controller which ensures that if e ∈ Be then a proper choice of the controller parameters can be

made so that Be ⊂ Se.

14 The control law is given by

U(t) = Us(t) + H(t, θˆ(t)), (3.7)

with Us(t) being the static controller.

We can derive Us(t) assuming no uncertainty h(t). That is h(t) = 0 and (3.5) becomes

e(t + 1) = −ϕ(t)e(t) + ωz1(t) − (1 + ω)z2(t) − Us(t). (3.8)

Choosing

Us = α(t) − ke(t), such that |k| < 1 and k 6= 0, (3.9) where

α(t) = −ϕ(t)e(t) + ωz1(t) − (1 + ω)z2(t), (3.10)

2 then e(t + 1) = ke(t), |k| < 1. Consider the Lyapunov candidate Vs(t) = (e(t)) . Vs is positive definite, decrescent and radially unbounded. Further,

2 Vs(t + 1) − Vs(t) = (e(t + 1)) − Vs(t),

2 = k Vs(t) − Vs(t),

2  = k − 1 Vs(t). (3.11)

2 Because |k| < 1 then k − 1 < 0 and consequently Vs(t + 1) − Vs(t) < 0. Therefore, Vs(t) is exponentially stable.

Now, going back to having the uncertainty h(t) in (3.5), let us define the signal

q(t) = − [e(t) − α(t − 1) + Us(t − 1)] . (3.12)

Notice that (3.12) can also be written as

q(t) = − [e(t) − α(t − 1) + α(t − 1) − ke(t − 1)] ,

= −e(t) + ke(t − 1). (3.13)

15 As a side note, (3.13) is how the signal q(t) is computed in simulation. For now, we continue our proof by using (3.5) and (3.12) to express q(t + 1) as

q(t + 1) = − [e(t + 1) − α(t) + Us(t)] ,

= −s(t + 1) − α(t) + Us(t) + H(t, θˆ(t)) + α(t) − Us(t),

= −s(t + 1) + H(t, θˆ(t)). (3.14)

p Let θ˜(t) ∈ R be the parameter error, defined as θ˜(t) = θˆ(t) − θ. That means θˆ(t) = θ˜(t) + θ.

Developing (3.14)

!> ∂H(t, θˆ(t))   q(t + 1) = −h(t) + θ˜(t) + θ , ∂θˆ(t) !> ∂H(t, θˆ(t)) = (H(t, θ) − h(t)) + θ˜(t), ∂θˆ(t) !> ∂H(t, θˆ(t)) = l(t) + θ˜(t), (3.15) ∂θˆ(t)

where l(t) is the approximation error defined as l(t) = H(t, θ) − h(t). Notice that H (t, θ) '  > ∂H(t, θˆ(t)) θ is an approximation we are making. There exists L ≥ 0 such that |l(t)| ≤ ∂θˆ(t)

L for all x ∈ Sx and v ∈ Sv.

We pause our proof to choose an approximator H(t, θˆ(t)) such that for some ideal parameter

p θ ∈ R , |H(t, θ) − h(t)| ≤ L for all x ∈ Sx and v ∈ Sv. Using (2.6) we can write

ϕ (t + 1)p(t + 1) + ϕ (t + 1)g(t + 1) s(t + 1) = 1 2 , ϕ1(t + 1) + ϕ2(t + 1) ϕ (t + 1) ϕ (t + 1) = 1 p(t + 1) + 2 g(t + 1), ϕ(t + 1) ϕ(t + 1)

= c1p(t + 1) + c2g(t + 1), (3.16)

ϕ1(t+1) ϕ2(t+1) with ϕ(t + 1) = ϕ1(t + 1) + ϕ2(t + 1), c1 = ϕ(t+1) , 0 < c1 < 1, c2 = ϕ(t+1) and 0 < c2 < 1.

Because p(t), g(t) ∈ Sx for all t, then p(t + 1) and g(t + 1) can be estimated as p(t + 1) = c3p(t)

16 and g(t + 1) = c4g(t) for some time varying c3, c4 ∈ R. We rewrite (3.16) as

s(t + 1) = c1c3p(t) + c2c4g(t),

> = m1p(t) + m2g(t) = φ (t)ξ(t), (3.17)

    m1 p(t) where m1 = c1c3 and m2 = c2c4 are time dependent, φ(t) = and ξ(t) = . m2 g(t) The uncertainty is thus of the form h(t) = φ>(t)ξ(t). At generation t, the basis ξ(t) is known.

Additionally, because PSO particles are attracted towards the best particle(s), h(t) = s(t + 1) → g as t → ∞. That means h(t) = s(t + 1), which initially starts off as random, can be perfectly approximated and the ideal approximation error is l(t) = 0. Hence, ideally L = 0 and (3.15) becomes

!> ∂H(t, θˆ(t)) q(t + 1) = θ˜(t). (3.18) ∂θˆ(t)

2 We use the parameter estimate vector θˆ(t) ∈ R given by

 θˆ (t)  θˆ(t) = 1 , (3.19) θˆ2(t) and predict the uncertainty h(t) = s(t + 1) with

> H(t, θˆ(t)) = θˆ (t)φ(t) = θˆ1(t)p(t) + θˆ2(t)g(t), (3.20)

so that

∂H(t, θˆ(t))  p(t)  = φ(t) = . (3.21) ∂θˆ(t) g(t)

We resume our proof. For the rest of this chapter, we study (3.4) using the normalized gradient

update law [44] given by   ηζ t − 1, θˆ(t − 1) θˆ(t) = θˆ(t − 1) − q(t), (3.22)   2 ˆ 1 + γ ζ t − 1, θ(t − 1)

17 where k · k is the 2-norm operator, γ > 0 and 0 < η < 2γ. Additionally, ζ(t, ρ) is defined as

∂H(t, ρ) ζ(t, ρ) = . (3.23) ∂ρ

Notice that, because θ˜(t) = θˆ(t) − θ, we can also write   ηζ t − 1, θˆ(t − 1) θ˜(t) = θ˜(t − 1) − q(t). (3.24)   2 ˆ 1 + γ ζ t − 1, θ(t − 1)

ˆ To prove the choice of (3.22), we start by assuming that there exists b > 0 such that ∂H(t, θ(t)) = H ∂θˆ(t)

ˆ ˜ ζ(t, θ(t)) ≤ bH and proceed to study the behavior of θ(t).

Consider the positive definite, decrescent, radially unbounded Lyapunov candidate Vθ˜(t) =

θ˜>(t)θ˜(t). We have 2  ˆ  ηζ t, θ(t) q(t + 1) 2 V (t + 1) − V (t) = θ˜(t) − − θ˜(t) , θ˜ θ˜   2 ˆ 1 + γ ζ t, θ(t) 2 >  ˆ  ˜  ˆ  −2ηζ t, θ(t) θ(t)q(t + 1) ηζ t, θ(t) q(t + 1) = + .   2   2 ˆ ˆ 1 + γ ζ t, θ(t) 1 + γ ζ t, θ(t) Using (3.18) and (3.23), !> ∂H(t, θˆ(t)) ζ>(t, θˆ(t))θ˜(t) = θ˜(t) = q(t + 1). ∂θˆ(t)

Therefore    2  ˆ ηq2(t + 1) η ζ t, θ(t) V (t + 1) − V (t) = −2 +  . θ˜ θ˜   2    2  ˆ ˆ 1 + γ ζ t, θ(t) 1 + γ ζ t, θ(t) Parameters η and γ can be picked so that η, γ > 0 and   2 ˆ η ζ t, θ(t) η 2 − ≥ 2 − > 0. (3.25)   2 ˆ γ 1 + γ ζ t, θ(t) Let

η k = 2 − . (3.26) 2 γ

18 Setting k2 > 0 then 0 < η < 2γ. Because of (3.25)

−ηk q2(t + 1) V (t + 1) − V (t) ≤ 2 ≤ 0. (3.27) θ˜ θ˜   2 ˆ 1 + γ ζ t, θ(t) ˜ As a result, Vθ˜(t) is a monotonically nonincreasing and consequently Vθ˜(t) and θ(t) are bounded.

We then use the positive definite, decrescent, radially unbounded Lyapunov candidate Vs(t) = e>(t)P e(t), where P is a symmetric, positive definite matrix to study the trajectory of the error system e(t). First, because of (3.7) and (3.10), we rewrite e(t + 1) in (3.5) as

e(t + 1) = s(t + 1) + α(t) − Us(t) − H(t, θˆ(t)),   > ∂H t, θˆ(t) ˆ = s(t + 1) + α(t) − Us(t) −   θ(t). ∂θˆ(t)

From the expression of Us(t) in (3.9), we get >   ˆ  ∂H t, θ(t)   e(t + 1) = ke(t) + s(t + 1) −   θ˜(t) + θ , ∂θˆ(t)

= ke(t) − (H (t, θ) − s(t + 1)) − ζ>(t, θˆ(t))θ˜(t),

= ke(t) − l(t) − ζ>(t, θˆ(t))θ˜(t).

 > ∂H(t, θˆ(t)) Notice that, here again, we approximate H (t, θ) ' θ. Moreover, as we mentioned ∂θˆ(t) before, ideally l(t) = 0, so

e(t + 1) = ke(t) − ζ>(t, θˆ(t))θ˜(t). (3.28)

Considering a matrix P > 0 (positive definite), and any scalar  > 0,

(x + y)>P (x + y) = x>P x + 2x>P y + y>P y ≥ 0,

√ y > √ y  x − √ P x − √ = x>P x − 2x>P y + 1 y>P y ≥ 0,   

√ y > √ y   1 (x + y)>P (x + y) + x − √ P x − √ = (1 + ) x>P x + 1 + y>P y,   

19 and

 1 (x + y)>P (x + y) ≤ (1 + ) x>P x + 1 + y>P y. (3.29) 

Now using (3.28) and (3.29)

 1 h i2 V (t + 1) − V (t) ≤ (1 + )[ke(t)]> P [ke(t)] − V (t) + 1 + P ζ>(t, θˆ(t))θ˜(t) , s s s 

 1  2 V (t + 1) − V (t) ≤ (1 + ) k2 − 1 V (t) + 1 + P ζ>(t, θˆ(t))θ˜(t) . (3.30) s s s 

Let V (t) = Vs(t) + k3Vθ˜(t), k3 > 0. The function V (t) is positive definite, decrescent and radially unbounded since both Vs(t) and Vθ˜(t) are. We have

 V (t + 1) − V (t) = Vs(t + 1) − Vs(t) + k3 Vθ˜(t + 1) − Vθ˜(t) ,

Taking into consideration (3.27) and (3.30)  1  2 V (t + 1) − V (t) ≤ (1 + ) k2 − 1 V (t) + 1 + P ζ>(t, θˆ(t))θ˜(t) s  ηk k q2(t + 1) (3.31) − 2 3 .   2 ˆ 1 + γ ζ t, θ(t) Let

2 k1 = 1 − (1 + ) k . (3.32)

We want k1 to be strictly positive. That means

1 − (1 + )k2 > 0, 1 ⇔ 1 +  < , k2 1 − k2 ⇔  < . k2

Remember that  > 0 and |k| < 1 or 1 − k2 > 0. Thus, we pick  so that

1 − k2 0 <  < . (3.33) k2

20 We can rewrite (3.31) as

ηk k q2(t + 1) V (t + 1) − V (t) ≤ −k V (t) − 2 3 1 s   2 1 + γ ζ t, θˆ(t) (3.34)  1  2 + 1 + P ζ>(t, θˆ(t))θ˜(t) . 

Remark from (3.18) that ζ>(t, θˆ(t))θ˜(t) = q(t + 1). Therefore

ηk k q2(t + 1)  1 V (t + 1) − V (t) ≤ −k V (t) − 2 3 + 1 + P q2(t + 1), 1 s   2 ˆ  1 + γ ζ t, θ(t)

q2(t + 1)   1    2 V (t + 1) − V (t) ≤ −k V (t) − ηk k − 1 + P 1 + γ ζ t, θˆ(t) . 1 s   2 2 3 ˆ  1 + γ ζ t, θ(t)

ˆ Assuming ζ(t, θˆ(t)) = ∂H(t, θ(t)) ≤ b for all x ∈ S and v ∈ S , then ∂θˆ(t) H x v

q2(t + 1)   1  V (t + 1) − V (t) ≤ −k V (t) − ηk k − 1 + P 1 + γb2  , 1 s   2 2 3 H ˆ  1 + γ ζ t, θ(t) F q2(t + 1) ≤ −k V (t) − , (3.35) 1 s   2 ˆ 1 + γ ζ t, θ(t) where  1 F = ηk k − 1 + P 1 + γb2  . (3.36) 2 3  H

Based on (3.25) and (3.26), k2 > 0. Picking k3 such that

1  2  1 +  P 1 + γbH k3 ≥ > 0 (3.37) ηk2

F q2(t+1) ensures that F ≥ 0 and − 2 ≤ 0. We can then write 1+γkζ(t, θˆ(t))k

V (t + 1) − V (t) ≤ −k1Vs(t). (3.38)

By LaSalle-Yoshizawa theorem [44] and replacing V˙ (t) by V (t + 1) − V (t)), e(t) is uniformly

2 bounded and lim k1Vs(t) = lim k1P e (t) = 0 or lim |e(t)| = 0. Next, Theorem 13.5 and t→+∞ t→+∞ t→+∞ Lemma 13.1 from [44] are used to place bounds on e(t).

As shown before, Vθ˜ is positive nonincreasing. We can therefore say that, for all t, Vθ˜(t) ≤

21 Vθ˜(0). Also, because Vθ˜(0) is the largest value, Vθ˜(t) can only decrease by that much, meaning

Vθ˜(t) − Vθ˜(t + 1) ≤ Vθ˜(0). Additionally V (t) = Vs(t) + k3Vθ˜(t) means Vs(t) = V (t) − k3Vθ˜(t).

Using (3.38), we find

 Vs(t + 1) − Vs(t) = (V (t + 1) − V (t)) + k3 Vθ˜(t) − Vθ˜(t − 1) ,

≤ −k1Vs(t) + k3Vθ˜(0) (3.39)

According to (3.37), k3 > 0. Moreover Vθ˜(0) ≥ 0. Thus, k3Vθ˜(0) ≥ 0. We also require that 

2 2 2 be picked so that k1 > 0. Since  > 0 and k > 0, then k (1 + ) > 0, 1 − k (1 + ) < 1,

and referring to (3.32), 0 < k1 < 1. We can write Vs(t + 1) ≤ (1 − k1) Vs(t) + k3Vθ˜(0) or

−Vs(t + 1) ≥ − (1 − k1) Vs(t) − k3Vθ˜(0). Let {µ(t)} be a sequence such that

µ(t + 1) = µ(t) − k1µ(t) + k3Vθ˜(0) = (1 − k1) µ(t) + k3Vθ˜(0),

with µ(t) ≥ Vs(t) for all t and µ(0) = Vs(0). Thus µ(t+1)−Vs(t+1) ≥ (1 − k1)[µ(t) − Vs(t)] ≥

0. The first three terms of the sequence {µ(t)} are

µ(1) = (1 − k1) µ(0) + k3Vθ˜(0),

2 µ(2) = (1 − k1) µ(0) + (1 − k1) k3Vθ˜(0) + k3Vθ˜(0),

3 2 µ(3) = (1 − k1) µ(0) + (1 − k1) k3Vθ˜(0) + (1 − k1) k3Vθ˜(0) + k3Vθ˜(0).

By induction and because 0 < 1 − k1 < 1,

t−1 t ! X 1 − (1 − k1) µ(t) = (1 − k )t µ(0) + k V (0) (1 − k )i = (1 − k )t µ(0) + k V (0) , 1 3 θ˜ 1 1 3 θ˜ k i=0 1

The sequence {µ(t)} is therefore bounded and since µ(t) ≥ Vs(t) for all t, then Vs(t) is also

bounded such that Vs(t) ≤ Vr, with

t ! t 1 − (1 − k1) Vr = (1 − k1) Vs(0) + k3Vθ˜(0) , k1   k3Vθ˜(0) t k3Vθ˜(0) = Vs(0) − (1 − k1) + (3.40) k1 k1

22 t Since 0 < 1 − k1 < 1, then (1 − k1) is monotonically decreasing. In addition, because k1 > 0,

k V (0)  k V (0)  k > 0 and V (0) ≥ 0, we have 3 θ˜ ≥ 0. If V (0) − 3 θ˜ > 0 then V is monoton- 3 θ˜ k1 s k1 r k V (0) ically decreasing with a maximum of V (0) at t = 0 and an infimum of 3 θ˜ as t → ∞. If s k1  k V (0)  V (0) − 3 θ˜ < 0 then V is monotonically increasing with a minimum of V (0) at t = 0 and s k1 r s k V (0)  k V (0)  k V (0) a supremum of 3 θ˜ as t → ∞. If V (0) − 3 θ˜ = 0 then V = V (0) = 3 θ˜ . Either k1 s k1 r s k1

way, we see that

  k3Vθ˜(0) Vr ≤ max Vs(0), . (3.41) k1

Moreover, going back to the positive and nonincreasing sequence {Vθ˜}, there exists δ > 0 and a given T such that Vθ˜(t − 1) − Vθ˜(t) ≤ δ for t ≥ T . Just like (3.40) is derived, we also find that for all t ≥ T

  k3δ t−T k3δ Vs(t) ≤ Vs(0) − (1 − k1) + . k1 k1

k3δ Because 0 < 1 − k1 < 1, then lim Vs(t) ≤ . However, we can remove the k3δ term so long t→+∞ k1 as we pick an arbitrarily small δ. That means

lim Vs(t) = 0. (3.42) t→+∞

Remember that, by LaSalle-Yoshizawa theorem, we already have lim k1Vs(t) = 0, which means t→+∞ (3.42) makes sense. Furthermore, e(t) is such that v u  k3V˜(0)  s s max V (0), θ V (t) V u s k1 |e(t)| ≤ s ≤ r ≤ t , (3.43) λmin(P ) λmin(P ) λmin(P ) where λmin(P ) denotes the smallest eigenvalue of P . Thus, e(t) ∈ Be for all t such that  v   u k3Vθ˜(0)  umax Vs(0), k  B = e : |e(t)| ≤ t 1 . (3.44) e λ (P )  min 

Choosing appropriate control parameters so that Be ⊆ Se ensures that the inputs to the approximator remain properly bounded. In conclusion, Vθ˜ is bounded and both Vs(t) and e(t) are ultimately,

23 uniformly bounded. Moreover, as we saw earlier, using LaSalle-Yoshizawa theorem, we have shown that e(t) goes to zero over time.

24 CHAPTER IV

TEST FUNCTIONS

Six benchmark functions are used for testing. Table 4.1 contains the functions to optimize, the

∗ problem dimension n, the search space Sx, the global minimum of each function fa(x ) and the

∗ point xa at which that global minimum is reached. Here, a = 1, 2, ... , 6. For all six functions,

> x = [x1 x2 . . . xn] . Figure 4.1 shows the contour plots of all six functions.

Table 4.1: Test functions

∗ ∗ Function Formula n Sx xa fa(xa)

n X 2 n n Sphere f1(x) = xp 30 [−100, 100] 0 0 p=1 n−1 X h 2 22i n n Rosenbrock f2(x) = (xp − 1) + 100 xp+1 − xp 30 [−30, 30] 1 0 p=1

1 q 1 Pn 2 − 5 n p=1 xp f3(x) = −20e Ackley 30 [−32.768, 32.768]n 0n 0 1 Pn cos(2πx ) −e n p=1 p + 20 + e

n X  2  n n Rastrigin f4(x) = xp − 10 cos(2π ∗ xp) + 10 30 [−5.12, 5.12] 0 0 p=1 n n 1 X 2 Y xp n n Griewank f5(x) = x − cos( √ ) + 1 30 [−600, 600] 0 0 4000 p p p=1 p=1 p 2 2 sin x1 + x2 − 0.5 n n Schaffer f6 f6(x) = 0.5 − 2 [−100, 100] 0 0 2 2 2 (1 + 0.001 (x1 + x2))

25 Rosenbrock function

15000

10000 (x) 2 f 5000

0 4

2

0

−2 3 1 2 −4 −1 0 −3 −2

Figure 4.1: Contour plots of the test functions

The Sphere and Rosenbrock functions are unimodal while the Ackley, Rastrigin, Griewank and

Shaffer f6 functions are multimodal.

26 PSO algorithms can be origin-biased. They perform great when the optimum is located at or in the vicinity the origin of the search region, which is the case for all the test functions in Table 4.1, and poorly when the optimum is moved further away from that origin. Angeline uses the Region

Scaling (RS) method, previously proposed by Gehlaar and Fogel [46], to prove PSO algorithms’ origin bias [47]. An alternative to the RS method is the Center Offset (CO) method. It consists in essentially moving the optimum to a different location inside the search space. Applying the CO method means testing algorithms on costs fa(x, xo) = fa(x − xo), such that xo ∈ Sx and the

∗ new optimum xa + xo ∈ Sx, instead of fa(x). Monson and Seppi show that the CO approach is better than the RS approach at uncovering origin-bias in PSO algorithms (for the limited number of algorithms they tested on) [48]. We want to make sure that our adaptive PSO works properly on average wherever the optimum is situated. It is easy to see why this is important as, in real life problems, the optimum location is unknown and can be located anywhere inside the region of interest.

27 CHAPTER V

THE ADAPTIVE PSO

In this chapter, we run several tests on our adaptive PSO so as to get a better understanding of how it works but, first, we complete its design.

5.1 Designing the Adaptive PSO

Going the opposite direction of how (3.4) is derived, it can be shown that, for each particle i = 1, 2, ... , N, implementing (3.4) is the same as implementing

vi(t + 1) = ωivi(t) + ui(t), (5.1) xi(t + 1) = xi(t) + vi(t + 1), with ui(t) being the same as u(t) in (3.3) but adding the subscript i to specify the controller signals of particle i.

Now we revert back to using the single, scalar particle notation. Let

Mx = max |x(t)| . (5.2) x(t)∈Sx⊂R   The 2-norm of ζ t, θˆ(t) is given by

  ∂H(t, θˆ(t)) ˆ p 2 2 ζ t, θ(t) = = kφ(t)k = p (t) + g (t). ∂θˆ(t)

Since p(t), g(t) ∈ Sx, |p(t)| ≤ Mx and |g(t)| ≤ Mx by the definition of Mx in (5.2). Therefore   √ √   ˆ ˆ ζ t, θ(t) ≤ 2Mx, and choosing bH = 2Mx satisfies ζ t, θ(t) ≤ bH.

28 ϕ1(t) ϕ2(t) ϕ1(t) ϕ2(t) Because ϕ(t) , ϕ(t) < 1 such that ϕ(t) + ϕ(t) = 1 and p(t), g(t) ∈ Sx for all t, then

ϕ1(t) ϕ2(t) s(t) = ϕ(t) p(t) + ϕ(t) g(t) ∈ Sx for all t. According to (5.2), s(t) ∈ Sx means |s(t)| ≤ Mx for

all t. From (2.9), we can say that |x(t)| ≤ |e(t)| + |s(t)|. For all t, we want |x(t)| ≤ Mx. However, s  k V (0)  3 θ˜ max Vs(0), k1 that is not something we can guarantee as |x(t)| ≤ |e(t)| + |s(t)| ≤ + Mx. λmin(P )

We therefore have to force x(t) to stay within Sx whenever it tries to escape it. Doing so we cannot design for , k1, k2 and k3 anymore. There still exists , k1, k2 and k3 for which our stability proof holds. However, those parameters are of no use in designing the adaptive PSO, as we have it now.

Moreover, since we want e(t) ∈ Be ⊂ Se such that x(t) ∈ Sx and v(t) ∈ Sv, we also force v(t) to remain inside Sv. We set Sv = Sx. In practice, if Sx is known, then there is really no point going outside of it as the solution to the optimization problem resides within it. One more thing that we do is, if x(t + 1) is at the boundaries of Sx and v(t + 1) is pointing outside the search space, essentially

having the same sign as x(t + 1), we update v(t + 1), multiplying it by a random number between

[−1, 0], to point back inside the search space.

5.2 Pseudocode

d d For an n-dimensional, N-particle swarm, based on (5.2), M = max x (t) , and Mx = x n x(t)∈Sx⊂R  1 2 n Mx , Mx , ... , Mx , where d = 1, 2, ... , n. The adaptive PSO pseudocode is as follows (the

stopping condition can be a maximum number of iterations, which we use here, or a metric of some

sort, or a combination of both):

29 Algorithm 1 Adaptive PSO i i i i Require: Initialize all N, n-dimensional particles: x ∈ Sx and v ∈ Sv. ω 6= 0 can be random. k such that ki 6= 0n and −1n < ki < 1n, γi and ηi such that 0n < ηi < 2γi are picked randomly. i i i j At start, p = x and g = p such that j ∈ Si, where Si is the set of all neighbors of particle j, and j i ˆi i f(p ) ≤ f(p ). Also set both θ and ep to zero. repeat for i = 1, 2, ... , N do if f(xi) < f(pi) then pi = xi. end if if f(pi) < f(gi) then gi = pi. end if i i n i i n i i i Generate ϕ1 ∈]0, ϕ1] and ϕ2 ∈]0, ϕ2] . s is given by (2.6). e is given by (2.9). q is given by i i ˆi i i (3.13), with e (t − 1) = ep. Update θ and ζ using respectively (3.22) and (3.21). Find H using (3.20).  i  u1 is calculated using (2.4) and (2.5), ui is given by (3.3): U i is given by (3.7), i  Us is calculated using (3.9) and (3.10). Update velocities using the first equation in (5.1): for d = 1, 2, ... , n do id d if |v | > Mv then id id d v = sign(v ) · Mx , where sign(·) is the sign operator. end if end for Update positions using the second equation in (5.1): for d = 1, 2, ... , n do id d if |x | > Mx then id id d x = sign(x ) · Mx . if sign(xid) = sign(vid) then vid = −rand ([0, 1]) · vid, where rand ([0, 1]) is a random number between 0 and 1. end if end if end for end for i i i i Store e in ep: ep = e . until stopping condition is true

5.3 Understanding the Adaptive PSO

Here, we study the performance of our adaptive PSO for insights on how it works.

30 5.3.1 Origin-Bias

∗ We investigate the impact of changing the position of xa within the search space Sx, essentially

applying the Center Offset method. We do so by changing the origin of the coordinate system in

Sx. Considering xo as the origin of the coordinate system in Sx, we optimize the costs fa(x, xo) =

∗0 ∗ fa(x − x0), a = 1, 2, ... , 6, whose global minimum are reached at xa = xa + xo, in the new

∗0 coordinate system with origin at xo. We make sure xa ∈ Sx. For simulation, we use N = 30

particles and we run the algorithm 100 times, each run consisting of tf = 100 generations. At the

start of each run, the initial positions xi(0) and velocities vi(0) of the particles, i = 1, 2, ... , N,

are randomly picked within Sx and Sv. The problem dimension for each cost function is as reported

i i i i in Table 4.1. As mentioned earlier, we make Sv = Sx. Keeping ω , k , η and γ constant, for the

i i i same initial conditions and for the same ϕ1(t) and ϕ2(t) at every generation, the positions x (t)

i n  Mx n  Mx n and velocities v (t) of the particles are computed for xo1 = 0 , xo2 = − 2 , xo3 = 2

> i i i and xo4 = [−Mx + 1, Mx − 1, − Mx + 1, ...] . Parameters k , η and γ are chosen randomly,

while ensuring that |kid| < 1, with kid 6= 0, and 0 < ηid < 2γid for d = 1, 2, ... , n. We pick

ηi and γi such that γid ≤ 100. After each run, we compute the fitness of the final positions of

i particles x (tf + 1), and find the average fitness of the final positions of each particle over the total

number of runs. Knowing the average fitness of each particle over the 100 runs, we compute the

best average fitness, which is essentially the minimum fitness achieved by the N = 30 particles on

average. Table 5.1 contains the best average fitness achieved for xo1 , xo2 , xo3 and xo4 .

31 ∗ Table 5.1: Impact of moving xa inside Sx

Mean fitness

xo1 xo2 xo3 xo4 Sphere 3.7150e-005 3.0665e+002 4.9366e+002 3.7150e-005 Rosenbrock 0.2906e+000 3.8230e+005 1.0514e+006 0.2906e+000 Ackley 7.7115e-006 0.1823e+000 0.2117e+000 7.7115e-006 Rastrigin 1.9091e-005 3.1560e+000 4.4355e+000 1.9091e-005 Griewank 1.1248e-004 1.5877e+000 2.3738e+000 1.1248e-004

Schaffer f6 1.8614e-011 4.3395e-004 7.8595e-004 1.8614e-011

Based on Table 5.1, it is clear that the adaptive PSO performs differently depending on where we put the origin of the search space. It does seem that the best results are obtained when the optimum

n is near the initial search space origin, 0 or near the bounds of Sx. We suspect that parameters k, η and γ also play a role in how the adaptive PSO performs. What we have seen from simulation is the best parameter values do depend on the function to optimize. However, through trial and error, for the most part, we get the best results when γi is high and ηi is picked accordingly, that is ηi < 2γi.

Due to the fact that we run simulation in Matlab, the highest integer that can be randomly generated is less than 253, which is in the 1015 order. Parameter k does not really seem to affect the adaptive

PSO performance as long as its absolute value is not too big (too close to 1) or too small (too close to 0). Picking ki randomly so as to have a variety across the swarm even seems to work best. Of course, a lot more testing needs to be done to figure out a proper guideline for picking ki, ηi and

γi. The design of experiments approach, as done in [22], can possibly be applied to our adaptive

PSO to get better insight into how k, η and γ affect our adaptive optimizer. An alternative could be to find a way to incorporate , k1, k2 and k3 in the design of the Adaptive PSO so as to make

|x(t)| ≤ |e(t)| + |s(t)| ≤ Mx. That however will not figure in this thesis but would be investigated in our future work.

32 5.3.2 Predictor

For n = 2, N = 30 and running the algorithm only one time for tf = 1000 iterations, we look ˆ into how our predictor H(t, θ(t)) performs. For no apparent reason, we set xo5 = [−2, 2] as the origin of the search space. For all i = 1, 2, ... , N and d = 1, 2, ... , n, we randomly pick γi,

ηi and ki such that 0 < γid ≤ 1015, 0 < ηid < 2γid and |kid| < 1, with kid 6= 0. Why 1015?

Simulations are carried out in Matlab and, as mentioned previously, 1015 is the order of magnitude of the highest integer that can be randomly generated using the Matlab function ’randi’. We use that many particles (N = 30) to make sure that at least one of them finds the global minimum during the tf = 1000 iterations. This experiment, however, should not be misinterpreted as a performance evaluation of our adaptive PSO. We are mostly concerned to see if indeed H(t, θˆ(t)) predicts the uncertainty s(t + 1). We therefore plot both the estimate H(t, θˆ(t)) and the uncertainty s(t + 1) of one of the best particles in the swarm on the same figure for all six benchmark functions used.

0 100 0 X: 1000 s11(t+1)

(t) Y: −2 (t) −20 0 prediction 11 12

x x X: 1000 −1 Y: 2 −40 −100 0 500 1000 0 500 1000 −2 t (generation) t (generation) X: 100 50 100 Y: −2 −3

(t) (t) 0 20 40 60 80 100 0 0 11 12 t (generation) v X: 1000 v X: 1000 Y: 0 Y: 0 −50 −100 15 0 500 1000 0 500 1000 s12(t+1) t (generation) t (generation) prediction 50 10 initial position 0 trajectory (t) final position 5 X: 100 12 Y: 2 x −50

−100 0 −40 −30 −20 −10 0 0 20 40 60 80 100 x11(t) t (generation) (a) position and velocity (b) estimation of s(t + 1)

Figure 5.1: Optimizing f1, n = 2 with the search space origin at xo5

33 50 10 6 s11(t+1) (t) 0 (t) 0 4 prediction

11 12 X: 1000 x X: 1000 x Y: 3 Y: −1 −50 −10 2 0 500 1000 0 500 1000 X: 100 t (generation) t (generation) 0 Y: −1 20 20 −2

(t) (t) 0 20 40 60 80 100 0 0 11 12 t (generation) v X: 1000 v X: 1000 Y: 4.525e−16 Y: −1.116e−15 −20 −20 8 0 500 1000 0 500 1000 s12(t+1) t (generation) t (generation) 6 prediction 10 initial position 4 5 trajectory (t) final position 12 X: 100

x 2 0 Y: 3

−5 0 −5 0 5 10 15 20 25 0 20 40 60 80 100 x11(t) t (generation) (a) position and velocity (b) estimation of s(t + 1)

Figure 5.2: Optimizing f2, n = 2 with the search space origin at xo5

20 20 1 s11(t+1) (t) 0 (t) 0 0 prediction 11 12

x x X: 1000 X: 1000 Y: 2 Y: −2 −1 −20 −20 X: 100 0 500 1000 0 500 1000 Y: −2 t (generation) t (generation) −2 50 20 −3

(t) (t) 0 20 40 60 80 100 0 0 11 12 t (generation) v X: 1000 v X: 1000 Y: −1.863e−16 Y: 0 −50 −20 10 0 500 1000 0 500 1000 s12(t+1) t (generation) t (generation) prediction 20 5 initial position 10 trajectory (t) final position 0 X: 100

12 Y: 2 x 0

−10 −5 −15 −10 −5 0 5 0 20 40 60 80 100 x11(t) t (generation) (a) position and velocity (b) estimation of s(t + 1)

Figure 5.3: Optimizing f3, n = 2 with the search space origin at xo5

34 5 4 0 11 X: 1000 s (t+1) (t) 0 Y: −2 (t) 2 prediction 11 12

x x X: 1000 −1 Y: 2 −5 0 0 500 1000 0 500 1000 −2 t (generation) t (generation) X: 100 5 5 Y: −2 −3

(t) (t) 0 20 40 60 80 100 0 0 11 12 t (generation) v X: 1000 v X: 1000 Y: 2.037e−16 Y: 7.365e−16 −5 −5 4 0 500 1000 0 500 1000 s12(t+1) t (generation) t (generation) 3 prediction 3 initial position 2 trajectory 2 X: 100 (t) final position Y: 2 12 x 1 1

0 0 −3 −2 −1 0 1 0 20 40 60 80 100 x11(t) t (generation) (a) position and velocity (b) estimation of s(t + 1)

Figure 5.4: Optimizing f4, n = 2 with the search space origin at xo5

1000 500 100 s11(t+1) (t) 0 (t) 0 prediction 11 12

x X: 1000 x X: 1000 50 Y: −2 Y: 2 −1000 −500 0 500 1000 0 500 1000 0 t (generation) t (generation) X: 600 1000 200 Y: −2 −50

(t) (t) 0 100 200 300 400 500 600 0 0 11 12 t (generation) v X: 1000 v X: 1000 Y: 1.162e−17 Y: −1.865e−21 −1000 −200 50 0 500 1000 0 500 1000 t (generation) t (generation) 0 200 X: 600 initial position Y: 2 −50 0 trajectory (t) final position 12 12

x s (t+1) −200 −100 prediction −400 −150 −600 −400 −200 0 200 0 100 200 300 400 500 600 x11(t) t (generation) (a) position and velocity (b) estimation of s(t + 1)

Figure 5.5: Optimizing f5, n = 2 with the search space origin at xo5

35 0 100 50 X: 1000 X: 150 Y: −2 (t) −50 (t) 0 Y: −2 11 12

x x X: 1000 0 Y: 2 −100 −100 0 500 1000 0 500 1000 −50 t (generation) t (generation) s11(t+1) 100 100 prediction −100

(t) (t) 0 50 100 150 0 0 11 12 t (generation) v X: 1000 v X: 1000 Y: 1.778e−23 Y: 2.104e−16 −100 −100 100 0 500 1000 0 500 1000 s12(t+1) t (generation) t (generation) prediction 100 50 initial position 50 trajectory (t) final position 0 12 x 0 X: 150 Y: 2 −50 −50 −100 −80 −60 −40 −20 0 0 50 100 150 x11(t) t (generation) (a) position and velocity (b) estimation of s(t + 1)

Figure 5.6: Optimizing f6, n = 2 with the search space origin at xo5

Figure 5.1b, Figure 5.2b, Figure 5.3b, Figure 5.4b, Figure 5.5b and Figure 5.6b show that

H(t, θˆ(t)) does a really good job at predicting s(t + 1). Moreover, Figure 5.1a, Figure 5.2a, Figure

5.3a, Figure 5.4a, Figure 5.5a and Figure 5.6a show that, moving the origin of the coordinates in Sx

∗0 ∗ to xo5 , the expected xa = xa + xo5 is reached. As mentioned before, these results do not tell in

entirety how well our adaptive PSO performs, especially when using N = 30 particles and running

the algorithm for tf = 1000 generations for a 2-dimensional problem. They only show that picking

the appropriate swarm size N and parameters k, η and γ, we can very well optimize the costs fa.

In the next chapter, we evaluate the performance of our adaptive PSO.

36 CHAPTER VI

PERFORMANCE EVALUATION

We compare our adaptive PSO to some other PSO algorithms in literature. As mentioned in

id the introductory paragraphs, Shi and Eberhart obtain their best results with set1 ω = 0.729,

id id  ϕ1 = ϕ2 = 1.494 for all i = 1, 2, ... , N and d = 1, 2, ... , n, N = 30, while forcing the ve-

locities to remain within Sv = Sx [30]. Trelea runs simulations with both Eberhart and Shi’s set1

and set2 (w = 0.6, ϕ1 = ϕ2 = 1.7) for N = 15, 30, 60 without confining positions and velocities to Sx and Sv respectively [31]. Both studies experiment with the Sphere, Rosenbrock, Rastrigin,

Griewank and Schaffer f6 functions with the same problem dimensions n as in Table 4.1. We recre-

n ate the same experiment. As in [30] and [31], the origin of the coordinates in Sx is kept to xo1 = 0 .

We run our adaptive PSO 20 times, with a maximum of tf = 10000 generations per run. We seek the same goals for the costs fa as in [30] and [31] (see Table 6.1). For each run and at each gen- eration, we compute the fitness achieved by the best particle in the swarm. If the desired fitness is reached then we stop the run and perform another one till we go through all 20 runs. It should be noted that we do not wait for the swarm to converge. Once the fitness of the best particle becomes less than the desired fitness (which is achieved when one particle evaluates a position with such

fitness) the algorithm is stopped. The number of generations needed every run is recorded. We also keep track of successful runs, meaning runs during which the desired goal is achieved. We compute the mean, median, maximum and minimum of the number of generations it took each run, as well as the success rate, which is defined as the fraction of the number of successful runs by the total

37 number of runs. Parameters ki, ηi and γi are randomly picked such that |kid| < 1, with kid 6= 0, and 0 < ηid < 2γid, with γid ≤ 1015. Our results as well as results reported in [31] are summarized in Table 6.1.

Table 6.1: Performance comparison

Number of generations to achieve goal Success rate fa Goal for fa N Average Median Maximum Minimum

2 2 2 2 2 set1 APSO set1 APSO set1 APSO set1 APSO set1 APSO 15 764 1 731 1 586 1 1275 1 1 1 Sphere 0.01 30 395 1 395 1 330 1 572 1 1 1 301 530 – 525 – 495 – 573 – 1 –

15 1430 1 729 1 452 1 9476 1 1 1 Rosenbrock 100 30 900 1 408 1 298 1 4642 1 1 1 301 669 – 621 – 402 – 1394 – 1 –

15 299 1 292 1 152 1 523 1 0.8 1 Rastrigin 100 30 182 1 174 1 123 1 299 1 0.95 1 301 213 – 200 – 161 – 336 – 1 –

15 755 1 608 1 470 1 1755 1 0.6 1 Griewank 0.1 30 365 1 361 1 319 1 455 1 0.9 1 301 313 – 308 – 282 – 366 – 1 –

15 1203 1 126 1 91 1 5853 1 0.4 1

Schaffer f6 0.00001 30 350 1 157 1 102 1 1264 1 0.6 1 301 532 – 321 – 94 – 2046 – 1 – 1 Best results reported by Eberhart and Shi [30]. 2 APSO stands for Adaptive PSO.

Table 6.1 shows that the adaptive PSO performs satisfactorily. For all five test functions, we only needed one generation or iteration to meet the desired fitness. What we can only take from this experiment, however, is how fast our optimizer leads to the best particle entering a certain region.

What Table 6.1 does not show is which algorithm ultimately is the best one. We are therefore

38 not making the argument that our algorithm converges the fastest to global minimum of the test functions used here. We have shown that our algorithm is prone to origin-bias. That might in fact be the reason why it converges so fast to the desired region, which, in the case of all five test functions used in this experiment, is the region around the origin of the search space Sx. Next, we investigate convergence to global minima.

Kadirkamanathan et al. and Gazi study PSO considering stochastic parameters. Based on [42], for stability (in our notation)

|ωi| < 1 such that ωi 6= 0 and   2 1 − 2|ωi| + ωi2 ϕi = ϕi + ϕi < , 1 2 1 + ωi

where i = 1, 2, ... , N. The parameter ϕi is referred to as maximum gain. A larger upperbound

derived by Gazi [13] is given by   27 1 − 2|ωi| + ωi2 0 ϕi < . 7 (1 + ωi)

We set up an experiment to compare our adaptive optimizer, an optimizer based on Eberhart and

Shi’s findings [30], an optimizer based on Trelea’s findings [31] and an optimizer based on Kadirka- manathan et al.’s findings [42]. We use Kadirkamanathan et al.’s results as opposed to Gazi’s since

i i0 ϕ < ϕ . For the same initial conditions, we perform the experiment for 20 runs of tf = 1000 generations each so as to compute the average fitness of the best particle over the total number of runs for all algorithms. It should be noted that KPSO stands for Kadirkamanathan et al. based

PSO, ESPSO stands for Eberhart and Shi based PSO and TPSO stands for Trelea based PSO.

The experiment is carried for a swarm population of N = 30 particles. The origin of the co-

n  Mx n  Mx n ordinates in Sx is kept at xo1 = 0 , then moved to xo2 = − 2 , xo3 = 2 and finally

39 > xo4 = [−Mx + 1, Mx − 1, − Mx + 1, ...] . Moreover, we also look into the size of the transient, meaning the furthest and closest particle to the position of the global minimum. The following

figures are obtained for all six benchmark figures used.

Furhtest particle

KPSO KPSO 40 3000 APSO APSO ESPSO 30 ESPSO: closest by 5.2943e−08 ESPSO TPSO TPSO 2500 global minimum 20 APSO: away by 0.11125 APSO: smallest fitness of 0 10 2000 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 1500 Closest particle

Average fitness KPSO 1000 APSO 10 APSO: closest by 5.5412e−22 ESPSO TPSO 500 5

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.1: Optimizing f1, n = 30 with the search space origin at xo1

Furhtest particle

KPSO 250 KPSO 4500 APSO APSO ESPSO 200 APSO: closest by 259.0438 ESPSO 4000 TPSO 150 TPSO global minimum 100 3500 ESPSO: smallest fitness of 1.5598e−15 50 3000 0

Average distance (zoomed in) 0 200 400 600 800 1000 2500 t (generation) Closest particle 2000 Average fitness 250 KPSO APSO: best fitness of 126.2475 1500 200 APSO TPSO: closest by 250.9333 ESPSO 150 1000 TPSO 100 APSO: away by 257.4902 500 50 0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.2: Optimizing f1, n = 30 with the search space origin at xo2

40 Furhtest particle 5000 KPSO 250 KPSO 4500 APSO APSO 200 ESPSO APSO: closest by 259.3922 ESPSO 4000 TPSO 150 TPSO global minimum 100 3500 TPSO: smallest fitness of 1.5803e−15 50 3000 0

Average distance (zoomed in) 0 200 400 600 800 1000 2500 t (generation) Closest particle 2000 Average fitness 250 KPSO APSO: best fitness of 189.1865 1500 200 APSO TPSO: closest by 254.7799 ESPSO 150 1000 TPSO 100 APSO: away by 258.2926 500 50 0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.3: Optimizing f1, n = 30 with the search space origin at xo3

Furhtest particle

16000 600 KPSO KPSO APSO APSO 14000 ESPSO 400 APSO: closest by 513.6593 ESPSO TPSO TPSO global minimum 12000 200 ESPSO: smallest fitness of 1.9732e−14 10000 0

Average distance (zoomed in) 0 200 400 600 800 1000 8000 t (generation) Closest particle

Average fitness 6000 500 KPSO APSO: best fitness of 0.99456 400 APSO TPSO: closest by 506.4053 ESPSO 4000 300 TPSO 200 2000 APSO: away by 513.4212 100 0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.4: Optimizing f1, n = 30 with the search space origin at xo4

41 6 x 10 Furhtest particle

12 KPSO 100 KPSO APSO APSO ESPSO 80 TPSO: closest by 5.3278 ESPSO 10 TPSO 60 TPSO global minimum 40 APSO: away by 5.5603 APSO: smallest fitness of 1.311 8 20 0

Average distance (zoomed in) 0 200 400 600 800 1000 6 t (generation) Closest particle 15 Average fitness KPSO 4 APSO 10 APSO: closest by 4.9051 ESPSO TPSO 2 5

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.5: Optimizing f2, n = 30 with the search space origin at xo1

7 x 10 Furhtest particle

4.5 KPSO KPSO APSO 60 APSO 4 ESPSO ESPSO: closest by 72.4963 ESPSO TPSO 40 TPSO 3.5 global minimum APSO: away by 74.1711 20 3 ESPSO: smallest fitness of 0.25508 0

2.5 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 2 Closest particle

Average fitness KPSO APSO: best fitness of 89167.5414 1.5 60 APSO TPSO: closest by 70.4952 ESPSO 1 40 TPSO APSO: away by 72.3672 0.5 20

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.6: Optimizing f2, n = 30 with the search space origin at xo2

42 6 x 10 Furhtest particle

KPSO KPSO 18 APSO 60 APSO ESPSO TPSO: closest by 72.4056 ESPSO 16 TPSO 40 TPSO global minimum 14 APSO: away by 73.0555 20 TPSO: smallest fitness of 2.0364 12 0

Average distance (zoomed in) 0 200 400 600 800 1000 10 t (generation) Closest particle 8 Average fitness KPSO APSO: best fitness of 10.1753 6 60 APSO TPSO: closest by 70.4638 ESPSO 4 40 TPSO APSO: away by 72.0412 2 20

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.7: Optimizing f2, n = 30 with the search space origin at xo3

8 x 10 Furhtest particle

KPSO 150 KPSO APSO 2 APSO ESPSO APSO: closest by 150.4888 100 ESPSO TPSO TPSO global minimum 50 1.5 ESPSO: smallest fitness of 1.3443 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 1 Closest particle

Average fitness 150 KPSO APSO: best fitness of 51.8451 APSO 100 KPSO: closest by 147.6594 ESPSO 0.5 TPSO

50 APSO: away by 150.3392

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.8: Optimizing f2, n = 30 with the search space origin at xo4

43 Furhtest particle

2 15 KPSO KPSO APSO APSO ESPSO 10 TPSO: closest by 0.11406 ESPSO 1.5 TPSO TPSO global minimum 5 APSO: away by 1.6404 APSO: smallest fitness of 4.6746e−17 1 0

Average distance (zoomed in) 0 200 400 600 800 1000 0.5 t (generation) Closest particle

6 Average fitness KPSO 0 APSO 4 APSO: closest by 3.4186e−18 ESPSO TPSO −0.5 2

0 −1

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.9: Optimizing f3, n = 30 with the search space origin at xo1

Furhtest particle

2 KPSO 80 KPSO APSO APSO ESPSO 60 ESPSO: closest by 85.0392 ESPSO 1.5 TPSO TPSO global minimum 40 APSO: away by 85.1792 ESPSO: smallest fitness of 0.062218 20 1 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 0.5 Closest particle

Average fitness 80 KPSO APSO: best fitness of 0.47381 0 APSO 60 KPSO: closest by 81.7577 ESPSO TPSO 40 −0.5 APSO: away by 84.6497 20

−1 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.10: Optimizing f3, n = 30 with the search space origin at xo2

44 Furhtest particle

2 KPSO 80 KPSO APSO APSO ESPSO 60 TPSO: closest by 85.0253 ESPSO 1.5 TPSO TPSO global minimum 40 APSO: away by 85.0525 ESPSO: smallest fitness of 0.08718 20 1 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 0.5 Closest particle

Average fitness 80 KPSO APSO: best fitness of 0.50546 0 APSO 60 TPSO: closest by 81.939 ESPSO TPSO 40 −0.5 APSO: away by 84.3079 20

−1 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.11: Optimizing f3, n = 30 with the search space origin at xo3

Furhtest particle

KPSO 1 150 APSO APSO: closest by 170.8474 ESPSO 100 TPSO KPSO 0.8 APSO 50 APSO: smallest fitness of 1.046 ESPSO TPSO 0

0.6 global minimum Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) Closest particle

Average fitness 0.4 150 KPSO APSO KPSO: closest by 162.0123 ESPSO 100 TPSO 0.2 50 APSO: away by 169.239

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.12: Optimizing f3, n = 30 with the search space origin at xo4

45 Furhtest particle

4 25 KPSO KPSO APSO 3 APSO ESPSO APSO: closest by 0.256 ESPSO TPSO 2 TPSO 20 global minimum 1

APSO: smallest fitness of 0 0

15 −1

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) Closest particle 10 Average fitness 1.5 KPSO 1 APSO APSO: closest by 7.3497e−12 ESPSO 5 0.5 TPSO 0 −0.5 0 −1

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.13: Optimizing f4, n = 30 with the search space origin at xo1

Furhtest particle

15 KPSO KPSO APSO 30 APSO ESPSO 10 ESPSO: closest by 13.3163 ESPSO TPSO TPSO global minimum 25 5 APSO: away by 13.6297 ESPSO: smallest fitness of 3.1601 0 20

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 15 Closest particle

Average fitness APSO: best fitness of 4.745 KPSO 10 APSO 10 ESPSO: closest by 12.9238 ESPSO TPSO 5 5 APSO: away by 13.4593

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.14: Optimizing f4, n = 30 with the search space origin at xo2

46 Furhtest particle

15 30 KPSO KPSO APSO APSO ESPSO 10 TPSO: closest by 13.3854 ESPSO TPSO 25 TPSO global minimum 5 APSO: away by 13.5105 ESPSO: smallest fitness of 3.0865 20 0

Average distance (zoomed in) 0 200 400 600 800 1000 15 t (generation) Closest particle

Average fitness KPSO 10 APSO: best fitness of 5.4756 APSO 10 TPSO: closest by 13.043 ESPSO TPSO 5 5 APSO: away by 13.3473

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.15: Optimizing f4, n = 30 with the search space origin at xo3

Furhtest particle

40 KPSO 20 KPSO APSO APSO 35 ESPSO 15 APSO: closest by 21.3272 ESPSO TPSO TPSO global minimum 10 30 APSO: smallest fitness of 2.8808 5 25 0

Average distance (zoomed in) 0 200 400 600 800 1000 20 t (generation) Closest particle

Average fitness 15 20 KPSO APSO 10 15 APSO: closest by 21.1737 ESPSO TPSO 10 5 5 0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.16: Optimizing f4, n = 30 with the search space origin at xo4

47 Furhtest particle

35 KPSO 300 KPSO APSO APSO ESPSO ESPSO: closest by 0.020703 ESPSO 30 TPSO 200 TPSO global minimum APSO: away by 2.0364 100 25 APSO: smallest fitness of 0

0

20 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) Closest particle 15 Average fitness KPSO 80 APSO 10 60 APSO: closest by 6.6584e−10 ESPSO TPSO 5 40 20 0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.17: Optimizing f5, n = 30 with the search space origin at xo1

Furhtest particle

60 KPSO 1500 KPSO APSO APSO ESPSO ESPSO: closest by 1556.0331 ESPSO 50 TPSO 1000 TPSO global minimum APSO: away by 1559.9389 500 40 ESPSO: smallest fitness of 0.0014847 0

Average distance (zoomed in) 0 200 400 600 800 1000 30 t (generation) Closest particle

Average fitness 1500 APSO: best fitness of 0.82397 KPSO 20 APSO TPSO: closest by 1523.8665 1000 ESPSO TPSO 10 500 APSO: away by 1550.5819

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.18: Optimizing f5, n = 30 with the search space origin at xo2

48 Furhtest particle

45 KPSO 1500 KPSO APSO APSO ESPSO ESPSO: closest by 1556.4844 ESPSO 40 1000 TPSO TPSO global minimum 35 500 APSO: away by 1557.2753 TPSO: smallest fitness of 9.999e−05 30 0

Average distance (zoomed in) 0 200 400 600 800 1000 25 t (generation) Closest particle 20 Average fitness 1500 KPSO APSO: best fitness of 0.059009 15 APSO KPSO: closest by 1491.7627 1000 ESPSO 10 TPSO

5 500 APSO: away by 1547.1226

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.19: Optimizing f5, n = 30 with the search space origin at xo3

Furhtest particle

KPSO 3000 KPSO 120 APSO APSO ESPSO TPSO: closest by 3108.1319 ESPSO 2000 TPSO TPSO global minimum 100 1000 APSO: away by 3108.4626 ESPSO: smallest fitness of 0.00017748

80 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 60 Closest particle

Average fitness 3000 KPSO APSO: best fitness of 0.034203 40 APSO TPSO: closest by 3057.0231 2000 ESPSO TPSO 20 1000 APSO: away by 3107.8968

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.20: Optimizing f5, n = 30 with the search space origin at xo4

49 Furhtest particle 20 KPSO KPSO 0.02 APSO 15 APSO ESPSO ESPSO: closest by 0.018649 ESPSO TPSO 10 TPSO global minimum APSO: away by 0.081481 5 0.015 APSO: smallest fitness of 0

0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) 0.01 Closest particle

Average fitness 1.5 KPSO 1 APSO APSO: closest by 6.0956e−12 ESPSO 0.005 0.5 TPSO 0 −0.5 0 −1

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.21: Optimizing f6, n = 30 with the search space origin at xo1

Furhtest particle

KPSO KPSO APSO 60 APSO ESPSO ESPSO: closest by 66.9988 ESPSO 0.02 TPSO 40 TPSO global minimum APSO: away by 67.0358 20 APSO: smallest fitness of 6.3912e−08 0.015 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) Closest particle 0.01 Average fitness 60 KPSO APSO KPSO: closest by 24.2965 ESPSO 40 0.005 TPSO

20 APSO: away by 64.6515

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.22: Optimizing f6, n = 30 with the search space origin at xo2

50 Furhtest particle

0.018 KPSO KPSO APSO 60 APSO 0.016 ESPSO ESPSO: closest by 66.8589 ESPSO TPSO 40 TPSO 0.014 global minimum APSO: away by 67.2139 20 ESPSO: smallest fitness of 1.5181e−10 0.012 0

0.01 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) Closest particle 0.008 Average fitness KPSO APSO: best fitness of 0.00051015 60 0.006 APSO KPSO: closest by 15.728 ESPSO 40 0.004 TPSO APSO: away by 64.7886 0.002 20

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.23: Optimizing f6, n = 30 with the search space origin at xo3

Furhtest particle

KPSO KPSO APSO APSO ESPSO 100 ESPSO: closest by 132.6383 ESPSO 0.02 TPSO TPSO global minimum 50 APSO: away by 132.7095 ESPSO: smallest fitness of 1.5181e−10 0.015 0

Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) Closest particle 0.01 Average fitness KPSO APSO: best fitness of 2.5568e−05 100 APSO KPSO: closest by 83.5712 ESPSO 0.005 TPSO 50 APSO: away by 132.5711

0 0

0 200 400 600 800 1000 Average distance (zoomed in) 0 200 400 600 800 1000 t (generation) t (generation)

(a) convergence (b) distance to global minimum

Figure 6.24: Optimizing f6, n = 30 with the search space origin at xo4

i i i It is right to mention that Kadirkamanathan and al.’s study tells us how to pick ω , ϕ1 and ϕ2 to achieve stability and not optimal performance. However, both our adaptive PSO and the PSO based on Kadirkamanathan and al.’s findings are results of theoretical derivations. On that point, we can

51 say that our adaptive optimizer performs better than the optimizer based on Kadirkamanathan et al.’s derivations. Looking at Figures 6.1 through 6.24, for the most part, the TPSO and the ESPSO, perform better than our optimizer, which fairs not too badly. As mentioned before, finding a way to incorporate , k1, k2 and k3 might lead to better results.

52 CHAPTER VII

CONCLUSION

Building on the studies in [42] and [44], we develop an adaptive particle swarm optimizer APSO.

We start off by devising an error system in Chapter II and proceed using discrete-time system adap- tive control tools to drive it to zero. The designed control law u(t) in (3.3) features a function approximator used in this work as a predictor. Using a Lyapunov based approach [45] and LaSalle-

Yoshizawa theorem [44], we show in Chapter III that our devised error system is uniformly bounded, ultimately goes to zero and consequently our optimizer is stable. Because, our proof is based on

Lyapunov Direct method, our derivations are therefore conservative and violation of our results does not imply instability.

7.1 APSO Characteristics

Our optimizer features new control parameters k, γ and η instead of ω, ϕ1 and ϕ2 as does the

inertia factor PSO variant from which we started from. It also necessitates saturating particles’

positions and velocities so as to keep them respectively within the search space Sx and velocity

space Sv. In general, for all six test functions, our best results are obtained for high values of γ

and η, picked such that 0 < ηid < 2γid, for i = 1, 2, ... , N and d = 1, 2, ... , n, where N is the

number of swarm particles and n is the dimension space. Parameter k, which has to picked such

that 1 < kid < 1 and kid 6= 0n, seems to have little effect on the adaptive PSO performance so long

53 as its absolute value is not too big (too close to 1) or too small (too close to 0). The best results were even obtained when picking k randomly so as to have a variety aScross the swarm.

7.2 On Being Biased

∗ We performed a Center Offset experiment by moving the optimum location xa to different loca- tions inside the search space. For every test functions in Chapter IV, the best average performance of the best particle(s) over 100 runs is presented in Table 5.1. The APSO performs differently de- pending on the position of the optimum. The best results are obtained when the optimum is near the

n origin 0 or the bounds of the solution space Sx.

7.3 Testing the Predictor

We investigate a 2-dimensional, 30-particle APSO swarm. What we are interested about is whether or not the designed predictor H(t, θˆ(t)), given in (3.20), is able to predict the uncertainty

s(t + 1). The parameter estimate θˆ(t) is updated using the normalized gradient update law [44]

given in (3.22). Remember that s(t + 1) starts out being random; but because, over time, particles

are attracted towards the best one(s), s(t + 1) → g = lim g(t), we are able to approximate it. Plots t→∞ (Figure 5.1b, Figure 5.2b, Figure 5.3b, Figure 5.4b, Figure 5.5b and Figure 5.6b) showing H(t, θˆ(t)) and s(t+1) on the same figure, for the test functions used, attest to the predictor working pleasingly.

7.4 APSO Performance

The Adaptive PSO is put through the experiment in [30] and [31]. We do not wait for particles to collapse to a single point but rather only consider the best particle(s). As shown in Table 6.1, we obtain better results than any other algorithm. However, we do acknowledge that such results might be linked to the fact that our optimizer is origin-biased.

54 For convergence comparison, we devise an experiment that compares the fitness of the best particle. We put to test our optimizer, an optimizer based on Kadirkamanathan and al.’s theoretical derivations (KPSO) [42], an optimizer based on Eberhart and Shi’s empirical findings (ESPSO) [30] and an optimizer based on Trelea findings (TPSO) [31]. Results are shown on Figures 6.1 through

6.24. On one hand, albeit Kadirkamanathan and al. paper only address the issue of stability and not PSO performance, both APSO and KPSO are based on theoretical derivations and for the test functions used, the APSO performs better than the KPSO. On the other, even though the APSO does perform satisfactorily, in general, it does not outdo the ESPSO and the TPSO, which for the most part are based on empirical studies in the sense that the authors of [30] and [31] do not really tell us how ω, ϕ1 and ϕ2 are obtained.

7.5 Future Work

Further testing and research would help achieve fine tuning of the proposed adaptive optimizer.

Remember that throughout this work our control parameters k, η and γ are picked randomly, though, having experimented with the algorithm, we do offer suggestions on how to pick those control parameters. As stated earlier, what can be done in the future would be to devise a control algorithm that designs for , k1, k2 and k3 to keep particles positions and velocities inside Sx and Sv instead of saturating xi and vi so as to avoid particles positions and velocities leaving search areas. The design of experiments approach, as done in [22], can also be applied here so as to get more insights on how k, η and γ affect the APSO performance. Additionally, we can look into how to use projection

i i instead of saturation to keep x and v is respectively Sx and Sv.

55 BIBLIOGRAPHY

[1] T. Back,¨ Evolutionary algorithms in theory and practice - evolution strategies, , genetic algorithms. Oxford University Press, 1996.

[2] T. Back,¨ D. Fogel, and Z. Michalewicz, Eds., Handbook of Evolutionary Computation. New York, NY: Institute of Physics Publishing Ltd, Bristol and Oxford University Press, 1997.

[3] D. A. Ashlock, Evolutionary computation for modeling and optimization. Springer, 2006.

[4] K. N. Krishnanand and D. Ghose, “Glowworm swarm based optimization algorithm for mul- timodal functions with collective robotics applications.” Multiagent and Grid Systems, vol. 2, no. 3, pp. 209–222, 2006.

[5] D. Karaboga and B. Basturk, “A powerful and efficient algorithm for numerical function op- timization: artificial bee colony (ABC) algorithm,” J. of , vol. 39, no. 3, pp. 459–471, Nov. 2007.

[6] H. Shah-Hosseini, “The intelligent water drops algorithm: a nature-inspired swarm-based op- timization algorithm.” IJBIC, vol. 1, no. 1/2, pp. 71–79, 2009.

[7] R. Eberhart and J. Kennedy, “A new optimizer using particle swarm theory,” in Micro Machine and Human Science, 1995. MHS ’95., Proceedings of the Sixth International Symposium on, oct 1995, pp. 39–43.

[8] J. Kennedy and R. Eberhart, “Particle swarm optimization,” in Proceedings of the IEEE Inter- national Joint Conference on Neural Networks, IEEE Press, 1995, pp. 1942–1948.

[9] J. Kennedy, “The behavior of particles,” in Proceedings of the 7th International Conference on Evolutionary Programming VII, ser. EP ’98. London, UK, UK: Springer-Verlag, 1998, pp. 581–589.

[10] ——, “Minds and cultures: Particle swarm implications for beings in sociocognitive space.” Adaptive Behaviour, vol. 7, no. 3-4, pp. 269–287, 1999.

[11] R. Eberhart and Y. Shi, “Comparison between genetic algorithms and particle swarm opti- mization,” in Proceedings of the 7th International Conference on Evolutionary Programming VII, ser. EP ’98. London, UK, UK: Springer-Verlag, 1998, pp. 611–616.

56 [12] A. Carlisle and G. Dozler, “Tracking changing extrema with adaptive particle swarm opti- mizer,” in Automation Congress, 2002 Proceedings of the 5th Biannual World, vol. 13, 2002, pp. 265–270.

[13] V. Gazi, “Stochastic stability analysis of the particle dynamics in the pso algorithm,” in Intel- ligent Control (ISIC), 2012 IEEE International Symposium on, oct. 2012, pp. 708–713.

[14] Y. Shi and R. Eberhart, “Empirical study of particle swarm optimization,” in Evolutionary Computation, 1999. CEC 99. Proceedings of the 1999 Congress on, vol. 3, 1999, pp. 3 vol. (xxxvii+2348).

[15] P. Angeline, “Evolutionary optimization versus particle swarm optimization: Philosophy and performance differences,” in Proceedings of the 7th International Conference on Evolutionary Programming VII, ser. EP ’98. London, UK, UK: Springer-Verlag, 1998, pp. 601–610.

[16] ——, “Using selection to improve particle swarm optimization,” in Evolutionary Computation Proceedings, 1998. IEEE World Congress on Computational Intelligence., The 1998 IEEE International Conference on, 1998, pp. 84–89.

[17] R. Eberhart and X. Hu, “Human tremor analysis using particle swarm optimization,” in Evolu- tionary Computation, 1999. CEC 99. Proceedings of the 1999 Congress on, vol. 3, 1999, pp. –1930 Vol. 3.

[18] B. Brandstatter and U. Baumgartne, “Particle swarm optimization - mass-spring system anal- ogon,” Magnetics, IEEE Transactions on, vol. 38, no. 2, pp. 997–1000, 2002.

[19] A. Cockshott and B. Hartman, “Improving the fermentation medium for echinocandin b pro- duction part ii: Particle swarm optimization,” Process Biochemistry, vol. 36, no. 7, pp. 661 – 669, 2001.

[20] R. Eberhart. and Y. Shi, “Particle swarm optimization: developments, applications and re- sources,” in Evolutionary Computation, 2001. Proceedings of the 2001 Congress on, vol. 1, 2001, pp. 81–86 vol. 1.

[21] R. Eberhart, P. Simpson, and R. Dobbins, Computational Intelligence PC Tools, first ed. Aca- demic Press Professional, 1996.

[22] T. Beielstein, K. Parsopoulos, and M. Vrahatis, “Tuning pso parameters through sensitivity analysis,” 2002.

[23] A. Carlisle and G. Dozier, “Adapting particle swarm optimization to dynamic environments,” in Proceedings of International Conference on Artificial Intelligence, ICAI2000, Las vegas, Nevada, USA, June 2000, pp. 429–434.

[24] ——, “An off-the-shelf pso,” in Proceedings of the Workshop on Particle Swarm Optimization, Indianapolis, USA, 2001.

57 [25] J. Kennedy, “The particle swarm: social adaptation of knowledge,” in Evolutionary Computa- tion, 1997., IEEE International Conference on, apr 1997, pp. 303–308.

[26] S. Naka, T. Genj, T. Yura, and Y. Fukuyama, “A hybrid particle swarm optimization for distri- bution state estimation,” in Power Engineering Society General Meeting, 2003, IEEE, vol. 2, july 2003, p. 4 vol. 2666.

[27] Y. Shi and R. Eberhart, “A modified particle swarm optimizer,” in Evolutionary Computation Proceedings, 1998. IEEE World Congress on Computational Intelligence., The 1998 IEEE International Conference on, may 1998, pp. 69–73.

[28] ——, “Parameter selection in particle swarm optimization,” in Proceedings of the 7th Inter- national Conference on Evolutionary Programming VII, ser. EP ’98. London, UK, UK: Springer-Verlag, 1998, pp. 591–600.

[29] H. Fan and Y. Shi, “Study on vmax of particle swarm optimization,” in Proceedings of IEEE Swarm Intelligence Symposium (SIS–2001)., 2003.

[30] R. Eberhart and Y. Shi, “Comparing inertia weights and constriction factors in particle swarm optimization,” in Evolutionary Computation, 2000. Proceedings of the 2000 Congress on, vol. 1, 2000, pp. 84–88 vol.1.

[31] I. C. Trelea, “The particle swarm optimization algorithm: Convergence analysis and parameter selection,” Information Processing Letters, vol. 85, pp. 317–325, 2003.

[32] M. Clerc, “Think locally, act locally: The way of life of cheap-pso, an adaptive pso,” 2001.

[33] Y.Shi and R. Eberhart, “Fuzzy adaptive particle swarm optimization,” in Evolutionary Com- putation, 2001. Proceedings of the 2001 Congress on, vol. 1, 2001, pp. 101–106 vol. 1.

[34] P. Suganthan, “Particle swarm optimiser with neighbourhood operator,” in Evolutionary Com- putation, 1999. CEC 99. Proceedings of the 1999 Congress on, vol. 3, 1999, pp. –1962 Vol. 3.

[35] G. Venter and J. Sobieszczanski-Sobieski, “Multidisciplinary optimization of a transport air- craft wing using particle swarm optimization,” Structural and Multidisciplinary Optimization, vol. 26, no. 1-2, pp. 121–131, 2004.

[36] H. Yoshida, K. Kawata, Y. Fukuyama, S. Takayama, and Y. Nakanishi, “A particle swarm optimization for reactive power and voltage control considering voltage security assessment,” in Power Engineering Society Winter Meeting, 2001. IEEE, vol. 2, 2001, pp. 498 vol.2–.

[37] M. Clerc and J. Kennedy, “The particle swarm – exploxion, stability, and convergence in a multidimensional complex space,” IEEE Trans. on Evolutionary Computation, vol. 6, no. 1, pp. 58–73, February 2002.

58 [38] E. Ozcan and C. Mohan, “Analysis of a simple particle of a simple particle swarm optimization system,” in Intelligent Engineering Systems Through Artificial Neural Networks (ANNIE–98), 1998, pp. 253–258.

[39] ——, “Particle swarm optimization: Surfing the waves,” IEEE Congress on Evolutionary Computation, pp. 1939–1944, 1999.

[40] F. V. D. Bergh, “An analysis of particle swarm optimizers,” Ph.D. dissertation, Pretoria, South Africa, South Africa, 2002.

[41] F. V. D. Bergh and A. P. Engelbrecht, “A study of particle swarm optimization particle trajec- tories,” Information Sciences, no. 176, pp. 937–971, February 2006.

[42] V. Kadirkamanathan, K. Selvarajah, and P. J. Fleming, “Stability analysis of the particle dynamics in particle swarm optimizer,” Evolutionary Computation, IEEE Transactions on, vol. 10, no. 3, pp. 245–255, june 2006.

[43] M. Clerc, “The swarm and the queen: towards a deterministic and adaptive particle swarm optimization,” in Evolutionary Computation, 1999. CEC 99. Proceedings of the 1999 Congress on, vol. 3, 1999, pp. –1957 Vol. 3.

[44] J. T. Spooner, M. Maggiore, R. Ordo´nez,˜ and K. M. Passino, Stable Adaptive Control and Estimation for Nonlinear Systems: Neural and Fuzzy Approximation Techniques. New York, NY, USA: John Wiley & Sons, Inc., 2001.

[45] M. Vidyasagar, Nonlinear systems analysis (2nd ed.). Upper Saddle River, NJ, USA: Prentice- Hall, Inc., 1992.

[46] D. Gehlhaar and D. Fogel, “Tuning evolutionary programming for conformationally flexible molecular docking.” in Evolutionary Programming, 1996, pp. 419–429.

[47] P. Angeline, “Using selection to improve particle swarm optimization,” in Evolutionary Com- putation Proceedings, 1998. IEEE World Congress on Computational Intelligence., The 1998 IEEE International Conference on, 1998, pp. 84–89.

[48] C. Monson and K. Seppi, “Exposing origin-seeking bias in pso,” in Proceedings of the 2005 conference on Genetic and evolutionary computation, ser. GECCO ’05. New York, NY, USA: ACM, 2005, pp. 241–248.

59 APPENDIX A

MATLAB CODE FOR ADAPTIVE PSO

1.1 Main program

%% Gradient update adaptive PSO % (particles aren’t allowed to leave the search space) % Author: Ouboti Djaneye−Boundjou

close all; clear all; clc;

global center upperBound globalMin

% Define parameter r u n time=1000; %numberof generations N=30; %numberofparticles

% functions to minimize (f1 = sphere = 1, f2 = rosenbrock = 2, % f3 = ackley = 3, f4 = rastringin = 4, f5 = griewank = 5, % f6 = schaffer’s = 6) f c t = 1 ;

% dimension of each particle or objective function i f f c t == 6 D = 2 ; e l s e D = 3 0 ; end

setUpperbound(fct); % define the search space

% a priori knowledge of the region where the optimum is: −S < optimum d < S % on each dimension (optimum d is the value of the optimum on dimension d) S = upperBound;

60 V = upperBound;

% set origin of search space (modify as needed) center = zeros(D,1); for cc = 1 : length(center) if mod(cc,2) center(cc) = 0; e l s e center(cc) = 0; end end

% set inertia factor imax = 2∗ randi(100,1,1); w = 2∗(randi(imax,D,N) /(imax)) −1; c l e a r imax

% approximation error upperbound L = zeros(D,N);%2∗S∗ ones (D,N) ;

% set k, gamma and eta (eta = nu) imax = randi(100,1,1); k = 2∗(randi(imax,D,N) /(imax+1)) −1; c l e a r imax %gamma = randi(10ˆ7,D,N); gamma = [randi([10ˆ0 10ˆ1],D,floor(N/15)) ... randi([10ˆ1 10ˆ2],D,floor(N/15)) randi([10ˆ2 10ˆ3],D,floor(N / 1 5 ) ) . . . randi([10ˆ3 10ˆ4],D,floor(N/15)) randi([10ˆ4 10ˆ5],D,floor(N / 1 5 ) ) . . . randi([10ˆ5 10ˆ6],D,floor(N/15)) randi([10ˆ6 10ˆ7],D,floor(N / 1 5 ) ) . . . randi([10ˆ7 10ˆ8],D,floor(N/15)) randi([10ˆ8 10ˆ9],D,floor(N / 1 5 ) ) . . . randi([10ˆ9 10ˆ10],D,floor(N/15)) randi([10ˆ10 10ˆ11],D,floor (N/ 1 5 ) ) . . . randi([10ˆ11 10ˆ12],D,floor(N/15)) ... randi([10ˆ12 10ˆ13],D,floor(N/15)) ... randi([10ˆ13 10ˆ14],D,floor(N/15)) ... randi([10ˆ14 10ˆ15],D,N−14∗ floor(N/15))]; nu = (randi(100,D,N)/(100+1)). ∗ ( 2 ∗ gamma ) ;

% initial conditions x0 = (2∗ rand (D,N) −1)∗S; v0 = (2∗ rand (D,N) −1)∗V; x = zeros(D,N,run t i m e +1) ;

61 v = zeros(D,N,run t i m e +1) ; x(:,:,1) = x0; v(:,:,1) = v0;

%% Run system

for tt =1 : run t i m e

% compute personal and global bests i f t t == 1 pbest(:,:,tt) = x0; f = objF(pbest(:,:,tt),fct); idx = find(f == min(f)); gbest(:,:, tt) = repmat(pbest(:,idx(1),tt),1,N); c l e a r f i d x e l s e f = objF(pbest(:,:,tt −1) , f c t ) ; g = objF(x(:,:,tt),fct); idx = find((f−g ) >0) ; pbest(:,idx,tt) = x(:,idx,tt); c l e a r i d x idx = find((f−g ) <=0) ; pbest(:,idx,tt) = pbest(:,idx,tt −1) ; c l e a r f g i d x f = objF(pbest(:,:,tt),fct); idx = find(f == min(f)); b e s t pos = [pbest(:,idx(1),tt),gbest(:,1,tt −1) ] ; c l e a r f i d x f = objF(best p o s , f c t ) ; idx = find(f == min(f)); gbest(:,:,tt) = repmat(best pos(:,idx(1)) ,1,N); clear f idx best p o s end

% generate phi1 and phi2 imax = randi(100,1,1); phi = randi(imax,D,N); c l e a r imax imax = randi(100,1,1); phi1 = (randi(imax,D,N)/(imax+1)). ∗ p h i ; c l e a r imax phi2 = phi−phi1 ;

% compute s(t) = pg(t) pg(:,:,tt) = (phi1. ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt))./phi;

62 % partial derivatives of the estimate dFp = pbest(:,:,tt); dFg = gbest(:,:,tt);

% compute the error z1 = x(:,:,tt)−v ( : , : , t t ) ; z2 = x(:,:,tt); e = pg(:,:,tt)−z2 ; i f t t == 1 e previous = zeros(D,N); end

% compute signal q(t) q = −e+k . ∗ e p r e v i o u s ; qbar = deadZone(q,L); % because L = 0, using the deadzone modification % isn’t necessary: qbar = q if L = 0.

% compute parameter estimates i f t t == 1 t h e t a f hatp(:,:,tt) = zeros(D,N); t h e t a f hatg(:,:,tt) = zeros(D,N); e l s e t h e t a f hatp(:,:,tt) = thetaf hatp(:,:,tt −1)−(nu . ∗ dFp . ∗ qbar) ./(... 1+gamma . ∗ (sqrt(dFp.ˆ2+dFg.ˆ2)).ˆ2); t h e t a f hatg(:,:,tt) = thetaf hatg(:,:,tt −1)−(nu . ∗ dFg . ∗ qbar) ./(... 1+gamma . ∗ (sqrt(dFp.ˆ2+dFg.ˆ2)).ˆ2); end

% compute estimate F(:,:,tt) = thetaf hatp(:,:,tt). ∗ dFp+ t h e t a f hatg(:,:,tt). ∗ dFg ;

% compute controller u(:,:,tt) = phi. ∗ e ; a l p h a = w. ∗ z1 −(1+w) . ∗ z2−p h i . ∗ e ; U s = alpha −k . ∗ e ; U = F(:,:,tt)+U s ; u new(:,:,tt) = u(:,:,tt)+U;

% velocity and position updates v(:,:,tt+1) = w. ∗ v(:,:,tt)+u new(:,:,tt); idv = find(abs(v) > V); v(idv) = sign(v(idv)) ∗V;

63 x(:,:,tt+1) = x(:,:,tt)+v(:,:,tt+1); idx = find(abs(x) > S); x(idx) = sign(x(idx)) ∗S; if sign(x(idx)) == sign(v(idx)) v ( i d x ) = −rand(size(idx ,1) ,size(idx ,2)). ∗ v ( i d x ) ; end clear idx idv

e previous = e; c l e a r e dF q q bar z1 z2 alpha U s U end

%% State plots for nn = 1 : N% change to look at single particle or whole swarm

for tt =0 : run t i m e xpos(tt+1) = x(1,nn,tt+1); ypos(tt+1) = x(2,nn,tt+1); xvel(tt+1) = v(1,nn,tt+1); yvel(tt+1) = v(2,nn,tt+1); end

f i g u r e subplot(3,2,1), plot(0:run time ,xpos,’b’,’linewidth ’,2); grid; ylabel(’xˆ { 1 1 } (t)’);xlabel(’t (generation)’) %title ([’Particle ’,num2str(nn)]) subplot(3,2,2), plot(0:run time ,ypos,’r’,’linewidth ’,2); grid; ylabel(’xˆ { 1 2 } (t)’);xlabel(’t (generation)’) subplot(3,2,3), plot(0:run time ,xvel ,’m’,’linewidth ’,2); grid; ylabel(’vˆ { 1 1 } (t)’);xlabel(’t (generation)’) subplot(3,2,4), plot(0:run time ,yvel,’c’,’linewidth ’,2); grid; ylabel(’vˆ { 1 2 } (t)’);xlabel(’t (generation)’) subplot(3,2,5:6) , plot(xpos(1) ,ypos(1) ,’ks’,xpos,ypos,’g’ ,... xpos(end) ,ypos(end) ,’ro’,’linewidth ’,2); x l a b e l ( ’ x ˆ { 1 1 } (t)’); ylabel(’xˆ { 1 2 } ( t ) ’ ) grid; legend(’initial position ’, ’trajectory ’, ’final position ’ ,... ’Location ’,’NorthEastOutside ’)

end

%% Uncertainty prediction window = 150; % number of values to plots for nn = 5%1 : N

for tt =1 : run t i m e

64 Xprediction(tt) = F(1,nn,tt); Yprediction(tt) = F(2,nn,tt); actualX(tt) = pg(1,nn,tt); actualY(tt) = pg(2,nn,tt); end

f i g u r e subplot(2,1,1) , plot(0:window,[actualX(2:window+2) ’ ,... Xprediction(1:window+1) ’],’linewidth ’ ,1.4) ; xlabel(’t (generation) ’) grid; legend(’sˆ { 1 1 } (t+1)’,’prediction ’) %title([’Particle ’,num2str(nn), ’: pbest and gbest combo’ ]) subplot(2,1,2) , plot(0:window,[actualY(2:window+2) ’ ,... Yprediction(1:window+1) ’],’linewidth ’ ,1.4) ; xlabel(’t (generation) ’) grid; legend(’sˆ { 1 2 } (t+1)’,’prediction ’)

end

To reproduce Figures 5.1 through 5.6, use the ’States plots’ and ’Uncertainty prediction’ portion of the above code. 1.2 Functions used

1.2.1 Search space set up

%% This function sets the upperbound Mx depending on what function is used % Author: Ouboti Djaneye−Boundjou

function setUpperbound(fct)

global upperBound

s w i t c h f c t c a s e 1 upperBound = 100; c a s e 2 upperBound = 30; c a s e 3 upperBound = 32.768; c a s e 4 upperBound = 5.12; c a s e 5 upperBound = 600;

65 c a s e 6 upperBound = 100; o t h e r w i s e disp(’Function is not defined ’); r e t u r n end

1.2.2 Computing the fitness

%% Objectif or test functions % Author: Ouboti Djaneye−Boundjou

function y = objF(x,fct)

global center fMin globalMin

[d1, d2] = size(x); y = zeros(1,d2); z = x−repmat(center ,1,d2);

s w i t c h f c t c a s e 1 %%% Dejong’s function I or Sphere (range: −100 t o 100) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; y = sum(z.ˆ2, 1); c a s e 2 %%% Rosenbrock’s valley or Dejong function II ( range: −30 t o %%% 30). Global minimum f(z) = 0 at z = 1 −−> x = 1+ c e n t e r fMin = 0 ; globalMin = center+1; y = sum ( 1 0 0 ∗ (z(2:end ,:)−z ( 1 : end −1,:).ˆ2).ˆ2+(1 − z ( 1 : end −1,:)).ˆ2 ,... 1) ; c a s e 3 %%% Ackley path function (range: −32.768 to 32.768) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; y = −20∗exp ( −0.2∗ sqrt(sum(z.ˆ2, 1)/d1)) ... −exp(sum(cos(2∗ p i ∗z) , 1)/d1)+20+exp(1); c a s e 4 %%% Rastrigin ’s function (range: −5.12 to 5.12)

66 %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; y = sum ( z .ˆ2 −10∗ cos (2∗ p i ∗z ) +10 , 1) ; c a s e 5 %%% Griewank’s function (range: −600 t o 600) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; temp = repmat((1:d1) ’,1,d2); y = 1+sum(z.ˆ2, 1)/4000 − prod(cos(z./ sqrt(temp))); c a s e 6 %%% Schaffer’s function (range: 100 to 100) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r i f d1 == 2 fMin = 0 ; globalMin = center; y = 0.5+((sin(sqrt(sum(z.ˆ2,1)))).ˆ2 − 0 . 5 ) . / . . . ( ( 1 + 0 . 0 0 1 ∗ sum(z.ˆ2,1)).ˆ2); e l s e disp(’The Schaffer”s function is a 2D function ’) r e t u r n end o t h e r w i s e disp(’Function is not defined ’); r e t u r n end 1.2.3 Dead-zone modification

The dead-zone modification [44] had initially been employed in the stability analysis. A dead- zone non-linearity Dc was used to define   q(t) − L , if q(t) > L, q(t) = Dc(q(t),L) = 0 , if −L ≤ q(t) ≤ L,  q(t) + L , if q(t) < −L. However, because particles are attracted towards the best one(s), the uncertainty s(t + 1) → g =

lim g(t) and can be approximated while setting the upperbound L of the absolute value of the t→∞ approximation error l(t) to be ideally zero. Doing so, it becomes unecessary to use the dead-zone modification. Even though we do not show it in this work, the APSO system can be proven to be stable in case we make use of the dead-zone modification. Therefore, this has to be used if L 6= 0.

67 %% Dead−zone modification % Author: Ouboti Djaneye−Boundjou

f u n c t i o n q bar = deadZone(q,L)

[d1, d2] = size(L);

for dd2 = 1 : d2 for dd1 = 1 : d1 if q(dd1,dd2)>L( dd1 , dd2 ) q bar(dd1,dd2) = q(dd1,dd2)−L(dd1,dd2); elseif q(dd1,dd2)<−L( dd1 , dd2 ) q bar(dd1,dd2) = q(dd1,dd2)+L(dd1,dd2); e l s e q bar(dd1,dd2) = 0; end end end

68 APPENDIX B

MATLAB CODE FOR EXPOSING ORIGIN-BIAS

2.1 Main program

%% This script is used for studying the origin bias of the APSO % Author: Ouboti Djaneye−Boundjou %% Define parameters close all; clear all; clc;

global upperBound fMin globalMin

% functions to minimize (f1 = sphere = 1, f2 = rosenbrock = 2, % f3 = ackley = 3, f4 = rastringin = 4, f5 = griewank = 5, % f6 = schaffer’s = 6) fct = [1 2345 6];

runs = 100; %number of times to run the algorithm r u n time = 100; % maximum number of generations per run N=30; %numberof particles

%% Simulation

for ff = 1 : length(fct)

setUpperbound(fct(ff)); %defines upperbound to use

% a priori knowledge of the region where the optimum is: % −S < optimum d < S on each dimension (optimum d i s t h e v a l u e of % the optimum on dimension d) S = upperBound; % equivalent of M x V = upperBound;

% dimension of each particle or objective function

69 i f f f == 6 D = 2 ; e l s e D = 3 0 ; end

% origin of search space (modify as needed) center1 = zeros(D,1); center2 = zeros(D,1); for cc = 1 : length(center2) if mod(cc,2) center2(cc) = −S / 2 ; e l s e center2(cc) = −S / 2 ; end end center3 = zeros(D,1); for cc = 1 : length(center3) if mod(cc,2) center3(cc) = S/2; e l s e center3(cc) = S/2; end end center4 = zeros(D,1); for cc = 1 : length(center4) if mod(cc,2) center3(cc) = −S +1; e l s e center3(cc) = S−1; end end

% mean values fitA1 = zeros(1,N); fitA2 = zeros(1,N); fitA3 = zeros(1,N); fitA4 = zeros(1,N);

for rr = 1 : runs % initial conditions x0 = (2∗ rand (D,N) −1)∗S; v0 = (2∗ rand (D,N) −1)∗V;

% set inertia factor imax = 2∗ randi(100,1,1);

70 w = imax ∗ ( 2 ∗ (randi(imax,D,N) /(imax)) −1) ; c l e a r imax

%set k, gamma and eta (eta = nu) imax = randi(100,1,1); k = 2∗(randi(imax,D,N) /(imax+1)) −1; % k c l e a r imax %gamma = randi(100,D,N); gamma = [randi([10ˆ0 10ˆ1],D,floor(N/15)) ... randi([10ˆ1 10ˆ2],D,floor(N/15)) ... randi([10ˆ2 10ˆ3],D,floor(N/15)) ... randi([10ˆ3 10ˆ4],D,floor(N/15)) ... randi([10ˆ4 10ˆ5],D,floor(N/15)) ... randi([10ˆ5 10ˆ6],D,floor(N/15)) ... randi([10ˆ6 10ˆ7],D,floor(N/15)) ... randi([10ˆ7 10ˆ8],D,floor(N/15)) ... randi([10ˆ8 10ˆ9],D,floor(N/15)) ... randi([10ˆ9 10ˆ10],D,floor(N/15)) ... randi([10ˆ10 10ˆ11],D,floor(N/15)) ... randi([10ˆ11 10ˆ12],D,floor(N/15)) ... randi([10ˆ12 10ˆ13],D,floor(N/15)) ... randi([10ˆ13 10ˆ14],D,floor(N/15)) ... randi([10ˆ14 10ˆ15],D,N−14∗ floor(N/15))]; nu = (randi(100,D,N)/(100+1)). ∗ ( 2 ∗ gamma ) ; x1 = zeros(D,N,run t i m e +1) ; v1 = zeros(D,N,run t i m e +1) ; x1(:,:,1) = x0; v1(:,:,1) = v0; x2 = zeros(D,N,run t i m e +1) ; v2 = zeros(D,N,run t i m e +1) ; x2(:,:,1) = x0; v2(:,:,1) = v0; x3 = zeros(D,N,run t i m e +1) ; v3 = zeros(D,N,run t i m e +1) ; x3(:,:,1) = x0; v3(:,:,1) = v0; x4 = zeros(D,N,run t i m e +1) ; v4 = zeros(D,N,run t i m e +1) ; x4(:,:,1) = x0; v4(:,:,1) = v0;

for tt = 1:run t i m e

% compute personal and global bests i f t t == 1

71 pbest1(:,:,tt) = x1(:,:,tt); f1 = objFnew(pbest1(:,:, tt),fct(ff),center1); idx1 = find(f1 == min(f1)); gbest1(:,:, tt) = repmat(pbest1(:,idx1(1),tt),1,N) ; clear f1 idx1

pbest2(:,:,tt) = x2(:,:,tt); f2 = objFnew(pbest2(:,:, tt),fct(ff),center2); idx2 = find(f2 == min(f2)); gbest2(:,:, tt) = repmat(pbest2(:,idx2(1),tt),1,N) ; clear f2 idx2

pbest3(:,:,tt) = x3(:,:,tt); f3 = objFnew(pbest3(:,:, tt),fct(ff),center3); idx3 = find(f3 == min(f3)); gbest3(:,:, tt) = repmat(pbest3(:,idx3(1),tt),1,N) ; clear f3 idx3

pbest4(:,:,tt) = x4(:,:,tt); f4 = objFnew(pbest4(:,:, tt),fct(ff),center4); idx4 = find(f4 == min(f4)); gbest4(:,:, tt) = repmat(pbest4(:,idx4(1),tt),1,N) ; clear f4 idx4 e l s e f1 = objFnew(pbest1(: ,: ,tt −1),fct(ff),center1); g1 = objFnew(x1(:,:, tt),fct(ff),center1); idx1 = find((f1−g1 ) >0) ; pbest1(:,idx1,tt) = x1(:,idx1,tt); c l e a r idx1 idx1 = find((f1−g1 ) <=0) ; pbest1(:,idx1,tt) = pbest1(:,idx1,tt −1) ; clear f1 g1 idx1 f1 = objFnew(pbest1(:,:, tt),fct(ff),center1); idx1 = find(f1 == min(f1)); b e s t pos1 = [pbest1(:,idx1(1),tt),gbest1(:,1,tt −1) ] ; clear f1 idx1 f1 = objFnew(best pos1 ,fct(ff),center1); idx1 = find(f1 == min(f1)); gbest1(:,:,tt) = repmat(best pos1(: ,idx1(1)) ,1,N) ;

72 f2 = objFnew(pbest2(: ,: ,tt −1),fct(ff),center2); g2 = objFnew(x2(:,:, tt),fct(ff),center2); idx2 = find((f2−g2 ) >0) ; pbest2(:,idx2,tt) = x2(:,idx2,tt); c l e a r idx2 idx2 = find((f2−g2 ) <=0) ; pbest2(:,idx2,tt) = pbest2(:,idx2,tt −1) ; clear f2 g2 idx2 f2 = objFnew(pbest2(:,:, tt),fct(ff),center2); idx2 = find(f2 == min(f2)); b e s t pos2 = [pbest2(:,idx2(1),tt),gbest2(:,1,tt −1) ] ; clear f2 idx2 f2 = objFnew(best pos2 ,fct(ff),center2); idx2 = find(f2 == min(f2)); gbest2(:,:,tt) = repmat(best pos2(: ,idx2(1)) ,1,N) ; clear f2 idx2 best p o s 2 f3 = objFnew(pbest3(: ,: ,tt −1),fct(ff),center3); g3 = objFnew(x3(:,:, tt),fct(ff),center3); idx3 = find((f3−g3 ) >0) ; pbest3(:,idx3,tt) = x3(:,idx3,tt); c l e a r idx3 idx3 = find((f3−g3 ) <=0) ; pbest3(:,idx3,tt) = pbest3(:,idx3,tt −1) ; clear f3 g3 idx3 f3 = objFnew(pbest3(:,:, tt),fct(ff),center3); idx3 = find(f3 == min(f3)); b e s t pos3 = [pbest3(:,idx3(1),tt),gbest3(:,1,tt −1) ] ; clear f3 idx3 f3 = objFnew(best pos3 ,fct(ff),center3); idx3 = find(f3 == min(f3)); gbest3(:,:,tt) = repmat(best pos3(: ,idx3(1)) ,1,N) ; clear f3 idx3 best p o s 3 f4 = objFnew(pbest4(: ,: ,tt −1),fct(ff),center4); g4 = objFnew(x4(:,:, tt),fct(ff),center4); idx4 = find((f4−g4 ) >0) ; pbest4(:,idx4,tt) = x4(:,idx4,tt); c l e a r idx4 idx4 = find((f4−g4 ) <=0) ; pbest4(:,idx4,tt) = pbest4(:,idx4,tt −1) ; clear f4 g4 idx4

73 f4 = objFnew(pbest4(:,:, tt),fct(ff),center4); idx4 = find(f4 == min(f4)); b e s t pos4 = [pbest4(:,idx4(1),tt),gbest4(:,1,tt −1) ] ; clear f4 idx4 f4 = objFnew(best pos4 ,fct(ff),center4); idx4 = find(f4 == min(f4)); gbest4(:,:,tt) = repmat(best pos4(: ,idx4(1)) ,1,N) ; clear f4 idx4 best p o s 4 end

% generate phi1 and phi2 imax = randi(100,1,1); phi = randi(imax,D,N); c l e a r imax imax = randi(100,1,1); phi1 = (randi(imax,D,N)/(imax+1)). ∗ p h i ; c l e a r imax phi2 = phi−phi1 ;

% pg(t) is the same as s(t) pg1(:,:,tt) = (phi1. ∗ pbest1(: ,: , tt)+phi2. ∗ gbest1(: ,: , t t ) ) . / p h i ; pg2(:,:,tt) = (phi1. ∗ pbest2(: ,: , tt)+phi2. ∗ gbest2(: ,: , t t ) ) . / p h i ; pg3(:,:,tt) = (phi1. ∗ pbest3(: ,: , tt)+phi2. ∗ gbest3(: ,: , t t ) ) . / p h i ; pg4(:,:,tt) = (phi1. ∗ pbest4(: ,: , tt)+phi2. ∗ gbest4(: ,: , t t ) ) . / p h i ;

% partial derivatives of the estimate dFp1 = pbest1(:,:,tt); dFg1 = gbest1(:,:,tt); dFp2 = pbest2(:,:,tt); dFg2 = gbest2(:,:,tt); dFp3 = pbest3(:,:,tt); dFg3 = gbest3(:,:,tt); dFp4 = pbest4(:,:,tt); dFg4 = gbest4(:,:,tt);

% compute the errors z11 = x1(:,:,tt)−v1(:,:,tt); z21 = x1(:,:,tt); e1 = pg1(:,:,tt)−z21 ; z12 = x2(:,:,tt)−v2(:,:,tt);

74 z22 = x2(:,:,tt); e2 = pg2(:,:,tt)−z22 ; z13 = x3(:,:,tt)−v3(:,:,tt); z23 = x3(:,:,tt); e3 = pg3(:,:,tt)−z23 ; z14 = x4(:,:,tt)−v4(:,:,tt); z24 = x4(:,:,tt); e4 = pg4(:,:,tt)−z24 ; i f t t == 1 e previous1 = zeros(D,N); e previous2 = zeros(D,N); e previous3 = zeros(D,N); e previous4 = zeros(D,N); end

% compute signal q(t) q1 = −e1+k . ∗ e p r e v i o u s 1 ; q2 = −e2+k . ∗ e p r e v i o u s 2 ; q3 = −e3+k . ∗ e p r e v i o u s 3 ; q4 = −e4+k . ∗ e p r e v i o u s 4 ;

% compute parameter estimates i f t t == 1 t h e t a f hatp1 = zeros(D,N); t h e t a f hatg1 = zeros(D,N); t h e t a f hatp2 = zeros(D,N); t h e t a f hatg2 = zeros(D,N); t h e t a f hatp3 = zeros(D,N); t h e t a f hatg3 = zeros(D,N); t h e t a f hatp4 = zeros(D,N); t h e t a f hatg4 = zeros(D,N); e l s e t h e t a f hatp1 = thetaf h a t p 1 −(nu . ∗ dFp1 . ∗ q1 ) . / . . . (1+gamma . ∗ ( sqrt(dFp1.ˆ2+dFg1.ˆ2)).ˆ2) ; t h e t a f hatg1 = thetaf h a t g 1 −(nu . ∗ dFg1 . ∗ q1 ) . / . . . (1+gamma . ∗ ( sqrt(dFp1.ˆ2+dFg1.ˆ2)).ˆ2) ; t h e t a f hatp2 = thetaf h a t p 2 −(nu . ∗ dFp2 . ∗ q2 ) . / . . . (1+gamma . ∗ ( sqrt(dFp2.ˆ2+dFg2.ˆ2)).ˆ2) ; t h e t a f hatg2 = thetaf h a t g 2 −(nu . ∗ dFg2 . ∗ q2 ) . / . . . (1+gamma . ∗ ( sqrt(dFp2.ˆ2+dFg2.ˆ2)).ˆ2) ; t h e t a f hatp3 = thetaf h a t p 3 −(nu . ∗ dFp3 . ∗ q3 ) . / . . . (1+gamma . ∗ ( sqrt(dFp3.ˆ2+dFg3.ˆ2)).ˆ2) ; t h e t a f hatg3 = thetaf h a t g 3 −(nu . ∗ dFg3 . ∗ q3 ) . / . . . (1+gamma . ∗ ( sqrt(dFp3.ˆ2+dFg3.ˆ2)).ˆ2) ; t h e t a f hatp4 = thetaf h a t p 4 −(nu . ∗ dFp4 . ∗ q4 ) . / . . . (1+gamma . ∗ ( sqrt(dFp4.ˆ2+dFg4.ˆ2)).ˆ2) ;

75 t h e t a f hatg4 = thetaf h a t g 4 −(nu . ∗ dFg4 . ∗ q4 ) . / . . . (1+gamma . ∗ ( sqrt(dFp4.ˆ2+dFg4.ˆ2)).ˆ2) ; end

%compute estimates estimate1 = thetaf h a t p 1 . ∗ dFp1+thetaf h a t g 1 . ∗ dFg1 ; estimate2 = thetaf h a t p 2 . ∗ dFp2+thetaf h a t g 2 . ∗ dFg2 ; estimate3 = thetaf h a t p 3 . ∗ dFp3+thetaf h a t g 3 . ∗ dFg3 ; estimate4 = thetaf h a t p 4 . ∗ dFp4+thetaf h a t g 4 . ∗ dFg4 ;

%compute controllers u11 = p h i . ∗ e1 ; a l p h a 1 = w. ∗ z11 −(1+w) . ∗ z21−p h i . ∗ e1 ; Us1 = alpha1 −k . ∗ e1 ; U1 = estimate1+Us1; u1 = u11+U1 ; u12 = p h i . ∗ e2 ; a l p h a 2 = w. ∗ z12 −(1+w) . ∗ z22−p h i . ∗ e2 ; Us2 = alpha2 −k . ∗ e2 ; U2 = estimate2+Us2; u2 = u12+U2 ; u13 = p h i . ∗ e3 ; a l p h a 3 = w. ∗ z13 −(1+w) . ∗ z23−p h i . ∗ e3 ; Us3 = alpha3 −k . ∗ e3 ; U3 = estimate3+Us3; u3 = u13+U3 ; u14 = p h i . ∗ e4 ; a l p h a 4 = w. ∗ z14 −(1+w) . ∗ z24−p h i . ∗ e4 ; Us4 = alpha4 −k . ∗ e4 ; U4 = estimate4+Us4; u4 = u14+U4 ;

% update velocities and positions v1(:,:,tt+1) = w. ∗ v1(: ,: , tt)+u1; id = find(abs(v1) > V); v1(id) = sign(v1(id)) ∗V; c l e a r i d x1(:,:,tt+1) = x1(:,:,tt)+v1(:,:,tt+1); id = find(abs(x1) > S); x1(id) = sign(x1(id)) ∗S; if sign(x1(id)) == sign(v1(id)) v1 ( i d ) = −rand(size(id ,1) ,size(id ,2)). ∗ v1 ( i d ) ; end

76 c l e a r i d v2(:,:,tt+1) = w. ∗ v2(: ,: , tt)+u2; id = find(abs(v2) > V); v2(id) = sign(v2(id)) ∗V; c l e a r i d x2(:,:,tt+1) = x2(:,:,tt)+v2(:,:,tt+1); id = find(abs(x2) > S); x2(id) = sign(x2(id)) ∗S; if sign(x2(id)) == sign(v2(id)) v2 ( i d ) = −rand(size(id ,1) ,size(id ,2)). ∗ v2 ( i d ) ; end c l e a r i d v3(:,:,tt+1) = w. ∗ v3(: ,: , tt)+u3; id = find(abs(v3) > V); v3(id) = sign(v3(id)) ∗V; c l e a r i d x3(:,:,tt+1) = x3(:,:,tt)+v3(:,:,tt+1); id = find(abs(x3) > S); x3(id) = sign(x3(id)) ∗S; if sign(x3(id)) == sign(v3(id)) v3 ( i d ) = −rand(size(id ,1) ,size(id ,2)). ∗ v3 ( i d ) ; end c l e a r i d v4(:,:,tt+1) = w. ∗ v4(: ,: , tt)+u4; id = find(abs(v4) > V); v4(id) = sign(v4(id)) ∗V; c l e a r i d x4(:,:,tt+1) = x4(:,:,tt)+v4(:,:,tt+1); id = find(abs(x4) > S); x4(id) = sign(x4(id)) ∗S; if sign(x4(id)) == sign(v4(id)) v4 ( i d ) = −rand(size(id ,1) ,size(id ,2)). ∗ v4 ( i d ) ; end c l e a r i d e previous1 = e1; e previous2 = e2; e previous3 = e3; e previous4 = e4; clear e1 e2 e3 e4 u11 u12 u13 u14 U1 U2 U3 U4 u1 u2 u3 u4 c l e a r (’− regexp’, ’ˆphi | ˆ dF | ˆ z | ˆ e s t i m a t e | ˆ q | ˆ a l p h a | ˆ Us ’ )

77 end fit1 = objFnew(x1(: ,: ,end),fct(ff),center1); fitA1 = (fitA1+fit1)/runs; fit2 = objFnew(x2(: ,: ,end),fct(ff),center2); fitA2 = (fitA2+fit2)/runs; fit3 = objFnew(x3(: ,: ,end),fct(ff),center3); fitA3 = (fitA3+fit3)/runs; fit4 = objFnew(x4(: ,: ,end),fct(ff),center4); fitA4 = (fitA4+fit4)/runs; clear w k gamma nu pbest gbest fit1 fit2 fit3 fit4 c l e a r (’− regexp’, ’ˆx | ˆ v | ˆ pg | ˆ p b e s t | ˆ g b e s t | ˆ e p r e v i o u s ’ )

end fit1 = min(fitA1); fit2 = min(fitA2); fit3 = min(fitA3); fit4 = min(fitA4); var = [’f’ num2str(fct(ff)) ’C’]; save ( var , ’ − regexp’,’ˆfit ’) c l e a r (’− regexp ’,’ˆ fit | ˆ v a r | ˆ c e n t e r ’ ) end

2.2 Functions used

The ’setUpperbound’ and ’deadZone’ functions can be found in Appendix A. The ’objFnew’ function is used to compute fitness. It is a bit different from the ’objF’ function in Appendix A in that it takes one more input specifying the center of the search space so as to implement the Center

Offsetting method. %% Objectif function % Author: Ouboti Djaneye−Boundjou

function y = objFnew(x,fct ,center)

global fMin globalMin

[d1, d2] = size(x); y = zeros(1,d2); z = x−repmat(center ,1,d2);

s w i t c h f c t c a s e 1

78 %%% Dejong’s function I or Sphere (range: −100 t o 100) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; y = sum(z.ˆ2, 1); c a s e 2 %%% Rosenbrock’s valley or Dejong function II ( range: −30 t o %%% 30). Global minimum f(z) = 0 at z = 1 −−> x = 1+ c e n t e r fMin = 0 ; globalMin = center+1; y = sum ( 1 0 0 ∗ (z(2:end ,:)−z ( 1 : end −1,:).ˆ2).ˆ2+(1 − z ( 1 : end −1,:)).ˆ2 ,... 1) ; c a s e 3 %%% Ackley path function (range: −32.768 to 32.768) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; y = −20∗exp ( −0.2∗ sqrt(sum(z.ˆ2, 1)/d1)) ... −exp(sum(cos(2∗ p i ∗z) , 1)/d1)+20+exp(1); c a s e 4 %%% Rastrigin ’s function (range: −5.12 to 5.12) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; y = sum ( z .ˆ2 −10∗ cos (2∗ p i ∗z ) +10 , 1) ; c a s e 5 %%% Griewank’s function (range: −600 t o 600) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r fMin = 0 ; globalMin = center; temp = repmat((1:d1) ’,1,d2); y = 1+sum(z.ˆ2, 1)/4000 − prod(cos(z./ sqrt(temp))); c a s e 6 %%% Schaffer’s function (range: 100 to 100) %%% Global minimum f(z) = 0 at z = 0 −−> x = c e n t e r i f d1 == 2 fMin = 0 ; globalMin = center; y = 0.5+((sin(sqrt(sum(z.ˆ2,1)))).ˆ2 − 0 . 5 ) . / . . . ( ( 1 + 0 . 0 0 1 ∗ sum(z.ˆ2,1)).ˆ2); e l s e disp(’The Schaffer”s function is a 2D function ’) r e t u r n

79 end o t h e r w i s e disp(’Function is not defined ’); r e t u r n end

80 APPENDIX C

MATLAB CODE FOR PERFORMANCE COMPARISON TABLE

3.1 Main program

The results generated by this code are presented in Table 6.1. %% This script is used for comparison purposes % Author: Ouboti Djaneye−Boundjou %% Define parameters close all; clear all; clc;

global center upperBound fMin globalMin

% functions to minimize (f1 = sphere = 1, f2 = rosenbrock = 2, % f3 = ackley = 3, f4 = rastringin = 4, f5 = griewank = 5, % f6 = schaffer’s = 6) fct = [1 2 4 5 6]; goal = [0.01 100 100 0.1 10ˆ −5]; % goal for f according to Trelea p a p er

runs = 20; %number of times to run the algorithm r u n time = 10000; % maximum number of generations per run N=30; %numberof particles

%% Simulation

for ff = 1 %: length(fct)

% dimension of each particle or objective function if fct(ff) == 6 D = 2 ; e l s e D = 3 0 ; end

81 setUpperbound(fct(ff)); %defines upperbound to use

% a priori knowledge of the region where the optimum is: % −S < optimum d < S on each dimension (optimum d i s t h e v a l u e of % the optimum on dimension d) S = upperBound; V = upperBound;

% origin of search space center = zeros(D,1); % for cc = 1 : length(center) % ifmod(cc,2) % center(cc)= −exp ( 1 ) ; % e l s e % center(cc)=pi; % end % end

for rr = 1 : runs % initial conditions x0 = (2∗ rand (D,N) −1)∗S; v0 = (2∗ rand (D,N) −1)∗V;

% set inertia factor imax = 2∗ randi(100,1,1); w = imax ∗ ( 2 ∗ (randi(imax,D,N) /(imax)) −1) ; c l e a r imax

% set k, gamma and eta (eta = nu) imax = randi(100,1,1); k = 2∗(randi(imax,D,N) /(imax+1)) −1; % k c l e a r imax gamma = [randi([10ˆ0 10ˆ1],D,floor(N/15)) ... randi([10ˆ1 10ˆ2],D,floor(N/15)) ... randi([10ˆ2 10ˆ3],D,floor(N/15)) ... randi([10ˆ3 10ˆ4],D,floor(N/15)) ... randi([10ˆ4 10ˆ5],D,floor(N/15)) ... randi([10ˆ5 10ˆ6],D,floor(N/15)) ... randi([10ˆ6 10ˆ7],D,floor(N/15)) ... randi([10ˆ7 10ˆ8],D,floor(N/15)) ... randi([10ˆ8 10ˆ9],D,floor(N/15)) ... randi([10ˆ9 10ˆ10],D,floor(N/15)) ... randi([10ˆ10 10ˆ11],D,floor(N/15)) ... randi([10ˆ11 10ˆ12],D,floor(N/15)) ...

82 randi([10ˆ12 10ˆ13],D,floor(N/15)) ... randi([10ˆ13 10ˆ14],D,floor(N/15)) ... randi([10ˆ14 10ˆ15],D,N−14∗ floor(N/15))]; nu = (randi(100,D,N)/(100+1)). ∗ ( 2 ∗ gamma ) ; x = zeros(D,N,run t i m e +1) ; v = zeros(D,N,run t i m e +1) ; x(:,:,1) = x0; v(:,:,1) = v0;

t t = 1 ; goalReached = 0; w hi l e ( t t <= r u n time)&&(goalReached == 0)

% compute personal and global bests i f t t == 1 pbest(:,:,tt) = x(:,:,tt); f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); % best particle fitness wise %idx = find(f == max(f)); % furthest particle fitness wise gbest(:,:, tt) = repmat(pbest(:,idx(1),tt),1,N); fit(1,tt) = f(idx(1)); c l e a r f i d x e l s e f = objF(pbest(:,:,tt −1),fct(ff)); g = objF(x(:,:,tt),fct(ff)); idx = find((f−g ) >0) ; pbest(:,idx,tt) = x(:,idx,tt); c l e a r i d x idx = find((f−g ) <=0) ; pbest(:,idx,tt) = pbest(:,idx,tt −1) ; c l e a r f g i d x f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); b e s t pos = [pbest(:,idx(1),tt),gbest(:,1,tt −1) ] ; c l e a r f i d x f = objF(best pos ,fct(ff)); idx = find(f == min(f)); % best particle fitness wise %idx = find(f == max(f)); % furthest particle fitness wise gbest(:,:,tt) = repmat(best pos(:,idx(1)) ,1,N); fit(1,tt) = f(idx(1)); clear f idx best p o s

83 end

% generate phi1 and phi2 imax = randi(100,1,1); phi = randi(imax,D,N); c l e a r imax imax = randi(100,1,1); phi1 = (randi(imax,D,N)/(imax+1)). ∗ p h i ; c l e a r imax phi2 = phi−phi1 ;

% compute s(t) = pg(t) pg(:,:,tt) = (phi1. ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt) ) . / p h i ;

% partial derivatives of estimate dFp = pbest(:,:,tt); dFg = gbest(:,:,tt);

% compute error z1 = x(:,:,tt)−v ( : , : , t t ) ; z2 = x(:,:,tt); e = pg(:,:,tt)−z2 ; i f t t == 1 e previous = zeros(D,N); end

% compute signal q(t) q = −e+k . ∗ e p r e v i o u s ;

% compute parameter estimates i f t t == 1 t h e t a f hatp = zeros(D,N); t h e t a f hatg = zeros(D,N); e l s e t h e t a f hatp = thetaf h a t p . . . −(nu . ∗ dFp . ∗ q) ./(1+gamma. ∗ ( sqrt(dFp.ˆ2+dFg.ˆ2) ) . ˆ 2 ) ; t h e t a f hatg = thetaf h a t g . . . −(nu . ∗ dFg . ∗ q) ./(1+gamma. ∗ ( sqrt(dFp.ˆ2+dFg.ˆ2) ) . ˆ 2 ) ; end

% compute estimate estimate = thetaf h a t p . ∗ pbest(: ,: , tt)+thetaf h a t g . ∗ ...

84 gbest(:,:,tt);

% compute controllers u1 = p h i . ∗ e ; a l p h a = w. ∗ z1 −(1+w) . ∗ z2−p h i . ∗ e ; Us = alpha −k . ∗ e ; U = estimate+Us; u = u1+U;

% update positions and velocities v(:,:,tt+1) = w. ∗ v(:,:,tt)+u; idv = find(abs(v) > V); v(idv) = sign(v(idv)) ∗V; x(:,:,tt+1) = x(:,:,tt)+v(:,:,tt+1); idx = find(abs(x) > S); x(idx) = sign(x(idx)) ∗S; if sign(x(idx)) == sign(v(idx)) v ( i d x ) = −rand(size(idx ,1) ,size(idx ,2)). ∗ v ( i d x ) ; end clear idx idv

e previous = e; clear phi phi1 phi2 dFp dFg z1 z2 e q q bar estimate a l p h a . . . u1 Us U u

% check whether goal is met if fit(1,tt) <= g o a l ( f f ) goalReached = 1; end t t = t t +1; end if goalReached == 1 it2goal(1,rr) = length(fit) −1; e l s e it2goal(1,rr) = tt; end yield(1,rr) = goalReached; c l e a r e previous w k gamma nu x v pbest gbest pg

end % compute average , median, minimum, maximum generations and s u c c e s r a t e avgV = mean(it2goal); mdV = median(it2goal); minV = min(it2goal);

85 maxV = max(it2goal); idx = find(yield); successRate = length(idx)/length(yield); var = [’f’ num2str(fct(ff)) ’comparison ’]; save (var ,’it2goal ’,’yield ’,’avgV’,’mdV’,’minV’,’maxV’,’ successRate ’) clear avgV mdV minV maxV idx sucessRate var end

3.2 Functions Used

The ’setUpperbound’, ’objF’ and ’deadZone’ functions can be found in Appendix A.

86 APPENDIX D

MATLAB CODE FOR FIGURES OF MERIT: CONVERGENCE AND TRANSIENT COMPARISON

4.1 Main program

This code plots Figures 6.1 through 6.24. %% This script is used to plot Figures of Merit % Author: Ouboti Djaneye−Boundjou %% Define common parameters close all; clear all; clc;

global center upperBound fMin globalMin

% functions to minimize (f1 = sphere = 1, f2 = rosenbrock = 2, % f3 = ackley = 3, f4 = rastringin = 4, f5 = griewangk = 5, % f6 = schaffer’s = 6) fct = [1 2345 6];

runs = 20; %number of times to run the algorithm r u n t i m e = 1000; N=30; %numberofparticles

%% Simulation

for ff = 1 : length(fct)

% dimension of each particle or objective function if fct(ff) == 6 D = 2 ; e l s e D = 3 0 ; end

setUpperbound(fct(ff)); %defines upperbound to use

87 % a priori knowledge of the region where the optimum is: % −S < optimum d < S on each dimension (optimum d i s t h e v a l u e of % the optimum on dimension d) S = upperBound; V = upperBound;

% origin of search space (modify as needed) center = zeros(D,1); for cc = 1 : length(center) if mod(cc,2) center(cc) = 0; e l s e center(cc) = 0; end end

% mean values xWOA = zeros(D,N,run t i m e +1) ; vWOA = zeros(D,N,run t i m e +1) ; pbestWOA = zeros(D,N,run t i m e ) ; gbestWOA = zeros(D,N,run t i m e ) ; pgWOA = zeros(D,N, run t i m e ) ; fitWOA = zeros(1,run t i m e ) ; xA = zeros(D,N,run t i m e +1) ; vA = zeros(D,N,run t i m e +1) ; pbestA = zeros(D,N,run t i m e ) ; gbestA = zeros(D,N,run t i m e ) ; pgA = zeros(D,N,run t i m e ) ; fitA = zeros(1,run t i m e ) ; maxfitA = zeros(1,run t i m e ) ; xES = zeros(D,N,run t i m e +1) ; vES = zeros(D,N,run t i m e +1) ; pbestES = zeros(D,N,run t i m e ) ; gbestES = zeros(D,N,run t i m e ) ; pgES = zeros(D,N,run t i m e ) ; fitES = zeros(1,run t i m e ) ; xT = zeros(D,N,run t i m e +1) ; vT = zeros(D,N,run t i m e +1) ; pbestT = zeros(D,N,run t i m e ) ; gbestT = zeros(D,N,run t i m e ) ; pgT = zeros(D,N,run t i m e ) ; fitT = zeros(1,run t i m e ) ;

method used = 0; % initialization of ”method used ”

88 for rr = 1 : runs % initial conditions x0 = (2∗ rand (D,N) −1)∗S; v0 = (2∗ rand (D,N) −1)∗V;

% Best PSO without adaptation based on Kadirkamanathan p a pe r imax = randi(100,1,1); w = 2∗ randi(imax ,D,N) /(imax+1/imax) −1; c l e a r imax

p h i b a r = 2∗(1 −2.∗ abs(w)+w.ˆ2)./(1+w); % K (from Kardikamanathan % et al. paper)

x = zeros(D,N,run t i m e +1) ; v = zeros(D,N,run t i m e +1) ; x(:,:,1) = x0; v(:,:,1) = v0;

for tt =1 : run t i m e

% compute personal and global bests i f t t == 1 pbest(:,:,tt) = x(:,:,tt); f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); gbest(:,:, tt) = repmat(pbest(:,idx(1),tt),1,N); fit(1,tt) = f(idx(1)); c l e a r f i d x e l s e f = objF(pbest(:,:,tt −1),fct(ff)); g = objF(x(:,:,tt),fct(ff)); idx = find((f−g ) >0) ; pbest(:,idx,tt) = x(:,idx,tt); c l e a r i d x idx = find((f−g ) <=0) ; pbest(:,idx,tt) = pbest(:,idx,tt −1) ; c l e a r f g i d x f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); b e s t pos = [pbest(:,idx(1),tt),gbest(:,1,tt −1) ] ; c l e a r f i d x f = objF(best pos ,fct(ff)); idx = find(f == min(f));

89 gbest(:,:,tt) = repmat(best pos(:,idx(1)) ,1,N); fit(1,tt) = f(idx(1)); clear f idx best p o s end

% generate phi1 and phi2 phi1 = rand(D,N). ∗ ( p h i b a r −0.1) ; phi2 = rand(D,N). ∗ ( p h i b a r −0.1− phi1 ) ; phi = phi1+phi2;

% compute s(t) = pg(t) and controller pg(:,:,tt) = (phi1. ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt) ) . / p h i ; u = phi1 . ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt)−p h i . ∗ x ( : , : , t t ) ;

% update position and velocity v(:,:,tt+1) = w. ∗ v(:,:,tt)+u; x(:,:,tt+1) = x(:,:,tt)+v(:,:,tt+1);

clear phi phi1 phi2 u end xWOA = (xWOA+x ) / r u n s ; vWOA = (vWOA+v ) / r u n s ; pbestWOA = (pbestWOA+pbest)/runs; gbestWOA = (gbestWOA+gbest)/runs; pgWOA = (pgWOA+pg ) / r u n s ; fitWOA = (fitWOA+fit )/runs; c l e a r w p h i bar x v pbest gbest pg fit

% Gradient update adaptive PSO imax = randi(100,1,1); w = 2∗(randi(imax,D,N) /(imax)) −1; c l e a r imax imax = randi(100,1,1); k = 2∗(randi(imax,D,N) /(imax+1)) −1; % k c l e a r imax %gamma = randi(10ˆ15,D,N); gamma = [randi([10ˆ0 10ˆ1],D,floor(N/15)) ... randi([10ˆ1 10ˆ2],D,floor(N/15)) ... randi([10ˆ2 10ˆ3],D,floor(N/15)) ... randi([10ˆ3 10ˆ4],D,floor(N/15)) ... randi([10ˆ4 10ˆ5],D,floor(N/15)) ... randi([10ˆ5 10ˆ6],D,floor(N/15)) ... randi([10ˆ6 10ˆ7],D,floor(N/15)) ...

90 randi([10ˆ7 10ˆ8],D,floor(N/15)) ... randi([10ˆ8 10ˆ9],D,floor(N/15)) ... randi([10ˆ9 10ˆ10],D,floor(N/15)) ... randi([10ˆ10 10ˆ11],D,floor(N/15)) ... randi([10ˆ11 10ˆ12],D,floor(N/15)) ... randi([10ˆ12 10ˆ13],D,floor(N/15)) ... randi([10ˆ13 10ˆ14],D,floor(N/15)) ... randi([10ˆ14 10ˆ15],D,N−14∗ floor(N/15))]; nu = (randi(100,D,N)/(100+1)). ∗ ( 2 ∗ gamma ) ;

L = zeros(D,N);%2∗S∗ ones (D,N) ; x = zeros(D,N,run t i m e +1) ; v = zeros(D,N,run t i m e +1) ; x(:,:,1) = x0; v(:,:,1) = v0;

for tt =1 : run t i m e

% compute personal and global bests i f t t == 1 pbest(:,:,tt) = x(:,:,tt); f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); gbest(:,:, tt) = repmat(pbest(:,idx(1),tt),1,N); fit(1,tt) = f(idx(1)); idx = find(f == max(f)); maxfit(1,tt) = f(idx(1)); c l e a r f i d x e l s e f = objF(pbest(:,:,tt −1),fct(ff)); g = objF(x(:,:,tt),fct(ff)); idx = find((f−g ) >0) ; pbest(:,idx,tt) = x(:,idx,tt); c l e a r i d x idx = find((f−g ) <=0) ; pbest(:,idx,tt) = pbest(:,idx,tt −1) ; c l e a r f g i d x f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); b e s t pos = [pbest(:,idx(1),tt),gbest(:,1,tt −1) ] ; c l e a r f i d x f = objF(best pos ,fct(ff)); idx = find(f == min(f)); gbest(:,:,tt) = repmat(best pos(:,idx(1)) ,1,N); fit(1,tt) = f(idx(1));

91 idx = find(f == max(f)); maxfit(1,tt) = f(idx(1)); clear f idx best p o s end

% generate phi1 and phi2 imax = randi(100,1,1); phi = randi(imax,D,N); c l e a r imax imax = randi(100,1,1); phi1 = (randi(imax,D,N)/(imax+1)). ∗ p h i ; c l e a r imax phi2 = phi−phi1 ;

% compute s(t) = pg(t) pg(:,:,tt) = (phi1. ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt) ) . / p h i ;

% partial derivatives dFp = pbest(:,:,tt); dFg = gbest(:,:,tt);

% compute error z1 = x(:,:,tt)−v ( : , : , t t ) ; z2 = x(:,:,tt); e = pg(:,:,tt)−z2 ; i f t t == 1 e previous = zeros(D,N);%pg(: ,: , tt)−z1 ; end

% compute signal q(t) q = −e+k . ∗ e p r e v i o u s ; qbar = deadZone(q,L); % because L = 0, using the deadzone % modification isn’t necessary

% compute parameter estimates i f t t == 1 t h e t a f hatp = zeros(D,N); t h e t a f hatg = zeros(D,N); e l s e t h e t a f hatp = thetaf h a t p . . . −(nu . ∗ dFp . ∗ qbar) ./(1+gamma. ∗ ( sqrt(dFp.ˆ2+dFg . ˆ 2 ) ) . ˆ 2 ) ; t h e t a f hatg = thetaf h a t g . . .

92 −(nu . ∗ dFg . ∗ qbar) ./(1+gamma. ∗ ( sqrt(dFp.ˆ2+dFg . ˆ 2 ) ) . ˆ 2 ) ; end

% compute estimate estimate = thetaf h a t p . ∗ pbest(: ,: , tt)+thetaf h a t g . ∗ ... gbest(:,:,tt);

% compute controller u1 = p h i . ∗ e ; a l p h a = w. ∗ z1 −(1+w) . ∗ z2−p h i . ∗ e ; Us = alpha −k . ∗ e ; U = estimate+Us; u = u1+U;

% compute positions and velocities v(:,:,tt+1) = w. ∗ v(:,:,tt)+u; idv = find(abs(v) > V); v(idv) = sign(v(idv)) ∗V; x(:,:,tt+1) = x(:,:,tt)+v(:,:,tt+1); idx = find(abs(x) > S); x(idx) = sign(x(idx)) ∗S; if sign(x(idx)) == sign(v(idx)) v ( i d x ) = −rand(size(idx ,1) ,size(idx ,2)). ∗ v ( i d x ) ; end clear idx idv

e previous = e; clear phi phi1 phi2 dFp dFg z1 z2 e q qbar estimate a l p h a . . . u1 Us U u end xA = (xA+x)/runs; vA = (vA+v)/runs; pbestA = (pbestA+pbest)/runs; gbestA = (gbestA+gbest)/runs; pgA = (pgA+pg)/runs; fitA = (fitA+fit)/runs; maxfitA = (maxfitA+maxfit)/runs; c l e a r e previous w k gamma nu x v pbest gbest pg fit m a x f i t

% PSO based on Eberhart and Shi paper w = 0 . 7 2 9 ; p h i 1 b a r = 1 . 4 9 4 ;

93 p h i 2 b a r = 1 . 4 9 4 ; x = zeros(D,N,run t i m e +1) ; v = zeros(D,N,run t i m e +1) ; x(:,:,1) = x0; v(:,:,1) = v0;

for tt =1 : run t i m e

% compute personal and global bests i f t t == 1 pbest(:,:,tt) = x(:,:,tt); f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); gbest(:,:, tt) = repmat(pbest(:,idx(1),tt),1,N); fit(1,tt) = f(idx(1)); c l e a r f i d x e l s e f = objF(pbest(:,:,tt −1),fct(ff)); g = objF(x(:,:,tt),fct(ff)); idx = find((f−g ) >0) ; pbest(:,idx,tt) = x(:,idx,tt); c l e a r i d x idx = find((f−g ) <=0) ; pbest(:,idx,tt) = pbest(:,idx,tt −1) ; c l e a r f g i d x f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); b e s t pos = [pbest(:,idx(1),tt),gbest(:,1,tt −1) ] ; c l e a r f i d x f = objF(best pos ,fct(ff)); idx = find(f == min(f)); gbest(:,:,tt) = repmat(best pos(:,idx(1)) ,1,N); fit(1,tt) = f(idx(1)); clear f idx best p o s end

% generate phi1 and phi2 phi1 = rand(D,N). ∗ p h i 1 b a r ; phi2 = rand(D,N). ∗ p h i 2 b a r ; phi = phi1+phi2;

% compute controller u = phi1 . ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt)−p h i . ∗ x ( : , : , t t ) ;

94 % update velocities and positions v(:,:,tt+1) = w. ∗ v(:,:,tt)+u; id = find(abs(v) > V); v(id) = sign(v(id)) ∗V; c l e a r i d x(:,:,tt+1) = x(:,:,tt)+v(:,:,tt+1);

clear phi phi1 phi2 u end xES = (xES+x)/runs; vES = (vES+v)/runs; pbestES = (pbestES+pbest)/runs; gbestES = (gbestES+gbest)/runs; %pgES = (pgES+pg)/runs; fitES = (fitES+fit)/runs; c l e a r w p h i bar x v pbest gbest pg fit

% PSO based on Trelea paper w = 0 . 7 2 9 ; p h i 1 b a r = 1 . 4 9 4 ; p h i 2 b a r = 1 . 4 9 4 ; x = zeros(D,N,run t i m e +1) ; v = zeros(D,N,run t i m e +1) ; x(:,:,1) = x0; v(:,:,1) = v0;

for tt =1 : run t i m e

% compute personal and global bests i f t t == 1 pbest(:,:,tt) = x(:,:,tt); f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); gbest(:,:, tt) = repmat(pbest(:,idx(1),tt),1,N); fit(1,tt) = f(idx(1)); c l e a r f i d x e l s e f = objF(pbest(:,:,tt −1),fct(ff)); g = objF(x(:,:,tt),fct(ff)); idx = find((f−g ) >0) ; pbest(:,idx,tt) = x(:,idx,tt); c l e a r i d x idx = find((f−g ) <=0) ; pbest(:,idx,tt) = pbest(:,idx,tt −1) ; c l e a r f g i d x

95 f = objF(pbest(:,:,tt),fct(ff)); idx = find(f == min(f)); b e s t pos = [pbest(:,idx(1),tt),gbest(:,1,tt −1) ] ; c l e a r f i d x f = objF(best pos ,fct(ff)); idx = find(f == min(f)); gbest(:,:,tt) = repmat(best pos(:,idx(1)) ,1,N); fit(1,tt) = f(idx(1)); clear f idx best p o s end

% generate phi1 and phi2 phi1 = rand(D,N). ∗ p h i 1 b a r ; phi2 = rand(D,N). ∗ p h i 2 b a r ; phi = phi1+phi2;

% compute controller u = phi1 . ∗ pbest(: ,: , tt)+phi2. ∗ gbest(:,:,tt)−p h i . ∗ x ( : , : , t t ) ;

% update positions and velocities v(:,:,tt+1) = w. ∗ v(:,:,tt)+u; x(:,:,tt+1) = x(:,:,tt)+v(:,:,tt+1);

clear phi phi1 phi2 u end xT = (xT+x)/runs; vT = (vT+v)/runs; pbestT = (pbestT+pbest)/runs; gbestT = (gbestT+gbest)/runs; %pgT = (pgT+pg)/runs; fitT = (fitT+fit)/runs; c l e a r w p h i bar x v pbest gbest pg fit end method used = method used +1; var = [’f’ num2str(fct(ff)) ’method’ num2str(method used ) ] ; save ( var , ’−regexp’, ’ˆxW| ˆvW| ˆ pbestW | ˆ gbestW | ˆ pgW | ˆ fitW ’ ) c l e a r v a r method used = method used +1; var = [’f’ num2str(fct(ff)) ’method’ num2str(method used ) ] ; save ( var , ’−regexp’, ’ˆxA | ˆ vA | ˆ pbestA | ˆ gbestA | ˆ pgA | ˆ f i t A ’ ) c l e a r v a r method used = method used +1; var = [’f’ num2str(fct(ff)) ’method’ num2str(method used ) ] ; save ( var , ’−regexp’, ’ˆxE | ˆ vE | ˆ pbestE | ˆ gbestE | ˆ pgE | ˆ f i t E ’ )

96 c l e a r v a r method used = method used +1; var = [’f’ num2str(fct(ff)) ’method’ num2str(method used ) ] ; save ( var , ’−regexp’, ’ˆxT | ˆ vT | ˆ pbestT | ˆ gbestT | ˆ pgT | ˆ f i t T ’ ) c l e a r v a r

% Plot: Speed of convergence convWindow = run t i m e −1; % convWindow has to be less or equal t o % r u n t i m e −1 fit = [fitWOA’ fitA’ fitES’ fitT ’]; smallestFit = min(min(fit)); linIND = find(fit == smallestFit); [rowIND colIND] = ind2sub([size(fit ,1) size(fit ,2)],linIND); if colIND == 1 var = ’KPSO’; elseif colIND == 2 var = ’APSO’; elseif colIND == 3 v a r = ’ESPSO ’ ; e l s e var = ’TPSO’; end maxfit = max(max(fit)); i f m a x f i t < 8 m i n f i t = 0 ; e l s e maxfit = maxfit+1; m i n f i t = −1; end Xmax = r u n t i m e +50; f i g u r e %subplot(2,2,[1 3]) plot (0:convWindow, fit (1:convWindow+1,:) ,... 0:convWindow , fMin ∗ ones(convWindow+1,1) ,’k−−’,’linewidth ’ , 2 ) ; xlabel(’t (generation) ’);ylabel(’Average fitness ’) legend(’KPSO’ ,’APSO’ ,’ESPSO’ ,’TPSO’ ,’ global minimum’) a x i s ([ −50 Xmax minfit maxfit]) midX = (Xmax+100)/3 −50; midY = 2∗( maxfit −minfit)/3+minfit; text(midX,midY,[var ’: smallest fitness of ’ num2str( smallestFit)], ... ’HorizontalAlignment ’,’center ’,’BackgroundColor ’ ,[.7 .9 . 7 ] ) if colIND ˜= 2

97 midY = (maxfit −minfit)/3+minfit; text(midX,midY,[’APSO: best fitness of ’ ... num2str(min( fit (: ,2)))],’HorizontalAlignment ’,’center ’,... ’BackgroundColor ’,[.9 .7 .9]) end clear smallestFit linIND rowIND colIND var Xmax minfit maxfit midX midY

% clear fit maxfit minfit % fit = [fitA’ maxfitA’]; % maxfit = max(max(fit))+1; % m i n f i t = −1; % subplot(2,2,[2 4]) % plot(0:convWindow, fit (1:convWindow+1,:) ,... % 0:convWindow,fMin∗ ones(convWindow+1,1) ,’k−−’,’linewidth ’ , 2 ) ; % xlabel(’t (generation)’);ylabel(’Average fitness ’) % legend(’APSO best ’,’APSO worst’,’global minimum’) % a x i s ([ −50 Xmax minfit maxfit])

% Plot: Size of transient SOTWindow = run t i m e −1; % SOTWindow has to be less or equal t o % r u n t i m e −1 [maxSOT minSOT] = sizeOfTransient({xWOA,xA,xES , xT }); smallestDist = min(min(maxSOT)); linIND = find(maxSOT == smallestDist); [rowIND colIND] = ind2sub([ size(maxSOT,1) size(maxSOT,2)], linIND ) ; if colIND == 1 var = ’KPSO’; elseif colIND == 2 var = ’APSO’; elseif colIND == 3 v a r = ’ESPSO ’ ; e l s e var = ’TPSO’; end maxfit = max(max(maxSOT(: ,2:end)))+1; m i n f i t = −1; Xmax = r u n t i m e +100; f i g u r e subplot (2 ,1 ,1) , plot (0:SOTWindow,maxSOT(1:SOTWindow+1 ,:) ,’ linewidth ’,2)

98 xlabel(’t (generation) ’);ylabel(’Average distance (zoomed in) ’) title(’Furhtest particle ’) l e g e n d ( ’KPSO’ , ’APSO’ , ’ ESPSO ’ , ’ TPSO ’ ) a x i s ([ −100 Xmax minfit maxfit]) midX = (Xmax+100)/3 −100; midY = 2∗( maxfit −minfit)/3+minfit; text(midX,midY,[var ’: closest by ’ num2str(smallestDist)], ... ’HorizontalAlignment ’,’center ’,’BackgroundColor ’ ,[.7 .9 . 7 ] ) if colIND ˜= 2 midY = (maxfit −minfit)/3+minfit; text(midX,midY,[’APSO: away by ’ ... num2str(min(maxSOT(: ,2) ))],’HorizontalAlignment ’,’ center ’ ,... ’BackgroundColor ’,[.9 .7 .9]) end clear smallestDist linIND rowIND colIND var Xmax minfit maxfit midX ... midY smallestDist = min(min(minSOT)); linIND = find(minSOT == smallestDist); [rowIND colIND] = ind2sub([ size(minSOT,1) size(minSOT,2)], linIND ) ; if colIND == 1 var = ’KPSO’; elseif colIND == 2 var = ’APSO’; elseif colIND == 3 v a r = ’ESPSO ’ ; e l s e var = ’TPSO’; end maxfit = max(max(minSOT(: ,2:end)))+1; m i n f i t = −1; Xmax = r u n t i m e +100; subplot (2 ,1 ,2) , plot (0:SOTWindow,minSOT(1:SOTWindow+1 ,:) ,’ linewidth ’,2) %subplot (2 ,1 ,2) , plot (0:SOTWindow,minSOT(1:SOTWindow+1 ,:) ,’ linewidth ’,2) xlabel(’t (generation) ’);ylabel(’Average distance (zoomed in) ’) title(’Closest particle ’) l e g e n d ( ’KPSO’ , ’APSO’ , ’ ESPSO ’ , ’ TPSO ’ ) a x i s ([ −100 Xmax minfit maxfit])

99 midX = (Xmax+100)/3 −100; midY = 2∗( maxfit −minfit)/3+minfit; text(midX,midY,[var ’: closest by ’ num2str(smallestDist)], ... ’HorizontalAlignment ’,’center ’,’BackgroundColor ’ ,[.7 .9 . 7 ] ) if colIND ˜= 2 midY = (maxfit −minfit)/3+minfit; text(midX,midY,[’APSO: away by ’ ... num2str(min(minSOT(: ,2) ))],’HorizontalAlignment ’,’ center ’ ,... ’BackgroundColor ’,[.9 .7 .9]) end clear smallestDist linIND rowIND colIND var Xmax minfit maxfit midX ... midY maxSOT minSOT

c l e a r (’− regexp’, ’ˆx | ˆ v | ˆ p b e s t | ˆ g b e s t | ˆ pg | ˆ f i t ’ ) end

4.2 Functions used

The ’setUpperbound’, ’objF’ and ’deadZone’ functions can be found in Appendix A. The ’size-

OfTransient’ function is used to compute the minimum and maximum distances to the global mini-

mum. %% Size of transient % Author: Ouboti Djaneye−Boundjou

function [y z] = sizeOfTransient(x)

global globalMin xSTAR = globalMin; % XSTAR is the global minimum. It depends on % the function to be minimized

[d1 d2 d3] = size(x {1 ,1}); y = zeros(d3,size(x,2)); z = zeros(d3,size(x,2));

for dd = 1 : size(x,2)

temp = sqrt(sum((x {1 , dd}−repmat(xSTAR,[1 d2 d3])).ˆ2));

100 y(:,dd) = max(temp); z(:,dd) = min(temp); end

101