Code covered by the BSD License  

Highlights from
Particle Swarm Optimization Toolbox

4.21333

4.2 | 81 ratings Rate this file 319 Downloads (last 30 days) File Size: 745 KB File ID: #7506
image thumbnail

Particle Swarm Optimization Toolbox

by

 

22 Apr 2005 (Updated )

With Trelea, Common, and Clerc types along with ...

| Watch this File

File Information
Description

Robust Particle Swarm toolbox implementing Trelea, Common, and Clerc types along with an alpha version of change detection.

This toolbox is designed for researchers in Computational Intelligence as well as application developers, students, and classroom labs. It is robust enough that several papers have been developed using it but it is also in constant development and very easy to hack. Users of MATLAB's Optimization Toolbox should feel right at home but even if you don't use that toolbox this will be easy to figure. Extensive help is included.

Anyone from serious AI researchers to beginning students should get something out of this.

This toolbox is constantly evolving and I welcome suggestions.

Current feature set:
* Trelea, Clerc, and Common Types
* Vectorized and non-vectorized versions, you can investigate thousands of particles at once with the proper cost function.
* custom plotting plug ins
* neural net trainer (requires Matlab's neural net toolbox)
* PDF Particle Swarm Introduction
* Alpha version of change detection, will track dynamic environments
* includes suite of test functions commonly used in the CI/optimization community.

Acknowledgements

This file inspired Neural Network Add In For Psort, Optimal Power Flow By Vector Pso, Pso Solution To Economic Dispatch, and Improved Pso Program To Solve Economic Dispatch.

Required Products Neural Network Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements * current version works in Matlab 7 but has been in development since Matlab 5 so might work in the earlier versions too.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (126)
30 Jul 2014 ABIN joy

Sir,i want to apply optimization technique to the intencity values taken from the histogram..is it possble to apply PSO to that?

28 Jul 2014 Jordan

I can't even get the demo to run...

>> pso_Trelea_vectorized('f6',2)
Error: File: pso_Trelea_vectorized.m Line: 105 Column: 1
Function definitions are not permitted in this context.

28 Jul 2014 Jordan

WHY??

Error using plot3
Vectors must be the same lengths.

Error in goplotpso (line 23)
plot3(pos(:,1),pos(:,D),out,'b.','Markersize',7)

Error in pso_Trelea_vectorized (line 295)
eval(plotfcn); % defined at top of script

28 Jul 2014 Jordan

Undefined function 'normmat' for input arguments of type 'double'? Help

20 Jun 2014 Marcio H Zuchini  
19 Jun 2014 Wendy

Hi,

I want to apply PSO to fit kinetic parameters of a system of ODEs. I got the following error when I ran the program. Does anybody know how to fit it? Thank you in advance!

[val] = pso_Trelea_vectorized(@fitness, 2);

-- error message
PSO: 1/2000 iterations, GBest = 1895760000.0007648468.
Error using plot3
Vectors must be the same lengths.
Error in goplotpso (line 23)
plot3(pos(:,1),pos(:,D),out,'b.','Markersize',7)
Error in pso_Trelea_vectorized (line 344)
eval(plotfcn); % defined at top of script
Error in driver_fitness (line 5)
[val] = pso_Trelea_vectorized(@fitness, 2);

15 May 2014 Talieh

Hi,
I was trying to use this program with a function handle input (instead of an .m file), but I get error. I was wondering, the only way to use this is to define the objective function in a separate .m file?

Thanks

04 May 2014 GUIZHOU  
03 Feb 2014 Hong Nhung Phan

Hello,

Please, Can any body tell me way to simulation PSO-C from Matlab PSO toolbox.

Thanks.

31 Jan 2014 Matthias

Uuups,

my comment (see below) actually refers to another PS-optimizer. Sorry for that.

17 Jan 2014 Matthias

Hello,

I think I found a crucial bug: in my program I write down the test parameters if they fit better than in the iterations before. In my test PSO stopped after fulfilling a break condition and gave me a final parameter set, which fitted less than an intermediate result I wrote down before.

15 Jan 2014 homecat  
29 Nov 2013 dab483

Can this toolbox works with multiobjective optimization?

01 Oct 2013 Sabb Aquarians  
12 Sep 2013 Phan HaNhut

Hi, Bui Hong Phong, I am living in Binh Duong, and you? 0167 3493 081

03 Sep 2013 Joe Ajay

Hi Brian Brige, just an info needed...Were u able to update the toolbox for Discrete problems. I got a problem in which my variables are integers. Say for ex:-3 to 3 with step size of 1

19 Jul 2013 Muhmmad

Very helpful package.

07 May 2013 zhong  
06 May 2013 sehrish

plz can any body tell me which files are necessary for simple PSO...as there GPSO and LPSO...so how to get only those files which run simple PSO??

17 Apr 2013 Guillermo

@Fabian You could always rewrite your objective function to take into account function constraints by adding penalties.

05 Apr 2013 Fabian

Is there still no update for constraints? Or I#m blind enough to not find the option?

22 Jan 2013 IBRAHIM MTOLERA

1.how to create switch onoff_Constraints in the control panel
2.how to add objective function in PSOt box

07 Nov 2012 kevin

doesn't work for me

25 Oct 2012 Tom  
21 Jun 2012 Phong Bui Hong

i could not read this file. Pls help me

07 Apr 2012 ahmed albakri

THANK YOU VERY MUCH MY DEAR

26 Mar 2012 yap ee chiet

Hi Brian Bierge,
may I know is the matlab code for multi-objectives PSO available?

Thank you.

19 Mar 2012 isma

hello every 1..i need a help pso method...hw do i can relate this method into solar tracking system..i am doing a simulation on solar mppt based on pso method..can anybody guide me hw to related this method into my project...
this is my email b010910290@student.utem.edu.my

03 Mar 2012 sofiane

good job

24 Feb 2012 Erik

Hello!
I think this is a good package because one can get started quickly and has good graphics. I hope it will be updated soon, and that the option of constrained optimization will be added.

A few comments:
* the code is easily modifiable to support anonymous functions as objective. This is neccessary to pass extra parameters to objective without using global parameters. The only modification needed is to remove the use of the function name as a string in the plotting routine.
* There is an error in the doc of pso_Trelea_vectorized.m: the explaination for input variable minmax value of 2 says that error is targeted to P(12), but the correct is P(11)
* The options should be moved from an array to a structure, so that only those one wants to let override the defaults need to be given.
* there is an error in line 441, where the variable 'sqrerr1' is misspelt as 'sqerr1'
Best,
Erik

24 Jan 2012 nilam nini

good...does anybody here work on Multiobjective PSO using matlab..where can i get the source code

19 Aug 2011 Raffaele  
28 Jun 2011 ondrej

Hi
been trying to run demoPSOnet
getting the following error:

??? Error using ==> trainpso at 124
Unrecognized code.

Error in ==> network.subsasgn>setTrainFcn at 2025
net.trainParam = feval(trainFcn,'defaultParam');

Error in ==> network.subsasgn>network_subsasgn at 462
if isempty(err), [net,err]=setTrainFcn(net,trainFcn); end

Error in ==> network.subsasgn at 11
net = network_subsasgn(net,subscripts,v,netname);

Error in ==> newff>new_5p0 at 301
net.trainfcn = btf;

Error in ==> newff>create_network at 128
net = new_5p0(varargin{:});

Error in ==> newff at 102
out1 = create_network(varargin{:});

Error in ==> demoPSOnet at 34
net = newff([min(P,[],2),max(P,[],2)],... % input parameter ranges

12 Jun 2011 reham hassen

thanks

08 May 2011 Aditya Gourav

amazing!!!

22 Apr 2011 moh moh

good day for all users

29 Nov 2010 Tricia Rambharose

Good day users,

A PSO toolbox which can be used for NN trainig, and works with the latests versions of MATLAB, is now available on MathWorks.

The PSO toolbox is found at:
http://www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox

The NN add-in for this PSO toolbox is found at: http://www.mathworks.com/matlabcentral/fileexchange/29565-neural-network-add-in-for-psort

Regards,
Tricia

Regards,
Tricia

08 Oct 2010 junjie

Thank you very much, with these, I can use pso more quickly.

26 Sep 2010 Tricia Rambharose

Good day everyone,

For those of you who emailed me asking for assistance in using PSO for NN training, and also for the general public, I found another PSO toolbox to be very helpful to me. The toolbox I now use is found at

http://www.mathworks.com/matlabcentral/fileexchange/28291-particle-swarm-optimization-research-toolbox

I have added functionality for this PSO toolbox to be used as a training algorithm for a NN. This version is currently being tested and will then be made available.

26 Sep 2010 sugith sewdass

I am currently working on a research project.
I am trying to train a neural network using PSO.
When using the PSO toolbox with Matlab version
7.6.

demoPSOnet' does not work. I get the following error :
??? Error using ==> trainpso at 124
Unrecognized code.
If I can find a simple way to train the Neural Network using the PSO toolbox it will be of great help to me.

Please can anyone assist me in anyway.

Regards
Sugith

02 Sep 2010 Eric  
12 Jul 2010 Erdal Bizkevelci  
25 Jun 2010 Shawkat hamdan

hi Brian
i want to ask you if you have program in which we can make tuning the parameters of the pso like w, c1, c2 to make the pso more effective as results
thank you very much to your help and cooperation

this is my e-mail:shawkat@bau.edu.lb

my best regards

shawkat

23 May 2010 syed musthafa

dear all,
i need pso coding for OPIMAL LOCATION OF FACTS DEVICES..i also need ur valuable suggestions to do this project..kindly send me the codings/suggestions...

29 Apr 2010 Brian Birge

Hey everyone, sorry for taking so long to update this, it will be updated shortly and contain discrete capability as well as multi-objective optimization built in and more flexible constraints (linear or nonlinear). If you wish to do multi-objective opt "lite" right now you can, just write your cost function so it has a weighted sum of your objectives as the output, a standard way to do it. More complex methods will be added with the update.

06 Apr 2010 Tusi Bai

How to use it to multi-objective optimization problems?

begtostudy@gmail.com

03 Mar 2010 Zacharias Voulgaris

I am also interested in discrete PSO for TSP. If anyone has something in Matlab, please contact me. Thanks.

11 Jan 2010 Mohammed Ahmed Saeed

i prepare for my Master in optimal relay coordination and if you please i need your help to provide me with a swarm code to determine the optimal relay settings ( i can not do the fitness function for each particle )
Thanks

14 Dec 2009 tom

Hi, everyone,
I am interested in PSO with both linear and nonlinear constraints for high-dimention problem, but I found this package can not handle it.
Is there any other PSO toolbox to handle the problems with nonlinear and linear constraints? Please let me know: dr.xinlivu@gmail.com. I am waiting for your reply.

Thanks,
Tommy

13 Nov 2009 Eric

Saeed and Vishal,
You need to manually add the subdirectories to your path, e.g. /hiddenutils and /testfunctions for the demo.

Anyway, I'm still learning how to use the PSO tool - so far so good! I'll come back with a rating once I've explored it further.

13 Nov 2009 saeed gol Golian

hi everyone
I encountered with the same error as vishal mehra

?? Undefined function or method 'normmat' for input arguments of type 'double'.

Error in ==> pso_Trelea_vectorized at 252
pos(1:ps,1:D) = normmat(rand([ps,D]),VR',1);

can anyone give me a hand?

09 Sep 2009 vishal mehra

hello
can anyone help me?
when i run the command at command window for testing the fn f6 i got the error as below.

out = pso_Trelea_vectorized('f6',2)
??? Undefined function or method 'normmat' for input arguments of type 'double'.

Error in ==> pso_Trelea_vectorized at 252
pos(1:ps,1:D) = normmat(rand([ps,D]),VR',1);

can anyone tell me now what i have to do?

28 Apr 2009 Homri

Hello,
Please who can help me for the choice of parameters trainpso
thank you

09 Apr 2009 Shree Guha

I found this helpful. I had to modify the function to fit my problem description. I have a lot more to work on it. But i like it so far! Thanks again.

06 Apr 2009 Ali Sabbagh

Dear jalla
would you please help me how it work?
i spend too much time to understand but i was not successfull
thank you

05 Apr 2009 jjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjj

Hi friend,
I am a PhD Research Scholar in Indian Institute of Technology, Roorkee, India.
After working for 4 hours continuously, i am able to run train the Neural network program using this PSO toolbox.
I am vary thankful to you. Great job.
I can help, if anybody is in need of my help.

14 Mar 2009 Tricia Rambharose

I am a research student at the University of the West Indies.

A collegue of mine used trainpso and newff to train a neural network. He used Matlab version 5 and it worked well. I am using Matlab version 7.6.0 and neither trainpso nor newff works.

With this toolbox 'DemoPSOBehavior' and pso_Trelea_vectorized('f6',2) works with my Matlab version, but 'demoPSOnet' does not work. I get this root error :

??? Error using ==> trainpso at 124
Unrecognized code.

Is there any other way to train a Neural Network by PSO using this toolbox?

16 Feb 2009 skouliki katelouzos

this doesn't work with version 5.1 of neural network

16 Feb 2009 skouliki katelouzos  
25 Jan 2009 Homri  
25 Jan 2009 Homri

I want to use Trainpso but i have a probleme .
matlab error message "Unrecognized code".
Please can you help me

05 Oct 2008 Kanwardeep Singh

A Good Work

28 Sep 2008 Gui Xiaolin

ilike it very much!

26 Sep 2008 necla OZKAYA  
21 Sep 2008 thangjam singh

inspiring

31 Jul 2008 asd adsf

very good!I hope the new version can add local pso !

09 Jul 2008 Masoud Shariati-Rad  
09 Jul 2008 Masoud Shariati  
12 Jun 2008 Lin Wang  
29 Apr 2008 mat yusof  
28 Apr 2008 sahbi boubaker

there's someone who have worked with pso to optimize hybrid systems please mail me if...

23 Apr 2008 sahbi boubaker

good work

22 Apr 2008 Ahmed Saleh

This is good to apply pso in optimization problem

17 Apr 2008 sanny sihombing

is there anyone know a research paper that explore PSO for Neural Network training, using this toolbox? please e-mail me about this, i really need it for studying. thanks!

10 Apr 2008 Maurice Clerc

It would be interesting to implement the new version (Standard PSO 2007, available on the Particle Swarm Central http://www.particleswarm.info).

13 Feb 2008 nadda chawalarat  
06 Feb 2008 Dhilip Kumaar

This tool is very nice to use. I have done certain works using this tool for Vehicle Routing Problem.

20 Jan 2008 abdelwahhab Boudjellal

i am etidient algerienne mgister can you help me by Matlab traitement image please
i d'nt space english good

20 Jan 2008 Dhilip Kumaar

Its very good to use this zip file. It helps me inlot to use PSO toolbox in MATLAB

11 Nov 2007 elham asadi

Where can I find a matlab code of discrete PSO or to solve TSP by PSO?Is anyone konw?If you konw,please mail me. Thanks a lot.

18 Oct 2007 morteza eslamian

this program is very good

22 Sep 2007 toumi lyazid

very happy

10 Sep 2007 Mohammad Zakermoshfegh  
14 Aug 2007 lin si

Great job!

12 Aug 2007 John Q

Any idea how to use for training neural nets with custom non-differentiable cost functions?
Please help...

04 Aug 2007 saleh mohseni  
04 Aug 2007 saleh mohseni  
13 Jul 2007 m saberan

please add a perfect help to this file,because it is very hard to use it without help.i can not use trainpso for my problem.
thanks for your attention

06 Jul 2007 Pragati Tiwary

very vague description of how to use the toolbox. I am not able to run a simple optimization problem. Please try to come up with some illustrative and explanatory User manual.

01 Jul 2007 mm rezaei  
29 May 2007 wu di  
27 May 2007 Huynh Chau Duy

Documents and paper about Particle Swarm Optimization

24 May 2007 li zhen

Where can I find a matlab code to solve TSP by PSO?Is anyone konw?If you konw,please mail me,thx a lot.

11 May 2007 zhaojia Wang

Thanks a lot:)

17 Apr 2007 Muhammad Shakil

Does not work with matlab 2006a

30 Mar 2007 trace water

thank you the dear author!great work!

04 Mar 2007 robert rino  
13 Feb 2007 ehsan nasr  
10 Feb 2007 babak zarei  
31 Jan 2007 Sirichai S

I'm graduate student of Thammasat University, Thailand.
I need to support my study.
Thank a lot

17 Dec 2006 potter harryhfy

i am a student of computer and technologe department.

28 Nov 2006 lan FA

thank you ,I need it for my project of ant model

19 Nov 2006 ali alizade

hello.
please send for me

11 Nov 2006 Dingyu Xue

Nice code.
Is it possible to provide the non-vectorized version as well? thanks

18 Oct 2006 Ranjit singh chauhan

Excellent tool.

06 Oct 2006 sachin soni

it's an excellent toolbox for the researchers and university student. it is helping me alot in preparing my research paper and i hope that the other user's will also find it a boon to them.

20 Sep 2006 jagdish bansal

very good

19 Sep 2006 aa ss

66pll;

13 Sep 2006 ish kakkar

it is very good and some more friendly can be made...

13 Aug 2006 sankar karan

thanks

05 Aug 2006 weidong wu  
04 Aug 2006 Ran Ren  
03 Jul 2006 safiye turgay  
18 Jun 2006 Omar Vicencio  
09 Jun 2006 dan lak

good

09 Jun 2006 dan lak  
09 Jun 2006 dana lak

some democanbe added

29 May 2006 Rafael Rodriguez  
19 Apr 2006 Yuan Liguo

Thanks,I downloaded it. It is helpful for me to learn PSO.

08 Apr 2006 John D'Errico

I like the cleanup that was done, so I thought it was time to revisit this (nice, sophisticated) tool. Great graphics, at least where this is possible. If I want to complain about anything, its the fact that PSOt REQUIRES its function in the form of an m-file. Neither inline or anonymous functions are supported. Its a silly constraint, because my guess is the only reason is to include the function name on the generated graphics. Otherwise feval should be insensitive to these alternatives. The advantages that anonymous functions (especially) offer suggests fixing this. On the other hand, this is a really nice piece of work, so I'll raise my rating to a 5 anyway.

13 Mar 2006 shark spear

I am wondering if this PSO can deal with discrete parameter optimization problems. Thanks a lot!

29 Jan 2006 KHALED ABO-AL-EZ  
27 Jan 2006 John D'Errico

A nice, sophisticated PSO toolbox. The only flaw is it feels like the interface & documentation needs some attention - apparent defaults that did not seem to default as the documentation implies. A simple test crashed for no apparent reason. I noted that the documentation did not even tell you the correct name of the function used to drive the optimizer. Once you get past these minor points and learn how to drive it properly, I think this is a nice toolbox. I'd like to give it about a 3.75 rating.

22 Nov 2005 sione palu

Brian, could you please give a more examples. I find it excellent for a new learner like me about the subject.

07 Oct 2005 Kurt Lewis

I don't know much about theis, but if the program won't run on the example included in the help, then I think I can't use it:

> out = pso_Trelea('f6',2)
??? Error using ==> f6
Too many input arguments.

Error in ==> pso_Trelea at 203
out(j)=eval(evstrg); % evaluate desired function with particle j

08 Aug 2005 zhuohua duan  
Updates
08 Mar 2006

Significantly updated PSO function itself as well as the plotting routines. Fixed DemoPSOBehavior, updated README, dropped non-vectorized code. This completely replaces previous version.

Contact us