Plotting Muscle Fiber Length and Force outside Opensim

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Rachel Jackson
Posts: 5
Joined: Thu Nov 21, 2013 1:12 pm

Plotting Muscle Fiber Length and Force outside Opensim

Post by Rachel Jackson » Mon May 19, 2014 8:33 am

Hi all,

I am running CMC to try to understand muscle forces and length changes in different experimental conditions. I found that you can look at muscle fiber forces and lengths separate from the tendon, in the Opensim environment. I was wondering if this data was stored in any output file that could be accessed with Matlab. I know that CMC outputs "*_Actuation_force.sto" and "*_Acutation_power.sto" (etc.) files, but I wasn't sure if these were for the muscle only, or if this was for the combined muscle-tendon unit.

Ideally I would like to plot muscle force and power as a function of time.

Thanks!

Best,
Rachel

User avatar
M.Ali Akhras
Posts: 11
Joined: Mon Apr 29, 2013 6:32 am

Re: Plotting Muscle Fiber Length and Force outside Opensim

Post by M.Ali Akhras » Mon May 19, 2014 9:21 am

Hi Rachel,
Yes, in the output files you can have all the data you need. For example, In "*_Actuation_force.sto" file the muscle forces are stored, those force are the muscle fiber forces along tendon or the tendon forces (they are equal)... they are exactly why you plotted by OpenSim plot tool "total fiber forces". However, You can also output active and passive fiber forces in separate files. Muscle fiber lengths instead can be stored in a separate output file "*_MuscleAnalysis_FiberLength.sto" or "*_states.sto" according to the type of analysis you are specifying in .xml setting file.

The first column of output files is usually the time vector. If you would just like to plot muscle force and power as a function of time, then use directly the output files you have (i.g. "*_Actuation_force.sto" and "*_Acutation_power.sto") which contain the information of what you need.

Best,
Ali

User avatar
Rachel Jackson
Posts: 5
Joined: Thu Nov 21, 2013 1:12 pm

Re: Plotting Muscle Fiber Length and Force outside Opensim

Post by Rachel Jackson » Mon May 19, 2014 2:59 pm

Hi Ali,

When I compare the "total fiber forces" to the "tendon forces" in the opensim environment they are not necessarily the same (depending on the muscle I am looking at). I figured this had to do with the definition of the pennation angle...is this correct?

What do I need to specify in my .xml file to output the active and passive fiber forces?

In addition, are the fiber lengths that are output in the "*_states.sto" the fiber lengths of the muscle or the muscle-tendon unit? Similarly, are the "*_Actuation_power.sto" files for the mtu or just the muscle? I would like to understand the power output of the muscle independent of the tendon to see the relative contributions of each and to try to analyze where overall energetic costs are being saved or increased. Sorry if these are sort of repetitive questions.

Thanks for your help!

Best,
Rachel

User avatar
M.Ali Akhras
Posts: 11
Joined: Mon Apr 29, 2013 6:32 am

Re: Plotting Muscle Fiber Length and Force outside Opensim

Post by M.Ali Akhras » Tue May 20, 2014 3:41 am

Hi Rachel,
Yes, this is correct. The tendon force is equal to the muscle fiber force along tendon (not the muscle fiber force), F_T=F_MaT. The difference between the two forces, muscle fiber force and muscle fiber force along tendon, is that the last one depends also on the pennation angle.
F_MaT=F_M.cos⁡(α)
Where F_M is the total fiber force, α is the pennation angle.
The total fiber force is given by:
F_M=[a(t) f_AL(L_M ) f_v (v_M )+f_PL (L_M )] f_iso
Where f_AL(L_M ) is the active fiber multiplier which depends on the normalized fiber length, f_v (v_M ) is the muscle force-velocity relationship, f_PL(L_M) the passive fiber force which also depends on the normalized fiber length, and f_iso is the max isometric force.
The tendon force is given by:
F_T=f(L_T )=f (f_SE,f_iso )=f_SE(L_T) f_iso
f_SE(L_T) is the serial element force (normalized tendon force) which depends on the normalized tendon length.

To output the active and passive force, include in your .xml setting file the "MuscleAnalysis":
Example:
<AnalysisSet name="Analyses">
<objects>
<MuscleAnalysis name="MuscleAnalysis">
<!--Flag (true or false) specifying whether whether on. True by default.-->
<on>true</on>
<!--Start time.-->
<start_time>-Inf</start_time>
<!--End time.-->
<end_time>Inf</end_time>
<!--Specifies how often to store results during a simulation. More specifically, the interval (a positive integer) specifies how many successful integration steps should be taken before results are recorded again.-->
<step_interval>1</step_interval>
<!--Flag (true or false) indicating whether the results are in degrees or not.-->
<in_degrees>true</in_degrees>
<!--List of muscles for which to perform the analysis. Use 'all' to perform the analysis for all muscles.-->
<muscle_list> all</muscle_list>
<!--List of generalized coordinates for which to compute moment arms. Use 'all' to compute for all coordinates.-->
<moment_arm_coordinate_list> all </moment_arm_coordinate_list>
<!--Flag indicating whether moments should be computed.-->
<compute_moments>true</compute_moments>
</MuscleAnalysis>
</objects>
<groups/>
</AnalysisSet>

The fiber lengths in "*_states.sto" are the fiber lengths of the muscles (Not the muscle-tendon units), because they are the state variables of the muscle contraction dynamics system. The muscle-tendon unit lengths are computed from kinematics, they are also stored in a separate file"*_MuscleAnalysis_Length.sto" if you use "MuscleAnalysis". Fiber lengths are stored in "*_MuscleAnalysis_FiberLength.sto" or "*_states.sto" according to the type of analysis you are specifying in .xml setting file.

I can not give you a definite answer regarding "*_Actuation_power.sto" files, but I think they are for muscle-tendon units because a muscle actuator is made by a muscle+tendon. In case of "*_Actuation_force.sto" file the muscle forces are the muscle fiber forces along tendon = the tendon forces as I explained you above. If you would like to look at only the total fiber force, then F_M is what you need (without considering cos⁡(α)). If you would like to study the muscle force applied on bone segments, the muscle fiber forces along tendon/the tendon forces are the case.

Best,
Ali

User avatar
Rachel Jackson
Posts: 5
Joined: Thu Nov 21, 2013 1:12 pm

Re: Plotting Muscle Fiber Length and Force outside Opensim

Post by Rachel Jackson » Tue May 20, 2014 5:57 am

Thank you, Ali!

User avatar
M.Ali Akhras
Posts: 11
Joined: Mon Apr 29, 2013 6:32 am

Re: Plotting Muscle Fiber Length and Force outside Opensim

Post by M.Ali Akhras » Tue May 20, 2014 8:14 am

You are welcome.
However, If you set "MuscleAnalysis" in your .xml file, the power of muscle, the fiber active and passive powers, and the tendon power are all stored in separate output files.

Good luck with your research
Ali

User avatar
John Rogers
Posts: 45
Joined: Fri Feb 24, 2012 11:47 am

Re: Plotting Muscle Fiber Length and Force outside Opensim

Post by John Rogers » Mon Jun 23, 2014 8:34 am

Rachel,
Please try the attached script for plotting and let me know how it goes.
Cheers,
John
Attachments
plot_sto.zip
(135.71 KiB) Downloaded 111 times

POST REPLY