Use Particle Swarm Optimization with inequality linear constraints.
20 次查看(过去 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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!