alphaville / optimization-engine

Nonconvex embedded optimization: code generation for fast real-time optimization + ROS support
https://alphaville.github.io/optimization-engine/
Other
499 stars 53 forks source link

Preconditioning #107

Closed alphaville closed 1 year ago

alphaville commented 4 years ago

(Implemented preconditioning in Python)

Implement scaling of the cost function and the constraints...

image

where, for example,

image

and

image

[which is not very straightforward as we don't compute the Jacobian of F1 directly]

The weights can be easily computed in Rust.

alphaville commented 3 years ago

@korken89 This is why this is not so straightforward: we need to compute scaling parameters w_f, w_1 and w_2 such that the FBE becomes

image

Recall that in Rust, we only have access to F1, F2 and psi, but not f and that psi as well as its gradient auto-generated.

The problem is not how we can compute the scaling parameters w_f, w_1 and w_2, but how to actually scale psi and its gradient.

However, here is a possible easy and, in my opinion, clean solution: Casadi will generate code for the function

image

the argument p is already there: it is the user-defined parameter; the additional argument w will be the vector of scaling parameters. In fact this may or may not be part of p.

In other words:

image

My proposal would be to use the existing vector p to pass w because it will be less disruptive.

korken89 commented 3 years ago

Makes sense, I don't remember the interface we use right now, but I understand there is a limit on the interface and we cannot add more parameters? Or is it just simply a simple way to include the new scanning parameters?

alphaville commented 3 years ago

That's an overview of the various interfaces:

image

The question is whether to:

Moreover, we currently do not compute the Jacobian of F_1 or F_2 (well, in a way we do, but only implicitly), but we'll have to in order to determine w_1 and w_2. We'll have to split F_1 and F_2 into multiple functions F_{1, j} and F_{2, j}.

korken89 commented 3 years ago

Ah okey, it's an issue for the augmented Lagrangian. Does the penalty method have the same issue?

alphaville commented 2 years ago

@Arun-R-M @smokinmirror To push this forward, let us break it down into small tasks. Every task should correspond to a PR.

Regarding DevOps:

Here is a list of tasks:

korken89 commented 2 years ago

🚀

Happy to see this getting some focus :D

korken89 commented 2 years ago

Also, ping me if you want some feedback :)

alphaville commented 1 year ago

Also, ping me if you want some feedback :)

Thank you, Emil. This is almost done now (we're testing it). I'll send you a review request soon.