csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
94 stars 20 forks source link

Figure out why convergence is more difficult with human scaled parameters. #18

Closed moorepants closed 9 years ago

moorepants commented 10 years ago
tvdbogert commented 10 years ago

It is just difficult, or (so far) impossible to get convergence?

moorepants commented 10 years ago

I just got the Park/Kuo model running. I'm also having this issue. For example, if my initial guess is the known state trajectories and the known continuous gains, it took around 2000 iterations to find the solution. It does find the correct solution, but at some point in history I was able to find the correct solution for the n-pendulum problem with far fewer iterations. I'm also having trouble converging at all for different initial gain guesses (random, zeros, ones).

moorepants commented 10 years ago

I just confirmed that the parameter id problem converges in under 100 iterations after switching back to my original numerical parameter set for the n-link pendulum which was masses and links are 1.0 kg and 1 m respectively. I'm not sure why this would effect things so much.

tvdbogert commented 10 years ago

Have you experimented with varying the time step for direct collocation? The smaller pendulum has faster dynamics, so may need smaller step size to converge equally well. Other than that I would have no idea.

moorepants commented 10 years ago

Yeh, I've used smaller steps. I think I'll need to systematically go through various things. This is discouraging though...

tvdbogert commented 10 years ago

It's such a dramatic difference in performance of the optimization. Important to understand what the critical factor is. Yes, systematic exploration of in-between cases seems to be the only option.

moorepants commented 10 years ago

Ton suggested trying a regularization term in the cost function.

These should have small weighting terms.

moorepants commented 10 years ago

Think about scaling:

moorepants commented 10 years ago

Some useful links for scaling:

moorepants commented 9 years ago

@tvdbogert Good news. The gains for human quiet standing problem range from 0 to 1000. The state trajectories are all in the realm of -0.5 to 0.5, so they are fine in terms of scaling. I scaled the gains in the problem formulation such that they are all 0.5. Problem now converges in 31 iterations. The paper can move forward!

tvdbogert commented 9 years ago

So it was the scaling! Very nice and very useful to know how important this is.

moorepants commented 9 years ago

Fixed both examples: