Major iteration limit reached

301 views
Skip to first unread message

Yanzhe Yang

unread,
Jun 22, 2020, 7:56:49 AM6/22/20
to am...@googlegroups.com
Hi,

I am learning AMPL to solve a nonlinear problem with SNOPT solver. I encountered a problem with "Major iteration limit reached". Do you have any advice on that?

The output is:
SNOPT 7.5-1.2 : Major iteration limit reached.
2439 iterations, objective 240.0187311
Nonlin evals: obj = 1919, grad = 1918, constrs = 1919, Jac = 1918.

Given the document https://ampl.com/products/solvers/snopt-options/ and the discussion http://ampl.996311.n3.nabble.com/AMPL-10583-SNOPT-options-major-iterations-limit-td11316.html, I should be able to set the major iteration limit like
option snopt_option 'major_iterations_limit=10000';
But I have tried with "major_iterations_limit", "major_iterations", "iterations". No matter what I changed, it will return the same error. 

My run file is:
model test.mod;
data test.dat;
option snopt_option 'wantsol=1 major_iterations_limit=10000 iterations';
option solver snopt;
solve;

Thank you!

Best,
Yanzhe

AMPL Google Group

unread,
Jun 22, 2020, 5:55:16 PM6/22/20
to AMPL Modeling Language
You should write

option snopt_options 'major_iterations_limit=10000';

If you call it "snopt_option" (without the s) then SNOPT will not recognize it. You can tell when SNOPT has successfully read your options, because it will echo them back at the beginning of its run:

ampl: option snopt_options 'major_iterations_limit=10000';
ampl: solve;
SNOPT 7.5-1.2 : wantsol=1
major_iterations_limit=10000


--
Robert Fourer
am...@googlegroups.com
{#HS:1201843960-81113#}
Message has been deleted

Yanzhe Yang

unread,
Jun 22, 2020, 10:18:53 PM6/22/20
to AMPL Modeling Language
Ah, I can't believe I made this mistake~ Thanks so much for the help!
Reply all
Reply to author
Forward
0 new messages