[Ipopt] A small bug

Stefan Vigerske stefan at math.hu-berlin.de
Tue Nov 12 05:35:00 EST 2013


Hi,

sorry, I can't reproduce this.
If  I run Ipopt 3.11 (current stable branch, Linux 64bit) through the 
GAMS interface on your instance,
   Variables x1, x2, x3, y;
   Equations obj, e1, e2;
   obj.. y =e= x1 * x2 + eps*x3;
   e1..  x1 * x2 =e= x3;
   e2..  x3 =e= 0;
   x1.fx = 0; x2.fx = 0;
   model m / all /;
   solve m min y using nlp;

then I get


List of user-set options:

                                     Name   Value                used
                   bound_mult_init_method = mu-based              yes

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

This is Ipopt version 3.11, running with linear solver ma27.

Too few degrees of freedom (n_x = 1, n_c = 2).
   Trying fixed_variable_treatment = RELAX_BOUNDS

Number of nonzeros in equality constraint Jacobian...:        4
Number of nonzeros in inequality constraint Jacobian.:        0
Number of nonzeros in Lagrangian Hessian.............:        1

Total number of variables............................:        3
                      variables with only lower bounds:        0
                 variables with lower and upper bounds:        2
                      variables with only upper bounds:        0
Total number of equality constraints.................:        2
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 0.00e+00 0.00e+00   0.0 0.00e+00    -  0.00e+00 
0.00e+00   0
    1  0.0000000e+00 0.00e+00 0.00e+00  -7.0 0.00e+00    -  1.00e+00 
1.00e+00   0

Number of Iterations....: 1

                                    (scaled)                 (unscaled)
Objective...............:   0.0000000000000000e+00    0.0000000000000000e+00
Dual infeasibility......:   0.0000000000000000e+00    0.0000000000000000e+00
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   1.0000000000000001e-07    1.0000000000000001e-07
Overall NLP error.......:   1.0000000000000000e-08    1.0000000000000001e-07


Number of objective function evaluations             = 2
Number of objective gradient evaluations             = 2
Number of equality constraint evaluations            = 2
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 2
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 1
Total CPU secs in IPOPT (w/o function evaluations)   =      2.637
Total CPU secs in NLP function evaluations           =      0.052

EXIT: Optimal Solution Found.



And this is under valgrind.

Stefan

On 11/11/2013 04:16 AM, 八重雾中渡 wrote:
> I am very sorry, I had made a mistake on describing the problem.
> The problem we actually used is difference form the user input.
>
> Here is the problem to run the solver:
> y = x1 * x2 + 0 * x3
> subject to:
> x1 * x2 - x3 = 0
>                 x3 = 0
>
> x1, x2 = 0; x3: unbound
>
> the Ipopt version is 3.11.1
> bound_mult_init_method = mu-based
>
> ------------------ Original ------------------
> From:  "Stefan Vigerske";<stefan at math.hu-berlin.de>;
> Date:  Sun, Nov 10, 2013 00:48 AM
> To:  "八重雾中渡"<darknesswind at qq.com>;
> Cc:  "ipopt"<ipopt at list.coin-or.org>;
> Subject:  Re: [Ipopt] A small bug
>
> Hi,
>
> I cannot reproduce this issue.
> If all variables are fixed, the code should not even get to the place
> you show in your stacktrace.
> In DefaultIterateInitializer::SetInitialIterates(), the call to
> IpData().InitializeDataStructures() just at the beginning (line 194)
> should throw an exception, so that it doesn't get to line 278
> (iterates->z_L_NonConst()->ElementWiseDivide(*IpCq().trial_slack_x_L())).
>
> The exception is thrown by IpTNLPAdapter.cpp:684,
>
>           if (status == SUCCESS) {
>             jnlst_->Printf(J_WARNING, J_INITIALIZATION,
>                            "All variables are fixed and constraint
> violation %e\n   is below tolerance %e. Declaring success.\n", max_viol,
> tol_);
>
> and catched again in IpIpoptApplication.cpp:1048 (end of
> IpoptApplication::call_optimize()).
>
> Can you specify more which Ipopt version you are using and which interface?
>
> Stefan
>
> On 11/08/2013 08:48 AM, darknesswind wrote:
>> When I run the solver on a problem with all fixed variables, I found the DenseVector "ip_data_->curr()->z_L()" is uninitialized in function IpoptCalculatedQuantities::trial_slack_x_L.It may cause a crash in release version because of access violation.
>>
>> The problem is:
>> y = x1 * x2
>> subject to:
>> x1 * x2 = 0
>> x1 = 0
>> x2 = 0
>>
>> Here is the call stack:        The dense_x->homogeneous_ equal to false but the dense_x->values_ is null.
>>
>>> ipopt.dll!Ipopt::DenseVector::ElementWiseDivideImpl(const Ipopt::Vector & x)  Line 240	C++
>>    ipopt.dll!Ipopt::Vector::ElementWiseDivide(const Ipopt::Vector & x)  Line 602 + 0x13 bytes	C++
>>    ipopt.dll!Ipopt::IpoptCalculatedQuantities::CalculateSafeSlack(Ipopt::SmartPtr<Ipopt::Vector> & slack, const Ipopt::SmartPtr<Ipopt::Vector const > & bound, const Ipopt::SmartPtr<Ipopt::Vector const > & curr_point, const Ipopt::SmartPtr<Ipopt::Vector const > & multiplier)  Line 481	C++
>>    ipopt.dll!Ipopt::IpoptCalculatedQuantities::trial_slack_x_L()  Line 365 + 0x5b bytes	C++
>>    ipopt.dll!Ipopt::DefaultIterateInitializer::SetInitialIterates()  Line 278 + 0x16 bytes	C++
>>    ipopt.dll!Ipopt::IpoptAlgorithm::InitializeIterates()  Line 545 + 0x26 bytes	C++
>>    ipopt.dll!Ipopt::IpoptAlgorithm::Optimize(bool isResto)  Line 274	C++
>>    ipopt.dll!Ipopt::IpoptApplication::call_optimize()  Line 860 + 0xd bytes	C++
>>    ipopt.dll!Ipopt::IpoptApplication::OptimizeNLP(const Ipopt::SmartPtr<Ipopt::NLP> & nlp, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder> & alg_builder)  Line 754 + 0x8 bytes	C++
>>    ipopt.dll!Ipopt::IpoptApplication::OptimizeNLP(const Ipopt::SmartPtr<Ipopt::NLP> & nlp)  Line 717 + 0x17 bytes	C++
>>    ipopt.dll!Ipopt::IpoptApplication::OptimizeTNLP(const Ipopt::SmartPtr<Ipopt::TNLP> & tnlp)  Line 696 + 0x16 bytes	C++
>>
>> _______________________________________________
>> Ipopt mailing list
>> Ipopt at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/ipopt
>>
>
> .
>



More information about the Ipopt mailing list