ampl with ipopt constraint violation / infeasibility detection

318 views
Skip to first unread message

erimk...@gmail.com

unread,
Jan 2, 2014, 1:42:42 PM1/2/14
to am...@googlegroups.com
Hello folks, 
I am trying to write a script where AMPL solves a model using ipopt. After solution is returned, I need to check the constraint violation given by IPOPT and some other things like dual feasibility, etc. 
I have done it before with CPLEX but how could this be done using IPOPT? Basically, I want my script to do certain things based on the values of constraint violation. Any help is appreciated. thanks

erim

Robert Fourer

unread,
Jan 5, 2014, 2:30:52 PM1/5/14
to am...@googlegroups.com

The amount that a constraint or variable violates its bounds is represented in AMPL by the name of the constraint or variable with .slack after it.  So for example to look for violation in constraint Bal[i,j] you should examine the value of Bal[i,j].slack.  The greatest violation over all variables and constraints is given by

 

   display (min {i in 1.._ncons: _con[i].slack < 0} _con[i].slack);
   display (min {j in 1.._nvars: _var[j].slack < 0} _var[j].slack);

Similarly append .dual to constraint names to see the dual variables, and .rc to variables to the see the dual constraint slacks ("reduced costs" in LP terminology).

 

Bob Fourer

am...@googlegroups.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of erimk...@gmail.com
Sent: Thursday, January 2, 2014 12:43 PM
To: am...@googlegroups.com
Subject: [AMPL 7829] ampl with ipopt constraint violation / infeasibility detection

Reply all
Reply to author
Forward
0 new messages