Page 1 of 1

Understanding the Plot Tool

Posted: Wed Sep 12, 2018 5:42 am
by masterv
Hi team,

I have been using the plot tools as well as the .sto files generated after performing analysis like RRA and CMC to view results such as joint angles and forces. I am having a bit of trouble to understand how the plotting tool works in OpenSim.

Consider the case where I run CMC for a gait2392 subject provided along with the resources in OpenSim. (I did perform scaling, IK, RRA and now CMC)

After referring to the plotting documentation at : https://simtk-confluence.stanford.edu/d ... lot+Window
I am interested in moments at ankle, I could see from the plot tool that, in Y-Quantity there is an option in curve creating tool to plot moments. I chose the ankle_angle_r_moment and selected the muscles responsible for ankle pf/df and used sum option to add all the moments. For the X-Quantity, I chose ankle_angle_r.
I would like to know how the moments are internally calculated in OpenSim? What data is loaded in plot tool to generate these plots? How would I be able to plot the same(ankle moments vs ankle angle) from the files generated as a result of CMC? Is this option only available via plot tool and export them manually?

Also, I believe that torque and moments are synonymous in opensim?

Thanks,
Vishal

Re: Understanding the Plot Tool

Posted: Thu Sep 13, 2018 4:15 am
by mitkof6
The moment that you refer to is the torque that is generated by the muscles at a particular joint as a function of some coordinate. This is used to analyze the capacity of the muscles to produce a moment around a joint as the range of motion of a coordinate is varied. The process is as follows:

1) The coordinate (x-axis) is varied from min to max (see advanced options).
2) Then the moment arm matrix (R(q)) is calculated.
3) Finally, the torque is calculated as the product of the moment arm matrix and the muscle forces (tau = R(q) * fm(a)). By default the selected muscles are fully activated (a = 1), but this can be changed.

Re: Understanding the Plot Tool

Posted: Thu Sep 13, 2018 10:32 am
by masterv
Thank you Dimitar. Yes you are right. For now I have been calculating the moments the same way as you mentioned. I plotted the moment arms and then exported the data to a separate file to do moment calculations. As I get forces, activation and joint angles after executing CMC. Is there any way to get the moment arm as a separate output as an output from CMC without using the plot tool.

I was trying to plot the ankle moments vs ankle angle data using the plot tool, but the results from the plot tool wasn't looking fair because in the X axis you can see that ankle angle is stretched from -90 to 90, whereas the ankle is always with -15 to 15 dregees while doing walking and it is also seen in the coordinate tab from GUI. Why does plot tool use show the information from -90 to 90(although it is the range set in opensim)?
Please find the plot below:
Image
ankle moment Vs ankle angle for a gait cycle

Thanks :)

Re: Understanding the Plot Tool

Posted: Fri Sep 14, 2018 2:24 am
by mitkof6
Is there any way to get the moment arm as a separate output as an output from CMC without using the plot tool.
You can use the analyze tool, provided the state from CMC. You have to add a MuscleAnalysis, which exports the moment arms.
Why does plot tool use show the information from -90 to 90(although it is the range set in opensim)?
In the advanced option of the plotting tool you can change the range of the coordinate.

Re: Understanding the Plot Tool

Posted: Fri Sep 14, 2018 2:39 am
by masterv
mitkof6 wrote:
Fri Sep 14, 2018 2:24 am
You can use the analyze tool, provided the state from CMC. You have to add a MuscleAnalysis, which exports the moment arms.
Thank you :)
mitkof6 wrote:
Fri Sep 14, 2018 2:24 am
In the advanced option of the plotting tool you can change the range of the coordinate.
Sorry, I think I didn't explain the problem clearly. You can see that the ankle angle would never go to its extremes -90 and +90, in the plot as you have mentioned if I use the advanced options to set the xmin and xmax as -15 & 15 respectively, then the data is sliced to show only from -15 to 15 for some reason that looks very wrong. If you remember the plot should somewhat look like this:
Image

What I found surprising was that I could never see the values for ankle angle reach the extremes in the GUI. So, if i understand correctly, if I choose the X-Quantity as ankle_angle_r, the plot tool uses the full range of ankle_angle rather than the information from the trial/analysis, but I wonder how it only takes values for Y-Quantity from the trial but not X-Quantity. :?: