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's gravatar image

accept rate: 0%

edited 12 May '13, 03:19

fbahr's gravatar image

fbahr ♦

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 ♦♦

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%20Rubin's gravatar image

Paul Rubin ♦♦
accept rate: 19%

edited 11 May '13, 18:30

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • 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



Asked: 11 May '13, 11:42

Seen: 2,476 times

Last updated: 12 May '13, 09:20

OR-Exchange! Your site for questions, answers, and announcements about operations research.