Giter VIP home page Giter VIP logo

Comments (3)

awinkler avatar awinkler commented on July 30, 2024 1

Hi! That's a good question that I unfortunately don't have a direct answer to. You're right, the polynomial that's affecting the constraint changes as the duration get optimized. Therefore, you can't really know in advance which optimization variables affect this constraint, anyone of the polynomials might. See here the discrete id being calculated:

std::tie(id, t_local) = GetLocalTime(t_global, GetPolyDurations());

(Side note: only for the dynamic and range-of-motion constraint that are equally spaced in time. Many other constraints are directly enforced at the polynomial junctions, and move together as the durations change, so those should be easier to formulate symbolically).

So I'm not sure how you could implement this symbolically, but the function above that calculates this discrete ID would be the one to focus on. Maybe there's a way to say: All node values might affect the specific constraint at time t, just the affect of those nodes far away from the constraint are zero?

from towr.

Mathieu-Geisert avatar Mathieu-Geisert commented on July 30, 2024 1

Hi,
On the same subject, I think this problem already exists with IPOPT. According to my tests and the IPOPT documentation, the structure of the Jacobian needs to be constant [1] and IPOPT starts to give weird results when a constraint switches from one spline to the other.
@awinkler Do you initialize IPOPT with a specific structure somewhere? If not, I'd suggest to add non-zero values in the Jacobian for the n next/previous splines w.r.t the active one at least during the IPOPT initialization.

[1] "Once defined, this nonzero structure MUST remain constant for the entire optimization procedure. This means that the structure needs to include entries for any element that could ever be nonzero,
not only those that are nonzero at the starting point." https://projects.coin-or.org/Ipopt/browser/stable/3.2/Ipopt/doc/documentation.pdf?format=raw

from towr.

awinkler avatar awinkler commented on July 30, 2024

Yes, you're right, I just checked the code to find where I'm tackling this issue already. This is because IPOPT requires the sparsity structure beforehand, see this discussion. They way it's currently solved is very generously initializing all elements to be non-zero; so similar to what you suggested @Mathieu-Geisert. I'm assuming this makes it less performant, but at least won't mess up the algorithmic structure.

return jac.sparseView(1.0, -1.0);

On a more general note, optimizing over the durations remains tricky. Convergence is slower from my experience and not as robust, so there's definitely room for investigation and discussion on how to set up this structure correctly.

from towr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.