How to do particle swarm optimization for this problem?

3 views (last 30 days)
How can I do particle swarm optimization to get the value of e1,e2,p1,p2 that can give the highest value of f? How do make objective function and boundary constraints for PSO? I not familiar with coding and this is my first time to do PSO. Ty for your help.
% d=12
% f=z*y*2064*d
% 1.2d<=e1<48
% 1.2d<=e2<48
% 2.2d<=p1<84
% 2.4d<=p2<84
% a=e1/3d
% b=p1/3d
% k=2.8e2/d-1.7
% m=1.4p2/d-1.7
% if a<=b , y=a else y=b
% if k<=m , z=k else z=m

Answers (1)

Alan Weiss
Alan Weiss on 23 Feb 2015
If you have a recent version of Global Optimization Toolbox (R2014b) then you can use the particleswarm solver, which accepts bounds, as in your question. For more information, see the particle swarm documentation.
Alan Weiss
MATLAB mathematical toolbox documentation

Products

Community Treasure Hunt

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

Start Hunting!