File Exchange

image thumbnail

Particle Swarm Optimization (Vectorized Code)

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

60 Downloads

Updated 17 Jun 2014

View License

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.

Comments and Ratings (25)

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.
Can you please help me about the code.
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).

Dicken Chow

Abdulaziz

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

can you please send the detailed explaination for the fitness function

Ningwen Xu

nice app

Nimisha

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

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

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

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
Acknowledgements

Inspired by: Particle Swarm Optimization Simulation