How to compute general mass matrix in c++?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Dídac Coll
Posts: 8
Joined: Tue Jan 31, 2017 6:59 pm

How to compute general mass matrix in c++?

Post by Dídac Coll » Sun Aug 27, 2017 2:16 pm

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 490 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!

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

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

Post by Dimitar Stanev » Mon Aug 28, 2017 12:06 am

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

User avatar
Dídac Coll
Posts: 8
Joined: Tue Jan 31, 2017 6:59 pm

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

Post by Dídac Coll » Tue Aug 29, 2017 4:00 am

Thanks for the answer Dimitar.

Best regards

User avatar
Sarah Roelker
Posts: 7
Joined: Mon Sep 24, 2012 10:09 am

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

Post by Sarah Roelker » Thu Apr 26, 2018 1:32 pm

Is it possible to use an analogous call to compute the mass matrix in Matlab?

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

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

Post by Dimitar Stanev » Fri Apr 27, 2018 12:24 am

Yes, but you must use the latest version of OpenSim (v4.0).

User avatar
Sarah Roelker
Posts: 7
Joined: Mon Sep 24, 2012 10:09 am

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

Post by Sarah Roelker » Fri Apr 27, 2018 11:03 am

Okay thank you!

POST REPLY