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 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by