Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

constraint in fmincon

2 vues (au cours des 30 derniers jours)
Mouloud
Mouloud le 19 Mai 2011
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hi,
In my function optimization fmincon, I use 600 inequalities nonlineairs and one nonlineair equality, but the solution does not satisfact bounds. my constraint function writes like this:
function [c,ceq] = nonlcon(x)
global n
for i=n+1:2*n
c(i)= abs(-100-sum(x(n+1:i)-0.075266*abs(x(n+1:i))))-600;
end
ceq= sum (x(n+1:2*n)-0.075266*abs(x(n+1:2*n)));
end
is it right ????

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by