Page 1 of 1

How OpenSim Analyze tool calculate acceleration?

Posted: Sun Jul 05, 2020 9:16 am
by yanran6
Hi there,

I'm struggling to understand the theory behind the acceleration calculation in Opensim. Which specific formulas are used for point acceleration in the OpenSim?

Or a quick question is the linear acceleration calculated as the second derivative of the origin of the segment coordinate systems?

I get my body kinematic and point kinematic results from the Analyze tool with inverse kinematic results as input. But the acceleration values are wired. From the result of velocity, I can see the change of velocity is very small (vel=-0.0013761 (t=0s), -0.00131352(t=0.01s),-0.131224(t
0.02s),-0.139191(t=0.03s)...). But whether the linear accelerations or angular accelerations are quite large (almost 114 rad/s), which looks impossible.
In the Analyse tool setup file, I only provide IK results and ground reaction force. I didn't add actuator and control. I really don't know how to find the reason now. Do you know any possible reasons?

Is there any bug behind the OpenSim Analyze tool? Could anyone provide raw script of Analyze tool? I want to see the code.

Thanks,
Yanran

Re: How OpenSim Analyze tool calculate acceleration?

Posted: Tue Jul 07, 2020 4:37 pm
by ongcf
We've seen this recently (viewtopicPhpbb.php?f=91&t=11925&p=0&sta ... d52b7c398c), and while it's not quite a bug, it's definitely not a behavior that users expect. It seems that when the Analyze tool is used to calculate velocities, it calculates these from the position variables. When calculating accelerations, it calculates these by taking dynamics into account. Because of this, Analyze tool will calculate the accelerations as if certain constraints are not enforced, since this is not available directly through the data alone. One of the workarounds proposed in the link from before is to do a forward simulation but use the <prescribed_function> tag. There is a MATLAB script available in the examples folder (prescribeMotionInModel.m), or you can use the example model file that I posted in the previously linked forum post.