Group: sci.op-research
From: minben
Date: Tuesday, April 08, 2008 2:35 AM
Subject: Re: How can I define such constraint in linear way?

On 4=D4=C28=C8=D5, =C9=CF=CE=E73=CA=B126=B7=D6, Ray Vickson ca> wrote:
> On Apr 6, 8:27 pm, "minb...@gmail.com" wrote:
>
> > Suppose there is a continuous variable X (it can be negative) and two
> > constants a and b, and I want to define a variable Y and let Y equal
> > to a*X(if X>=3D0) or b*X(if X<0),how can I define such constraint in
> > linear way?
>
> It depends on whether you are minimizing or maximizing. You want the
> function f(X) =3D a*X if X >=3D 0 and f(X) =3D b*X if X < 0. Write f(X) =
=3D
> c*X + e*|X|, and figure out what c and e must be to get your desired
> f(.). Now the question becomes: can you represent |X| in a linear way?
> The standard way is to write X =3D Xp - Xn, where Xp, Xn >=3D0, and to
> write |X| =3D Xp + Xn. This will be OK if we have at most one of Xp or
> Xn positive, which will be true of the optimal solution to a linear
> problem involving minimization of f(X) in the case that e > 0.
> However, it will not be true of maximizing solutions (or minimizing
> solutions when e < 0), in which case you need to impose the extra
> constraint Xp*Xn =3D 0. This can be done by introducing a binary
> variable, so you get a mixed integer problem.
>
> R.G. Vickson

Thank you for your advice!

Safety Articles | News in English | 20lbs in 30 days | Bluegrass | Usenet Newsfeeds