How to formulate this GA constrain ?

2 views (last 30 days)
Mamdouh
Mamdouh on 29 Oct 2013
Commented: Mamdouh on 30 Oct 2013
Hello, I am working in Wind Farm Layout Optimization Problem, using GA MATLAB, with some integer variables, I stuck in formulating the constrain for minimum distance among any two turbines inside the farm, for example: I have 35 turbines, are to be installed in 1800 m wide x 1500 m deep area (farm), with four design variables for each turbine ...
f(1:35) are the turbine's type ... integer
f(36:70) are the turbines' height ...
f(71:105) are the turbines' X-coordinates ...
f(106:140) are the turbines' Y-coordinates ...
I'd like to wright a constrain function to assign 300 m as a minimum allowable separating distance between any two turbines, (among any individual turbine and all other 34 turbines).
as the turbines' location being specified by Cartesian coordinates, so the distance between turbine i and turbine j is S(ij) = sqrt ((x(i)-x(j))^2 + (y(i)-y(j))^2)
thank you in advance,
Mamdouh

Accepted Answer

Alan Weiss
Alan Weiss on 29 Oct 2013
You have 35 turbines, so there are 35*34/2 pairwise constraints that the distance has to be greater than 300. Let S(i,j) be the distance from turbine i to turbine j. Then your nonlinear constraint is
300 - S(i,j) <= 0
See the documentation for details on specifying nonlinear constraints.
Please note that GA is an inefficient algorithm. You would do well to try to formulate your problem so that a more efficient solver such as fmincon could attempt the solution. For example, formulate your problem without integer constraints, let fmincon solve it, then try rounding the supposed integer components of the answer and see if it remains good.
But if, for example, turbine type is really an integer and a noninteger value makes no sense, then you might be stuck with GA. I suggest that you use a very large population in order to get an answer that might be somewhat optimal. The solver will take a long time.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  3 Comments
Alan Weiss
Alan Weiss on 30 Oct 2013
As I told you above, the correct constraint is
c(k) = 300 - S(i,j)
where S(i,j) is the distance. Also, you don't need to calculate for j = 1:35, you can just do from i+1 to 35.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Mamdouh
Mamdouh on 30 Oct 2013
many thanks and appreciation for your help, Alan :)

Sign in to comment.

More Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!