On Wed, 1 Sep 2010, xiaomi wrote:
I am considering to use the property that the result of GLPK is
non-negative to simulate step function as follows:
for example: step function y=u(5);
minimize y
y<=M(x-5) , where M is a large number to simulate sharp slope.
y<=1;
It seems to imply that when y<=5, y>=M(x-5) && y>=0.
Does that work(fast?)? And is GLPK default to be non-negative result?
Not for x> 5.
In that case, y< 0.
Note that neither of you constraints is good for minimizing y.
I gather that you want to allow y to be 0 only in the range [0, 5]
and 1 only in the range [5, H], where H is an upper bound on x.
________
_____|
The convex hull is a quadralateral.
Two of the sides are y>=0 and y<=1.
I'll leave the other two as an exercise for the reader.
Be sure to make y binary.
If you are minimizing y, you can omit two of the sides.