Variable f coeffficient depends on x for linprog
조회 수: 20(최근 30일)
I have a minimization problem and I wonder that if i can solve the problem with linprog or how can i solve within matlab framework?
E.g. f= [f(1) f(2)]; x = linprog(f,A,b,Aeq,beq);
In that problem i have variable f coefficient depend on x value. f(1)=0, if x(1)<0 / f(1)=50, if x(1)>0 .
How can i solve this minimization problem?
Bruno Luong 2022년 5월 4일
Solve 2 problems
f= [0 f2]; x = linprog(f,A,b,Aeq,beq,lb1,up1); with lb1 = -inf(size(x)), up1 = zeros(size(x));
g= [50 f2]; x = linprog(g,A,b,Aeq,beq,lb2,up2); with lb2 = zeros(size(x)), up2 = inf(size(x));
Then pick the best solution
Torsten 2022년 5월 4일
According to that some of x variables should be less than zero and some of them should be greter than zero. So, I think I need a combined solution.
Add new variables
y(i) >= x(i)
y(i) >= 0
and define the objective as
For the interpretation:
y(i) = max(x(i),0)