主要内容

massDistribution

R2026b

Class: simscape.multibody.UniformSolid
Namespace: simscape.multibody

Extract mass distribution of UniformSolid object

Since R2026b

Description

md = massDistribution(solid) extracts the mass distribution of the solid modeled by the specified UniformSolid object and returns the result as a simscape.multibody.MassDistribution object. The returned values are always in SI units regardless of the units used to define the solid properties.

example

Input Arguments

expand all

Solid, specified as a simscape.multibody.UniformSolid object.

Output Arguments

expand all

Mass distribution of the solid relative to its reference frame R, returned as a simscape.multibody.MassDistribution object.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Examples

expand all

This example shows how to create a solid with uniform density and extract its computed mass distribution.

Create a solid with uniform density using a brick geometry with dimensions in centimeters and a density in g/cm^3.

brick = simscape.multibody.Brick(simscape.Value([10 5 2],"cm"));
solid = simscape.multibody.UniformSolid(brick,simscape.Value(2.7,"g/cm^3"));

Extract the mass distribution of the solid. The mass, center of mass, moments of inertia, and products of inertia are computed automatically from the geometry and density. The returned values are always in SI units.

md = massDistribution(solid)
md =
  MassDistribution with properties:

                 Mass: 0.2700 (kg)
         CenterOfMass: [0 0 0] (m)
     MomentsOfInertia: [6.5250e-05 2.3400e-04 2.8125e-04] (kg*m^2)
    ProductsOfInertia: [0 0 0] (kg*m^2)

Version History

Introduced in R2026b