UMocoD update

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Ross Miller
Posts: 371
Joined: Tue Sep 22, 2009 2:02 pm

UMocoD update

Post by Ross Miller » Thu Nov 12, 2020 12:06 pm

Hi all,

I recently uploaded an updated version of my "UMocoD" project to SimTk, you can see it here:

https://simtk.org/frs/?group_id=1910

The model and code is adjusted/refined a bit from the earlier version:
- Has a few more muscles (84 total)
- Upper limb torque actuators have activation dynamics
- Matlab code is streamlined a bit
- Metabolic cost is calculated after the optimization finishes
- A more realistic model of joint ranges of motion (functions from the Anderson & Pandy model) is used

A solution is provided for a tracking problem of walking that tracked the data reasonably well with a realistic metabolic cost (~3.6 J/m/kg), it should be a good starting point for doing other simulations. The GRF sometimes have high-frequency wiggles in predictive simulations that I haven't sorted out, but other than that it seems to work pretty well.

Please let me know if you have any issues/questions/problems using it. I don't check the forum for that project much (ever) so it would be better to post something here or email me (rosshm [at] umd [dot] edu).

Ross

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: UMocoD update

Post by Nicholas Bianco » Thu Nov 12, 2020 4:40 pm

Thanks Ross! This is fantastic.

I noticed that you're using explicit multibody dynamics over implicit dynamics. Did you find that formulation faster/easier to use?

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

Re: UMocoD update

Post by Ross Miller » Thu Nov 12, 2020 5:03 pm

I've not yet gotten good results with implicit multibody dynamics, it usually will not converge, and explicit seemed to work well so I've stuck with that recently. I should try again with implicit.

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: UMocoD update

Post by Nicholas Bianco » Thu Nov 12, 2020 5:59 pm

I've found that when minimizing accelerations with implicit dynamics, I've needed a larger acceleration weight than I originally thought to get good convergence. But then it can be hard to find a balance between good convergence and not letting the acceleration cost term dominate the solution. In that regard, I like the simplicity of explicit dynamics.

User avatar
Karthick Ganesan
Posts: 118
Joined: Thu Oct 10, 2013 12:11 am

Re: UMocoD update

Post by Karthick Ganesan » Sun Nov 15, 2020 9:56 am

Hi Ross Miller,
Thanks for sharing the updated version. I am curious to know how you formulate the predictive simulations and that will be helpful.
Regards,
Karthick

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

Re: UMocoD update

Post by Ross Miller » Sun Nov 15, 2020 10:27 am

Hi Karthick,

The easiest way is to just set the weight on all the tracking terms to zero. That would be a "pure predictive" simulation. However, I usually get better results on predictive simulations ("better" = converges faster and more consistently) if I keep a small tracking term in the cost function, so for that you could just crank up the weight on the control effort term (e.g. make it 100,000 instead of 50) or add some other prediction criterion with MocoSumSquaredStateGoal or MocoOutputGoal and give it a heavy weight.

In the code I posted, the cost function score for tracking will typically be ~0.5 or less, so if doing a "pseudo-predictive" simulation (one that still has some light tracking) you'd want to weight your predictive term(s) heavily enough such that their scores when minimized are much greater than 0.5 (so that they dominate the cost function instead of tracking).

Ross

POST REPLY