Page 1 of 1

How does getAccelerations consider forces?

Posted: Fri May 25, 2018 4:34 am
by mwoodward
Hi all

I'm trying to learn more about how the getAccelerations function works in order to validate that a process being constructed through the MATLAB API is extracting the correct results.

Currently I'm simply attempting to extract the acceleration of a simple cube body which has only a single translation motion in one direction relative to the ground (with zero gravitational acceleration).

Through updating the state in the model the correct displacement and velocity of the model can be extracted but the accelerations (after calling ComputeStateVariableDerivatives) come out to be a zero value. I know getAccelerations calculates acceleration based on forces (F=ma) so it makes sense that the call outputs zero if the model has no forces or actuators associated with it.

My confusion however comes from an earlier test I did with the Arm26 model. Using the same method to extract the body acceleration (update the state variables and call ComputeStateVariableDerivatives for each time frame) and removing all the muscles and gravitational forces from the model (so it has no forces or actuators, as with the above test with only the translating cube). For this model however the accelerations of the r_ulna_radius_hand body were not zero.

What is different between these models? Why does one yield zero accelerations with only motion and no incident forces and the other non-zero accelerations?

Thanks and regards
Michael

Re: How does getAccelerations consider forces?

Posted: Fri May 25, 2018 5:21 pm
by tkuchida
Does the SimTK::Vector returned by Model::computeStateVariableDerivatives() contain the correct accelerations?

Re: How does getAccelerations consider forces?

Posted: Tue May 29, 2018 3:11 am
by mwoodward
Hi Tom, sorry for the late reply

For the Arm26 model yes it does, assuming the call is returning the accelerations of the generalised coordinates described by the state (essential Udot?). The block model I'm analysing returns zero values for this call, despite having Q and U values in the state.