Clear Filters
Clear Filters

Explanation about the boundaries at the Particle Swarm Optimization

7 views (last 30 days)
Hey.
I'm a freshman with the handling from Matlab and I have a question for the particle swarm optimization. Attached you can see my script for the PSO and the function (Rosenbrock function).
I have a question about VarMin and VarMax variables. These variables define the upper and lower bound. But when I define for example:
VarMin = 0
VarMax = 5
nVar = 5
Then of course I get for the GlobalBest a vector with 5 columns. For example:
Position: [3.7542e-04 -8.0293e-04 -0.0011 1.1266e-04 1.5088e-04]
How is this possible? There are negative values. And I defined the minimum boundary with zero.
I hope you can help me with my understanding problem.
Kind regards

Accepted Answer

Walter Roberson
Walter Roberson on 18 Mar 2018
The only place you use VarMin and VarMax is the line
particle(i).Position = unifrnd(VarMin, VarMax, VarSize);
to initialize the values.
However, as the particle moves, the velocity could easily have it go below VarMin or above VarMax, since you do not catch that it hits those boundaries.
You need to program in a test for hitting the boundaries, and you need to decide what you want to do with that case.
  2 Comments
Stefan Zeiter
Stefan Zeiter on 19 Mar 2018
Thanks for your help!
Does that mean at the moment in my script just the starting positions from the particles are bounded to my VarMin and VarMax?
Regards

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!