주요 콘텐츠

simscape.multibody.GeneralInertia Class

R2026b

Namespace: simscape.multibody

Mass and inertia properties

Since R2026b

Description

Use an object of the simscape.multibody.GeneralInertia class to specify mass, center of mass, moments of inertia, and products of inertia. The object has an implicit reference frame. You can use a GeneralInertia object to define the Inertia property of a simscape.multibody.GeneralSolid object. When assigned to a GeneralSolid, the implicit reference frame coincides with the reference frame of the solid.

Class Attributes

Sealed
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

inertia = simscape.multibody.GeneralInertia creates an inertia object with default property values.

inertia = simscape.multibody.GeneralInertia(mass) creates an inertia object with the specified mass. The center of mass, moments of inertia, and products of inertia use zero values.

inertia = simscape.multibody.GeneralInertia(mass,centerOfMass) creates an inertia object with the specified mass and center of mass.

inertia = simscape.multibody.GeneralInertia(mass,centerOfMass,momentsOfInertia) creates an inertia object with the specified mass, center of mass, and moments of inertia.

inertia = simscape.multibody.GeneralInertia(mass,centerOfMass,momentsOfInertia,productsOfInertia) creates an inertia object with the specified mass, center of mass, moments of inertia, and products of inertia.

example

Properties

expand all

Mass, specified as a simscape.Value object that must have a scalar and mass unit. The scalar can be positive or negative. Use a negative value to capture the effect of a void or cavity in a compound body that comprises multiple solids. The total mass of the compound body must be positive.

Example: simscape.Value(2.5, "kg")

Location of the center of mass relative to the implicit reference frame, specified as a simscape.Value object that must have a 1-by-3 or 3-by-1 array and a unit of length.

Example: simscape.Value([0.1 0 0], "m")

Three-element vector with the [Ixx Iyy Izz] moments of inertia specified relative to a frame with origin at the center of mass and axes parallel to the reference frame, specified as a simscape.Value object that must have a 1-by-3 or 3-by-1 array and a unit of inertia.

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

(IxxIyyIzz),

where:

  • Ixx=∫m(y2+z2) dm

  • Iyy=∫m(x2+z2) dm

  • Izz=∫m(x2+y2) dm

Example: simscape.Value([0.1 0.2 0.3], "kg*m^2")

Three-element vector with the [Iyz Izx Ixy] products of inertia specified relative to a frame with origin at the center of mass and axes parallel to the reference frame, specified as a simscape.Value object that must have a 1-by-3 or 3-by-1 array and a unit of inertia.

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

(IxyIzxIxyIyzIzxIyz),

where:

  • Iyz=−∫myz dm

  • Izx=−∫mzx dm

  • Ixy=−∫mxy dm

Example: simscape.Value([0 0 0], "kg*m^2")

Methods

expand all

Examples

collapse all

This example shows how to create a GeneralInertia object and use it to define a solid with a cylinder geometry.

Create a GeneralInertia object that specifies a mass of 2.5 kg, a center of mass at [0.1 0 0] m, moments of inertia of [0.04 0.05 0.06] kg*m^2, and zero products of inertia.

inertia = simscape.multibody.GeneralInertia( ...
    simscape.Value(2.5,"kg"), ...
    simscape.Value([0.1 0 0],"m"), ...
    simscape.Value([0.04 0.05 0.06],"kg*m^2"), ...
    simscape.Value([0 0 0],"kg*m^2"))
inertia =
  GeneralInertia with properties:

                 Mass: 2.5000 (kg)
         CenterOfMass: [0.1000 0 0] (m)
     MomentsOfInertia: [0.0400 0.0500 0.0600] (kg*m^2)
    ProductsOfInertia: [0 0 0] (kg*m^2)

Use the GeneralInertia object to create a solid with a cylinder geometry.

cyl = simscape.multibody.Cylinder(simscape.Value(0.02,"m"), ...
    simscape.Value(0.5,"m"));
solid = simscape.multibody.GeneralSolid(cyl,inertia)
solid =
  GeneralSolid with properties:

           Geometry: [1x1 simscape.multibody.Cylinder]
            Inertia: [1x1 simscape.multibody.GeneralInertia]
    FrameConnectors: "R"

This example shows how to create a GeneralInertia object that models a point mass offset from the reference frame origin.

Create a GeneralInertia object that specifies a mass of 0.5 kg at a position of [0.2 0 0] m from the reference frame origin. Set the moments and products of inertia to zero to model a point mass.

inertia = simscape.multibody.GeneralInertia( ...
    simscape.Value(0.5,"kg"), ...
    simscape.Value([0.2 0 0],"m"), ...
    simscape.Value([0 0 0],"kg*m^2"), ...
    simscape.Value([0 0 0],"kg*m^2"))
inertia =
  GeneralInertia with properties:

                 Mass: 0.5000 (kg)
         CenterOfMass: [0.2000 0 0] (m)
     MomentsOfInertia: [0 0 0] (kg*m^2)
    ProductsOfInertia: [0 0 0] (kg*m^2)

Use the point mass inertia to create a solid with a small sphere geometry for visualization.

solid = simscape.multibody.GeneralSolid( ...
    simscape.multibody.Sphere(simscape.Value(0.02,"m")), ...
    inertia)
solid =
  GeneralSolid with properties:

           Geometry: [1x1 simscape.multibody.Sphere]
            Inertia: [1x1 simscape.multibody.GeneralInertia]
    FrameConnectors: "R"

Version History

Introduced in R2026b