(close to) minimizing metabolic cost

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: (close to) minimizing metabolic cost

Post by Carlos Gonçalves » Mon Nov 16, 2020 7:25 am

Hello Nick,

I want to prevent the predictive simulation from finding a local optimum like the picture attached, where the GRF is only in the forefoot.
OpenSimWeakness01.PNG
OpenSimWeakness01.PNG (34.81 KiB) Viewed 930 times
That is totally unexpected from a gait with weakened plantairflexors.

I checked out the output report as in outputTable = study.analyze(full, outputPaths), includeding in the outputPaths the "potential energy" (outputTable = study.analyze(full, outputPaths)).

The results for variables "/contactHeel_r|potential_energy", "/contactHeel_l|potential_energy", "/contactFront_r|potential_energy" and "/contactFront_l|potential_energy" was zero for all timestamps. A constant zero value.

So, I looked again at my model and noticed the positioning of the contact geometry in the forefoot. After I changed, moving closer to the heel, I got something that looks more correct. This "heel gait" was found in previously published articles.
OpenSimWeakness02.PNG
OpenSimWeakness02.PNG (66.79 KiB) Viewed 930 times
Hope it is clearer now. The idea is to have more tools (goals in the cost function) to generate a broad range of impairment gait.

Best regards.

Carlos

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

Re: (close to) minimizing metabolic cost

Post by Ross Miller » Mon Nov 16, 2020 8:14 am

Hi Carlos,

Just a thought on toe-walking: I'm not super-familiar with earlier predictive simulation work on plantarflexor weakness or on clinical biomechanics of toe-walking gait, but toe-walking I think is a pretty common symptom in, for example, children with CP or muscular dystrophy, and plantarflexor weakness is pretty common too in children with those conditions.

If weakening the plantarflexors seems to be causing the model to use toe-walking gait, it might be interesting to figure out why the model is moving that way to minimize the specified cost.

Ross

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: (close to) minimizing metabolic cost

Post by Carlos Gonçalves » Mon Nov 16, 2020 12:15 pm

Hello Ross, thanks a lot for the feedback.

Regularly, what the clinical team that I work with explains to me is that, in most cases, the forefoot gait, or equinus gait, is due to calf muscle contracture and/or dystonia (involuntary movements).

So, the muscle-tendon is too short during gait to enable support on the heel. That was also found in predictive simulation in:

Ong, C. F., Geijtenbeek, T., Hicks, J. L., & Delp, S. L. (2019). Predicting gait adaptations due to ankle plantarflexor muscle weakness and contracture using physics-based musculoskeletal simulations. PLoS Computational Biology, 15(10), e1006993. https://doi.org/10.1371/journal.pcbi.1006993

The plantarflexion weakness appears to create more often a "crouch gait", but in cerebral palsy children, there are other "lever arms" disfunction that the 2D model cannot represent. Predictive gait for plantarflexion weakness was produced in previous work, and it also generated a heel strike pattern.

Ong, C. F., Geijtenbeek, T., Hicks, J. L., & Delp, S. L. (2019). Predicting gait adaptations due to ankle plantarflexor muscle weakness and contracture using physics-based musculoskeletal simulations. PLoS Computational Biology, 15(10), e1006993. https://doi.org/10.1371/journal.pcbi.1006993

Falisse, A., Serrancoli, G., Dembia, C. L., Gillis, J., Jonkers, I., & De Groote, F. (2019). Rapid predictive simulations with complex musculoskeletal models suggest that diverse healthy and pathological human gaits can emerge from similar control strategies. Journal of the Royal Society Interface, 16(157). https://doi.org/10.1098/rsif.2019.0402

But I still think it is possible to see patients walk with equinus gait and also have plantarflexion weakness. I personally had already seen a child like this, by he was a hemiplegic.

The odd thing about my result is that it seems to be very hard to balance over the toes like "ballerina", and it also doesn't seem metabolic efficient. To sum on top of it all, to support the body, would require too much force for the muscles on the metatarsal joint. Moving the contact are closer to the heel gives a more realistic area for support (I think). In my model this the metatarsal joint is a WeldJoint.

What I also hypothesize is that, with more plantarflexion, the lever-arm for the weight-bearing in the ankle joint is shortened. With so, the force needed to balance it out is also smaller. Maybe that is why the model converges to this gait pattern.
Equinus.PNG
Equinus.PNG (85.79 KiB) Viewed 901 times
I reckon that I should use more accurate models for my problem. Thanks a lot for this opportunity for discussion.

Carlos

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: (close to) minimizing metabolic cost

Post by Carlos Gonçalves » Mon Apr 26, 2021 7:23 am

Hello everyone,

I have a new doubt and thought on metabolic goals for predictive simulation and decided to bring this post back to the discussion.

I am starting to get a hand on all the nuances that the direct collocation imposes and the muscle properties tied to the sim result.

I'm exploring predictive simulations to different "virtual" subjects, scaled from a basic model (gait1018dof), and I would like some help on tips for this scaling procedure.

The first thing is that the scaling is working, but I noticed that the muscle properties don't change from the base model to the scaled one. This could generate weaker models, but the curious thing is that I am observing greater passive forces in the ankle plantiflexors. I suspect that the new subjects have longer tendons, and the model relies on them to reduce metabolic costs.

I other words, the ballerina gait has returned. :shock:

Does anyone have experience something similar?

What are the scaling procedures for muscles that are commonly used?

Best regards.

Carlos

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: (close to) minimizing metabolic cost

Post by Carlos Gonçalves » Wed Apr 28, 2021 2:05 pm

Hello again,

I think I found a bug in the scaling of DeGrooteFregly2016Muscle. It is not updating the optimal fiber length and the tendon slack. :shock:

If someone could check it out, it would be fantastic. I'm using a version of the 2D_gait.osim available in the examples.

My scaling sets a 1.18 factor for the new subject's tibia, but the soleus' optimal fiber length and the tendon slack remain the same as the original.

______________optimal fiber length | tendon slack
Previous scaling: 0.0481705511245028 x 0.240852755622514
After scaling: 0.0481705511245028 x 0.240852755622514

The good news is that I manually updated these parameters for all muscles with the scaling factors, and my new model is walking as the 2D_gait.osim reference model.

Should I post an issue like this in the OpenSim forum?

Best regards.

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

Re: (close to) minimizing metabolic cost

Post by Nicholas Bianco » Wed May 05, 2021 6:06 pm

Hi Carlos,

Thanks for reporting this bug. The dev team is now aware and captured it in this GitHub Issue: https://github.com/opensim-org/opensim-core/issues/2995.

Best,
-Nick

User avatar
Russell Johnson
Posts: 14
Joined: Sun Dec 23, 2012 5:10 pm

Re: (close to) minimizing metabolic cost

Post by Russell Johnson » Thu May 06, 2021 10:10 am

carlosoleto wrote:
Mon Apr 26, 2021 7:23 am

Does anyone have experience something similar?

What are the scaling procedures for muscles that are commonly used?

Best regards.

Carlos
Hi Carlos,

I had encountered this issue as well when I was testing out 4.2 (I tried to record the issue, but probably put it in the wrong place so that's my fault). The temporary workaround I've been using has been to use a model with the Millard muscle model to scale to the subject-specific anthropometry, then in my Moco code, I use

Code: Select all

modelProcessor.append(ModOpReplaceMusclesWithDeGrooteFregly2016());        % Millard muscle model input, replace with DGF2016 to run Moco
to switch the muscles to DeGrooteFregly before running the optimization.

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: (close to) minimizing metabolic cost

Post by Carlos Gonçalves » Thu May 06, 2021 4:23 pm

Hello Nick and Russell, thanks a lot for the feedback.

Using the modelProcessor.append(ModOpReplaceMusclesWithDeGrooteFregly2016()) has also worked for me.

The first idea of the post was to point out that sometimes the passive forces may overcome the active forces when the model is not well set. It took a long time to figure out that this was a major issue in the predict simulations.

Leading to a scaling problem was another surprise.

I also point out that the scaling does not alter the max isometric forces with the weight. Another thing that can make people stay awake at night ...

In the end, another day, new knowledge, hopefully, more sanity :lol:

Best regards.

Carlos

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

Re: (close to) minimizing metabolic cost

Post by Nicholas Bianco » Mon May 10, 2021 7:42 pm

Hi Carlos,

Thanks for the tip. It's known that max isometric forces don't get adjusted during scaling. You could adjust max isometric forces using the relationships. in the Handsfield et al. 2014, which is something I've done previously.

-Nick

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: (close to) minimizing metabolic cost

Post by Carlos Gonçalves » Tue May 11, 2021 4:08 pm

Million thanks Nick!!

I will study it for sure. I'm currently developing scaled models for patients attended at SARAH Network of Rehabilitation Hospitals. The goal is to run predictive simulations of gait based on assistive devices (AFOs mostly).

I think I got the roadmap well designed, but the journey is challenging. 3D gait simulations are great for anxiety therapy ... 1h of coding, 10h of computer time to get a skeleton magically levitating.

:lol:

Best regards.

Carlos

POST REPLY