MATLAB: Linear programming optimization for conditional

conditionallinear optimization

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)

Best Answer

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
Related Question