Moment and muscle force don't match

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Chaofei Zhang
Posts: 26
Joined: Tue Oct 03, 2017 11:03 am

Moment and muscle force don't match

Post by Chaofei Zhang » Wed Dec 06, 2017 9:46 am

Hi all,

I am using gait2354.osim to run Inverse Dynamics (ID) and Static Optimization (SO) with Matlab using API 3.3. But when I compare the joint moment (read from ID) with moment (summation of moment arm multiply muscle force read from SO), they don't match, especially for 'pelvis_tilt_moment','pelvis_ty_force'.
The moment arm seems the same compared with moment arm-joint figure which could be plotted in OpenSim.
Here is code reading moment arm:
MA=MomentArmSolver(model);
muscle=model.getMuscles().get(i);
musclegeopath=muscle.getGeometryPath();
MAvalue(j+1,i+1)=MA.solve(state, model.getCoordinateSet().get(j), musclegeopath); %% j is joint, i is muscle

Does anyone know what's wrong?

Chaofei

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

Re: Moment and muscle force don't match

Post by Thomas Uchida » Wed Dec 06, 2017 1:29 pm

Please see Sherman, Seth, Delp (2013) "What is a moment arm? Calculating muscle effectiveness in biomechanical models using generalized coordinates". https://www.researchgate.net/profile/Mi ... inates.pdf

User avatar
Chaofei Zhang
Posts: 26
Joined: Tue Oct 03, 2017 11:03 am

Re: Moment and muscle force don't match

Post by Chaofei Zhang » Mon Dec 11, 2017 8:35 am

Hi Tom,

Thanks for your reply.
I have read the paper you suggested, it seems to introduce details how to compute moment arm in opensim.
I just read the computed result from opensim via API in Matlab.

Except for the previous posted method to read moment arm, I also tried another method which comes from a simple optimization example (OpenSim 3.3\Scripts\Matlab\simpleOptimizerObjectiveFunction.m). And I get the same moment arm.

So do you have any other suggestions for that?

Thanks,
Chaofei

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

Re: Moment and muscle force don't match

Post by Thomas Uchida » Mon Dec 11, 2017 1:05 pm

It's difficult to determine the problem without seeing the rest of your code. Here are a couple things that come to mind:
1. How are you setting the state prior to the code snippet in your first post? Note that Static Optimization uses the length and velocity of the muscle path, so be sure you are setting the u's in addition to the q's.
2. Be sure you are adding in the contribution of the reserve actuators and external forces, if there are any.

User avatar
Chaofei Zhang
Posts: 26
Joined: Tue Oct 03, 2017 11:03 am

Re: Moment and muscle force don't match

Post by Chaofei Zhang » Wed Dec 13, 2017 9:17 am

Hi Tom,

Thanks very much for your suggestion. I have double checked my code and inputs.

I find that the coordinate is usually indegree in motion file , while it's radian in API 3.3. that's the main reason I get the incorrect result.
I also added some reserve actuator to the pelvis coordinate which is connected to ground to make sure that static optimization run successfully.

Much Appreciate,

Chaofei

POST REPLY