Hello I need to construct an integer constrain for a situation that if result of an equation is positive it changed to zero and if the result of an equation is not positive it changed to a big number. For example if A-B>=0 Integer constrain=0 and if A-B<0 Integer constrain=big number.
Please help me. Tanks

asked 23 Dec '14, 10:23

majid's gravatar image

majid
112
accept rate: 0%

edited 23 Dec '14, 12:11


A - B                >=      - M1 *      Z  # M1 constant, > max |A - B|
A - B                <= -eps + M1 * (1 - Z) # eps constant, 0 < eps << 1
<integer constraint> ==        M2 *      Z  # M2 = big number
...or, perhaps:      >=        M2 *      Z
Z binary
link

answered 23 Dec '14, 16:44

fbahr's gravatar image

fbahr ♦
4.6k716
accept rate: 13%

edited 27 Dec '14, 17:03

Have you considered other modeling options? Perhaps using a binary decision variable that states if your expression in positive-valued, otherwise 0? This d-var can be implemented in the objective function easily, if that's where the 0/M are supposed to go...

link

answered 28 Dec '14, 11:22

Gunther77's gravatar image

Gunther77
111
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×231
×11
×4

Asked: 23 Dec '14, 10:23

Seen: 708 times

Last updated: 28 Dec '14, 11:22

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