Hi all,

I have a question about the computation of COM (center of mass) acceleration by using Bodykinematics in Analyze tool. I want to estimate the COM acceleration based on kinematics data without muscle forces.

I used the Gait2354 example. I ran the BodyKinematics in Analyze tool by using subject01_walk1_states.sto from CMC. After that, I changed the value of muscle activation and fiber length to zero to get no muscle forces in subject01_walk1_states.sto and I ran the BodyKinematics in Analyze tool.

When I compared the results I found the same COM positions and velocities, but the COM accelerations were very different. The accelerations with zero forces leads to 6000 times higher accelerations compared to the results with muscle forces ( e.g., -3868 vs. 0.5696 for tibia_ry ).

I don't understand why the COM position and velocity are the same and not the acceleration when I have no muscle forces.

Thank you,

Pauline

## Acceleration computation in BodyKinematic

- Gerus Pauline
**Posts:**12**Joined:**Mon Dec 10, 2007 6:28 am

- Ward Bartels
**Posts:**2**Joined:**Thu Mar 13, 2008 7:06 am

### Re: Acceleration computation in BodyKinematic

I'm facing the same problem with several OpenSim models, as well as the examples included with OpenSim. I'm trying to determine body segment COM accelerations based on a motion file alone (so, no muscle excitations). The results are unrealistic. For example, the vertical acceleration for the pelvis segment is always negative.

Curiously, if "Solve for equilibrium for actuator states" is checked, the accelerations change (though they are still unrealistic). Also, despite a motion being loaded, the model's total center of mass gets a constant acceleration of -9.80665000 m/s^2 in the vertical direction, which I guess is g.

Is the Analysis tool intended to be run without muscle excitations or states? If it is, then this is a bug and I'll file it as such.

Best regards,

Ward Bartels

Curiously, if "Solve for equilibrium for actuator states" is checked, the accelerations change (though they are still unrealistic). Also, despite a motion being loaded, the model's total center of mass gets a constant acceleration of -9.80665000 m/s^2 in the vertical direction, which I guess is g.

Is the Analysis tool intended to be run without muscle excitations or states? If it is, then this is a bug and I'll file it as such.

Best regards,

Ward Bartels

- Sina Porsa
**Posts:**99**Joined:**Thu Feb 03, 2011 7:21 pm

### Re: Acceleration computation in BodyKinematic

Hi everyone

I am facing the same problem and it's interesting that this old post does not have any replies!

I was wondering how does BodyKinematic calculates the position, velocity and acceleration of the COM.

I ran BodyKinematic analysis on two different models, one with a proper foot-ground contact model and one without that.

As I used the same joint kinematics, I have the same values for position and velocity of COM at each time step, while the accelerations are completely different which does not make sense.

Regards

Sina

I am facing the same problem and it's interesting that this old post does not have any replies!

I was wondering how does BodyKinematic calculates the position, velocity and acceleration of the COM.

I ran BodyKinematic analysis on two different models, one with a proper foot-ground contact model and one without that.

As I used the same joint kinematics, I have the same values for position and velocity of COM at each time step, while the accelerations are completely different which does not make sense.

Regards

Sina

### Re: Acceleration computation in BodyKinematic

Hi Sina,

BodyKinematics is designed to work in a dynamic forward simulations . OpenSim realizes through stages and acceleration is the last stage (after forces). Therefore accelerations are not simply a double differentiation of kinematics in this case, if is a direct result of F=ma. Changing any forces in the simulation will effect the equations of motion and change the resulting accelerations calculated.

Hope that helps,

-james

BodyKinematics is designed to work in a dynamic forward simulations . OpenSim realizes through stages and acceleration is the last stage (after forces). Therefore accelerations are not simply a double differentiation of kinematics in this case, if is a direct result of F=ma. Changing any forces in the simulation will effect the equations of motion and change the resulting accelerations calculated.

Hope that helps,

-james

- Ward Bartels
**Posts:**2**Joined:**Thu Mar 13, 2008 7:06 am

### Re: Acceleration computation in BodyKinematic

Ah, that explains the accelerations we're getting when running BodyKinematics with only a motion imposed on the model. It's still strange though that the positions and velocities correspond to the loaded motion whereas the accelerations do not. If the accelerations are calculated from F=m*a, I'd expect the velocities and positions to be calculated from the acceleration by integration.

Now, if a BodyKinematics analysis can't be used to calculate the body segments' COM accelerations from a loaded motion file, is there any other method that works? Right now I'm calculating the COM velocities in OpenSim and differentiating them in Matlab, but that's a bit clunky.

Now, if a BodyKinematics analysis can't be used to calculate the body segments' COM accelerations from a loaded motion file, is there any other method that works? Right now I'm calculating the COM velocities in OpenSim and differentiating them in Matlab, but that's a bit clunky.

- Sina Porsa
**Posts:**99**Joined:**Thu Feb 03, 2011 7:21 pm

### Re: Acceleration computation in BodyKinematic

if you only need pos, vel and acc of COM then I would say it's easier and much faster to calculate them analytically. You have a simple linkage and you can easily drive the analytic equations for pos,vel and acc of COM using syms toolbox in MATLAB. You can find the method in any basic robotics book.

### Re: Acceleration computation in BodyKinematic

Hi Ward,

I think the confusion is coming in from deriving exactly where accelerations come from and what the bodykinematics analysis does.

The double differentiation of position information is only an estimate of a point (massless) acceleration. Acceleration of bodies with mass can only be calculated using F=ma. Positions, velocities, forces and inertia are used to calculate accelerations.

When you load a motion (and track it) you aren't using any calculated accelerations to integrate forward in time. You can apply a bunch of forces to the system but the computed accelerations dont get applied, because that's forward dynamics.

The bodyKinematics analysis works during dynamics to output the calculate accelerations. Any changes in the F=ma equation will therefore effect the output of the bodyKinematics analysis. When you use the analysis during tracking tasks, you will get weird behavior because the forces and the motions dont agree. Therefore I wouldn't expect the double differential of position to be in the ballpark of what gets output from the bodyKinematics analysis.

You could use getMassCenter() which can output the position and velocity. You would have to differentiate that yourself though to get acceleration. Its still not the 'real' acceleration but its a good estimate.

Hope that clears it up.

-james

I think the confusion is coming in from deriving exactly where accelerations come from and what the bodykinematics analysis does.

The double differentiation of position information is only an estimate of a point (massless) acceleration. Acceleration of bodies with mass can only be calculated using F=ma. Positions, velocities, forces and inertia are used to calculate accelerations.

When you load a motion (and track it) you aren't using any calculated accelerations to integrate forward in time. You can apply a bunch of forces to the system but the computed accelerations dont get applied, because that's forward dynamics.

The bodyKinematics analysis works during dynamics to output the calculate accelerations. Any changes in the F=ma equation will therefore effect the output of the bodyKinematics analysis. When you use the analysis during tracking tasks, you will get weird behavior because the forces and the motions dont agree. Therefore I wouldn't expect the double differential of position to be in the ballpark of what gets output from the bodyKinematics analysis.

You could use getMassCenter() which can output the position and velocity. You would have to differentiate that yourself though to get acceleration. Its still not the 'real' acceleration but its a good estimate.

Hope that clears it up.

-james