Home \ Metaheuristics \ Particle Swarm Optimization in MATLAB

Particle Swarm Optimization in MATLAB

A video tutorial on PSO implementation in MATLAB is freely available for download, in this link.

Particle Swarm Optimization (PSO) is an intelligent optimization algorithm based on the Swarm Intelligence. It is based on a simple mathematical model, developed by Kennedy and Eberhart in 1995, to describe the social behavior of birds and fish. The model relies mostly on the basic principles of self-organization which is used to describe the dynamics of complex systems.

Swarm intelligence is ability of such systems, to achieve a higher level of intelligence, which is absolutely unreachable for any of system units. For example, a flock of birds as a society, has very complex behavior patterns, which is beyond the intelligence level of any of birds in the flock, of course. However, this complex patterns are created via simple and repetitive tasks, performed by any of members in the flock.

PSO utilizes a very simplified model of social behavior to solve the optimization problems, in a cooperative and intelligent framework. PSO is one of the most useful and famous metaheuristics and it is successfully applied to various optimization problems. If you would like to read more about PSO, you can see the related article on Wikipedia (here).

In this post, we are going to share with you a complete implementation of Particle Swarm Optimization (PSO) in MATLAB. The algorithm is implemented in a structured manner and if you are familiar with MATLAB programming language, you will find it easy, to use the codes in your research projects.

Also the MATLAB implementation of Multi-Objective Particle Swarm Optimization (MOPSO) is available for download, in this link.


The download link of this project follows.

Implementation of Particle Swarm Optimization (PSO) in MATLAB


Citing This Work

If you wish, you can cite this content as follows.

Cite as:

Mostapha Kalami Heris, Particle Swarm Optimization in MATLAB (URL: https://yarpiz.com/50/ypea102-particle-swarm-optimization), Yarpiz, 2015.


  1. I need to Nested PSO in dispatching problem in Matlab. Do you help me?

  2. I need PSO implmentation for Dynamic Economic Load Dispatch problem in Matlab. I will much appreciate your help and support please.

  3. i need a MOPSO in optimizing speed, feed, depth of cut for measuring response 4 responses

  4. I need PSO implementation in more than two or three dimensions in MATLAB. This is useful for my studies..

    • You can use the provided code to solve single-objective optimization problems, with various decision variables, e.g. 100 variables or more. However if you are going to solve a multi-objective optimization problem, you must use MOPSO, which is available to download in this link.

  5. Thanks for your sharing! I have downloaded the programs,such as NSGA2,SPEA2,MOPSO,PSO,They are easy to use and modify.It is excellent.Thanks again.

  6. Dinesh kumar kasdekar

    its a good programming which is generally used in education purpose

  7. Dear Dr. Kalami,

    Thank you for your very efficient codes as well as your very efficient tutorials.

    It is our pleasure to have such a scientist from this country.

  8. Thanks a lot !! it was really helpfull.

  9. Hello, thanks of very good site….
    I am N.Badali of Ardabil city of Iran.
    Thanks a lot for you.

  10. Thank you for this great platform, great peoples share their knowledge, thanks again.

  11. I need MATLAB code for the swarm optimization algorithm to optimize the best position of the sensor/actuator in the plate

  12. Thank you for your support and effort. I need PSO smart home energy management

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.


Check Also

Particle Swarm Optimization (PSO) in MATLAB -- Video Tutorial

Particle Swarm Optimization (PSO) in MATLAB – Video Tutorial

Particle Swarm Optimization (PSO) is an intelligent algorithm leveraging principles from Swarm Intelligence, inspired by ...