pso

Logo

This repository contains the standard Particle Swarm Optimization code (Matlab M-file) for optimizing the benchmark function.

View the Project on GitHub ElkmanY/pso

Particle Swarm Optimization (PSO)

View pso - Particle Swarm Optimization on File Exchange

DOI: 10.13140/RG.2.2.16986.88000

This repository contains the standard Particle Swarm Optimization code (matlab M-file) for optimizing the benchmark function:

.
├── img
|   ├── benchmark.gif
|   ├── convergence-2d.png
|   ├── convergence-30d.png
|   ├── logo.jpg
|   └── trajectory.png
├── _config.yml
├── LICENSE
├── pso.m —— [function of particle swarm optimization]
├── README.md
└── test.m —— [a test for 'pso.m']

Usage

[f_best, x_best] = pso ( J, d, xlmt, n, T )

where

Test

For instance, a benchmark Rastrigin is chosen for a test:

benchmark

Here, this benchmark is coded as a function handle

J = @(X) sum( X.^2 - 10*cos(2*pi*X) + 10 );

where X is a d-by-n matrix.

To run the test by executing

test.m

The test including two runs:

Reference:

[1] Article: Particle swarm optimization (PSO). A tutorial

[2] Author’s post (Chinese simplified): 粒子群优化及其Matlab实现

[3] Repo: BenchmarkFcns