constrain in fmincon exceeds its maximum, any tip?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I have many constraints in my file but one is not fulfilling the given condition. When i run the model I get the values that exceeds max_capacity and I do not want that.
Can anyone let me know where is the error maybe? Thank you a lot!
% So constaint is of a form A*x <= b
ot = ones(N,1);
ot1 = ones(N,1)*k2; %k2 is a scalar
for i=1:M % number of case studies
A2 = spdiags([ot1 ot],[0 N],N,N*2);
end
for i=1:M
b4(1:N,i)=max_cap(1,i); %max capacity
end
A = [A; A2]; %just addition to previous vector constraints
b = [b; b4]; %just addition to previous vector constraints
and I am optimizing with fmincon on x.
The equation in respect to fmincon is:
% % k2*H*x<=max_cap
Should I also include H in calculation in constraint?
H is of a form= (S(t)/alpha_par).^(1/b_par(i)))
Thanks a lot!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!