MATLAB: How to output mass of solid in SimScape multibody

massmultibodySimscapeSimscape Multibodysolid

I created a solid by revolving a cross-section, and have given it a density and want the mass calculated from the geometry. How do I output the mass number? I want to scale the density to obtain a certain mass value. I have tried h=find_system('modelname','ClassName','Solid') and then get_param(h,'Mass'), and all I get is the value 1, no matter what density I use.

Best Answer

You unfortunately cannot get this information in the latest release so far (R2016a). MathWorks has received quite a few requests for this already.
When you query the block's "Mass" parameter as you did, it's actually looking at a hidden parameter in the block where, instead of calculating mass/inertia from geometry, you specify your own mass and moments of inertia. This is why you get 1, which is the default value for that parameter.
- Sebastian