Adding a constraint in @confun constrained optimization
Afficher commentaires plus anciens
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');
2 commentaires
Alan Weiss
le 1 Nov 2018
Sorry, I don't understand what you mean by your second constraint. The only description you gave is "I need that all the values from 0 to the X(i) to be generated (the optimum X(i)), the condition 1 is verified." I have no idea what that means.
Alan Weiss
MATLAB mathematical toolbox documentation
Mondher Souilah
le 1 Nov 2018
Modifié(e) : Mondher Souilah
le 2 Nov 2018
Réponse acceptée
Plus de réponses (1)
Alan Weiss
le 2 Nov 2018
1 vote
Alan Weiss
MATLAB mathematical toolbox documentation
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
