Because your piecewise-linear function does not have increasing slopes, it
is not convex. If you express it using AMPL's piecewise-linear notation,
then CPLEX can deal with the nonconvexity, but only by introducing integer
variables; CPLEX has some clever ways of doing this, but even so you will
very likely end up with a harder problem than your original one in which you
represented the step function exactly. For the example you give, your
constraints could be as simple as x <= 10*y, if the objective insures that y
will never be larger than necessary. Otherwise you could use 10*(y-1) <= x
and x <= 10*y. (This still leaves a little ambiguity -- y can be 3 or 4,
say, when x is 30 -- but there's no avoiding that given that you can't use <
and > constraints, only <= and >= ones.)
The "contains a nonquadratic nonlinear constraint" message suggests that
your model used something other than AMPL's piecewise-linear notation --
maybe "if" statements? -- which to CPLEX looked only like some
other-than-linear expression that it's not designed to handle.
Bob Fourer
4...@ampl.com