Hello, I am struggling to add a second constraint in my optimization problem… My obj function is:
function f = objfun(X)for i=1..18; f=sum(exp-(10*X(i)); end
My 1st constraint is a non linear inequality :
function [c,ceq]=confun(X)ceq = [];c(1) =(-0.35*X(3)+0.35*X(9)+1.3333*X(10))^2-(0.3333*X(13)+0.3182*X(3)-0.6364*X(6)+0.3182*X(9)-X(17))^2-(0.015/2)^2;
My second constraint is also a non linear inequality which I can't code, here is what I want to verify:
% I need that all the values from 0 to the X(i) to be generated (the optimum X(i)), the condition 1 is verified.
Would you note that ub and lb and all the other entries for fmincon are known and my problem is only in the @confun
[x,fval]= fmincon(@objfun,x0,A,b,Aeq,beq,lb,ub,@confun,options)A = [];b = [];Aeq = [];beq = [];x0 = [0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016,0.0016];lb = [0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015,0.0015];ub = [0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015,0.015];options = optimoptions(@fmincon,'Algorithm','sqp');
Best Answer