File Exchange

## Particle Swarm Optimization (Vectorized Code)

version 1.0.0.0 (4.12 KB) by
a simple implementation of Particle Swarm Optimization algorithm (PSO)

Updated 17 Jun 2014

Particle swarm optimization (PSO) is a computational method that optimizes a problem by iteratively trying to improve a candidate solution with regard to a given measure of quality. PSO optimizes a problem by having a population of candidate solutions, here dubbed particles, and moving these particles around in the search-space according to simple mathematical formulae over the particle's position and velocity. Each particle's movement is influenced by its local best known position but, is also guided toward the best known positions in the search-space, which are updated as better positions are found by other particles. This is expected to move the swarm toward the best solutions.
This code is based on the original PSO code in "file exchange" by Wesam Elshamy.

### Cite As

Reza Ahmadzadeh (2020). Particle Swarm Optimization (Vectorized Code) (https://www.mathworks.com/matlabcentral/fileexchange/46985-particle-swarm-optimization-vectorized-code), MATLAB Central File Exchange. Retrieved .

Satyam Sharma

I am trying to find optimal position of relay node in wireless body area network using PSO in Matlab(the relay node is used to calculate path with low SAR[specific absorption rate of sensors]). Can anyone help me?

Revanth Ram

Hello sir I want to minimise cos5x1+cos5x2+cos5x3+cos5x4=0
Cos7x1+cos7x2+cos7x3+cos7x4 =0
Cos11x1+cos11x2+cos11x3+cos11x4 =0
Where i have 4 unknown variables x1, x2, x3,x4 and condition is 0<x1<x2<x3<x4<pi/2.
This is my engineering project. Thanking you sir..
Mail revanthroy507@gmail.com

Ali Ali

Dear Mr. Reza,

Hoping this finds you well,

I appreciate if you can tell me why you are using the formula below for updating your algorithm:
swarm(i, 1, 1) = swarm(i, 1, 1) + swarm(i, 2, 1)/1.3;
specifically (/1.3).

Lakshya Sethi

Dicken Chow

Abdulaziz

B nikhil chand

PALASH MONDAL

it should be better if you provide audio explanation in every line of code.

suresh kumar

can you please send the detailed explaination for the fitness function

sawon pratiher

Lakshmanaprabu SK

Ningwen Xu

Ho Dang Dung

Hirak Mazumdar

nice app

Hirak Mazumdar

Nimisha

@ Mahendra Meher.! Mail me to get code.!

Mahendra Meher

I want optimal placement of PMU using PSOT Matlab Code. Can you help me?

M N Alam

Dear All
A very simple PSO codes can be obtained with an example in MATLAB environment to the link given below;

https://www.researchgate.net/publication/296636431_Codes_in_MATLAB_for_Particle_Swarm_Optimization

bourne

the animation is really cool

Shrinivas

Dear Sir,

I am getting following error

??? Error: File: VPSO.m Line: 63 Column: 7
Expression or statement is incorrect--possibly unbalanced (, {, or
[.

I tried some possibilities, but unable to fix. kindly help me

Shrinivas

Dear Sir,

I am getting following error

??? Error: File: VPSO.m Line: 63 Column: 7
Expression or statement is incorrect--possibly unbalanced (, {, or
[.

I tried some possibilities, but unable to fix. kindly help me

good job

Vembarasan V

Thanks for the code. Dear Sir, I am new learner to the PSO. Let me know what is the purpose of dividing by 1.3 when update x and y position in the code.

Toan Dang

##### MATLAB Release Compatibility
Created with R2010a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux