Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Particle Swarm Optimization Toolbox details
Please login or create an account

Particle Swarm Optimization Toolbox

The PSO on Scilab
(2057 downloads for this version - 12835 downloads for all versions)
Sébastien SALMON
Owner Organization
Optimization Command & Control Systems
Samuel Gougeon
Michael Baudin
Sebastien Salmon
Administrator Atoms
Creation Date
July 12, 2018
Source created on
Scilab 6.0.x
Binaries available on
Scilab 5.5.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Scilab 6.0.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Scilab 6.1.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Install command
--> atomsInstall("PSO")
This document introduces the Particle Swarm Optimization (PSO) in Scilab. 

The PSO method, published by Kennedy and Eberhart in 1995, is based on a
population of points at first stochastically deployed on a search field.

Each member of this particle swarm could be a solution of the optimization

This swarm flies in the search field (of D dimensions) and each member of it is
attracted by its personal best solution and by the best solution of its
neighbours. Each particle has a memory storing all data relating to its flight
(location, speed and its personal best solution). 

It can also inform its neighbours, i.e. communicate its speed and position. This
ability is known as socialisation. For each iteration, the objective function is
evaluated for every member of the swarm. 

Then the leader of the whole swarm can be determined: it is the particle with
the best personal solution. The process leads at the end to the best global

This direct search method does not require any knowledge 
of the objective function derivatives.

The PSO is a meta-heuristic optimization process created by Kennedy and Eberhart
in 1995.

Three PSO are implanted in this toolbox : 
 * the "Inertia Weight Model" by Shi & Eberhart in 1998, 
 * the "Radius",
 * the "BSG-Starcraft" by the author.

Sébastien Salmon was a mecatronics research engineer and a PhD. student at the
M3M - UTBM. 
He uses the PSO for actuator optimization and inverse parameter identification.
Now, he is creating its own company specialized in optimization.

Please cite the author when using modificated PSO (Radius and/or
Please contact the author if your are satisfied of this works (or not) and if
you find some bugs ;) . 

This module depends on the apifun module.

 * Kennedy, J. and Eberhart, R. C. (1995). Particle swarm optimization.  Proc.
IEEE Int'l. Conf. on Neural Networks, IV, 1942–1948.  Piscataway, NJ: IEEE
Service Center.
 * Shi, Y. and Eberhart, R. C. (1998a). Parameter selection in particle swarm
optimization.  In Evolutionary Programming VII: Proc. EP98, New York:
Springer-Verlag, pp. 591-600.
 * Shi, Y. and Eberhart, R. C. (1998b).  A modified particle swarm optimizer. 
Proceedings of the IEEE International Conference on Evolutionary Computation,
69-73. Piscataway, NJ: IEEE Press.
 * Salmon, S. (May 2012), Caractérisation, identification et optimisation des
systèmes mécaniques complexes par mise en œuvre de simulateurs hybrides
matériels/logiciels, PhD Thesis, UTBM, Belfort, France.

 * Copyright (C) 2012 - Optimization Command & Control Systems - Sebastien
 * Copyright (C) 2010 - 2012 - M3M - UTBM - Sebastien Salmon
 * Copyright (C) 2011 - DIGITEO - Michael Baudin

Released in Creative Commons CC-BY-NC-SA.

CHANGES 0.7 => 0.8
* First binary releases for Scilab 5.5 and for Scilab 6.0
* builder.sce can now build with both Scilab 5 and Scilab 6
* The dependence on the apifun module was not formally set
* PSO.start now checks that apifun is loaded.
* The library of macros is renamed from PSO_Toolboxlib to PSOlib.
* In PSO_bsg_starcraft() PSO_bsg_starcraft_radius(), 
  PSO_inertial(), and PSO_inertial_radius() :
  - A save('PSO_#_save',..) call was unsafe and unused. It is canceled:
    . pwd() is not always writable.
    . There were some syncronization issues (writing while the same
      file was being closed from the previous save() call).
  - When the provided speed_factor or radius is scalar while a row
    is expected, it was not replicated. Fixed.
Files (4)
[156.84 kB]
Source code archive

[94.23 kB]
OS-independent binary for Scilab 5.5.x

[136.89 kB]
OS-independent binary for Scilab 6.0.x

[136.89 kB]
OS-independent binary for Scilab 6.1.x

News (0)
Comments (1)     Leave a comment 
Comment from Mark Dresser -- December 4, 2018, 04:18:14 AM    
I attempted to run the help example for PSO_inertial verbatim on Scilab 6.0.0, Windows 7
x64 and 
got the following error:

at line   138 of function PSO_inertial ( 
line 145 
at line    32 of executed file D:\_Work\xxxxxx\xxxxxxx\PSO test.sce

Submatrix incorrectly defined.

Any suggestions?

Thanks. Mark
Answer from Samuel Gougeon -- December 6, 2018, 02:21:48 AM    
Hello Mark,

I am able to reproduce this error with Scilab 6.0.1 on Windows 7 64 bits.
However, it is no longer the case with Scilab 6.0.2- (6.0-branch).

This bug was likely due to a more general Scilab bug that has been recently fixed.
You may try yourself with a more recent Scilab version, as available there:

Leave a comment
You must register and log in before leaving a comment.
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.