Linear programming optimization for conditional

13 views (last 30 days)
Is it possible to optimize this objective function using linear programming (linprog or intlinprog)? I have difficulties especially in defining I(i) and the max part (second term). Thanks!
minimize
sum { I(i) * p(i)* (x(i) - x(i-1) + l(i) - g(i)) for i = 1, …, T } + max { pFix* (x(i) - x(i-1) + l(i) - g(i) for i = 1, …, T}
(I(i) = 0) if (x(i) - x(i-1) + l(i) - g(i) <= 0)
(I(i) = 1) if (x(i) - x(i-1) + l(i) - g(i) > 0)

Accepted Answer

Alan Weiss
Alan Weiss on 6 May 2016
If I understand you correctly, and if p(i) > 0, then instead of I(i) you can use
I(i) * p(i)* (x(i) - x(i-1) + l(i) - g(i)) = max[0,p(i)* (x(i) - x(i-1) + l(i) - g(i))]
If this is correct, then I believe that you cannot write your objective function as a linear function as required by intlinprog or linprog, because the objective is not linear in the variables x(i).
Alan Weiss
MATLAB mathematical toolbox documentation

More Answers (0)

Community Treasure Hunt

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

Start Hunting!