Tension and strech of a biarticular Path Spring

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Pia Stefanek
Posts: 48
Joined: Tue Mar 13, 2018 12:21 pm

Tension and strech of a biarticular Path Spring

Post by Pia Stefanek » Tue Jul 17, 2018 6:07 am

Hi,

I replaced a muscle (gastrocnemius) of the right leg by a biarticular path spring as described in "Simulation-Based Design to Reduce Metabolic Cost" (https://simtk-confluence.stanford.edu/d ... bolic+Cost). Now I would like to see the Tension and length values of the path Spring over time. I cannot find these values, when I perform CMC. I know that the Tension can be calculated using the following Formula: tension = (K*s)*(1+D*ldot) where stretch, s = l-lo for l > lo, and 0 otherwise (https://simtk.org/api_docs/opensim/api_ ... ml#details). But to calculate the Tension I Need to know the length l of the spring.


Thank you in advance for your help.

Tags:

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

Re: Tension and strech of a biarticular Path Spring

Post by Thomas Uchida » Tue Jul 17, 2018 9:41 am

to calculate the Tension I Need to know the length l of the spring
See the getLength() method here: https://simtk.org/api_docs/opensim/api_ ... 55d5f629ac.

User avatar
Pia Stefanek
Posts: 48
Joined: Tue Mar 13, 2018 12:21 pm

Re: Tension and strech of a biarticular Path Spring

Post by Pia Stefanek » Tue Jul 17, 2018 1:06 pm

Thank you very much for your Reply!

Can you tell me if I can use the getLength() method in the scripting shell window or is this not possible?

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

Re: Tension and strech of a biarticular Path Spring

Post by Thomas Uchida » Tue Jul 17, 2018 2:23 pm

Can you tell me if I can use the getLength() method in the scripting shell window or is this not possible?
Yes, you can use getLength() in the scripting shell. Here's an example (assuming the arm26 model has been opened):

Code: Select all

Jython Interactive Console
>>> model = getCurrentModel();
>>> state = model.getWorkingState();
>>> muscle = model.getMuscles().get('TRIlong');
>>> muscle.getGeometryPath().getLength(state)
0.27760917727192447
Information about scripting in the GUI can be found on the following pages in the Confluence documentation:
- Common Scripting Commands - https://simtk-confluence.stanford.edu/d ... g+Commands
- Scripting in the GUI - https://simtk-confluence.stanford.edu/d ... in+the+GUI
Also see the examples in your OpenSim installation directory (e.g., C:\OpenSim3.3\Scripts\GUI_Scripting).

User avatar
Pia Stefanek
Posts: 48
Joined: Tue Mar 13, 2018 12:21 pm

Re: Tension and strech of a biarticular Path Spring

Post by Pia Stefanek » Wed Jul 18, 2018 8:44 am

Thank you very much!

I managed to get the length with the following Code:
>>> model = getCurrentModel();
>>> state = model.getWorkingState();
>>> force = modeling.PathSpring.safeDownCast(model.getForceSet().get("BiarticularSpringDamper"))
>>> length= force.getGeometryPath().getLength(state)

I hope this is correct?

My problem is that I need the length of the biarticular path spring during the whole motion. Can you give me a hint how I can get the length at every time step? (I want to take the time steps for example from the motion file)

Thank you
Pia

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

Re: Tension and strech of a biarticular Path Spring

Post by Thomas Uchida » Wed Jul 18, 2018 9:43 am

There are a few strategies. You could try writing a script (in the GUI, MATLAB, or Python) that steps through each row of the results, computing the length of the GeometryPath at each time point. Another strategy is to use the OutputReporter in OpenSim 4.0 to compute/plot the GeometryPath's length (see https://simtk.org/api_docs/opensim/api_ ... 3897ad3d0b).

POST REPLY