Skip to content
LIBRARY
Components.Mass.md

Components.Mass ​

Represents a sliding mass with inertia, subject to external and gravitational forces.

This component models the translational motion of a point mass along a single axis. It considers the mass's inertia, external forces applied through its two mechanical connection flanges (flange_a and flange_b), and a gravitational effect determined by parameters g and theta. The position s, velocity v, and acceleration a are related by v = der(s) and a = der(v). The core dynamic behavior is defined by Newton's second law, expressed as:

'_' allowed only in math mode

where m is the mass, a is its acceleration, g is the gravitational acceleration parameter, \theta is the angle parameter, and \text{flange_a.f} + \text{flange_b.f} represents the sum of external forces applied via the flanges.

This component extends from TranslationalComponents.Interfaces.PartialRigid

Usage ​

TranslationalComponents.Components.Mass(L=0.0, m, g=-9.80665, theta=0.0)

Parameters: ​

NameDescriptionUnitsDefault value
LLength of component, from left flange to right flangem0.0
mMass of the sliding bodykg
gAcceleration due to gravity; its effect is scaled by sin(theta) using the specified default or user-provided value.m/s2-9.80665
thetaAngle defining the path of motion relative to how gravity's influence is calculated as per the component's equations (0 for horizontal).rad0.0

Connectors ​

  • flange_a - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)

  • flange_b - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)

Variables ​

NameDescriptionUnits
sAbsolute position of center of componentm
vAbsolute velocity of the mass along its path of motionm/s
aAbsolute acceleration of the mass along its path of motionm/s2

Behavior ​

Source ​

dyad
"""
Represents a sliding mass with inertia, subject to external and gravitational forces.

This component models the translational motion of a point mass along a single axis. It considers the mass's inertia, external forces applied through its two mechanical connection flanges (`flange_a` and `flange_b`), and a gravitational effect determined by parameters `g` and `theta`. The position `s`, velocity `v`, and acceleration `a` are related by `v = der(s)` and `a = der(v)`. The core dynamic behavior is defined by Newton's second law, expressed as:
```math
m \cdot (a + g \cdot \sin(\theta)) = \text{flange_a.f} + \text{flange_b.f}
```
where `m` is the mass, `a` is its acceleration, `g` is the gravitational acceleration parameter, `\theta` is the angle parameter, and `\text{flange_a.f} + \text{flange_b.f}` represents the sum of external forces applied via the flanges.
"""
component Mass
  extends TranslationalComponents.Interfaces.PartialRigid
  "Mass of the sliding body"
  parameter m::Dyad.Mass
  "Absolute velocity of the mass along its path of motion"
  variable v::Velocity
  "Absolute acceleration of the mass along its path of motion"
  variable a::Acceleration
  "Acceleration due to gravity; its effect is scaled by sin(theta) using the specified default or user-provided value."
  parameter g::Acceleration = -9.80665
  "Angle defining the path of motion relative to how gravity's influence is calculated as per the component's equations (0 for horizontal)."
  parameter theta::Angle = 0.0
relations
  v = der(s)
  a = der(v)
  m * (a + g * sin(theta)) = flange_a.f + flange_b.f
metadata {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Mass.svg"}}}
end
Flattened Source
dyad
"""
Represents a sliding mass with inertia, subject to external and gravitational forces.

This component models the translational motion of a point mass along a single axis. It considers the mass's inertia, external forces applied through its two mechanical connection flanges (`flange_a` and `flange_b`), and a gravitational effect determined by parameters `g` and `theta`. The position `s`, velocity `v`, and acceleration `a` are related by `v = der(s)` and `a = der(v)`. The core dynamic behavior is defined by Newton's second law, expressed as:
```math
m \cdot (a + g \cdot \sin(\theta)) = \text{flange_a.f} + \text{flange_b.f}
```
where `m` is the mass, `a` is its acceleration, `g` is the gravitational acceleration parameter, `\theta` is the angle parameter, and `\text{flange_a.f} + \text{flange_b.f}` represents the sum of external forces applied via the flanges.
"""
component Mass
  "Left translational 1D flange"
  flange_a = Flange() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Right translational 1D flange"
  flange_b = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Absolute position of center of component"
  variable s::Dyad.Position
  "Length of component, from left flange to right flange"
  parameter L::Length = 0.0
  "Mass of the sliding body"
  parameter m::Dyad.Mass
  "Absolute velocity of the mass along its path of motion"
  variable v::Velocity
  "Absolute acceleration of the mass along its path of motion"
  variable a::Acceleration
  "Acceleration due to gravity; its effect is scaled by sin(theta) using the specified default or user-provided value."
  parameter g::Acceleration = -9.80665
  "Angle defining the path of motion relative to how gravity's influence is calculated as per the component's equations (0 for horizontal)."
  parameter theta::Angle = 0.0
relations
  flange_a.s = s - L / 2
  flange_b.s = s + L / 2
  v = der(s)
  a = der(v)
  m * (a + g * sin(theta)) = flange_a.f + flange_b.f
metadata {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Mass.svg"}}}
end


Test Cases ​

No test cases defined.