Skip to content
IdealGear.md

IdealGear

An ideal mechanical gear unit with a fixed housing, connecting two rotational shafts.

This component models a lossless gearbox with a user-defined gear ratio, connecting two mechanical rotational splines, spline_a and spline_b. The housing of the gear is assumed to be rigidly connected to a support. The kinematic relationship between the relative angle of shaft 'a' and shaft 'b' with respect to the support is given by:

phia=ratiocdotphib

The corresponding torque relationship, assuming an ideal (lossless) transmission, is:

ratiocdottaua+taub=0

where τa and τb are the torques at spline_a and spline_b respectively. The relative angles are defined as:

\\phi_a = \text{spline\\_a}.\\phi - \\phi\\_\text{support} phib=splineb.phiphisupport

This component extends from PartialElementaryTwoSplinesAndSupport

Usage

IdealGear(ratio)

Parameters:

NameDescriptionUnitsDefault value
ratioThe fixed transmission ratio between shaft 'a' and shaft 'b' (phi_a / phi_b)

Connectors

Variables

NameDescriptionUnits
phi_supportVariable for the absolute angle of the support splinerad
phi_aRelative angle of shaft 'a' with respect to the supportrad
phi_bRelative angle of shaft 'b' with respect to the supportrad

Behavior

support.phi(t)=phi_support(t)support.tau(t)=spline_b.tau(t)spline_a.tau(t)phi_a(t)=phi_support(t)+spline_a.phi(t)phi_b(t)=spline_b.phi(t)phi_support(t)phi_a(t)=ratiophi_b(t)0=spline_b.tau(t)+ratiospline_a.tau(t)

Source

dyad
# An ideal mechanical gear unit with a fixed housing, connecting two rotational shafts.
#
# This component models a lossless gearbox with a user-defined gear ratio,
# connecting two mechanical rotational splines, `spline_a` and `spline_b`.
# The housing of the gear is assumed to be rigidly connected to a support.
# The kinematic relationship between the relative angle of shaft 'a' and shaft 'b'
# with respect to the support is given by:
# ```math
# \\phi_a = ratio \\cdot \\phi_b
# ```
# The corresponding torque relationship, assuming an ideal (lossless) transmission, is:
# ```math
# \text{ratio} \\cdot \\tau_a + \\tau_b = 0
# ```
# where \$\tau_a\$ and \$\tau_b\$ are the torques at `spline_a` and `spline_b` respectively.
# The relative angles are defined as:
# ```math
# \\phi_a = \text{spline\\_a}.\\phi - \\phi\\_\text{support}
# ```
# ```math
# \\phi_b = \text{spline}\\_b.\\phi - \\phi\\_\text{support}
# ```
component IdealGear
  extends PartialElementaryTwoSplinesAndSupport
  # The fixed transmission ratio between shaft 'a' and shaft 'b' (phi_a / phi_b)
  parameter ratio::Real
  # Relative angle of shaft 'a' with respect to the support
  variable phi_a::Angle
  # Relative angle of shaft 'b' with respect to the support
  variable phi_b::Angle
relations
  phi_a = spline_a.phi-phi_support
  phi_b = spline_b.phi-phi_support
  phi_a = ratio*phi_b
  0 = ratio*spline_a.tau+spline_b.tau
metadata {"Dyad": {"icons": {"default": "dyad://RotationalComponents/IdealGear.svg"}}}
end
Flattened Source
dyad
# An ideal mechanical gear unit with a fixed housing, connecting two rotational shafts.
#
# This component models a lossless gearbox with a user-defined gear ratio,
# connecting two mechanical rotational splines, `spline_a` and `spline_b`.
# The housing of the gear is assumed to be rigidly connected to a support.
# The kinematic relationship between the relative angle of shaft 'a' and shaft 'b'
# with respect to the support is given by:
# ```math
# \\phi_a = ratio \\cdot \\phi_b
# ```
# The corresponding torque relationship, assuming an ideal (lossless) transmission, is:
# ```math
# \text{ratio} \\cdot \\tau_a + \\tau_b = 0
# ```
# where \$\tau_a\$ and \$\tau_b\$ are the torques at `spline_a` and `spline_b` respectively.
# The relative angles are defined as:
# ```math
# \\phi_a = \text{spline\\_a}.\\phi - \\phi\\_\text{support}
# ```
# ```math
# \\phi_b = \text{spline}\\_b.\\phi - \\phi\\_\text{support}
# ```
component IdealGear
  # First rotational 1-dimensional shaft spline connector (flange_a)
  spline_a = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Second rotational 1-dimensional shaft spline connector (flange_b)
  spline_b = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Support spline connector, typically for housing or reaction torques
  support = Spline() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "support", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }]
  # Variable for the absolute angle of the support spline
  variable phi_support::Angle
  # The fixed transmission ratio between shaft 'a' and shaft 'b' (phi_a / phi_b)
  parameter ratio::Real
  # Relative angle of shaft 'a' with respect to the support
  variable phi_a::Angle
  # Relative angle of shaft 'b' with respect to the support
  variable phi_b::Angle
relations
  support.phi = phi_support
  support.tau = -spline_a.tau-spline_b.tau
  phi_a = spline_a.phi-phi_support
  phi_b = spline_b.phi-phi_support
  phi_a = ratio*phi_b
  0 = ratio*spline_a.tau+spline_b.tau
metadata {"Dyad": {"icons": {"default": "dyad://RotationalComponents/IdealGear.svg"}}}
end


Test Cases

This is setup code, that must be run before each test case.

julia
using RotationalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(RotationalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/RotationalComponents/0VPxm/test/snapshots"
  • Examples

  • Experiments

  • Analyses