Page 1 of 1

How to compute general mass matrix in c++?

Posted: Sun Aug 27, 2017 2:16 pm
by didix21
Hello,

Right know, I am working with a double pendulum and I am trying to control each joint of it with the following control law:
controlLaw.png
controlLaw.png (3.16 KiB) Viewed 506 times
where U(\theta,t) is my control law ( The angular accelerations are computed there taking into account the error generated by the position of the joint). My question is:
How can I obtain the M(\theta) with the OpenSim API. I think there is a method called SimTK::SimbodyMatterSubsystem::calcM() but not sure if what I am looking for.

Thanks!

Re: How to compute general mass matrix in c++?

Posted: Mon Aug 28, 2017 12:06 am
by mitkof6
Almost every calculation related to the EOM is accessed in:

https://simtk.org/api_docs/simbody/3.5/ ... ystem.html

I suggest you read the Dox carefully in order to understand Simbody's convention. Yes can use

Code: Select all

calcM()
, but first you need to realize the model to position stage because M(q) is a function of the positions (q).

Best

Re: How to compute general mass matrix in c++?

Posted: Tue Aug 29, 2017 4:00 am
by didix21
Thanks for the answer Dimitar.

Best regards

Re: How to compute general mass matrix in c++?

Posted: Thu Apr 26, 2018 1:32 pm
by schloemer7
Is it possible to use an analogous call to compute the mass matrix in Matlab?

Re: How to compute general mass matrix in c++?

Posted: Fri Apr 27, 2018 12:24 am
by mitkof6
Yes, but you must use the latest version of OpenSim (v4.0).

Re: How to compute general mass matrix in c++?

Posted: Fri Apr 27, 2018 11:03 am
by schloemer7
Okay thank you!