larg number constraints in matlab
Ältere Kommentare anzeigen
I have an optimization problem which have a larger number of variables,N=20;
how i can define this constrain? please answer to me
Qe and Qi is a matrix (40*10)
Z=[I2g,I2h, W]';
W=sdpvar(1,2*N+2);
function [cineq,ceq]=nonlcon(Z)
N=20;
for(n=1:N)
cineq(1*n)= Qe(n,:)*PP*Z-W(1)*ones(N,1)<= -10000; %%for all N indicates a vector inequality
cineq(2*n)= -Qe(n,:)*PP*Z+W(2)*ones(N,1)<= 10000; %%for all N indicates a vector inequality
cineq(3*n)= Qi(n,:)*ZZ+500-W(3+n)<=0;
cineq(4*n)= -W(3+n)<=0;
cineq(5*n)= W(N+3+n)-Qi(n,:)*ZZ-500<=0;
cineq(6*n)= W(N+3+n)<=0; %%for all N indicates a vector inequality
cineq(7*n)=sum(W(3:N+2))-sum(W(N+3:2*N+2))<=N*Iavemax;
cineq(8*n)=500+Qi(n,:)*ZZ<=Imax*ones(N,1);
cineq(9*n)=-Imax*ones(N,1)<=500+Qi(n,:)*ZZ;
end
ceq=[];
end
Akzeptierte Antwort
Weitere Antworten (1)
Johan Löfberg
am 14 Sep. 2021
Bearbeitet: Walter Roberson
am 14 Sep. 2021
1 Stimme
You're better off posting YALMIP specific questions on YALMIP specific forums
https://github.com/yalmip/YALMIP/discussions (new, prefered)
1 Kommentar
mohammad azimipary
am 14 Sep. 2021
Kategorien
Mehr zu Direct Search finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
