Date  File  Comment by  Comment  Rating 

18 Nov 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Petar  I have contacted you with a question about my fitness function. Hope for a positive answer. : ) 

14 Oct 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Onno Broekmans  
14 Oct 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Onno Broekmans  
07 Oct 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sampada  How can I use this toolbox for object detection and tracking in video? Is there any readymade prog. available for the same using PSO? Pl. help 

28 Sep 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Jian Guo  Thank you for your share. 

12 Sep 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Maria Esmeral  Good Morning, I want to know if I need the optimization toolbox in order to use the pso.m function? Thank you for your help 

03 Sep 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Anand  Dear Sam !


31 Aug 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  amanita  
28 Aug 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  ZhG  I found something in one of your comments here. On 15 May 2013 "I've also made a small change to ensure that only feasible solutions are selected as global optima when the penaltybased constraint enforcement method is used." What does this mean? We can obtain an relatively optimal result among all iterations? Is there an example of this kind of application. Or it is just set with options.ConstrBoundary = 'penalize' ? Thanks. 

26 Aug 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  ZhG  And another problem about population size and generation. I assigned this kind of value to these two variables.
But I always obtain the result like this:
x: [1.8990 0.9206 2.0019 0.3474 0.0901]
The population dimension is 40*5.
fitnessfcn = str2func('mytest');
issue1 = options; issue1.fitnessfcn = fitnessfcn;
[x,fval,exitflag,output,population,scores] = pso(issue1); 

26 Aug 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  ZhG  I fixed that problem.


26 Aug 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  ZhG  Hello, Does the toolbox work for the problems that variables are more than 2?


07 Aug 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  abolfazl  
30 Jul 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Molong Duan  
10 Jun 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Stephen, psoplotswarm is meant to plot particle positions in a 3dimensional axes. I use it in the PSODEMO file to make it easier to visualize how the swarm behaves. IIRC the ijk variable is a 3element array where you specify which dimension of your problem you want to plot (for example, if you have a problem with 12 dimensions and you want to plot the particle positions along the 4th, 7th, and 11th dimensions on a 3D plot). Sam 

09 Jun 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Stephen Bush  What is the meaning of the ijk parameter of psoplotswarm(options,state,flag,ijk)? What is psoplotswarm() intended to plot? As further background, I'm using psobinary() to optimize a twodimensional array (adjacency matrix for a network). 

09 Jun 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Zed  Hi Sam, Great tool, I have been using the 2010 release with no problems. Just updated to the latest release 20140330 but found out that my upper/lower bounds LB/UB are now somehow getting ignored. I noticed that this issue was brought up by Erik and others below, and you seem to indicate that this was fixed. Was it fixed in this release? This bug is serious because my LB is positive yet the PSO is straying into negative values. Hope this could be fixed soon. I am running 8.0.0.783 (R2012b). Thanks. 

28 May 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  math_network  What about the constraints handlingï¼Ÿ 

23 May 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  math_network  Dear Sam,


22 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Hi parinya, Can you email me a copy of your nonlinear constraints function through the Contact Author link? I will have a look at it. Sam 

17 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  parinya  Dear Sam, Thanks for powerful pso toolbox. I have an error after running the code with nonlinear constraint. The error message is:
I have checked that my nonlinear constraints is passed with my initial population that I supplied. What could be the possible place that I can take a look to fix this problem. Thanks Parinya 

03 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Thanks for pointing that out, Aman. b should really be a column vector [2;1] so that it will fit the equation [1 0 ; 0 1]*[x1; x2] â‰¤ [2; 1] however it looks like GA is robust enough to check for and correct that error. I will add a small piece of inputchecking code in the next release so that PSO will yield the same behavior as GA. 

02 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Erik  Sam, no problem :) 

02 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Aman Parkash  Sam,If PSO toolbox syntax same as GA toolbox so then I have found one a little bugs(but not with GA If using same syanx )for example: If I compare n run both GA n PSO syntax for two variable objective function.... pso(@(x)(x(1)^2+x(2)^2+x(1)),2,[1 0;0 1],[2 1]) showing "hozcat " and "psocheckinitialpopulation" error


01 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Aman, I'm glad your problem is working properly now. Sorry for the inconvenience! Erik, you are very welcome; is it OK if I add your name to the list of acknowledgements for this toolbox? 

01 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Aman Parkash  Erik,Sam thanks for tell n fix this bug.... now my all results are coming within range.. 

01 Apr 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Aman Parkash  means that Despite giving the bounds within postive range but some reslts was coming out of range i.e. with negative also.... 

31 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Erik  Sam, thanks for fixing the bug so quickly! 

31 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Erik, I have discovered a typo in one of the helper functions for PSO which is causing the bug that you describe. I have submitted an update which should appear over the next few days. This should also improve performance for anyone who is using lower and upper bound constraints for their optimization problems. 

30 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  kerolos, there is an option to use binary inputs (call PSOBINARY instead of PSO) however I haven't implemented any integer inputs yet. Erik, that is very curious behavior and I am getting the same results as you. Even stranger is getting a negative result if I set LB to less than 1. I will have to do some debugging to get to the bottom of this. Cristina, sorry I took so long to get back to you. I haven't actually tried to program Pareto fronts before, so I will not be of much help to your problem. I will look into developing a multiobjective version of this toolbox as time allows, however I cannot make any guarantees as medical school has other duties for me to attend to at this time. Let me know if you find a way to make it work! Matthias, that behavior is a result of the PSO algorithm not preserving the best point of every generation (unlike the genetic algorithm, which does). The algorithm proposed in Kennedy et al's book that I referred to above does not include such elitepreserving behavior, therefore I left it out of my code to maintain fidelity to their code. Ideally the swarm would stabilize in a region close to the global maximum anyway, so most of the time this is not a problem. If you are getting wildly different values between the historical best point found and the final best point, then the swarm has likely been terminated before it has found a stable equilibrium and I would not rely on those results. If the difference is within a very small margin of error, then you may choose which result to accept. 

29 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Kirti Wanjale  
29 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Kirti Wanjale  
29 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Kirti Wanjale  
29 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Kirti Wanjale  
28 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  kerolos  thanks this works great ; can i use any options to make integer inputs for the four dimensions thanks 

27 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  kerolos, try setting LB to [0, 0, 0, 0] and UB to [1, 1, 1, 1] and avoid using the linear constraints altogether. 

27 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  kerolos  thanks for this great toolbox I want some help using this toolbox for optimization of a 4 dimensional problem I want an example of Aeq and beq to saticify a constrain that all 4 dimensions values will be between 0 and 1 i tried this
Error using horzcat
Error in psocheckinitialpopulation (line 36)
Error in pso (line 338)
I read the help % x = pso(fitnessfcn,nvars,Aineq,bineq)
could not understand very well thanks .


27 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  kerolos  
13 Mar 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Erik  Hi Sam. Thanks for this great function. I have found a small bug I believe. If I try to find the lowest value of a 1/x function between 1 and 10:


20 Feb 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Cristina  Hi Sam, thank you for the toolbox! I have tried to modify the code in order to get a multiobjective optimizer, by means of a adaptive weighted sum approach for the fitness. How can I write the code, in order to write out the Pareto points? I wrote for each generation k for k=2:itr if k>=2
But it does not work well as it writes out equal points.Does anyone have any suggestion? thank you all.


10 Feb 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  longyan  hi, Sam. I am right now using PSO as a tool to minimize my fitness function. Actually i am using binary coding for the fitness function which i have already run it with GA previously, and it works fine. However, when i am using your binary PSO to calculate the same function, it best value in each generation is like random values, no patterns like gradually going down or at least sign of minimizing. I am wondering why is this happening. The binary coding fine for my case, cause it work well in GA. Will you be so kind to answer me this question, or i will post the details if you need to fix my trouble. Hope to get your reply soon. 

31 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Matthias  Hello, I think I found a crucial bug (version 20130702): 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. 

28 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  sakthi priya  Hi sam


21 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Aman Parkash, what have you defined for Aineq and bineq? Aineq must have the same number of rows as bineq. agus mujianto, I did not design my code to run in a Simulink environment, but I have heard from other users who have tried it with success. Your question pertains to aspects of the Simulink model that you are working with, which is not part of my toolbox. Unfortunately I will not be able to provide you with technical support for something that I did not create. I hope you find your answer soon! 

21 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Aman Parkash  Hi sam
Error using horzcat
Error in psocheckinitialpopulation (line 36)
Error in pso (line 338)
AND I SET THE OPTIONs : CognitiveAttraction: 0.5000
So tell me what should I do for satisfied these constraints n for getting result.... thanks


21 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  agus mujianto  hi dear sam :
the scrip :
% define the problem
where i must place dv_names, resp_names?because it contain a lot of variable but i just want to optimize 4 variable.


20 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  dab483  hi,does anyone knows where can i get pso toolbox that support multi objective optimization? 

18 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Aman Parkash  Hi dear Sam,


06 Jan 2014  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Bing  
20 Dec 2013  Another Particle Swarm Toolbox Implementation of a PSO algorithm with the same syntax as the Genetic Algorithm Toolbox.  Sam  Sanjaya, I am glad that you were able to find the answer to your question. After thinking about your problem I have also thought of some improvements to the code that I will implement in the near future. Natanael, the error looks like it is coming from the objective function which you supplied. I have recently received some emails from more community members asking for help using this toolbox. As I have mentioned before, I cannot guarantee that I will be able to respond to your particular questions in a timely or sufficient manner. I have provided demonstration functions and comprehensive help documentation with this toolbox, as well as links to further information which is posted in the file description above. Please refer to those sources of information to find the answers to your questions. If your question is timesensitive and related to academic homework, please post them to the community newsgroup so that more people will be able to see and respond to your question. 
