Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
hybrid PSO not working right

Subject: hybrid PSO not working right

From: Dave Brackett

Date: 1 Sep, 2008 19:42:01

Message: 1 of 2

I am trying to implement the hybrid particle swarm
optimisation (hPSO) algorithm from the file exchange, but
can't seem to get it to do much. As shown in the table
below, it doesn't improve over the whole optimisation. My
fitness function works fine with other Matlab optimisation
algorithms e.g. GA and simulated annealing, but doesn't
seem to work here. Any ideas why?

A snippit of my code is as follows:

fitness_fcn=@(radius_input)new_for_gatool
(radius_input,f,maxf,increment,w,k,hor_L_main,hor_L_bell,no_
variables_main,no_variables_bell,radiusi,r_diffi,Li,x0i,x1i,
mp_prodH,mp_prodH_finer,finer_freq_inc,target_Zin,orig_targe
t_maxtab,speed_c,rho,n,dT,algorithm);

options=hPSOoptions(variable_range);
[x,fval,gfx,output]=hPSO(fitness_fcn,no_variables,options);


 Flight # GlobalMin Stall Flight
__________ ___________ ______________
                                              
     2 213.3085 0
     3 213.3085 0
     4 213.3084 1
     5 213.3084 1
     6 213.3084 2
     7 213.3084 3
     8 213.3084 4
     9 213.3084 5
    10 213.3084 6
    11 213.3084 7
    12 213.3084 8
    13 213.3084 9
    14 213.3084 10
    15 213.3084 11
    16 213.3084 12
    17 213.3084 13
    18 213.3084 14
    19 213.3084 15
    20 213.3084 16
etc.

Subject: hybrid PSO not working right

From: woodchips@rochester.rr.com

Date: 1 Sep, 2008 21:13:11

Message: 2 of 2

On Sep 1, 3:42=A0pm, "Dave Brackett" <davebrack...@hotmail.com> wrote:
> I am trying to implement the hybrid particle swarm
> optimisation (hPSO) algorithm from the file exchange, but
> can't seem to get it to do much. As shown in the table
> below, it doesn't improve over the whole optimisation. My
> fitness function works fine with other Matlab optimisation
> algorithms e.g. GA and simulated annealing, but doesn't
> seem to work here. Any ideas why?
>
> A snippit of my code is as follows:

Since I can't possibly know why your code fails
to do anything, I can't really suggest the solution.
But I can test the hPSO code itself. It does work,
at least some of the time.

rosen =3D @(X) (1-X(:,1)).^2 + 105*(X(:,2)-X(:,1).^2).^2;

[x,fval,gfx,output]=3DhPSO(rosen,2,opts);
Global minimum reached: 0.0000

x
x =3D
       1.0042 1.0085

As a code, its not terribly well documented. In
fact, while I rated it sometime ago as a 4, I think
now that was perhaps quite generous on my part.
I should have rated it at best about a 3.

It took me a bit of time to figure out what most
of the options did when I just now looked at it,
and there are a few that remain a mystery,
although I did stop looking after a while.

John

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us