Skip to content
Position.md

Position

Defines a forced angular position for a spline relative to its support based on an input signal.

This component models the controlled angular positioning of a spline with respect to its supporting structure. It takes an external signal, phi_ref, as the desired or reference angle. The component calculates the actual relative angle, phi, between the spline and its support using the equation:

phi=spline.phiphisupport

The core function of this component is to ensure that this actual relative angle precisely follows the reference input, as defined by the constraint equation:

phi=phiref

The connectors spline and phi_support are inherited from PartialElementaryOneSplineAndSupport.

This component extends from PartialElementaryOneSplineAndSupport

Usage

Position()

Connectors

  • spline - (Spline)

  • support - (Spline)

  • phi_ref - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
phi_supportAbsolute angle of the support splinerad
phiVariable representing the actual relative angle between spline and support.rad

Behavior

support.phi(t)=phi_support(t)support.tau(t)=spline.tau(t)phi(t)=spline.phi(t)phi_support(t)phi(t)=phi_ref(t)

Source

dyad
# Defines a forced angular position for a spline relative to its support based on an input signal.
#
# This component models the controlled angular positioning of a spline with respect
# to its supporting structure. It takes an external signal, `phi_ref`, as the
# desired or reference angle. The component calculates the actual relative angle, `phi`,
# between the spline and its support using the equation:
#
# ```math
# \\phi = \text{spline}.\\phi - \\phi_\text{support}
# ```
#
# The core function of this component is to ensure that this actual relative angle
# precisely follows the reference input, as defined by the constraint equation:
#
# ```math
# \\phi = \\phi_\text{ref}
# ```
#
# The connectors `spline` and `phi_support` are inherited from
# `PartialElementaryOneSplineAndSupport`.
component Position
  extends PartialElementaryOneSplineAndSupport
  # Input signal defining the desired relative angle between spline and support.
  phi_ref = RealInput() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Variable representing the actual relative angle between spline and support.
  variable phi::Angle
relations
  phi = spline.phi-phi_support
  phi = phi_ref
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.svg"}}
}
end
Flattened Source
dyad
# Defines a forced angular position for a spline relative to its support based on an input signal.
#
# This component models the controlled angular positioning of a spline with respect
# to its supporting structure. It takes an external signal, `phi_ref`, as the
# desired or reference angle. The component calculates the actual relative angle, `phi`,
# between the spline and its support using the equation:
#
# ```math
# \\phi = \text{spline}.\\phi - \\phi_\text{support}
# ```
#
# The core function of this component is to ensure that this actual relative angle
# precisely follows the reference input, as defined by the constraint equation:
#
# ```math
# \\phi = \\phi_\text{ref}
# ```
#
# The connectors `spline` and `phi_support` are inherited from
# `PartialElementaryOneSplineAndSupport`.
component Position
  # Primary rotational shaft spline connector
  spline = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Support spline connector
  support = Spline() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "support", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }]
  # Absolute angle of the support spline
  variable phi_support::Angle
  # Input signal defining the desired relative angle between spline and support.
  phi_ref = RealInput() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Variable representing the actual relative angle between spline and support.
  variable phi::Angle
relations
  support.phi = phi_support
  support.tau = -spline.tau
  phi = spline.phi-phi_support
  phi = phi_ref
metadata {
  "Dyad": {"icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.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