I have a function as following and try to maximise the value of V. Logic: if sn coefficient is positively largest, take max qn. if sn coefficient is negative, take min qn. if sn coefficient is between positively largest and zero, qn varies proportionally.
My code below is working but the outputs of x are equal to either DQMax or DQMi, no value is between them. How can I modify the code to derive q will vary proportionally?
where qn subject to these constraints 1) every DQMin<q<DQMax 2) ADMin<sum (q1,q2,...qn)<ADMax
[x,fval,exitflag,output,lambda] = linprog(f,A,b,,,lb,ub);
I'm sorry, I do not understand why you are dissatisfied with the result. If the result satisfies all the constraints, then what else do you want? The only case where the outputs would not be equal to the bounds is when the linear inequality constraints are active, so I suppose your linear constraints are far enough apart that they do not matter.
You can test what I mean by setting ADMin and ADMax very close to each other.
MATLAB mathematical toolbox documentation