|
From: | Zvonko Bregar |
Subject: | [Help-glpk] function |
Date: | Fri, 17 Aug 2012 08:02:39 +0000 |
Hi, My name is Zvonko Bregar. Please help me with the following problem. There is a real variable P having disjunct definition area {0} + [PMIN, PMAX]. There is also a binary variable X helping in this definition. If X = 0 then P = 0 And if X = 1 then PMIN < P < PMAX. So variables X an P work simultaneously. This should be a rather standard construction. The question is to construct another variable, say R, from X an P Such that If X = P = 0 then also R = 0 Else R = min {P-PMIN,PMAX-P} In other words, R measures the minimal distance of P to its boundaries PMIN and PMAX. But if P = 0 then R must be set to 0 too. For example, if PMIN = 200 and PMAX = 400, than the required function should be something like the “upside down” absolute value function: R = - | P - 300 | + 100 if 200 < P < 400 But also R = 0 if P = 0. I have been trying this for quite some time but didn’t succeed. It looks simple and perhaps there is a simple solution? Or perhaps this cannot be done at all? Thank you
|
[Prev in Thread] | Current Thread | [Next in Thread] |