<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><p dir="ltr">I think the key points are:<br>
</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p dir="ltr">A) switch off scaling function:</p>
<p dir="ltr">     nlp_scaling_method none</p>
<p dir="ltr">(The default way evaluates the scaling factor based on the initial gradient.)</p>
<p dir="ltr">B) Telling Ipopt to do warm start before the second solve:</p>
<p dir="ltr">                  warm_start_init_point = yes             <br>
                   warm_start_bound_frac = 1e-16 <br>
                   warm_start_bound_push = 1e-16    <br>
              warm_start_mult_bound_push = 1e-16   <br>
             warm_start_slack_bound_frac = 1e-16   <br>
             warm_start_slack_bound_push = 1e-16     </p>
<p dir="ltr">C) Use exact-hessian to solve the problem. If L-bfgs is applied, different hessian approximation would be used in the 2nd run. This is due to that L-bfgs uses historic information in the 1st solve.</p>
<p dir="ltr"> I attached two results below and you can see that the second run has exact same result as the solution at the first run.</p>
<p dir="ltr">Cheers,</p>
<p dir="ltr">Nai-Yuan</p>
<p dir="ltr">Senior Scientist<br>
United Technologies Research Center<br>
CT, USA<br><br><br></p>
<p dir="ltr">List of user-set options:<br></p>
<p dir="ltr">                                    Name   Value                used</p>
<p dir="ltr">                              bound_frac = 0.0001                yes</p>
<p dir="ltr">                              bound_push = 0.0001                yes</p>
<p dir="ltr">              limited_memory_max_history = 6                      no</p>
<p dir="ltr">                           linear_solver = ma27                  yes</p>
<p dir="ltr">                                max_iter = 100                   yes</p>
<p dir="ltr">                                 mu_init = 0.1                   yes</p>
<p dir="ltr">                             mu_strategy = monotone              yes</p>
<p dir="ltr">                      nlp_scaling_method = none                  yes</p>
<p dir="ltr">                             output_file = ipopt.out             yes</p>
<p dir="ltr">                             print_level = 5                     yes</p>
<p dir="ltr">                      print_user_options = yes                   yes</p>
<p dir="ltr">               structured_bfgs_linearalg = yes                    no</p>
<p dir="ltr">                                     tol = 0.0001                yes</p>
<p dir="ltr">                 use_cholfact_lowranksol = no                     no<br></p>
<p dir="ltr">******************************************************************************</p>
<p dir="ltr">This program contains Ipopt, a library for large-scale nonlinear optimization.</p>
<p dir="ltr"> Ipopt is released as open source code under the Eclipse Public License (EPL).</p>
<p dir="ltr">         For more information visit <a href="http://projects.coin-or.org/Ipopt">http://projects.coin-or.org/Ipopt</a></p>
<p dir="ltr">******************************************************************************<br></p>
<p dir="ltr">This is Ipopt version 3.12.0, running with linear solver ma27.<br></p>
<p dir="ltr">Number of nonzeros in equality constraint Jacobian...:      164</p>
<p dir="ltr">Number of nonzeros in inequality constraint Jacobian.:      139</p>
<p dir="ltr">Number of nonzeros in Lagrangian Hessian.............:      252<br></p>
<p dir="ltr">Total number of variables............................:       23</p>
<p dir="ltr">                     variables with only lower bounds:        0</p>
<p dir="ltr">                variables with lower and upper bounds:       23</p>
<p dir="ltr">                     variables with only upper bounds:        0</p>
<p dir="ltr">Total number of equality constraints.................:       18</p>
<p dir="ltr">Total number of inequality constraints...............:       21</p>
<p dir="ltr">        inequality constraints with only lower bounds:        0</p>
<p dir="ltr">   inequality constraints with lower and upper bounds:       21</p>
<p dir="ltr">        inequality constraints with only upper bounds:        0<br></p>
<p dir="ltr">iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls  InReg  SiReg</p>
<p dir="ltr">   0  8.3631250e+03 1.55e+00 3.53e+03  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0   0    0</p>
<p dir="ltr">   1  7.3211706e+03 1.08e+00 4.72e+06  -1.0 4.59e-01    -  7.74e-01 2.98e-01f  1   0    0</p>
<p dir="ltr">   2  7.3108635e+03 1.07e+00 4.67e+06  -1.0 1.23e+01   4.0 4.16e-04 7.24e-03f  1   5    0</p>
<p dir="ltr">   3  7.2686586e+03 1.05e+00 4.52e+06  -1.0 2.09e+00    -  3.14e-04 2.11e-02f  1   5    0</p>
<p dir="ltr">   4  5.9284262e+03 6.43e-02 2.23e+06  -1.0 7.64e-01    -  5.41e-04 1.00e+00f  1   5    0</p>
<p dir="ltr">   5  5.5537365e+03 1.29e-02 1.25e+06  -1.0 5.96e-01   4.4 4.42e-01 1.00e+00f  1   7    0</p>
<p dir="ltr">   6  5.5260089e+03 7.57e-05 1.59e+05  -1.0 1.14e-01    -  8.72e-01 1.00e+00f  1   7    0</p>
<p dir="ltr">   7  5.5171774e+03 3.73e-05 1.59e+03  -1.0 1.47e-02   3.9 9.90e-01 1.00e+00f  1   8    0</p>
<p dir="ltr">   8  5.4937120e+03 2.40e-04 1.22e+02  -1.0 4.10e-02   3.5 9.90e-01 1.00e+00f  1   9    0</p>
<p dir="ltr">   9  5.4416411e+03 1.57e-03 1.03e+02  -1.0 1.04e-01   3.0 9.90e-01 1.00e+00f  1  10    0</p>
<p dir="ltr">iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls  InReg  SiReg</p>
<p dir="ltr">  10  5.3638043e+03 9.07e-03 2.99e+06  -3.8 2.08e-01   2.5 6.97e-01 1.00e+00f  1  11    0</p>
<p dir="ltr">  11  5.3285191e+03 1.24e-02 1.22e+06  -3.8 2.65e-01   2.0 5.92e-01 4.86e-01f  1  12    0</p>
<p dir="ltr">  12  5.3277064e+03 1.22e-02 6.92e+05  -3.8 2.82e-01   1.6 4.33e-01 1.57e-02f  1  13    0</p>
<p dir="ltr">  13  5.3219843e+03 1.14e-02 2.17e+05  -3.8 6.58e-01   1.1 6.86e-01 9.38e-02f  1  14    0</p>
<p dir="ltr">  14  5.3083730e+03 7.55e-03 1.46e+04  -3.8 3.11e-01    -  9.33e-01 3.38e-01f  1  14    0</p>
<p dir="ltr">  15  5.2971656e+03 3.89e-04 1.96e+02  -3.8 2.25e-01    -  1.00e+00 1.00e+00f  1  14    0</p>
<p dir="ltr">  16  5.2974069e+03 3.63e-07 2.79e-02  -3.8 1.51e-02    -  1.00e+00 1.00e+00h  1  14    0</p>
<p dir="ltr">  17  5.2974072e+03 4.21e-11 4.23e-08  -3.8 1.60e-05    -  1.00e+00 1.00e+00h  1  14    0</p>
<p dir="ltr">  18  5.2974067e+03 1.29e-09 1.64e-06  -5.0 8.42e-05    -  1.00e+00 1.00e+00f  1  14    0<br></p>
<p dir="ltr">Number of Iterations....: 18<br></p>
<p dir="ltr">                                   (scaled)                 (unscaled)</p>
<p dir="ltr">Objective...............:   5.2974067359191949e+03    5.2974067359191949e+03</p>
<p dir="ltr">Dual infeasibility......:   1.6380770751915933e-06    1.6380770751915933e-06</p>
<p dir="ltr">Constraint violation....:   1.2912881042215218e-09    1.2912881042215218e-09</p>
<p dir="ltr">Complementarity.........:   1.0003508439642409e-05    1.0003508439642409e-05</p>
<p dir="ltr">Overall NLP error.......:   1.0003508439642409e-05    1.0003508439642409e-05<br><br></p>
<p dir="ltr">Number of objective function evaluations             = 19</p>
<p dir="ltr">Number of objective gradient evaluations             = 19</p>
<p dir="ltr">Number of equality constraint evaluations            = 19</p>
<p dir="ltr">Number of inequality constraint evaluations          = 19</p>
<p dir="ltr">Number of equality constraint Jacobian evaluations   = 19</p>
<p dir="ltr">Number of inequality constraint Jacobian evaluations = 19</p>
<p dir="ltr">Number of Lagrangian Hessian evaluations             = 18</p>
<p dir="ltr">Total CPU secs in IPOPT (w/o function evaluations)   =      0.005</p>
<p dir="ltr">Total CPU secs in NLP function evaluations           =      0.000<br></p>
<p dir="ltr">EXIT: Optimal Solution Found.<br></p>
<p dir="ltr">List of user-set options:<br></p>
<p dir="ltr">                                    Name   Value                used</p>
<p dir="ltr">                              bound_frac = 0.0001                yes</p>
<p dir="ltr">                              bound_push = 0.0001                yes</p>
<p dir="ltr">              limited_memory_max_history = 6                     yes</p>
<p dir="ltr">                           linear_solver = ma27                  yes</p>
<p dir="ltr">                                max_iter = 100                   yes</p>
<p dir="ltr">                                 mu_init = 1e-05                 yes</p>
<p dir="ltr">                             mu_strategy = monotone              yes</p>
<p dir="ltr">                      nlp_scaling_method = none                  yes</p>
<p dir="ltr">                             output_file = ipopt.out             yes</p>
<p dir="ltr">                             print_level = 5                     yes</p>
<p dir="ltr">                      print_user_options = yes                   yes</p>
<p dir="ltr">               structured_bfgs_linearalg = yes                   yes</p>
<p dir="ltr">                                     tol = 0.0001                yes</p>
<p dir="ltr">                 use_cholfact_lowranksol = no                    yes</p>
<p dir="ltr">                   warm_start_bound_frac = 1e-16                 yes</p>
<p dir="ltr">                   warm_start_bound_push = 1e-16                 yes</p>
<p dir="ltr">                   warm_start_init_point = yes                   yes</p>
<p dir="ltr">              warm_start_mult_bound_push = 1e-16                 yes</p>
<p dir="ltr">             warm_start_slack_bound_frac = 1e-16                 yes</p>
<p dir="ltr">             warm_start_slack_bound_push = 1e-16                 yes</p>
<p dir="ltr">This is Ipopt version 3.12.0, running with linear solver ma27.<br></p>
<p dir="ltr">Number of nonzeros in equality constraint Jacobian...:      164</p>
<p dir="ltr">Number of nonzeros in inequality constraint Jacobian.:      139</p>
<p dir="ltr">Number of nonzeros in Lagrangian Hessian.............:      252<br></p>
<p dir="ltr">Total number of variables............................:       23</p>
<p dir="ltr">                     variables with only lower bounds:        0</p>
<p dir="ltr">                variables with lower and upper bounds:       23</p>
<p dir="ltr">                     variables with only upper bounds:        0</p>
<p dir="ltr">Total number of equality constraints.................:       18</p>
<p dir="ltr">Total number of inequality constraints...............:       21</p>
<p dir="ltr">        inequality constraints with only lower bounds:        0</p>
<p dir="ltr">   inequality constraints with lower and upper bounds:       21</p>
<p dir="ltr">        inequality constraints with only upper bounds:        0<br></p>
<p dir="ltr">iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls  InReg  SiReg</p>
<p dir="ltr">   0  5.2974067e+03 1.29e-09 1.64e-06  -5.0 0.00e+00    -  0.00e+00 0.00e+00   0  14    0<br></p>
<p dir="ltr">Number of Iterations....: 0<br></p>
<p dir="ltr">                                   (scaled)                 (unscaled)</p>
<p dir="ltr">Objective...............:   5.2974067359191949e+03    5.2974067359191949e+03</p>
<p dir="ltr">Dual infeasibility......:   1.6380770751915933e-06    1.6380770751915933e-06</p>
<p dir="ltr">Constraint violation....:   1.2912881042215218e-09    1.2912881042215218e-09</p>
<p dir="ltr">Complementarity.........:   1.0003508439642409e-05    1.0003508439642409e-05</p>
<p dir="ltr">Overall NLP error.......:   1.0003508439642409e-05    1.0003508439642409e-05<br><br></p>
<p dir="ltr">Number of objective function evaluations             = 1</p>
<p dir="ltr">Number of objective gradient evaluations             = 1</p>
<p dir="ltr">Number of equality constraint evaluations            = 1</p>
<p dir="ltr">Number of inequality constraint evaluations          = 1</p>
<p dir="ltr">Number of equality constraint Jacobian evaluations   = 1</p>
<p dir="ltr">Number of inequality constraint Jacobian evaluations = 1</p>
<p dir="ltr">Number of Lagrangian Hessian evaluations             = 0</p>
<p dir="ltr">Total CPU secs in IPOPT (w/o function evaluations)   =      0.000</p>
<p dir="ltr">Total CPU secs in NLP function evaluations           =      0.000<br></p>
<p dir="ltr">EXIT: Optimal Solution Found.<br></p>
<div class="gmail_quote">On May 7, 2016 8:37 AM, "Илья Палачев" <<a href="mailto:iliyapalachev@gmail.com">iliyapalachev@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I'm having the question regarding the similar problem.<br>
<br>
While trying to do the following:<br>
1. Solve some problem (it succeeds in ~2 minutes)<br>
... and save primal and dual variables in some intermediate buffers using finalize_solution callback.<br>
2. Re-run the solution of the same problem (it succeeds almost in the same time)<br>
<br>
But:<br>
The last iteration of the 1st run shows the following line in the log:<br>
<br>
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls<br>
  64  1.5248822e-04 0.00e+00 1.01e-16 -11.0 5.36e-02    -  1.00e+00 1.00e+00h  1<br>
But the first iteration of the 2nd run shows the following:<br>
<br>
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls<br>
   0  1.5478317e-04 0.00e+00 1.00e-03  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0<br>
<br>
As you can see, dual infeasibility (inf_du) is different at these two iterations. Is it correct?<br>
<br>
It's very likely that the difference between them (~ 0.001) is some internal constant, such as other constants that are described in the options manual that are also having this default value (0.001). Is there any option that controls that parameter?<br>
<br>
Thanks in advance,<br>
Ilya<br>
<br>
06.11.2015, 22:24, "Stefan Vigerske" <<a href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>>:<br>
> Hi,<br>
><br>
> as an interior point solver, it cannot do very much with the solution of<br>
> a previous problem, but the log should at least differ a bit if you set<br>
> a warm_start_init_point.<br>
> If you set this option, I believe init_z and init_lambda should be true<br>
> in TNLP::get_starting_point(). You might want to verify this.<br>
><br>
> Stefan<br>
><br>
> On 11/05/2015 11:40 AM, max leo correa cordova wrote:<br>
>>  Hello. I am using IPOPT for solving MPC using the c++ interface. I want to improve the computational time in the solution by using the final values of primal and dual variables (x, lambda, z_l and z_u) in the previous prediction. I have read the documentation and used:<br>
>><br>
>>  app->Options()->SetStringValue("warm_start_init_point","yes");<br>
>><br>
>>  and initialize lambda, z_l and z_u in MyNLP::get_starting_point(), but the results are the same and seems that Ipopt doesn't use the dual initial values. Could you help me please how to do that correct or is it factible to use this approach of warm starting? I will apprecciate your help.<br>
>><br>
>>  Thanks in advance<br>
>>  Max<br>
>><br>
>>  _______________________________________________<br>
>>  Ipopt mailing list<br>
>>  <a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
>>  <a href="http://list.coin-or.org/mailman/listinfo/ipopt" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
><br>
> --<br>
> <a href="http://www.gams.com/~stefan" rel="noreferrer" target="_blank">http://www.gams.com/~stefan</a><br>
> _______________________________________________<br>
> Ipopt mailing list<br>
> <a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
> <a href="http://list.coin-or.org/mailman/listinfo/ipopt" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
_______________________________________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/ipopt" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
</blockquote></div>