How to define an external cost like J = y' * u + u' * r * u + y' * q1 * y + z' * q2 * z;

how to define an external cost like J = y’ * u + u’ * r * u + y’ * q1 * y + z’ * q2 * z;

Hi,

sorry, your post does not meet our community standards.
Please describe clearly what you are trying to do and provide a minimal self-contained example that can be used to reproduce your issue.
Here: what are u, r, q1, z, q2? what are variables, what are numerical vector?
Also, please write a friendly message starting from the template forum post template below.

Best,
Jonathan


Hi :wave:

If you have an issue with acados and are looking for help here, please mention:

  • What interface of acados are you using (C/ Matlab/ Python/ Octave)?
  • What do you want to achieve?
  • If there is a specific thing you tried that you are not sure of, add a formatted
Code
Snippet
  • It is ideal to share a minimal example to reproduce your issue.
  • If you get an error message, paste it as a formatted one, like
this error message

These hints should help other people to help you :handshake:
Thanks for using acados :pray: