Use Fiber Force as input in Forward Dynamics tool

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Eduardo Sáenz Aldea
Posts: 18
Joined: Thu Oct 25, 2018 2:47 am

Use Fiber Force as input in Forward Dynamics tool

Post by Eduardo Sáenz Aldea » Mon May 13, 2019 4:22 am

Hello all,

I was wondering if there is any way in Matlab-OpenSim API to execute the Forward Dynamic Tool using FIBER FORCES as the states input.

The Forward Tool page literally states:
"subject01_walk1_states.sto: Contains the time histories of model states, including joint angles, joint speeds, muscle activations, muscle fiber lengths, and more."

So I'll like to know what kind of data it refers to when said "more".
I can also use fiber velocities as input instead of fiber forces if there is an option for that.

I've already tried to use FiberForce.sto directly as states input

Code: Select all

tool.setStatesFileName(New_Path);
but I get incoherent results, so I do not know if I'm making a mistake and I need to change the way I'm using it, or if it is impossible and the tool does not allow working with that kind of data as input.

Thank you in advance for your help!

Eduardo Saenz

Tags:

User avatar
Thomas Uchida
Posts: 1760
Joined: Wed May 16, 2012 11:40 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Thomas Uchida » Mon May 13, 2019 4:40 pm

I was wondering if there is any way in Matlab-OpenSim API to execute the Forward Dynamic Tool using FIBER FORCES as the states input.
No, because fiber force is not a state (it is computed by the muscle model). You can find more information about the muscle models on the "Muscle Model Theory and Publications" page in the Confluence documentation (https://simtk-confluence.stanford.edu:8 ... blications).
So I'll like to know what kind of data it refers to when said "more".
A model's states depends on its components. For example, the ClutchedPathSpring has an internal state for its stretch (https://simtk.org/api_docs/opensim/api_ ... ml#details).

User avatar
Eduardo Sáenz Aldea
Posts: 18
Joined: Thu Oct 25, 2018 2:47 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Eduardo Sáenz Aldea » Wed May 15, 2019 1:15 am

Thank you for your reply, it's been really helpful.

Is there any tool in OpenSim that can manage muscle model computed data as an input? As fiber force or fiber velocity.
Or instead of that aproach, what model component parameter do you think I should relate to fiber velocity? I'm trying to find any equations that links fiber properties with muscle model components, with no luck yet. For your knowledge, I'm using a Thelen model.

To sum up, in my master's thesis I'm trying to modify fiber velocities of a simulation in order to recreate a spastic behaviour in the muscle, so in order to close the diagram I need to use this modified fiber values as inputs, to compare them with the patients actual values.

How can be it done in Opensim?

Thank you!

User avatar
Thomas Uchida
Posts: 1760
Joined: Wed May 16, 2012 11:40 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Thomas Uchida » Wed May 15, 2019 6:26 am

I'm trying to modify fiber velocities of a simulation in order to recreate a spastic behaviour in the muscle
Have you looked at the "Spasticity model in OpenSim" project (https://simtk.org/projects/spasticitymodel)? Even if it's not exactly what you need, it may be a good place to start.

User avatar
Eduardo Sáenz Aldea
Posts: 18
Joined: Thu Oct 25, 2018 2:47 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Eduardo Sáenz Aldea » Wed May 15, 2019 7:54 am

Thank you for your replies, I really appreciate it!

I already evaluate this project, it's really interesting, but as I saw, they implement the spastic effects using a controller, and in my project we were more interested in having this two processes (spastic transformation and dynamic analysis) separate, in order to have more control of it and use in Simulink or similar.

Do you think this is possible?

Also, as it's said in the first post muscle fiber lengths are admitted in the Forward Dynamic tool too. But I'm trying to perform a Forward Dynamics introducing muscle fiber lengths values from a previous Muscle Analysis, and I'm not getting any coherent results. How can be it done?

User avatar
Thomas Uchida
Posts: 1760
Joined: Wed May 16, 2012 11:40 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Thomas Uchida » Wed May 15, 2019 1:50 pm

I already evaluate this project, it's really interesting, but as I saw, they implement the spastic effects using a controller, and in my project we were more interested in having this two processes (spastic transformation and dynamic analysis) separate, in order to have more control of it and use in Simulink or similar. Do you think this is possible?
There are a few ways you could approach the problem, depending on your research question and what exactly you are trying to capture in the model. If you don't want to use a controller, you could also potentially extend the muscle model (e.g., via a plugin).

User avatar
Eduardo Sáenz Aldea
Posts: 18
Joined: Thu Oct 25, 2018 2:47 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Eduardo Sáenz Aldea » Thu May 16, 2019 2:30 am

depending on your research question and what exactly you are trying to capture in the model
For the moment we are just trying to get joint coordinates values (after the modification) to compare them with the ones detected in the real patient, that's why I first started working with Forward Dynamics.

On the other hand, Thelen muscle model works by using two states (activation and fiber-length), how can I introduce fiber length states in the Forward Dynamics tool as inputs? If I get to do that, I think I'll be able to convert my fiber velocities to lengths using the model curves and equations.

Thank you for your effort and patience!

User avatar
Eduardo Sáenz Aldea
Posts: 18
Joined: Thu Oct 25, 2018 2:47 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Eduardo Sáenz Aldea » Thu Jun 13, 2019 2:14 am

Hello Mr. Uchida,
I've implemented a new C++ class to apply the spastic behaviour to our muscles. My intention is to use CMC to get excitation values from a real movement and my class should modify those excitations in the case the muscle is spastic. I was wondering which method should I call from my class in order to modify the control of a given state. My class is inherited fromThelen2003Muscle and I'm having difficulties to find a method to change these excitations.
I've seen that there is a way to do this using a controller (using computeControls), but we were avoiding to use a controller in our project.

Thank you in advance!

User avatar
Thomas Uchida
Posts: 1760
Joined: Wed May 16, 2012 11:40 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Thomas Uchida » Thu Jun 13, 2019 10:50 am

My intention is to use CMC to get excitation values from a real movement and my class should modify those excitations in the case the muscle is spastic.
It's unclear what you're trying to do. Was spasticity present in the subject from whom you collected data?
- If no: Simulating spasticity in a muscle while tracking a healthy movement may not be appropriate since, presumably, the muscle spasticity would affect the motion. In this case, you may want to run CMC to generate muscle excitations for the healthy subject, adjust these excitations using some algorithm, and then apply the new excitations in a Forward simulation. In this case, there would be no need to write a new muscle model (just the excitation-adjustment algorithm).
- If yes: CMC will compute the excitations necessary to produce the observed movement. You can add constraints to the excitations (https://simtk-confluence.stanford.edu:8 ... ion+Editor) if necessary.

User avatar
Eduardo Sáenz Aldea
Posts: 18
Joined: Thu Oct 25, 2018 2:47 am

Re: Use Fiber Force as input in Forward Dynamics tool

Post by Eduardo Sáenz Aldea » Thu Jun 13, 2019 11:26 am

Thank you for your reply!

We don't have real data from the patients yet, but the project is meant to work with patients with spasticity and evaluate them. Our main goal is to represent the real behaviour of our subjects, in order to classify the severity of the disorder of each one and give that information to their physiotherapist. Also, we are trying to avoid the use EMG data from the patient.

So, if I'm not misunderstanding you, if we simply run CMC with the subjects movement data (joint coordinates and external forces) it will compute the real muscle excitation, aren't we? And we can use this information in further analysis.
I thought we had to apply more deeply changes in the muscle values to get this kind of information and reproduce our subjects disease in OpenSim, as I saw in projects like https://simtk.org/projects/spasticitymodel

I don't understand how OpenSim will distinguish between a healthy subject performing an slow movement and a subject with spasticity.

Again, thank you for your help.

POST REPLY