Vulcan
Aerospace Engineering Utilities Built on Janus
Loading...
Searching...
No Matches
vulcan::dynamics::MassProperties< Scalar > Struct Template Reference

#include <MassProperties.hpp>

Public Member Functions

Mat3< Scalar > inertia_about_point (const Vec3< Scalar > &point) const
MassProperties< Scalar > operator+ (const MassProperties< Scalar > &other) const
MassProperties< Scalar > operator- (const MassProperties< Scalar > &other) const
MassProperties< Scalar > operator* (const Scalar &factor) const
MassProperties< Scalar > operator/ (const Scalar &factor) const
 Divide mass properties by a factor.
MassProperties< Scalar > & operator+= (const MassProperties< Scalar > &other)
 In-place addition.
Vec3< Scalar > cg_offset () const

Static Public Member Functions

static MassProperties< Scalar > point_mass (const Scalar &m, const Vec3< Scalar > &position)
static MassProperties< Scalar > diagonal (const Scalar &m, const Vec3< Scalar > &cg_pos, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz)
static MassProperties< Scalar > diagonal (const Scalar &m, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz)
static MassProperties< Scalar > from_components (const Scalar &m, const Vec3< Scalar > &cg_pos, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz, const Scalar &Ixy, const Scalar &Ixz, const Scalar &Iyz)
static MassProperties< Scalar > solid_sphere (const Scalar &m, const Scalar &radius, const Vec3< Scalar > &cg_pos=Vec3< Scalar >::Zero())
static MassProperties< Scalar > solid_cylinder (const Scalar &m, const Scalar &radius, const Scalar &length, const Vec3< Scalar > &cg_pos=Vec3< Scalar >::Zero())
static MassProperties< Scalar > solid_box (const Scalar &m, const Scalar &dx, const Scalar &dy, const Scalar &dz, const Vec3< Scalar > &cg_pos=Vec3< Scalar >::Zero())
static MassProperties< Scalar > from_mass (const Scalar &m)
static MassProperties< Scalar > full (const Scalar &m, const Scalar &Ixx, const Scalar &Iyy, const Scalar &Izz, const Scalar &Ixy, const Scalar &Ixz, const Scalar &Iyz)

Public Attributes

Scalar mass
 Total mass [kg].
Vec3< Scalar > cg
 CG position in body frame [m].
Mat3< Scalar > inertia
 Inertia tensor about CG, in body-fixed axes [kg·m²].

Detailed Description

template<typename Scalar>
struct vulcan::dynamics::MassProperties< Scalar >

Full mass properties for a rigid body component

All quantities are expressed in body-fixed coordinates:

  • cg: Position of the center of gravity in the body frame, measured from the body frame origin (typically a reference point like nose, or structural origin) [m]
  • inertia: Inertia tensor about the CG, expressed in body-fixed axes (i.e., the tensor components Ixx, Ixy, etc. are with respect to body X, Y, Z axes) [kg·m²]

Frame Convention

Body Frame (typical aerospace convention):
- X: Forward (out the nose)
- Y: Right (starboard wing)
- Z: Down
CG position is a 3-vector [x_cg, y_cg, z_cg] in body coordinates.
Inertia tensor is 3x3, about CG, with components in body axes.
@ Body
Definition FrameID.hpp:15

When passed to dynamics functions like compute_6dof_derivatives(), the mass properties must be consistent with the body frame used for forces, moments, and angular velocity.

Inertia Tensor Convention

Uses the STANDARD mathematical convention:

| Ixx Ixy Ixz |
| Ixy Iyy Iyz |
| Ixz Iyz Izz |

where Ixy = -∫xy dm (negative product of inertia).

This differs from some CAD tools (SolidWorks, NX) which use opposite signs.

Reference: https://en.wikipedia.org/wiki/Moment_of_inertia#Inertia_tensor

Aggregation

Mass properties can be combined using operator+:

auto total = wing + fuselage + tail;

The combined CG is the mass-weighted average, and inertia is computed using the parallel axis theorem. All components must be expressed in the same body frame for aggregation to be meaningful.

Member Function Documentation

◆ cg_offset()

template<typename Scalar>
Vec3< Scalar > vulcan::mass::MassProperties< Scalar >::cg_offset ( ) const
inline

Get CG offset from origin (alias for cg)

Deprecated
Use cg directly

◆ diagonal() [1/2]

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::diagonal ( const Scalar & m,
const Scalar & Ixx,
const Scalar & Iyy,
const Scalar & Izz )
inlinestatic

Create with diagonal inertia at origin (4-arg overload)

Deprecated
Use diagonal(m, cg, Ixx, Iyy, Izz) instead

◆ diagonal() [2/2]

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::diagonal ( const Scalar & m,
const Vec3< Scalar > & cg_pos,
const Scalar & Ixx,
const Scalar & Iyy,
const Scalar & Izz )
inlinestatic

Create mass properties with diagonal inertia tensor

Parameters
mMass [kg]
cg_posCG position [m]
IxxPrincipal moment about X [kg·m²]
IyyPrincipal moment about Y [kg·m²]
IzzPrincipal moment about Z [kg·m²]

◆ from_components()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::from_components ( const Scalar & m,
const Vec3< Scalar > & cg_pos,
const Scalar & Ixx,
const Scalar & Iyy,
const Scalar & Izz,
const Scalar & Ixy,
const Scalar & Ixz,
const Scalar & Iyz )
inlinestatic

Create mass properties with full 6-component inertia tensor

Products of inertia use POSITIVE convention: Ixy_input = ∫xy dm The function applies negation internally to form the standard tensor.

Parameters
mMass [kg]
cg_posCG position [m]
IxxMoment about X [kg·m²]
IyyMoment about Y [kg·m²]
IzzMoment about Z [kg·m²]
IxyProduct of inertia (positive convention) [kg·m²]
IxzProduct of inertia (positive convention) [kg·m²]
IyzProduct of inertia (positive convention) [kg·m²]

◆ from_mass()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::from_mass ( const Scalar & m)
inlinestatic

Create from mass only (point mass at origin)

Deprecated
Use point_mass() instead

◆ full()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::full ( const Scalar & m,
const Scalar & Ixx,
const Scalar & Iyy,
const Scalar & Izz,
const Scalar & Ixy,
const Scalar & Ixz,
const Scalar & Iyz )
inlinestatic

Create with full inertia at origin (7-arg overload)

Deprecated
Use from_components() instead

◆ inertia_about_point()

template<typename Scalar>
Mat3< Scalar > vulcan::mass::MassProperties< Scalar >::inertia_about_point ( const Vec3< Scalar > & point) const
inline

Get inertia tensor about an arbitrary point

Uses the parallel axis theorem (tensor generalization): J = I + m * (|r|² * Identity - r ⊗ r)

where r is the vector from the point to the CG.

Reference: https://en.wikipedia.org/wiki/Parallel_axis_theorem#Tensor_generalization

Parameters
pointThe reference point [m]
Returns
Inertia tensor about that point [kg·m²]

◆ operator*()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::operator* ( const Scalar & factor) const
inline

Scale mass properties by a factor

Scales mass and inertia; CG remains unchanged.

◆ operator+()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::operator+ ( const MassProperties< Scalar > & other) const
inline

Add two mass properties (aggregation)

Computes combined CG as mass-weighted average, then uses parallel axis theorem to express both inertias about the combined CG and sums them.

◆ operator+=()

template<typename Scalar>
MassProperties< Scalar > & vulcan::mass::MassProperties< Scalar >::operator+= ( const MassProperties< Scalar > & other)
inline

In-place addition.

◆ operator-()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::operator- ( const MassProperties< Scalar > & other) const
inline

Subtract mass properties (hole removal)

Used for modeling holes or removed material.

◆ operator/()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::operator/ ( const Scalar & factor) const
inline

Divide mass properties by a factor.

◆ point_mass()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::point_mass ( const Scalar & m,
const Vec3< Scalar > & position )
inlinestatic

Create a point mass at a specified location

A point mass has zero inertia about its own CG.

Parameters
mMass [kg]
positionCG position [m]

◆ solid_box()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::solid_box ( const Scalar & m,
const Scalar & dx,
const Scalar & dy,
const Scalar & dz,
const Vec3< Scalar > & cg_pos = Vec3<Scalar>::Zero() )
inlinestatic

Create mass properties for a solid rectangular box

Ixx = (1/12) * m * (dy² + dz²) Iyy = (1/12) * m * (dx² + dz²) Izz = (1/12) * m * (dx² + dy²)

Parameters
mMass [kg]
dxWidth in X [m]
dyWidth in Y [m]
dzWidth in Z [m]
cg_posCG position [m] (default: origin)

◆ solid_cylinder()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::solid_cylinder ( const Scalar & m,
const Scalar & radius,
const Scalar & length,
const Vec3< Scalar > & cg_pos = Vec3<Scalar>::Zero() )
inlinestatic

Create mass properties for a solid cylinder (axis along Z)

Ixx = Iyy = (1/12) * m * (3*r² + L²) Izz = (1/2) * m * r²

Parameters
mMass [kg]
radiusCylinder radius [m]
lengthCylinder length along Z [m]
cg_posCG position [m] (default: origin)

◆ solid_sphere()

template<typename Scalar>
MassProperties< Scalar > vulcan::mass::MassProperties< Scalar >::solid_sphere ( const Scalar & m,
const Scalar & radius,
const Vec3< Scalar > & cg_pos = Vec3<Scalar>::Zero() )
inlinestatic

Create mass properties for a solid sphere

I = (2/5) * m * r² for all axes

Parameters
mMass [kg]
radiusSphere radius [m]
cg_posCG position [m] (default: origin)

Member Data Documentation

◆ cg

template<typename Scalar>
Vec3<Scalar> vulcan::mass::MassProperties< Scalar >::cg

CG position in body frame [m].

◆ inertia

template<typename Scalar>
Mat3<Scalar> vulcan::mass::MassProperties< Scalar >::inertia

Inertia tensor about CG, in body-fixed axes [kg·m²].

◆ mass

template<typename Scalar>
Scalar vulcan::mass::MassProperties< Scalar >::mass

Total mass [kg].


The documentation for this struct was generated from the following file: