Home \ Multiobjective Optimization \ Multi-Objective PSO in MATLAB

# Multi-Objective PSO in MATLAB

Multi-Objective Particle Swarm Optimization (MOPSO) is proposed by Coello Coello et al., in 2004. It is a multi-objective version of PSO which incorporates the Pareto Envelope and grid making technique, similar to Pareto Envelope-based Selection Algorithm to handle the multi-objective optimization problems.

Just like PSO, particle in MOPSO are sharing information and moving towards global best particles and their own personal (local) best memory. However, unlike PSO, there is more than one criterion to determine and define the best (global or local). All of non-dominated particles in the swarm, are gathered into a sub-swarm called Repository, and every particle chooses its global best target, among members of this Repository. For personal (local) best particle, a domination based and probabilistic rules is utilized.

In this post, we are going to share with you the open source MATLAB implementation of MOPSO. The algorithm is implemented in a structured manner and if you are familiar with MATLAB programming language, you will find it easy, to use the codes in your research projects.

Also the MATLAB implementation of single-objective Particle Swarm Optimization (PSO) is available for download, in this link.

Implementation of MOPSO in MATLAB

### Citing This Work

If you wish, you can cite this content as follows.

Cite as:

Mostapha Kalami Heris, Multi-Objective PSO in MATLAB (URL: https://yarpiz.com/59/ypea121-mopso), Yarpiz, 2015.

1. Thanks for your sharing! Would you mind share the single-objective PSO algorithm implementation with us. Much appreciated! Your code are well documented and well written, it’s very helpful for my research.

2. getting the following error:-
Improper assignment with rectangular empty matrix.
Error in FindGridIndex (line 24)
particle.GridSubIndex(j)=…

Error in mopso (line 158)
rep(i)=FindGridIndex(rep(i),Grid);

• Maybe some exceptional situation cause the error. Please send us the definition of your optimization problem. We will investigate the problem and resolve any unhandled exceptions in the codes.

• %Objective Function

gamma=18.5;gammaw=0;fi_dash = 30*(pi/180);E=25000;nu=0.3;F=2000;
Bo=0.3;Lo=0.3;column=0.3;Fck=20;Ce=129.35;Cf=166.97;Cc=5094.85;
Cr=62.65;Cb=83.8;Pt=0.12;
D = x(1); L= x(2); B = x(3);Ht = x(4);
D_effx=Ht-0.05;
D_effy=D_effx-0.01;
D_avg=(D_effx+D_effy)/2.0;
Nq = ((tan((pi/4)+(fi_dash/2)))^2) * exp(pi*tan(fi_dash));
Nc = (Nq-1)/tan(fi_dash);
Nr = 2*(Nq+1)*tan(fi_dash);
F_gamas = 1-0.4*(B/L);
si = atan(D/B);
Fqs = 1+(B/L)*tan(fi_dash);
Fqd = 1+2*tan(fi_dash)*((1-sin(fi_dash))^2)*si;
gamma_dash = gamma-gammaw ;
q_dash = gamma_dash*D ;
q_u=F/(B*L);

%Critical BM
Mux=(1.5*q_u*B*((L/2-column/2)^2))/2;
Muy=(1.5*q_u*L*((B/2-column/2)^2))/2;

%check for depth– Take Maximum of Critical BM
%D_reqd=(sqrt(Mux*(10^6)/(5.199*0.9*B*1000)))/1000 ;

%One way shear–Vu11.0)
Tc=0.85*sqrt(0.8*Fck)*(sqrt(1+5*beta)-1)/(6*beta);
else
Tc=0.85*sqrt(0.8*Fck)*(sqrt(6)-1)/6;
end
Vu1=1.5*q_u*B*(L/2-column/2-D_effx);
Vc1=Tc*B*D_effx*1000;

% Two way shear–Vu2<Vc2
Vu2=1.5*q_u*(L*B-(column+D_avg)^2);
Vc2=1*0.25*sqrt(20)*(4*(column+D_avg)*D_avg)*1000;

%Reinforcement Long Direction– Ht or d for Atsx
Rux=Mux/(B*D_effx*D_effx);
Ptx=Fck*(1-sqrt(1-4.6*Rux/(Fck*1000)))/(2*415);
if(Ptx<Pt)
Ptx=Pt;
end
Astx=Ptx*B*D_effx/100;
Wsx=Astx*L*7850;

%Reinforceement in short Direction– Ht or d for Atsy
Ruy=Muy/(L*D_effy*D_effy);
Pty=Fck*(1-sqrt(1-4.6*Ruy/(Fck*1000)))/(2*415);
if(Pty<0.12)
Pty=0.12;
Asty=Pty*L*Ht/100;
else
Asty=Pty*L*D_effy/100;
end
Wsy=Asty*B*7850;

%FOS
FOS = q_ult/(F/(B*L));

%Settlement
beta_z = -0.0017*((L/B)^2)+0.0597*(L/B)+0.9843 ;
delta = (F*(1-(nu^2)))/(beta_z*E*sqrt(B*L));

%construction cost estimate–D and Ht interchange,+/- Qb
Qe = (B+Bo)*(L+Lo)*D;
Qf = 2*Ht*(B+L);
Qc = B*L*Ht;
Qr =(Wsx+Wsy) ;
Qb = Qe-Qc ;
Total_cost= Qe*Ce+Qf*Cf+Qc*Cc+Qr*Cr+Qb*Cb ;

% printf("\n\n Total_cost = %f",Total_cost);

z1=Total_cost;
z2=-FOS;
z3=delta;
z=[z1 z2 z3]';

• Your objectives can have the value of NaN. So everything may fall, due to incomparability of NaN to other numbers. You should modify your code, to replace the potential NaN outputs, with nun-NaN but invalid values.

3. Thank you very much for your remarkable codes in matlab. Its really being helpful for my research work.

4. very helpful for my research

5. Dr.Karamjeet Singh

Thanks a lot Yarpiz…!!
Great help to all….Highly appreciated your work and the way you wrote the Matlab codes.

7. since this is copyrifgt code. May I please get to know, in order to use this algorithm for my application domain, if I can use this code or not.

8. Thank you so much for your provide us knowledge about optimisation . In very less time I am understanding PSO by Seeing your video.. but I want to ask one thing How can we apply particle swarm optimisation for total cost function of inventory control problem…will you please explain with any example. I am try to use but I can’t understand how to right the cost and then how can I find the sensitivity table …please help me … I will be grateful …thank you again!

9. How can I cite your Matlab code in my research?

10. Dear Sir,
Will u please share the code for Harris hawks optimization with constraints.
Thanks & Regards,

This site uses Akismet to reduce spam. Learn how your comment data is processed.

x

## PESA-II in MATLAB

Pareto Envelope-based Selection Algorithm II (PESA-II) is a multi-objective evolutionary optimization algorithm, which uses the ...