Standing still!

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
User avatar
Pasha van Bijlert
Posts: 230
Joined: Sun May 10, 2020 3:15 am

Re: Standing still!

Post by Pasha van Bijlert » Mon Mar 21, 2022 3:03 pm

Hi Ross,

Thanks for sharing those! Is this all using the model that's part of UmocoD v2, with ankle + subtalar & MTP joints?
Your GRFs look quite good (especially min_u3, even if it's a local minimum). Did you end up using a standing solution for your initial guess? And these are pure predictions, correct? (i.e. no tracking)?

After trying out all the suggestions in the thread I'd made earlier (and some that hadn't been suggested), I still haven't gotten GRF curves that look like you'd expect in ostriches. They're smooth now - but I've got a smoothed spike at IC. I think my issue may just be that my model is too simple, since your GRFs have the overall "expected" double hump, even though you've got a lot fewer terms in the cost function. I think I might try adding in more contact spheres, similar to what you've added to model, and perhaps more joints in the foot/toes to see if that changes anything.

I've attached a walking and a running GRF.

Cheers,
Pasha
1.3ms_walk.PNG
1.3ms_walk.PNG (26.16 KiB) Viewed 428 times
1.3ms_walk.PNG
1.3ms_walk.PNG (26.16 KiB) Viewed 428 times
Attachments
5.5ms_run_GRF.PNG
5.5ms_run_GRF.PNG (26.36 KiB) Viewed 428 times

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Standing still!

Post by Ross Miller » Wed Mar 23, 2022 6:50 am

The model I used here was essentially the same as the one I have posted in SimTk yes. It has an ankle joint, subtalar joint, and toes joint, and 11 contact points on the plantar surface.

These all used a tracking solution as the initial guess, I think that is why the local minimum is conspicuously similar to real GRF (it did not budge much from the initial guess). With a standing initial guess I usually don't get good results with this model, either doesn't converge or converges on a solution with a cost function score that is obviously too high, e.g. metabolic cost = 7 J/m/kg for walking.

The simulations all had no tracking term whatsoever in the cost function.

Are the results in your figures above from an ostrich model?

Ross

User avatar
Pasha van Bijlert
Posts: 230
Joined: Sun May 10, 2020 3:15 am

Re: Standing still!

Post by Pasha van Bijlert » Wed Mar 23, 2022 3:16 pm

Hi Ross,

Sorry, I should have clarified - they're from my (8000kg) T. rex model. I'm expecting them to be close to an ostrich due to morphological similarities between the hindlimb, and I'm currently working on an emu and ostrich model to cross-check this assumption. There's also the distinct possibility that my model is currently too simplified to be able to match ratite-GRFs, even if it's sub-optimal.

It's good to know that you're using a tracking simulation as initial guess. This somewhat tempers my expectation that I can get good/adequate GRFs from a pure prediction, at least in one go. I wonder: have you experimented with adding a lot of cost terms initially (when using random initial guesses), and once you get a solution you're relatively happy with, use them as initial guesses for an optimization with fewer terms? This might not be a useful approach for you, since you can just use tracking data for your initial guesses, but it may be a viable alternative in a situation where a good initial guess is not available.

Cheers,
Pasha

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Standing still!

Post by Ross Miller » Thu Mar 24, 2022 9:15 am

I've not tried that particular approach.

For 3-D simulations, I've not had much luck getting good results in predictive simulations without using a tracking solution as the initial guess. Or I can use another predictive solution, but that solution itself was generated using a tracking solution as the initial guess.

I can use standing as the initial guess and get convergence but usually it is a local minimum, e.g. using standing as the initial guess, I just got the model to walk with a metabolic cost of 50 J/m/kg. When starting from a tracking simulation I get metabolic costs of 2-4 J/m/kg.

I don't think using tracking solutions as the initial guess for predictive simulations is problematic. The worry is often that this biases the mechanics to being similar to a tracking solution. That's not been my experience in practice. Unless we expect that "normal" gait is very sub-optimal, we should expect things like energy-minimizing gaits to roughly resemble real walking / tracking solutions. The goal of optimization is to minimize the cost function, so the best initial guess in my opinion is the one that results in the lowest cost function score. In my experience for human locomotion simulations, tracking solutions work well for that task.

I don't know if this would work well, but you could try getting your T-rex model to track human walking data? This might be a useful initial guess for predictive simulations.

Ross

User avatar
Pasha van Bijlert
Posts: 230
Joined: Sun May 10, 2020 3:15 am

Re: Standing still!

Post by Pasha van Bijlert » Fri Mar 25, 2022 4:21 am

Hi Ross,
The goal of optimization is to minimize the cost function, so the best initial guess in my opinion is the one that results in the lowest cost function score. In my experience for human locomotion simulations, tracking solutions work well for that task.

I don't know if this would work well, but you could try getting your T-rex model to track human walking data? This might be a useful initial guess for predictive simulations.
I agree with you that in most cases, it makes sense to use tracking data as an initial guess. I wonder if tracking a human would work well, because humans have two functional leg segments (thigh and shank), while dinosaurs (and birds) have three (thigh, shank, metatarsals, they walk on their toes). I've considered using published ostrich kinematics for a tracking solution (and you've now got me wondering if what tracking a human would lead to). My main argument against this, is that many people have used qualitative similarities between T. rex and ostriches to suggest their gait strategies would have similarities. If I can demonstrate these similarities without tracking data, I can add quantitative data to this claim. If I use ostrich tracking data, you could argue that this is circular reasoning (you use ostriches as a starting off-point, so you shouldn't be surprised your final result resembles their coordination strategies).

More generally speaking, (and more on topic for why you started this thread), I still don't understand why we shouldn't be able to avoid these local optima, if Antoine Falisse is able to with his trackingless-3D predictions? I understand that the speed-difference comes from his implementation of algorithmic differentiation, but does this also make the optimizations less susceptible to local-minima? Or is this a byproduct of adding the extra terms in the cost function (e.g. minimize DF/dt, minimize multibody accelerations, etc.).

Cheers,
Pasha

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Standing still!

Post by Ross Miller » Fri Mar 25, 2022 7:35 am

pvb wrote:
Fri Mar 25, 2022 4:21 am
If I use ostrich tracking data, you could argue that this is circular reasoning (you use ostriches as a starting off-point, so you shouldn't be surprised your final result resembles their coordination strategies).
I would give a different perspective here: you should try multiple initial guesses (usually a good idea for gradient-based optimization) but the best initial guess is the one that produces the lowest cost function score, regardless of whether it's a tracking solution and from what animal. If an ostrich data-tracking solution produces the lowest cost function score you can find for your predictive T-rex simulations, that's interesting in and of itself and I think further supports the idea T-rex may have walked similarly to an ostrich.

When I use data-tracking solutions for human walking as an initial guess for predictive walking, I don't get mechanics that are necessarily similar to the tracking solution, e.g. if my initial guess is a tracking solution to J = (tracking error) + w*(u^2), and I use this solution as the initial guess to J = u^2, I get a predictive simulation with a large GRF impact peak and a hip circumduction gait, neither of which were present in the tracking solution. The benefit of the tracking solution is that it starts with a fairly low u^2, helping my predictive simulation avoid local minima with large u^2.

If I do get mechanics similar to a tracking solution, they are very suspiciously similar and obviously a local minima that should be discarded, e.g. the optimization will converge within ~100 iterations (rarely does this happen that fast for me) and the mechanics and muscle activity will have barely changed from the initial guess.

Ross

User avatar
Pasha van Bijlert
Posts: 230
Joined: Sun May 10, 2020 3:15 am

Re: Standing still!

Post by Pasha van Bijlert » Fri Mar 25, 2022 9:00 am

Hi Ross,
I would give a different perspective here: you should try multiple initial guesses (usually a good idea for gradient-based optimization) but the best initial guess is the one that produces the lowest cost function score, regardless of whether it's a tracking solution and from what animal. If an ostrich data-tracking solution produces the lowest cost function score you can find for your predictive T-rex simulations, that's interesting in and of itself and I think further supports the idea T-rex may have walked similarly to an ostrich.
That's a very good point, thank you for this perspective! I'll give it a shot in the near future (especially since I'm building an emu model currently).

Cheers!
Pasha

POST REPLY