SNOPT cannot warmstart from restartDict in intermediate major iterations with snstop #421
anjianli21
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm solving some optimization problem with SNOPT. I try to use the callback function from snstop to save the restartDict at each major iteration, from which I should be able to warmstart the solving process.
However, when I save the restartDict from the callback function in snopt, and supply the saved restartDict like
sol, _ = opt(optProb, storeHistory=history_file, restartDict=restartDict)
The problem just cannot proceed. It stuck at one major iteration, and then ends with snopt info 41: current point cannot be improved.
However, when I set
"Return work arrays": True,
and then save the work arrays at the end of the optimization, this work array can be used for warmstart that converges immediately.
Even though I use the restartDict from the last major iteration with snstop to warm start, it still gets stuck with snopt info 41.
I compare the restartDict saved at the last major iteration using snstop and the work array saved using call function, and they are different:
Analyzing iw:
Different from work array
Number of different elements: 16 out of 264911 (0.01%)
Max difference: 12733
Index 180: snSTOP value = 1, final value = 2
Index 188: snSTOP value = 3584, final value = 3585
Index 193: snSTOP value = 3584, final value = 3585
Index 235: snSTOP value = 0, final value = -1
Index 241: snSTOP value = 0, final value = 2
Analyzing rw:
Different from work array
Number of different elements: 16 out of 229500 (0.01%)
Max difference: 111111.0
Index 420: snSTOP value = -11111.0, final value = 4.3168552289305415
Index 421: snSTOP value = -11111.0, final value = 1.0
Index 422: snSTOP value = -11111.0, final value = 14.707068711952871
Index 423: snSTOP value = -11111.0, final value = 100000.0
Index 426: snSTOP value = -11111.0, final value = 0.0001015611046662479
Analyzing xs:
Different from work array
Number of different elements: 1 out of 286 (0.35%)
Max difference: 0.0001015611046662479
Index 121: snSTOP value = 0.25, final value = 0.25010156110466625
Analyzing hs:
Identical to work array
Analyzing pi:
Identical to work array
Can you help me with this issue? I'm also wondering if it is because the snstop is called before line search such that the work arrays are not fully updated for restartDict.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions