how to add one equality constraint in gravitational search algorithm?

2 views (last 30 days)
i want use gsa for optimization, but i can't add constraint like: L(1)+L(2)+L(3)-200>=0 how i can do that?

Accepted Answer

Matt J
Matt J on 23 Jan 2014
Edited: Matt J on 23 Jan 2014
If it was supposed to be an equality constraint L(1)+L(2)+L(3)-200=0, you could eliminate one of the variables, e.g, by substituting L(1) in the objective function with
L(1) =200-L(2)-L(3)
If you really did mean an inequality constraint L(1)+L(2)+L(3)-200>=0, you might be able to do the same kind of thing by introducing a slack variable
L(1) =200-L(2)-L(3) + S^2

More Answers (0)

Community Treasure Hunt

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

Start Hunting!