| SimMechanics™ | ![]() |
| On this page… |
|---|
You can choose how the visualization window renders the bodies; see Choosing the Body Shape. There are two available rendering shapes:
Equivalent ellipsoid for each body, based on its mass properties and center of gravity (CG) position, explained in Equivalent Ellipsoids
Convex hull for each body, based on its Body coordinate systems (CSs), explained in Convex Hulls
You choose the body rendering in the SimMechanics™ toolbar of the SimMechanics visualization window. You can render the bodies of your machine with either convex hulls, or ellipsoids, or both. See Introducing the SimMechanics™ Visualization Window in this chapter for visualization control details.
The inertia tensor I of a rigid body is real and symmetric, so it has three real eigenvalues (I1, I2, I3) and three orthogonal eigenvectors. These eigenvectors are the principal axes of the body. In the coordinate system defined by those axes, the inertia tensor is diagonal. The trace of the inertia tensor, Tr(I) = I1+ I2 + I3, is the same in any coordinate system with its origin at the body's center of gravity (CG).
Every rigid body has a unique equivalent ellipsoid, a homogeneous solid ellipsoid of the same inertia tensor. The ellipsoid surface is given by
![]()
The three parameters (ax, ay, az) are the generalized radii of the ellipsoid. For axis i = 1,2,3,
![]()
The principal moments (I1, I2, I3) must satisfy the triangle inequalities:

Violation of the triangle inequality for Ii leads to an unphysical imaginary generalized radius ai.
Caution Visualizing the equivalent ellipsoid of a body whose principal moments do not satisfy the triangle inequalities leads to a SimMechanics warning indicating that one or more triangle inequalities have been violated. The simulation continues, but the body in violation is not displayed. |
In general, all three Ii, i = 1,2,3, are unequal. Such a body is an asymmetric top. If two of the three Ii are equal (double degeneracy), the body is a symmetric top. The third axis is the axis of symmetry. If all three Ii are equal (triple degeneracy), the body is a spherical top and dynamically equivalent to a homogeneous sphere.
In special cases, the equivalent ellipsoid reduces to a planar, linear, or point figure.
Let (i,j,k) label the three axes (1,2,3) = (x,y,z) in any order.
For a true ellipsoid, with nonzero volume, all the ai are nonzero. The triangle inequalities are strict inequalities in this case:

For an ellipse, with zero volume but nonzero area, one ai = 0 and the other two aj, ak are nonzero. One of the triangle inequalities becomes an equality:

For a line, with zero volume and area but nonzero length, two ai, aj = 0 and the third ak is nonzero. Two of the triangle inequalities become equalities:

Equivalently, Ii = Ij are nonzero and Ik = 0.
For a point, with no spatial size, all three ai vanish. All three triangle inequalities become equalities:

Equivalently, all three Ii vanish.
Consider the simple pendulum rod in Visualizing a Simple Mechanical Model in the Visualizing and Animating Machines chapter. You can open the model by entering mech_spen at the command line.
The rod length L = 1 m, and its radius r = 1 cm. The inertia tensor is

Because the rod has an axis of symmetry, the x-axis in this case, two of its three principal moments are equal: Iyy = Izz, and two of its three generalized radii are equal: ay = az. The rod is a symmetric top and, since r is much smaller than L, its equivalent ellipsoid is almost a line of zero volume and area.
The generalized radii of the equivalent ellipsoid are ax =
= 0.646 m and ay = az =
=
1.12 cm. This is the rod so rendered:

Every Body has at least one Body coordinate system (CS) at the CG. A Body also has one or more extra Body CSs for the attached Joints, as well as possible Actuators and Sensors. Each Body CS has an origin point, and the collection of all these points, in general, defines a volume in space. The minimum outward-bending surface enclosing such a volume is the convex hull of the Body CSs, and this is the alternative SimMechanics body rendering.
To enclose a nonzero volume, the set must have at least four non-coplanar Body CSs. Three non-collinear Body CSs are rendered instead by a triangle, and two non-coincident origins by a line. One is displayed just as a point. (The minimum one Body CS would be just the CG CS.) Four or more coplanar origins are rendered by a triangle, three or more collinear origins are rendered by a line, and two or more coincident origins are rendered by a point.
Refer to the four-cylinder engine model of the Demos library by entering mech_fceng at the command line.
Double-click the Engine Block subsystem and note the Crank block representing the engine crank. This Body block has six Body CSs. Visualize the engine as convex hulls with the SimMechanics visualization window. The large block in your visualization is this engine crank, and it encloses a nonzero volume.
Four Cylinder Engine Example: Engine Crank Convex Hull (Yellow)

![]() | About SimMechanics™ Visualization | Introducing the SimMechanics™ Visualization Window | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |