help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] function


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


OPOZORILO: To elektronsko sporočilo in vse njegove morebitne priloge lahko vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroinštituta Milan Vidmar in so namenjene izključno naslovniku. Če ste sporočilo prejeli pomotoma zaradi napake v naslovu ali pri prenosu sporočila, Vas prosimo, da nas o tem obvestite s povratno pošto. V tem primeru vsebine prejetega sporočila ne smete uporabiti, kopirati, tiskati, objaviti ali distribuirati, ampak ga morate takoj uničiti.

DISCLAIMER: This e-mail is for the intended recipient only. It contains proprietary information some or all of which may be legally privileged. If you received this e-mail by mistake please notify us by replying to this e-mail. Consequently, the contents of this e-mail must be deleted and not be used, copied, printed, disclosed or distributed.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]