It is advised to add to the current objective, e.g.:
mpc.prepare_nlp() # Modify the objective mpc.nlp_obj += sum1(vertcat(*mpc.opt_x['_x', -1, 0])**2) # Finish creating the NLP mpc.create_nlp()
This is a VERY low level feature and should be used with extreme caution. It is easy to break the code.
Be especially careful NOT to accidentially overwrite the default objective.
This page is auto-generated. Page source is not available on Github.