[Ipopt] can ipopt print out the constraint expression ?

Stefan Vigerske stefan at math.hu-berlin.de
Tue Sep 24 05:13:13 EDT 2013


Hi,

On 09/24/2013 11:05 AM, iphxer wrote:
> thanks ,  stefan
> 
> now i have another question.
> 
> I use lingo and ipopt to solve my nlp problem  (lingo is another  nlp  tool ),but  the results of lingo and ipopt are not equal.
> 
> object function value
> lingo : 1.1e8,
> ipopt: 0.95e8
> 
> my nlp problem is so big, and i can not find which is error .so I want to print out the constraint  expression .

Maybe they just find different local minima?
Are you sure your problem is correct?

> can  ipopt print out the constraint  expression ?

No, Ipopt only knows how to evaluate objective and constraint functions
and derivatives, but not how their algebraic expression looks like (if
there is one). To provide the evaluation routines is part of the Ipopt
interface that you are using, not part of Ipopt itself.

Stefan

> I edit ipopt.opt   and set print_options_documentation as yes,and read the option I can confige.
> but I do not find the   switch  which can help me print out constrains.
> 
> such as lingo's output :
> 
> 
>    [_16856] - X_21_2 - X_21_5 - X_21_11 - X_21_73 - X_21_77 - X_21_95 -
> X_21_107 - X_21_112 - X_21_115 - X_21_119 - X_21_122 - X_21_124 -
> X_21_175 - X_21_182 - X_21_183 - X_21_201 - X_21_208 - X_21_214 -
> X_21_222 - X_21_231 + RES_21 = 0 ;
> [_16857] - X_22_1 - X_22_6 - X_22_7 - X_22_12 - X_22_13 - X_22_14 -
> X_22_16 - X_22_18 - X_22_20 - X_22_21 - X_22_24 - X_22_25 - X_22_27 -
> X_22_31 - X_22_33 - X_22_34 - X_22_38 - X_22_39 - X_22_41 - X_22_43 -
> X_22_45 - X_22_46 - X_22_50 - X_22_51 - X_22_54 - X_22_55 - X_22_59 -
> X_22_60 - X_22_63 - X_22_66 - X_22_67 - X_22_69 - X_22_73 - X_22_74 -
> X_22_77 - X_22_78 - X_22_79 - X_22_83 - X_22_87 - X_22_88 - X_22_92 -
> X_22_93 - X_22_96 - X_22_101 - X_22_104 - X_22_105 - X_22_109 - X_22_113
> - X_22_116 - X_22_120 - X_22_121 - X_22_125 - X_22_126 - X_22_128 -
> X_22_130 - X_22_133 - X_22_135 - X_22_136 - X_22_138 - X_22_139 -
> X_22_142 - X_22_143 - X_22_144 - X_22_148 - X_22_153 - X_22_154 -
> X_22_156 - X_22_158 - X_22_161 - X_22_162 - X_22_166 - X_22_167 -
> X_22_171 - X_22_175 - X_22_176 - X_22_177 - X_22_179 - X_22_182 -
> X_22_184 - X_22_189 - X_22_190 - X_22_192 - X_22_197 - X_22_202 -
> X_22_206 - X_22_209 - X_22_211 - X_22_215 - X_22_218 - X_22_219 -
> X_22_223 - X_22_225 - X_22_227 - X_22_228 - X_22_230 + RES_22 = 0 ;
> [_16859] RES_SUM - RES_1 - RES_2 - RES_3 - RES_4 - RES_5 - RES_6 - RES_7
> - RES_8 - RES_9 - RES_10 - RES_11 - RES_12 - RES_13 - RES_14 - RES_15 -
> RES_16 - RES_17 - RES_18 - RES_19 - RES_20 - RES_21 - RES_22 = 0 ;
> [_5362] X_1_1 + X_3_1 + X_4_1 + X_5_1 + X_6_1 + X_7_1 + X_8_1 + X_9_1 +
> X_10_1 + X_11_1 + X_12_1 + X_13_1 + X_14_1 + X_15_1 + X_16_1 + X_20_1 +
> X_22_1 <= 21195 ;
> 
> 
> 在 2013-9-23,下午10:45,Stefan Vigerske <stefan at math.hu-berlin.de> 写道:
> 
>> Hi,
>>
>> z_U are the dual multipliers for the variable upper bounds, not variable values itself. You probably can ignore them.
>>
>> The solution seems to be given after the EXIT line:
>>
>> Solution of the primal variables, x
>> x[0] = 215.824
>> x[1] = 1114.39
>>
>>
>> Stefan
>>
>> On 09/23/2013 02:49 PM, iphxer wrote:
>>> dear all:
>>> please help me ...
>>>
>>> I am new for ipopt, and  i am not understand the  Mathematical Theory  of nlp.
>>>   now,I have  to use ipopt to solve a  practical problem .
>>> but  i find the var z_U is  too large for my  result, and i doubt whether  it is correct .
>>>
>>> z_U[3474] = 1.2888e-14
>>> z_U[3475] = 8.25948e-15
>>> z_U[3476] = 7.55577e-17
>>> z_U[3477] = 1.63332e-14
>>> z_U[3478] = 5.95928e-15
>>> z_U[3479] = 5.00774e-14
>>> z_U[3480] = 6.23147e-14
>>> z_U[3481] = 3.7331e-16
>>> z_U[3482] = 1.32901e-13
>>> z_U[3483] = 1.17351e-14
>>> z_U[3484] = 3.29264e-15
>>> z_U[3485] = 8.17356e-15
>>> z_U[3486] = 1.03979e-15
>>> z_U[3487] = 1.3004
>>> z_U[3488] = 1.3004
>>> z_U[3489] = 1.3004
>>> z_U[3490] = 1.3004
>>> z_U[3491] = 1.3004
>>> z_U[3492] = 1.3004
>>> z_U[3493] = 1.3004
>>> z_U[3494] = 1.3004
>>> z_U[3495] = 1.09812e-14
>>>
>>> iterator info.
>>>
>>> Number of nonzeros in Lagrangian Hessian.............:     4026
>>>
>>> Total number of variables............................:     4026
>>>                       variables with only lower bounds:        0
>>>                  variables with lower and upper bounds:     4026
>>>                       variables with only upper bounds:        0
>>> Total number of equality constraints.................:       22
>>> Total number of inequality constraints...............:      232
>>>          inequality constraints with only lower bounds:        0
>>>     inequality constraints with lower and upper bounds:      232
>>>          inequality constraints with only upper bounds:        0
>>>
>>> iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
>>>     0  2.1888251e+07 4.98e+06 4.33e+00   0.0 0.00e+00    -  0.00e+00 0.00e+00   0
>>>     1  2.1083709e+07 4.82e+06 2.41e+01   4.6 3.60e+07    -  1.27e-03 3.22e-02f  1
>>>     2  2.0500231e+07 4.63e+06 2.32e+01   4.1 3.40e+07    -  2.61e-02 3.82e-02f  1
>>>     3  1.8415377e+07 4.16e+06 2.08e+01   4.1 3.16e+07    -  2.08e-02 1.02e-01f  1
>>>     4  1.7745569e+07 3.99e+06 1.93e+02   4.9 2.58e+07    -  1.00e+00 4.04e-02f  1
>>>     5  1.5606627e+07 3.15e+06 2.32e+02  -1.1 2.38e+07    -  7.12e-02 2.10e-01f  1
>>>     6  1.3618871e+07 2.18e+06 2.12e+02   4.3 1.40e+07    -  8.97e-02 3.08e-01f  1
>>>     7  1.4486968e+07 2.02e+06 5.98e+02   6.2 7.42e+06    -  2.23e-01 7.64e-02f  1
>>>     8  1.4537437e+07 1.02e+06 4.89e+02   5.0 3.56e+06    -  2.24e-01 4.96e-01f  1
>>>     9  1.5084801e+07 5.69e+05 2.78e+02   4.7 4.14e+06    -  4.31e-01 4.40e-01f  1
>>> iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
>>>    10  1.5871058e+07 2.31e+05 1.08e+02   4.3 4.84e+06    -  6.08e-01 5.94e-01h  1
>>>    11  1.5502517e+07 3.79e+04 1.05e+01   4.4 3.87e+06    -  8.98e-01 8.36e-01h  1
>>>    12  1.3386722e+07 4.19e-09 3.62e-01   4.0 1.72e+06    -  9.94e-01 1.00e+00f  1
>>>    13  1.1503001e+07 9.31e-10 8.51e-02   3.6 2.14e+05    -  9.95e-01 1.00e+00f  1
>>>    14  1.0527259e+07 1.86e-09 2.15e-03   3.3 4.72e+04    -  1.00e+00 1.00e+00f  1
>>>    15  1.0055318e+07 4.66e-09 1.08e-02   3.0 2.87e+04    -  9.95e-01 1.00e+00f  1
>>>    16  9.8158750e+06 3.73e-09 2.22e-15   2.7 1.76e+04    -  1.00e+00 1.00e+00f  1
>>>    17  9.7005333e+06 6.52e-09 1.55e-03   2.5 1.05e+04    -  9.99e-01 1.00e+00f  1
>>>    18  9.6237545e+06 6.52e-09 7.17e-02   2.0 9.34e+03    -  9.51e-01 1.00e+00f  1
>>>    19  9.5920616e+06 4.66e-09 2.38e-01   1.2 5.58e+03    -  8.20e-01 1.00e+00f  1
>>> iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
>>>    20  9.5863056e+06 9.31e-10 4.43e-03   0.7 1.53e+03    -  9.95e-01 1.00e+00f  1
>>>    21  9.5845767e+06 2.79e-09 5.33e-02  -5.2 6.89e+02    -  8.13e-01 9.84e-01f  1
>>>    22  9.5845125e+06 3.73e-09 6.21e-04  -0.8 1.32e+02    -  9.93e-01 1.00e+00f  1
>>>    23  9.5844699e+06 3.73e-09 1.62e-03  -6.7 5.12e+01    -  9.40e-01 9.88e-01f  1
>>>    24  9.5844691e+06 2.33e-09 6.86e-04  -3.8 1.07e+01    -  9.53e-01 1.00e+00f  1
>>>    25  9.5844691e+06 4.66e-09 5.26e-05  -4.5 1.98e+00    -  9.89e-01 1.00e+00f  1
>>>    26  9.5844691e+06 7.45e-09 3.16e-06  -6.5 1.53e-01    -  9.94e-01 1.00e+00f  1
>>> In iteration 26, 11 Slacks too small, adjusting variable bounds
>>>    27  9.5844691e+06 6.05e-09 6.32e-10 -11.0 2.43e-03    -  1.00e+00 1.00e+00h  1
>>>
>>> Number of Iterations....: 27
>>>
>>>                                     (scaled)                 (unscaled)
>>> Objective...............:   9.5844690615889486e+06    9.5844690615889486e+06
>>> Dual infeasibility......:   6.3165569158340598e-10    6.3165569158340598e-10
>>> Constraint violation....:   6.0535967350006104e-09    6.0535967350006104e-09
>>> Complementarity.........:   4.0663367799099379e-08    4.0663367799099379e-08
>>> Overall NLP error.......:   4.0663367799099379e-08    4.0663367799099379e-08
>>>
>>>
>>> Number of objective function evaluations             = 28
>>> Number of objective gradient evaluations             = 28
>>> Number of equality constraint evaluations            = 28
>>> Number of inequality constraint evaluations          = 28
>>> Number of equality constraint Jacobian evaluations   = 28
>>> Number of inequality constraint Jacobian evaluations = 28
>>> Number of Lagrangian Hessian evaluations             = 27
>>> Total CPU secs in IPOPT (w/o function evaluations)   =      0.659
>>> Total CPU secs in NLP function evaluations           =      0.240
>>>
>>> EXIT: Optimal Solution Found.
>>>
>>>
>>> Solution of the primal variables, x
>>> x[0] = 215.824
>>> x[1] = 1114.39
>>>
>>>
>>>
>>> _______________________________________________
>>> Ipopt mailing list
>>> Ipopt at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/ipopt
>>>
>>
> 
> 



More information about the Ipopt mailing list