-
I am using IPOPT to solve my MPC and try to speed it up. I have turned on the warm start and got a significant improvement. However, I found that there is a function handle called ReOptimizeTNLP(), but it is not mentioned in the C++ interface documentation. I found that some third-party code uses this function starting from the second optimization. I checked the code a bit and found that this method reuses TNLPAdapter. In actual use, it seems that using ReOptimizeTNLP() will make the number of iterations after the warm start more stable and keep smaller. What is the difference between ReOptimizeTNLP() and OptimizeTNLP()? How is it different from directly enabling the warm start? When or under what conditions can it be used? Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The docu of ReOptimizeTNLP says a bit more, though I don't think that the structure must be the same. ReOptimizeTNLP still does a lot of initialization, which would deal with changes in problem structure. So, you can use If in addition the problem structure does not change, that is, the Jacobian and Hessian structure does not change, variable bounds do not appear or disappear, constraint sides do not appear or disappear, and constraints do not change between equality and ranged constraints, then setting option
|
Beta Was this translation helpful? Give feedback.
The docu of ReOptimizeTNLP says a bit more, though I don't think that the structure must be the same. ReOptimizeTNLP still does a lot of initialization, which would deal with changes in problem structure.
Option warm_start_same_structure needs to be set additionally if more initializations should be skipped.
So, you can use
ReOptimizeTNLP
whenever you solve with the sameTNLP
object that you used for solving before. This will skip reconstruction of theTNLPAdapter
that translates between theTNLP
and the NLP representation that Ipopt uses internally. It will also skip reconstruction of theIpoptAlgorithm
object, so if you change Ipopt options that would switch components of the Ipopt algo…