ga question_error "Could not find a feasible initial point"

I'm coding a small example of a huge problem. I think I did all the steps correctly but I get this error: "Could not find a feasible initial point" I searched and I saw I should check to not have linear constraints, and if the way I'm using ga is correct. I checked both of those things but they seem correct, is there anyone who knows what else should I check? or what else can make the problem? This is a part of my codes:
Aeq=[];
Beq=[];
nonlcon=@nlcon;
UB=[1;1;1;1;1; inf(40,1); 1;1; 1;1;1;1;1;1;1;
inf(40,1); 1;1; 1;1;1;1;1;1;1];%vector with upper bound
LB=zeros(54+49,1);%vector with lower bound
nvars=5+((8*5)+2+7)*2;
IntCon=[1,2,3,4,5, 46,47, 48,49,50,51,52,53,54, 95,96, 97,98,99,100,101,102,103];
x=ga(@obj_function,nvars,A,B,Aeq,Beq,LB,UB,nonlcon,IntCon);

댓글 수: 7

Can you show us
A
b
@nlcon
?
yes, but a and b are very big matrices that are made by concatenating some other matrices:
A=[A_X_FS,A_F_FS,A_O_FS,A_W_FS, zeros(22,49);A_X_SS,zeros(22,49),A_F_SS,A_O_SS,A_W_SS];
B=[B_FS; B_SS];
function [c,ceq]=nlcon(x)
% Nonlinear inequality constraints:
C=[0.0187, 0.0187, 0.0092, 0.0280, 0.0023];
c=[x(46)*(C(1)*(3.258*x(6)+8.503*x(7)-20.98*x(48)+13.16*x(8)-58.238*x(49)+17.537*x(9)-110.756*x(50)+21.728*x(10)-177.812*x(51)+25.781*x(11)-258.883*x(52)+29.726*x(12)-353.562*x(53)+33.5949*x(13)-461.876*x(54))+C(2)*(3.258*x(14)+8.503*x(15)-20.98*x(48)+13.16*x(16)-58.238*x(49)+17.537*x(17)-110.756*x(50)+21.728*x(18)-177.812*x(51)+25.781*x(19)-258.883*x(52)+29.726*x(20)-353.562*x(53)+33.5949*x(21)-461.876*x(54))+ C(3)*(3.258*x(22)+8.503*x(23)-20.98*x(49)+13.16*x(24)-58.238*x(49)+17.537*x(25)-110.756*x(50)+21.728*x(26)-177.812*x(51)+25.781*x(27)-258.883*x(52)+29.726*x(28)-353.562*x(53)+33.5949*x(29)-461.876*x(54)));
x(47)*(C(2)*(3.258*x(14)+8.503*x(15)-20.98*x(48)+13.16*x(16)-58.238*x(49)+17.537*x(17)-110.756*x(50)+21.728*x(18)-177.812*x(51)+25.781*x(19)-258.883*x(52)+29.726*x(20)-353.562*x(53)+33.5949*x(21)-461.876*x(54))+C(4)*(3.258*x(30)+8.503*x(31)-20.98*x(48)+13.16*x(32)-58.238*x(49)+17.537*x(33)-110.756*x(50)+21.728*x(34)-177.812*x(51)+25.781*x(35)-258.883*x(52)+29.726*x(36)-353.562*x(53)+33.5949*x(37)-461.876*x(54))+C(5)*(3.258*x(38)+8.503*x(39)-20.98*x(48)+13.16*x(40)-58.238*x(49)+17.537*x(41)-110.756*x(50)+21.728*x(42)-177.812*x(51)+25.781*x(43)-258.883*x(52)+29.726*x(44)-353.562*x(53)+33.5949*x(45)-461.876*x(54)));
x(95)*(C(1)*(3.258*x(55)+8.503*x(56)-20.98*x(97)+13.16*x(57)-58.238*x(98)+17.537*x(58)-110.756*x(99)+21.728*x(59)-177.812*x(100)+25.781*x(60)-258.883*x(101)+29.726*x(61)-353.562*x(102)+33.5949*x(62)-461.876*x(103))+C(2)*(3.258*x(63)+8.503*x(64)-20.98*x(97)+13.16*x(65)-58.238*x(98)+17.537*x(66)-110.756*x(99)+21.728*x(67)-177.812*x(100)+25.781*x(68)-258.883*x(101)+29.726*x(69)-353.562*x(102)+33.5949*x(70)-461.876*x(103))+ C(3)*(3.258*x(71)+8.503*x(72)-20.98*x(98)+13.16*x(73)-58.238*x(98)+17.537*x(74)-110.756*x(99)+21.728*x(75)-177.812*x(100)+25.781*x(76)-258.883*x(101)+29.726*x(77)-353.562*x(102)+33.5949*x(78)-461.876*x(103)));
x(96)*(C(2)*(3.258*x(63)+8.503*x(64)-20.98*x(97)+13.16*x(65)-58.238*x(98)+17.537*x(66)-110.756*x(99)+21.728*x(67)-177.812*x(100)+25.781*x(68)-258.883*x(101)+29.726*x(69)-353.562*x(102)+33.5949*x(70)-461.876*x(103))+C(4)*(3.258*x(79)+8.503*x(80)-20.98*x(97)+13.16*x(81)-58.238*x(98)+17.537*x(82)-110.756*x(99)+21.728*x(83)-177.812*x(100)+25.781*x(84)-258.883*x(101)+29.726*x(85)-353.562*x(102)+33.5949*x(86)-461.876*x(103))+C(5)*(3.258*x(87)+8.503*x(88)-20.98*x(97)+13.16*x(89)-58.238*x(98)+17.537*x(90)-110.756*x(99)+21.728*x(91)-177.812*x(100)+25.781*x(92)-258.883*x(101)+29.726*x(93)-353.562*x(102)+33.5949*x(94)-461.876*x(103)))
];
% No Nonlinear equality constraints:
ceq=[];
end
Ill appreciate your time if you can advise me!!!
To check: you have 80 variables with lower bound 0 and upper bound infinity, and you have 23 decision variables that are either 0 or 1 ?
You might be better off running all 2^23 combinations as separate problems, each with the value of the decision variables fixed, so that you get away from using intcon.
Im not very sure if it works, but maybe it is worth a try:
If you know at least on feasible constellation for your problem you could use the InitialPopulationMatrix option. This has as many columns as decision variables and as much lines as possible feasible States you know. Max number of lines is population size but also one line is possible. Then ga should have a feasible initial point in search space.
The only question is:
Do you have such a point?
The InitialPopulationMatrix should have as many columns as you have variables (103), not as your decision variables (23). "decision variables" refers to binary variables, 0 for No, 1 for Yes.
Thanks for the clarification Walter.
Thank you so much for your comments!!!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

질문:

2018년 9월 11일

댓글:

2018년 9월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by