How can I access Simscape Multibody solid properties calculated via geometry in a script?
25 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hey everyone. I've been using Simscape Multibody and I made a very basic model. I wanted to make a .m script that would be able to access the inertial properties of the solids I make which are set to "calculate from geometry" based on the dimensions and densities I set. So far I figured out how to use the "get_param" function to access properties of my model, but when I try to get something like "MomentsOfInertia" of a rod that I made, I get [0 0 0], which is the default of the manual input for moments of inertia. So there must be a different way to access the inertia properties that were calculated from the geometry of the solid. I would really like to be able to access this data in my script somehow.
Is there a way to do this? I would greatly appreciate some guidance.
0 Commenti
Risposte (1)
Divyajyoti Nayak
il 20 Dic 2024 alle 6:54
Accessing the derived values, such as center of mass, moments of inertia, etc. that are calculated from geometry in a Simscape model, through MATLAB scripts directly is not supported as of MATLAB R2024b. The ‘MomentsOfInertia’ property that you are getting from ‘get_param’ is the custom ‘MomentsOf Inertia’ property. Here’s a link to its documentation
A workaround for this could be to add an ‘Inertia Sensor’ block to your solid and output the calculated values to your workspace on running the simulation. Here’s some documentation to help you out:
‘Inertia Sensor’ Block: https://www.mathworks.com/help/sm/ref/inertiasensor.html
‘To Workspace’ Block: https://www.mathworks.com/help/simulink/slref/toworkspace.html
Vedere anche
Categorie
Scopri di più su Bodies in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!