Hi All,
Let me describe the problem. I have a large data set and part of the processing pipeline is to compute MTU lengths and moment arms for various modes of gait (walking, running, cutting, etc...).
I have successfully used the API via Matlab scripts to run muscle analysis, but seeing as I'm only interested in muscle lengths and moment arms this is a bit of a hammer where a scalpel would do as, noted here: https://simtk.org/forums/viewtopic.php? ... tarm#p8607. Also computational expense is a bit of an issue due to the size of the data set.
I tried a quick comparison of the MTU lengths from muscle analysis with length computed directly in the API from a loop of:
muscletendonlength(i) = Muscles.get(#mus).getGeometryPath().getLength(state);
The problem: I get quite different results.
Question 1) Should I get different results (i.e. the muscle analysis method at some point uses the function computeMomentArm()?)
Question 2) If I should be getting the same output, any likely reasons why I'm not?
This my first foray into lower level operations (lower than using scale, IK, ID, analysis), so if I've done something strange let me know!
Thanks guys,
David
muscle analysis vs direct API computation
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
- Ayman Habib
- Posts: 2244
- Joined: Fri Apr 01, 2005 12:24 pm
Re: muscle analysis vs direct API computation
Hi David,
The key is in the "state" passed to getLength() or computeMomentArm() as it contains representation of all the coordinates, muscle states, etc.
The assumptions made by the GUI/plotter when running the MuscleAnalysis are that:
1. Muscle Activation(s) = 1
2. Muscle FiberLength(s) = default value of .01
3. equilibrateMuscles on the whole model is invoked. The values specified in 1. & 2. above are used as initial conditions to solve for muscle equilibrium.
4. The state resulting from 3. is passed in to getLength(), computeMomentArm() etc.
You have to decide what values to put in the state passed in to these calls, and you'll get the same answers if you use the same assumptions.
Hope this helps,
-Ayman
The key is in the "state" passed to getLength() or computeMomentArm() as it contains representation of all the coordinates, muscle states, etc.
The assumptions made by the GUI/plotter when running the MuscleAnalysis are that:
1. Muscle Activation(s) = 1
2. Muscle FiberLength(s) = default value of .01
3. equilibrateMuscles on the whole model is invoked. The values specified in 1. & 2. above are used as initial conditions to solve for muscle equilibrium.
4. The state resulting from 3. is passed in to getLength(), computeMomentArm() etc.
You have to decide what values to put in the state passed in to these calls, and you'll get the same answers if you use the same assumptions.
Hope this helps,
-Ayman
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: muscle analysis vs direct API computation
Hi Ayman,
Thanks so much! A colleagues suggested equilibrate muscles, but and it would have been the next thing we tried, but the defaults would have been another story.
We'll implement those changes, check that we get the same outputs, and then post again with our results.
Thanks very much,
David
Thanks so much! A colleagues suggested equilibrate muscles, but and it would have been the next thing we tried, but the defaults would have been another story.
We'll implement those changes, check that we get the same outputs, and then post again with our results.
Thanks very much,
David
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: muscle analysis vs direct API computation
Hi All,
To update:
Success with direct computation of muscle lengths and moment arms, the outputs now match the analyze API exactly.
Thanks very much for the help,
David
To update:
Success with direct computation of muscle lengths and moment arms, the outputs now match the analyze API exactly.
Thanks very much for the help,
David