Use Particle Swarm Optimization with inequality linear constraints.
조회 수: 19 (최근 30일)
이전 댓글 표시
I would like to know how can I use Particle Swarm Optimization with inequality linear constraints.
I get to run my code just with bounds limits, but I need run my code with linear constraints also, I need the sintax of function PSO.
댓글 수: 0
채택된 답변
Stephan
2019년 3월 20일
Hi,
there is not such a syntax, since PSO does not support constraints. If you need constraints i suggest to use ga, which is able to handle this.
Best regards
Stephan
댓글 수: 0
추가 답변 (4개)
Maisa Melo
2019년 3월 20일
댓글 수: 1
Alan Weiss
2019년 3월 20일
We cannot answer why ga finds those points until we see your A and a matrices, and maybe (if it is not too long) your objective function funcaoObjetivo and the associated data U0 and n.
Alan Weiss
MATLAB mathematical toolbox documentation
Maisa Melo
2019년 3월 20일
댓글 수: 1
Alan Weiss
2019년 3월 20일
편집: Alan Weiss
2019년 3월 20일
Thank you for the detail. I do not understand why you are trying to solve this problem using Global Optimization Toolbox solvers. The objective function looks smooth (perhaps a ratio of quadratics), and the constraints are linear. Therefore, you should not attempt to solve the problem using particleswarm or ga, but instead should use fmincon or perhaps quadprog if I misunderstand the constraints.
It is possible that you are computing an expectation using a simulation, and I did not understand that part of your explanation. If so, then perhaps read Optimizing a Simulation or ODE to see how you might need to set finite differences appropriately.
I did not test your linear constraints to see what kind of region they allow. Perhaps you should look at your feasible region by using linprog with your A and a matrices, and give varying f arguments to see what kinds of solutions you can get (I mean choose differing signs of the components of f). Also, and this is important, you should set finite bounds on all variables, botth upper and lower bounds.
One reason that your ga optimization is working poorly is that your options seem suited for a problem with just a few variables and dimensions, perhaps three or four variables u(i). I suspect that you have a great number of variables in reality. Therefore, a population size of 50 means that ga has no chance of providing you with reasonable answers. But in any case, you should not use ga for this kind of problem.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Abderrahmane DADA
2019년 9월 15일
Hello Meisa.
Check the following link: It's a partcile swarm toolbox that is able to handle constrained problem.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Particle Swarm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




