[Ipopt] Ipopt Error

Andreas Waechter andreasw at watson.ibm.com
Tue Dec 1 14:25:46 EST 2009


Hi Tiago,

The error message

> EXIT: Invalid number in NLP function or derivative detected.
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.

means that in your AMPL model, an expression is asked to be evaluated at a 
point where the expression is not defined, such as sqrt(-1) or 1/0.  If 
you set the AMPL option by typing

option ipopt_options "halt_on_ampl_error=yes";

before you do the "solve;", the output might give an idea in which 
expression the error occurs.

You probably don't set a starting point explicitly (in which case AMPL 
sets it all to 0).  You might want to consider this.

Ipopt ensures that the variables are never violating their bounds (well, 
please make sure you read the documentation for the bound_relax_factor 
Ipopt option).  You need to make sure that all functions in your AMPL 
model are indeed defined and can be evaluated at all points that are 
within the variable bounds you define.

Hope this helps,

Andreas

On Sun, 29 Nov 2009, Tiago Filomena wrote:

> Hello,
> I am trying to solve a quadratic problem with non-linear constraints with
> Ipopt and AMPL. I have one model that works with the following constraint:
>
> sum{s1 in securities} ExpReturn[s1]*x[s1]-sqrt((1/card(T))*sum{t1 in
> T}(sum{s1 in securities} dif[t1, s1]*x[s1])^2)>=R
>
>
> I want to break this constraint in two parts:
>
> sum{s1 in securities} dif[t1, s1]*x[s1]=q[t1]
>
> and
>
> sum{s1 in securities} ExpReturn[s1]*x[s1]-sqrt((1/card(T))*sum{t1 in
> T}(q[t1])^2))>=R
>
> I am doing this because I want to decrease the number of operations of the
> model given that I want to solve many of these problems and I want to use
> q[t1] in other operations also.
> Ipopt is not being able to solve this second problem, I do not know why.
> Do you have some suggestion?
> Thanks,
> Tiago
>
> PS: the error message is the following:
> EXIT: Invalid number in NLP function or derivative detected.
> Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see
> details.
> Exception of type: Eval_Error in file
> "C:\cygwin\home\svigerske\BuildDir\Bonmin\releases-0.99.3\Ipopt\src\Algorithm\IpOrigIpoptNLP.cpp"
> at line 550:
> Exception message: success && IsFiniteNumber(unscaled_c->Nrm2()) evaluated
> false: Error evaluating the equality constraints
> EXIT: Some uncaught Ipopt exception encountered.
> can't open at2520.sol
>



More information about the Ipopt mailing list