constrain in fmincon exceeds its maximum, any tip?

1 回表示 (過去 30 日間)
sensation
sensation 2018 年 6 月 29 日
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 Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by