1

I have a value x, which is a combination of decision variables.

I need to calculate a cost, which only triggers if x > 100. So cost = MAX(x - 100, 0) * 20.

Is there any way to do this in linear programming?

I've tried creating two binary variables (y1 & y2), in which y1 = 1 when x <= 100 & y2 = 1 when x > 100 & y1 + y2 = 1, from this website - https://uk.mathworks.com/matlabcentral/answers/693740-linear-programming-with-conditional-constraints. However, my excel solver is still giving non-linearity complaints...

Any advice on how I can fix this?

1

1 Answer 1

2

The objective

 min cost = max(x-100,0)*20

can be implemented in an LP as:

 min cost = y*20
     y >= x - 100 
     x >= 0, y >= 0

There is no need for binary variables.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.