-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add both inputs and input_change cost to quad cost #17
Comments
Hi @camilogonzalez97 Here is the code I run,
|
Hey @brunomorampc, It seems that this only happens when you have another quad cost with
But if I change the order of the costs, it works.
Btw, which version of Casadi do you use with the library? When I install with pip I get Casadi 3.6.3, and if I try to run the example that you sent, I get the error:
I've encountered that before with other problems I am working on, the only integrators that work for me are cvodes, idas or discrete. To use collocation I have to modify |
Hi @camilogonzalez97 , sorry for the late answer. Yes, I am familiar with that error, I think we are using 3.4.5, the problem occourse with the last versions of casadi. We'll have to figure out why. thanks for providing an example, I'll check it probably next week as I do not have my computer at the moment |
I've noticed that when you use
quad_stage_cost
it is not possible to use bothadd_inputs
andadd_inputs_change
for the same set of inputs which is commonly required in many MPC problems. It results in the error:I got around that by modifying
_check_options
inmodeling.py
like so:I enabled IPOPT output and tested on the problem I am trying to solve, the objective values do change when I use
add_inputs
and add or removeadd_inputs_change
, and when I run the controller for a long trajectory I can see a difference in the solutions, the addition ofadd_inputs_change
does smooth the control actions.I don't know if this change breaks anything else in the library or if it is the right solution, so I thought I'd bring it up here as it would be nice to enable both
add_inputs
andadd_inputs_change
. What are your thoughts on that? Am I breaking something else by modifying that line?On a separate note, I have noticed a huge speed up when I pass
"expand": True
to_nlp_opts
, it would be useful to have that as an optional argument onNMPC.setup()
.p.s. This library is awesome!
The text was updated successfully, but these errors were encountered: