constraints dont satisfy in ga????!!!!!!

1 view (last 30 days)
aa
aa on 17 Dec 2011
hi my constraints function is as below:
_function [c,ceq]=mcon3(x) T=x(1:39); I=x(40:78);Y=x(79:117); D=[ 1 14 6080 6080; 2 20 4465 4465; 3 23 5933 5933; 4 25 3140 5104; 4 26 3118 7872; 6 10 5354 8198; 6 11 5359 8217; 6 8 5333 8334; 7 13 4674 4674; 9 5 1548 13845; 9 7 1548 12608; 10 17 3623 3623; 11 28 3804 3804; 12 5 1735 13845; 12 6 1751 12845; 13 15 2658 2658; 14 12 3472 3472; 15 2 1947 11608; 15 3 1971 11937; 15 4 1959 12137; 16 9 1521 4390; 16 11 1509 8217; 16 8 1508 8334; 17 19 2636 2636; 18 16 2644 2644; 19 21 2240 2240; 20 18 3656 3656; 21 1 1137 10893; 21 3 1138 11936; 21 4 1130 12137; 22 1 902 10893; 22 2 888 11608; 22 4 829 12137; 23 24 4730 6676; 23 26 4753 7872; 24 1 592 10893; 24 2 583 11608; 24 3 559 11936; 25 22 4048 4048; 26 29 3781 5193; 26 31 3771 5779; 27 9 1511 4390; 27 10 1497 8198; 27 8 1498 8334; 28 30 2025 3445; 28 31 2011 5779; 29 27 2493 2493; 30 24 1936 6676; 30 25 1977 5104; 31 33 2473 4766; 31 34 2494 2494; 32 29 1414 5193; 32 30 1421 3445; 34 36 1765 5090; 34 37 1776 5126; 35 32 2332 2332; 35 33 2317 4766; 36 38 1416 1416; 37 39 976 987; 1 14 3555 3492; 2 20 3674 3670; 3 23 4824 4802; 4 25 2305 4080; 4 26 1557 3819; 6 10 2581 3635; 6 11 2698 3833; 6 8 1570 2907; 7 13 2681 2665; 9 5 1570 3822; 9 7 1548 12608; 10 17 2648 2640; 11 28 2054 2037; 12 5 546 3822; 12 6 531 5417; 13 15 1998 1984; 14 12 1788 1777; 15 2 825 4475; 15 3 1336 5946; 15 4 1273 3149; 16 9 982 1585; 16 11 527 3833; 16 8 704 2907; 17 19 2264 2251; 18 16 1537 1529; 19 21 1150 1146; 20 18 2685 2657; 21 1 534 6862; 21 3 690 5946; 21 4 633 3149; 22 1 413 6862; 22 2 498 4475; 22 4 482 3149; 23 24 823 697; 23 26 2262 3819; 24 1 288 6862; 24 2 457 4475; 24 3 2305 5946; 25 22 923 910; 26 29 2262 2504; 26 31 1674 2503; 27 9 1021 1585; 27 10 470 3635; 27 8 705 2907; 28 30 1077 1979; 28 31 892 2503; 29 27 1529 1519; 30 25 1789 4080; 31 33 1108 2154; 32 29 747 2504; 32 30 931 1979; 34 36 777 1425; 34 37 863 1899; 35 32 1449 1428; 35 33 1051 2154; 36 38 758 733; 37 39 976 987];
for J=1:115 q=D(J,4); n=D(J,2); m=D(J,1); p=D(J,3);
t1=1.4*T(n)/(((q/(10000*I(n)))^(0.02))-1);
t2=1.4*T(m)/(((p/(10000*I(m)))^(0.02))-1);
t3=135*T(n)/(((q/(10000*I(n)))^(1))-1);
t4=135*T(m)/(((p/(10000*I(m)))^(1))-1);
t5=800*T(n)/(((q/(10000*I(n)))^(2))-1);
t6=800*T(m)/(((p/(10000*I(m)))^(2))-1);
t13=(unitstep(1-floor(10*Y(n))))*t1+(unitstep(2-floor(10*Y(n)))-unitstep(1-floor(10*Y(n))))*t3+(unitstep(3-floor(10*Y(n)))-unitstep(2-floor(10*Y(n))))*t5; t14=(unitstep(1-floor(10*Y(m))))*t2+(unitstep(2-floor(10*Y(m)))-unitstep(1-floor(10*Y(m))))*t4+(unitstep(3-floor(10*Y(m)))-unitstep(2-floor(10*Y(m))))*t6; c(J) = t13-t14+0.2; ceq = []; end
I don`t know what`s wrong with that. the algorithm finds a feasible solution but the constraints don`t satisfy. I appreciate any help.
  1 Comment
Walter Roberson
Walter Roberson on 18 Dec 2011
http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!