-
I found my objective be flat between iterations so wanted to terminate it early based on the percentage change of the objective between iterations. I found It says its default value is 10^20. But I tried setting Here is the first 30 iterations with This is Ipopt version 3.14.11, running with linear solver ma97.
Number of nonzeros in equality constraint Jacobian...: 77700
Number of nonzeros in inequality constraint Jacobian.: 27380
Number of nonzeros in Lagrangian Hessian.............: 0
Total number of variables............................: 370
variables with only lower bounds: 37
variables with lower and upper bounds: 167
variables with only upper bounds: 0
Total number of equality constraints.................: 210
Total number of inequality constraints...............: 74
inequality constraints with only lower bounds: 74
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 -4.6174315e+04 1.39e+02 1.86e+00 0.0 0.00e+00 - 0.00e+00 0.00e+00 0
1 -4.6231622e+04 1.39e+02 1.46e+01 -4.2 1.15e+03 - 1.56e-02 9.84e-04f 1
2 -4.6233102e+04 1.39e+02 1.55e+01 -0.3 1.47e+03 - 7.51e-04 2.40e-04f 1
3 -4.6234870e+04 1.39e+02 1.28e+02 -0.1 1.39e+03 - 7.75e-03 3.78e-04f 1
4 -4.6268767e+04 1.38e+02 1.17e+03 -0.1 1.39e+03 - 4.75e-02 1.08e-02f 1
5 -4.6252092e+04 1.34e+02 6.39e+03 0.3 1.37e+03 - 7.59e-02 2.79e-02f 1
6 -4.6179486e+04 1.27e+02 3.82e+04 0.7 1.30e+03 - 1.72e-01 4.79e-02f 1
7 -4.6155402e+04 1.19e+02 5.39e+04 0.5 1.17e+03 - 1.72e-01 6.87e-02f 1
8 -4.5742218e+04 1.18e+02 1.21e+07 2.3 1.23e+03 - 9.08e-01 8.64e-03f 1
9 -4.5746556e+04 1.16e+02 9.87e+06 0.9 9.95e+02 - 2.44e-01 1.14e-02h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
10 -2.7267327e+04 1.92e+01 3.79e+06 2.0 1.05e+03 - 5.58e-01 8.35e-01f 1
11 -2.7104740e+04 1.45e+01 1.61e+06 2.0 3.10e+02 - 5.57e-01 2.41e-01h 1
12 -2.6599621e+04 4.61e-01 3.96e+05 2.0 2.41e+02 - 7.32e-01 9.68e-01h 1
13 -2.5934027e+04 4.45e-01 4.53e+07 2.2 6.54e+01 - 1.00e+00 3.58e-02f 1
14 -2.9832864e+04 8.85e-02 2.50e+06 1.9 3.11e+01 - 1.00e+00 9.62e-01h 1
15 -3.7297683e+04 2.58e-02 9.61e+06 1.5 3.99e+01 - 8.81e-01 7.00e-01f 1
16 -4.5499460e+04 2.67e-03 3.50e+05 0.5 3.09e+01 - 1.00e+00 9.95e-01f 1
17 -4.5864138e+04 7.21e-04 9.11e+05 -0.0 4.08e+01 - 1.00e+00 9.63e-01f 1
18 -4.6142299e+04 5.43e-03 2.01e+01 -0.4 2.68e+01 - 1.00e+00 1.00e+00f 1
19 -4.6234709e+04 5.52e-03 1.40e+04 -0.6 1.05e+01 - 9.81e-01 1.00e+00f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
20 -4.6296392e+04 8.35e-03 4.25e+01 -0.9 4.76e+00 - 1.00e+00 1.00e+00f 1
21 -4.6250560e+04 4.87e-02 1.09e+05 -0.6 1.66e+01 - 1.00e+00 8.49e-01f 1
22 -4.6284598e+04 1.92e-02 1.31e+05 -0.7 7.05e+00 - 5.64e-01 1.00e+00f 1
23 -4.6291279e+04 3.22e-02 4.07e+04 -0.7 8.82e+00 - 6.90e-01 5.73e-01f 1
24 -4.6287744e+04 3.01e-02 3.39e+04 -0.7 3.16e+00 - 1.67e-01 5.34e-01h 1
25 -4.6286423e+04 2.01e-02 2.47e+04 -0.7 8.45e-01 - 2.70e-01 8.77e-01h 1
26 -4.6279553e+04 3.87e-02 2.18e+04 -0.7 6.12e+00 - 1.18e-01 1.00e+00h 1
27 -4.6279344e+04 2.93e-02 1.32e+03 -0.7 3.97e+00 - 1.00e+00 8.40e-01f 1
28 -4.6267139e+04 2.44e-02 5.96e+03 -0.7 3.29e+00 - 1.09e-01 5.94e-01H 1
29 -4.6268290e+04 2.74e-02 4.50e+03 -0.7 7.46e-01 - 4.39e-01 1.00e+00f 1 Here is the first 30 iterations with This is Ipopt version 3.14.11, running with linear solver ma97.
Number of nonzeros in equality constraint Jacobian...: 77700
Number of nonzeros in inequality constraint Jacobian.: 27380
Number of nonzeros in Lagrangian Hessian.............: 0
Total number of variables............................: 370
variables with only lower bounds: 37
variables with lower and upper bounds: 167
variables with only upper bounds: 0
Total number of equality constraints.................: 210
Total number of inequality constraints...............: 74
inequality constraints with only lower bounds: 74
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 -4.6174315e+04 1.39e+02 1.86e+00 0.0 0.00e+00 - 0.00e+00 0.00e+00 0
1 -4.6231622e+04 1.39e+02 1.46e+01 -4.2 1.15e+03 - 1.56e-02 9.84e-04f 1
2 -4.6233102e+04 1.39e+02 1.55e+01 -0.3 1.47e+03 - 7.51e-04 2.40e-04f 1
3 -4.6234870e+04 1.39e+02 1.28e+02 -0.1 1.39e+03 - 7.75e-03 3.78e-04f 1
4 -4.6268767e+04 1.38e+02 1.17e+03 -0.1 1.39e+03 - 4.75e-02 1.08e-02f 1
5 -4.6252092e+04 1.34e+02 6.39e+03 0.3 1.37e+03 - 7.59e-02 2.79e-02f 1
6 -4.6179486e+04 1.27e+02 3.82e+04 0.7 1.30e+03 - 1.72e-01 4.79e-02f 1
7 -4.6155402e+04 1.19e+02 5.39e+04 0.5 1.17e+03 - 1.72e-01 6.87e-02f 1
8 -4.5742218e+04 1.18e+02 1.21e+07 2.3 1.23e+03 - 9.08e-01 8.64e-03f 1
9 -4.5746556e+04 1.16e+02 9.87e+06 0.9 9.95e+02 - 2.44e-01 1.14e-02h 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
10 -2.7267327e+04 1.92e+01 3.79e+06 2.0 1.05e+03 - 5.58e-01 8.35e-01f 1
11 -2.7104740e+04 1.45e+01 1.61e+06 2.0 3.10e+02 - 5.57e-01 2.41e-01h 1
12 -2.6599621e+04 4.61e-01 3.96e+05 2.0 2.41e+02 - 7.32e-01 9.68e-01h 1
13 -2.5934027e+04 4.45e-01 4.53e+07 2.2 6.54e+01 - 1.00e+00 3.58e-02f 1
14 -2.9832864e+04 8.85e-02 2.50e+06 1.9 3.11e+01 - 1.00e+00 9.62e-01h 1
15 -3.7297683e+04 2.58e-02 9.61e+06 1.5 3.99e+01 - 8.81e-01 7.00e-01f 1
16 -4.5499460e+04 2.67e-03 3.50e+05 0.5 3.09e+01 - 1.00e+00 9.95e-01f 1
17 -4.5864138e+04 7.21e-04 9.11e+05 -0.0 4.08e+01 - 1.00e+00 9.63e-01f 1
18 -4.6142299e+04 5.43e-03 2.01e+01 -0.4 2.68e+01 - 1.00e+00 1.00e+00f 1
19 -4.6234709e+04 5.52e-03 1.40e+04 -0.6 1.05e+01 - 9.81e-01 1.00e+00f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
20 -4.6296392e+04 8.35e-03 4.25e+01 -0.9 4.76e+00 - 1.00e+00 1.00e+00f 1
21 -4.6250560e+04 4.87e-02 1.09e+05 -0.6 1.66e+01 - 1.00e+00 8.49e-01f 1
22 -4.6284598e+04 1.92e-02 1.31e+05 -0.7 7.05e+00 - 5.64e-01 1.00e+00f 1
23 -4.6291279e+04 3.22e-02 4.07e+04 -0.7 8.82e+00 - 6.90e-01 5.73e-01f 1
24 -4.6287744e+04 3.01e-02 3.39e+04 -0.7 3.16e+00 - 1.67e-01 5.34e-01h 1
25 -4.6286423e+04 2.01e-02 2.47e+04 -0.7 8.45e-01 - 2.70e-01 8.77e-01h 1
26 -4.6279553e+04 3.87e-02 2.18e+04 -0.7 6.12e+00 - 1.18e-01 1.00e+00h 1
27 -4.6279344e+04 2.93e-02 1.32e+03 -0.7 3.97e+00 - 1.00e+00 8.40e-01f 1
28 -4.6267139e+04 2.44e-02 5.96e+03 -0.7 3.29e+00 - 1.09e-01 5.94e-01H 1
29 -4.6268290e+04 2.74e-02 4.50e+03 -0.7 7.46e-01 - 4.39e-01 1.00e+00f 1 As you can see, the objective did not move much in either cases. I wonder what is the correct setting to make it stop at a acceptable (feasible) point in fewer iterations so I can speed up the program. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The Looking at the code for the acceptable check may also help: Ipopt/src/Algorithm/IpOptErrorConvCheck.cpp Lines 286 to 347 in e622421 You see that if you increase the print_level to 7, you will get additional info on whether the check was successful or not to the log. |
Beta Was this translation helpful? Give feedback.
The
acceptable_obj_change_tol
is only one criterion that needs to be satisfied to make Ipopt stop with an "acceptable" point. In addition, various infeasibility measures need to be satisfied and this needs to happen for at leastacceptable_iter
many subsequent iterations.Check https://coin-or.github.io/Ipopt/OPTIONS.html#OPT_Termination for all other options you may need to set. In your log, the primal and dual infeasibility are still quite high, preventing Ipopt from stopping.
Looking at the code for the acceptable check may also help:
Ipopt/src/Algorithm/IpOptErrorConvCheck.cpp
Lines 286 to 347 in e622421