# [Ipopt] Enforcing bound during iterations

Andreas Waechter andreasw at watson.ibm.com
Wed Apr 8 18:42:21 EDT 2009

```Hi,

Ipopt always respects bounds in each iteration (with the expection
described for the option bound_relax_factor).  (A user-given starting
point might not, but then Ipopt moves the point into the bounds at some
early point).

In AMPL, a constraint xi >= 0 as you posed it will be reformulated as a
bound on the variable (instead of an extra inequality constraint), unless
you disable AMPL's presolve (option presolve 0).  So, if you have a
variable x >= 0, the the argument of exp(-x) will always be negative.

However, if you use a "=" definition in your variable (like your
definition of xi0 it means that AMPL will substitude xi with the
expression y/d everywhere where xi appears.  This means, that xi>=0
becomes a nonlinear inequality constraint (not transferred into a bound)
which might be violated during the iteration.

You can avoid what you describe by making xi a real variables (not using
=... in the var statement), and make xi = y/d a constraint.  Then, the
bound xi>=0 makes sure that the exp term can be evaluated.

I hope this helps,

Andreas

On Wed, 8 Apr 2009, Mikhail Nediak wrote:

> Dear Ipopt developer/users,
>
> I would like to know if there is a way to make sure that IPOPT operates
> only within the feasible region (through AMPL options). I am encountering
> a situation where defined variables are explicitly constrained, something
> along the lines of
>
> var y >= 0;
> var d = "some stuff"
> subject to dpos: d >= 0;
> var xi = y / d;
> subject to xipos: xi >= 0;
> var w = exp(-xi);
>
> however, IPOPT aborts abnormally out with a message
>
> Error evaluating "var =" definition 697:
> can't evaluate exp(3632.5): No such file or directory.
>
> because (I guess) it cannot evaluate things like
> var w = exp(-xi);
> elsewhere in the model.
>
> I am sure that the initial point supplied to the solver is feasible. Any
> suggestions would be greatly appreciated (I have already tried to replace
> defined variables with constraints -- that causes other problems).
>
> Thanks. Best,
> Mikhail
>
>
>

```