"Error in AMPL evaluation" - How do I find out what this means?

1,893 views
Skip to first unread message

David Elixmann

unread,
Apr 25, 2007, 11:13:31 AM4/25/07
to am...@googlegroups.com
Hello,

I'm using AMPL to solve a chemical engineering model. The model has lots of nonlinear equations in it, due to the nature of the chemical rate equations and the thermodynamics involved, so I'm trying to build a simplified version of the full model that can help me compute initial guesses for all the variables.

However, when I try to solve this model, the solver reports that AMPL keeps throwing errors. I'm using the interor-point solver IPOPT, version 3.2.3 with AMPL. I attached the output at the bottom of this message.

I'm not concerned about the numbers that the solver gives (inf_pr, inf_du and so on) but rather about the many messages about AMPL errors.

What can cause these errors? Is my starting point bad, does AMPL have trouble computing the derivatives of my variables, or is it something else?

I also added the line "option halt_on_ampl_error yes" to my model, however, AMPL neither stops upon encountering those errors nor does it give me any information about what's happening...

Any ideas on what's wrong, or where to look for more detailed error messages?

Many thanks in advance,

David

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Common Public License (CPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

Number of nonzeros in equality constraint Jacobian...: 26595
Number of nonzeros in inequality constraint Jacobian.: 0
Number of nonzeros in Lagrangian Hessian.............: 4977

Total number of variables............................: 7392
variables with only lower bounds: 0
variables with lower and upper bounds: 0
variables with only upper bounds: 0
Total number of equality constraints.................: 7392
Total number of inequality constraints...............: 0
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0

iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 0.0000000e+00 1.81e+05 0.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: SOC step rejected due to evaluation error
1 0.0000000e+00 1.81e+05 0.00e+00 -1.0 5.53e+09 - 1.00e+00 1.95e-03h 10
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
2 0.0000000e+00 1.81e+05 0.00e+00 -1.0 1.56e+09 - 1.00e+00 9.77e-04h 11
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
3 0.0000000e+00 1.79e+05 0.00e+00 -1.0 1.04e+09 - 1.00e+00 7.81e-03h 8
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: SOC step rejected due to evaluation error
4 0.0000000e+00 1.79e+05 0.00e+00 -1.0 1.22e+09 - 1.00e+00 1.22e-04h 14
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: SOC step rejected due to evaluation error
5 0.0000000e+00 1.77e+05 0.00e+00 -1.0 9.77e+08 - 1.00e+00 1.56e-02h 7
Error in an AMPL evaluation. Run with "halt_on_ampl_error yes" to see details.
Warning: Cutting back alpha due to evaluation error
6r 0.0000000e+00 1.77e+05 9.99e+02 5.2 0.00e+00 - 0.00e+00 1.00e+00R 1
7r 0.0000000e+00 1.72e+05 9.95e+02 5.2 4.35e+07 - 9.11e-02 4.02e-03f 1
8r 0.0000000e+00 1.51e+05 1.54e+03 3.8 7.41e+06 - 3.46e-02 1.55e-02f 1
9r 0.0000000e+00 1.51e+05 2.31e+05 3.8 5.23e+01 2.0 9.37e-01 1.00e+00f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
10r 0.0000000e+00 1.51e+05 5.59e+04 3.8 2.40e+01 2.4 1.00e+00 1.00e+00f 1
11r 0.0000000e+00 1.51e+05 2.24e+04 3.2 6.91e+00 3.8 1.00e+00 1.00e+00f 1
12r 0.0000000e+00 1.51e+05 7.72e+03 3.2 2.06e+00 3.3 1.00e+00 1.00e+00f 1
13r 0.0000000e+00 1.51e+05 1.27e+03 2.5 2.00e+00 2.8 1.00e+00 1.00e+00f 1


--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

bwmoore22

unread,
Apr 25, 2007, 11:46:23 AM4/25/07
to AMPL Modeling Language
It looks like "halt_on_ampl_error" is an IPOPT option rather than an
AMPL option. As typed in your append, it would be treated as an AMPL
option.

You might try

options ipopt_options "halt_on_ampl_error=yes"

which will pass the option to IPOPT.

On Apr 25, 10:13 am, "David Elixmann" <charles.mar...@gmx.net> wrote:
> Hello,
>
> I'm using AMPL to solve a chemical engineering model. The model has lots of nonlinear equations in it, due to the nature of the chemical rate equations and the thermodynamics involved, so I'm trying to build a simplified version of the full model that can help me compute initial guesses for all the variables.
>
> However, when I try to solve this model, the solver reports that AMPL keeps throwing errors. I'm using the interor-point solver IPOPT, version 3.2.3 with AMPL. I attached the output at the bottom of this message.
>
> I'm not concerned about the numbers that the solver gives (inf_pr, inf_du and so on) but rather about the many messages about AMPL errors.
>
> What can cause these errors? Is my starting point bad, does AMPL have trouble computing the derivatives of my variables, or is it something else?
>
> I also added the line "option halt_on_ampl_error yes" to my model, however, AMPL neither stops upon encountering those errors nor does it give me any information about what's happening...
>
> Any ideas on what's wrong, or where to look for more detailed error messages?
>
> Many thanks in advance,
>
> David
>
> ******************************************************************************
> This program contains Ipopt, a library for large-scale nonlinear optimization.
> Ipopt is released as open source code under the Common Public License (CPL).

> For more information visithttp://projects.coin-or.org/Ipopt

Robert Fourer

unread,
Apr 26, 2007, 1:32:25 AM4/26/07
to am...@googlegroups.com, David Elixmann, bwmoore22
David,

The message about an "Error in an AMPL evaluation" is somewhat misleading.
This is a warning that occurs when IPOPT asks AMPL to evaluate some
objective or constraint function at a point where the function is not
defined. For example, the evaluation could involve taking a square root or
log of a negative number. IPOPT has ways of dealing with this situation
automatically, as indicated by the messages such as "SOC step rejected" and
"Cutting back alpha." Setting the AMPL option ipopt_options to contain
"halt_on_ampl_error yes" will cause IPOPT to stop and presumably tell you
more about why the function could not be evaluated, but normally you will
want to leave this option off so that IPOPT deals with the situation
automatically.

IPOPT is slowed by the need to cope with such situations, so you might want
to experiment with choosing a different starting point or tightening the
bounds so as to confine IPOPT iterates to regions where the problem
functions can be successfully evaluated.

Bob Fourer
4...@ampl.com

David Elixmann

unread,
Apr 28, 2007, 8:41:16 AM4/28/07
to 4...@ampl.com, am...@googlegroups.com, bwmoore22
Hi Bob, Hi bwmoore22,

Thanks for the explanation! It really was a problem with ill-defined
functions... in this case, it must have been a model equation that involved
powers with fractional exponents (in chemical reaction systems).

But I was able to circumvent this by restating the equations in a different
form.

Many thanks,
David

Reply all
Reply to author
Forward
0 new messages