Spec:particle swarm optimizer

Complete missing sections

=Overview=

The purpose of developing Particle Swam Optimization (PSO) in GridLAB-D is to determine the tuning parameters of Proportional Integral Derivative (PID) controller based price control mechanisms with energy resources on a power system. This model has a lot of flexibility and can easily be applied for single and multi-object optimization problems.

General Description
PSO is a population based stochastic optimization technique [1], [2]. It is inspired by social behavior of bird flocking, fish schooling and swarming theory. The implementation of PSO paradigms is not computationally intensive in terms of memory requirements and speed. PSO can be used to solve many of the same kinds of problems as genetic algorithms. In PSO, the potential solutions are called particles and they move through the search-space by following current optimum particles. Each particle keeps track of its coordinates in the search-space. The particle with the best solution (fitness) is stored and this value is called pbest. PSO also keeps track of the overall best value obtained so far by any particle in the population. This is called gbest. In each step, PSO calculates particle velocities and updates their positions. This process continues until the number of iterations reaches the maximum value or a minimum error criterion is satisfied. The final output indicates the fitness of the given candidate solution.

=Modeling Assumptions=

=PSO=

Interfacing overview
=Equations=

PSO published outputs
= PSO timing = PSO finds the fitness of the given candidate solution for every user defined time period. The values of the decision variables are set in presync. The objective function value is calculated in sync and it is compared with the best solution so far in postsync. If the current solution is better than the best solution so far, then keep the current solution as the best else do not update the best. Update particle velocity and position with the current best for each particle and update the fitness of the function for each iteration. This process repeats until it reaches the maximum iteration limit.

PSO passes
For obtaining the fitness of the given candidate solution, PSO proceeds as:

1.	Solve the fitness of the objective function for each particle 2.	Find the best fitness for each particle (pBest) 3.	Find the best fitness among all the particles (gBest) 4.	Solve for new velocity and position for each particle using 1.1 and 1.2 5.	Update the fitness of each particle with the new particle position. This procedure continues until it reaches the maximum iteration limit.

Pseudo code for basic PSO
* Step1: Initialize the particles and their velocity components (init ) For each particle: For all dimensions: particle position (particle, dimension) = rand particle velocity (particle, dimension) = rand pbest (particle, dimension) = particle position (particle, dimension) End End

* Step 2: Initialize the pbest fitness array (init ) For each particle pbest fitness (particle) = -1000 End

* Step 3: Main PSO routine (presync ) For each iteration(as long as number of iterations are less than maximum iterations) * Step 3A: Find the fitness of each particle For each particle value = particle position (particle) solution = f (value)(declaration of an objective function) (the calculation of the objective function takes place in sync (inrinsic sync) using runtime classes) If Solution is NOT zero current fitness = 1/absolute (solution) Else current fitness = 1000 End End * Step 3B: Decide pbest among all the particles For each particle If current fitness (particle) is greater than pbest fitness (particle) pbest fitness (particle) = current fitness (particle) For all dimensions pbest (particle, dimension) = particle position (particle, dimension) End End End * Step 3C: Decide gbest among all the particles [gbest, gbest index] = maximum of current fitness For all dimensions gbest (dimension) = particle position (gbest index, dimension) End * Step 3D: Update the position and velocity components For each particle For all dimensions present (dimension) = particle position (particle, dimension) End For all dimensions calculate particle velocity using 1.1 calculate particle position using 1.2 End End End * Step 4: Publish outputs gbest

= Testing and Validation =

……Testing and validation is still being finalized and will be updated shortly. Please try back later …….

= References =

1.	Eberhart, R. C. and Kennedy, J. A new optimizer using particle swarm theory. “''Proceedings of the Sixth International Symposium on Micromachine and Human Science''”, Nagoya, Japan. pp. 39-43, 1995 2.	Kennedy, J. and Eberhart, R. C. Particle swarm optimization. “Proceedings of IEEE International Conference on Neural Networks”, Piscataway, NJ. pp.1942- 1948,1995

= See also =


 * particle_swarm_optimizer
 * Requirements
 * Implementation