# Only one variable get value

 0 Dear OR experts, I have this equation in my model: X_it + Y_it - Z_it - N_i = 0 where all of these variables are continues. The problem is that Y_it and Z_it cannot have values greater than zero in the same time step (t). In other words, if Y_it is greater than zero, Z_it has to be zero and vise versa. Could you please give me your idea about how to formulate this condition in my model. Thanks Kam asked 03 Jan '14, 04:27 Kam 21●2●9 accept rate: 0%

 4 Florian's solution certainly handles it, at the cost of turning something that might have been a linear program into an integer program. Depending on how Y and Z are used otherwise, do you need to force the "one is zero" constraint or might it happen naturally? If Z measures the negative amount for X_it-N_i and Y is the positive amount, a lot of formulations will naturally have only one be positive (for instance, in a linear program where Y and Z don't occur otherwise except in the objective function). answered 03 Jan '14, 06:36 Mike Trick ♦♦ 1.0k●1●6 accept rate: 21%
 3 Let Y_it, Z_it <= M, M const: Y_it <= M * w Z_it <= M * (1 - w) w binary  answered 03 Jan '14, 04:46 fbahr ♦ 4.6k●7●16 accept rate: 13% Hi Florian, Thanks for your good idea. Kam (03 Jan '14, 04:50) Kam
 1 As an alternative to Florian's solution, you can declare $$Y_{it}$$ and $$Z_{it}$$ to be a type 1 special ordered set (SOS1). If you know a tight, valid bound M, I suspect you are better off with Florian's approach. (This assumes that Mike's approach does not work.) answered 04 Jan '14, 15:21 Paul Rubin ♦♦ 14.6k●5●13 accept rate: 19%
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×6