Particle Swarm Optimization Algorithm - MATLAB & Simulink - MathWorks India
Particle Swarm Optimization Algorithm - MATLAB & Simulink - MathWorks India
It evaluates the objective function at each particle location, and determines the best (lowest) function value and the best
location.
It chooses new velocities, based on the current velocity, the particles' individual best locations, and the best locations of
their neighbors.
It then iteratively updates the particle locations (the new location is the old one plus the velocity, modified to keep
particles within bounds), velocities, and neighbors.
Initialization
By default, particleswarm creates particles at random uniformly within bounds. If there is an unbounded component,
particleswarm creates particles with a random uniform distribution from 1000 to 1000. If you have only one bound,
particleswarm shifts the creation to have the bound as an endpoint, and a creation interval 2000 wide. Particle i has
position x(i), which is a row vector with nvars elements. Control the span of the initial swarm using the
InitialSwarmSpan option.
Similarly, particleswarm creates initial particle velocities v uniformly within the range [-r,r], where r is the vector of
initial ranges. The range of component i is the ub(i) - lb(i), but for unbounded or semi-unbounded components the
range is the InitialSwarmSpan option.
particleswarm evaluates the objective function at all particles. It records the current position p(i) of each particle i. In
subsequent iterations, p(i) will be the location of the best objective function that particle i has found. And b is the best
over all particles: b = min(fun(p(i))). d is the location such that b = fun(d).
Iteration Steps
The algorithm updates the swarm as follows. For particle i, which is at position x(i):
1 of 3 19-06-2016 15:22
Particle Swarm Optimization Algorithm - MATLAB & Simulink - Mat... http://in.mathworks.com/help/gads/particle-swarm-optimization-algorith...
The difference between the current position and the best position the particle has seen p-x
The difference between the current position and the best position in the current neighborhood g-x
If flag = false:
a. Set c = c+1.
b. Set N = min(N + minNeighborhoodSize,SwarmSize).
Stopping Criteria
particleswarm iterates until it reaches a stopping criterion.
If particleswarm stops with exit flag 1, it optionally calls a hybrid function after it exits.
2 of 3 19-06-2016 15:22
Particle Swarm Optimization Algorithm - MATLAB & Simulink - Mat... http://in.mathworks.com/help/gads/particle-swarm-optimization-algorith...
3 of 3 19-06-2016 15:22