# LP problem with conditional constraints and linearization

 0 Hi, please can you help me with my problem with one objective function - I want to maximize the following function: z = (a-b*x)*P -> max and I want to meet the condition that if (a-bx)<0 then P = p1, otherwise P = p2. I would solve it by using new binary variable y: z = (a-b*x)*p1*y + (a-b*x)*p2*(1-*y) -> max (if (a-bx)<0 then y=1, otherwise y=0) but I don't know how to state constraints to meet conditions above. The second question is whether it is possible to build model as a model of linear programming? Thanks in advance. asked 11 May '13, 11:42 Spitfire 1●1 accept rate: 0% fbahr ♦ 4.6k●7●16 There are entirely too many asterisks in the question. (11 May '13, 18:12) Paul Rubin ♦♦ @Paul: That one is on me; I forgot to remove/delete the asterisks originally used for italic formatting (of P, p1, and p2) when re-editing the question. (12 May '13, 03:26) fbahr ♦ @Florian: You should see how many edits I had to do on my answer before I got what I intended. :-) (12 May '13, 09:20) Paul Rubin ♦♦

 2 Assuming that $$p_1$$ and $$p_2$$ are constants, not variables, try $\begin{gather}z \le p_1(a-bx) + M_1y \\ z \le p_2(a-bx) + M_2(1-y) \\ a-bx\le M_3y \\ a-bx \ge \epsilon y \\ z \rightarrow \max \end{gather}$ where $$y$$ is a binary variable, $$M_1, M_2, M_3$$ are sufficiently large positive constants, and $$\epsilon > 0$$ is sufficiently small. This is not perfect -- it rules out $$0 \lt a-bx \lt \epsilon$$ -- but it's about as close as you will get, with one qualification. The qualification is that if $$p_2 \ge p_1 \ge 0$$ or $$p_1 \le p_2 \le 0$$, you do not need $$\epsilon$$ nor the constraint containing it, since maximization of $$z$$ will cause the choice of $$y=0$$ when $$a-bx \lt 0$$. answered 11 May '13, 18:17 Paul Rubin ♦♦ 14.6k●4●12 accept rate: 19% Thanks for this - it makes a lot of sense. Thanks again for spending your time on my question. Have a nice day. (12 May '13, 04:09) Spitfire
 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: