Main Content

simscape.multibody.MassDistribution Class

R2026b

Namespace: simscape.multibody

Mass distribution computation object

Since R2022a

Description

A simscape.multibody.MassDistribution object stores mass distribution properties relative to an implicit reference frame. Obtain a MassDistribution object by calling the massDistribution method on a simscape.multibody.GeneralSolid, simscape.multibody.UniformSolid, or simscape.multibody.GeneralInertia object, or construct one directly. When obtained from a solid, the implicit reference frame coincides with the reference frame of the solid.

Class Attributes

Sealed
true
ConstructOnLoad
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Creation

Description

MD = simscape.multibody.MassDistribution creates a mass distribution object with default property values.

MD = simscape.multibody.MassDistribution(mass) creates a mass distribution object with the specified mass.

MD = simscape.multibody.MassDistribution(mass,com) creates a mass distribution object with the specified mass and center of mass.

MD = simscape.multibody.MassDistribution(mass,com,moi) creates a mass distribution object with the specified mass, center of mass, and moments of inertia.

MD = simscape.multibody.MassDistribution(mass,com,moi,poi) creates a mass distribution object with the specified mass, center of mass, moments of inertia, and products of inertia.

example

Properties

expand all

Total mass, specified as a simscape.Value object that represents a positive scalar with a unit of mass.

Example: simscape.Value(16,"lbm")

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Center of mass position relative to the reference frame origin, along the axes of the reference frame, specified as a simscape.Value object that represents a 3-by-1 or 1-by-3 array with a unit of length.

Example: simscape.Value([0 0 5],"mm")

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Moments of inertia about the center of mass, expressed in the reference frame axes, specified as a simscape.Value object that represents a 3-by-1 or 1-by-3 array with a unit of mass*length^2. The three elements correspond to [Ixx Iyy Izz].

The moments of inertia are the diagonal elements of the inertia matrix

(IxxIyyIzz),

where:

  • Ixx=m(y2+z2)dm

  • Iyy=m(x2+z2)dm

  • Izz=m(x2+y2)dm

Example: simscape.Value([12 15 10],"kg*cm^2")

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Products of inertia about the center of mass, expressed in the reference frame axes, specified as a simscape.Value object that represents a 3-by-1 or 1-by-3 array with a unit of mass*length^2. The three elements correspond to [Iyz Izx Ixy].

The products of inertia are the off-diagonal elements of the inertia matrix

(IxyIzxIxyIyzIzxIyz),

where:

  • Iyz=myzdm

  • Izx=mzxdm

  • Ixy=mxydm

Example: simscape.Value([-2 3 1],"kg*cm^2")

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Methods

expand all

Examples

collapse all

Create a mass distribution object and compute its inertia matrix and principal moments of inertia.

Create a MassDistribution object with a mass of 3 kg, a center of mass at [0.05 0 0.02] m, moments of inertia of [0.1 0.15 0.2] kg*m^2, and products of inertia of [0.01 -0.02 0.005] kg*m^2.

md = simscape.multibody.MassDistribution( ...
    simscape.Value(3,"kg"), ...
    simscape.Value([0.05 0 0.02],"m"), ...
    simscape.Value([0.1 0.15 0.2],"kg*m^2"), ...
    simscape.Value([0.01 -0.02 0.005],"kg*m^2"))
md =
  MassDistribution with properties:

                 Mass: 3 (kg)
         CenterOfMass: [0.0500 0 0.0200] (m)
     MomentsOfInertia: [0.1000 0.1500 0.2000] (kg*m^2)
    ProductsOfInertia: [0.0100 -0.0200 0.0050] (kg*m^2)

Compute the full 3-by-3 inertia matrix of the mass distribution.

IM = inertiaMatrix(md)
IM =
    0.1000    0.0050   -0.0200
    0.0050    0.1500    0.0100
   -0.0200    0.0100    0.2000

    (kg*m^2)

Compute the principal moments of inertia. These are the eigenvalues of the inertia matrix, representing the moments of inertia about the principal axes.

PM = principalMomentsOfInertia(md)
PM =
    0.0953    0.1494    0.2053

    (kg*m^2)

Compute the transformation from the principal frame to the reference frame. The translation component equals the center of mass position, and the rotation aligns the principal axes with the reference frame axes.

T = principalToReferenceTransformation(md)
T =
  Transformation:

       Rotation: [0.9903 -0.0739 -0.0946 -0.0702]
    Translation: [0.0500 0 0.0200] (m)

Version History

Introduced in R2022a