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.
Tension and strech of a biarticular Path Spring
- Pia Stefanek
- Posts: 48
- Joined: Tue Mar 13, 2018 12:21 pm
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Tension and strech of a biarticular Path Spring
See the getLength() method here: https://simtk.org/api_docs/opensim/api_ ... 55d5f629ac.to calculate the Tension I Need to know the length l of the spring
- Pia Stefanek
- Posts: 48
- Joined: Tue Mar 13, 2018 12:21 pm
Re: Tension and strech of a biarticular Path Spring
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?
Can you tell me if I can use the getLength() method in the scripting shell window or is this not possible?
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Tension and strech of a biarticular Path Spring
Yes, you can use getLength() in the scripting shell. Here's an example (assuming the arm26 model has been opened):Can you tell me if I can use the getLength() method in the scripting shell window or is this not possible?
Code: Select all
Jython Interactive Console
>>> model = getCurrentModel();
>>> state = model.getWorkingState();
>>> muscle = model.getMuscles().get('TRIlong');
>>> muscle.getGeometryPath().getLength(state)
0.27760917727192447
- 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).
- Pia Stefanek
- Posts: 48
- Joined: Tue Mar 13, 2018 12:21 pm
Re: Tension and strech of a biarticular Path Spring
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
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
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Tension and strech of a biarticular Path Spring
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).