Skip to content
PrescribeInitialAcceleration.md

PrescribeInitialAcceleration

Defines an initial angular acceleration for a rotational mechanical spline.

This component sets a specific initial angular acceleration via its internal Spline subcomponent. The user provides the desired initial angular acceleration as the parameter a0. At the commencement of the simulation, an internal variable a is equated to a0. This acceleration a is then imposed as the second time derivative of the Spline's angular displacement (phi), as described by the equation:

d2phisplinedt2=a

Simultaneously, the torque (tau) associated with the spline is maintained at zero, ensuring that this component only dictates kinematic motion (specifically initial acceleration) without applying any torque.

Usage

PrescribeInitialAcceleration(a0)

Parameters:

NameDescriptionUnitsDefault value
a0User-defined initial angular acceleration to be prescribed.m/s2

Connectors

Variables

NameDescriptionUnits
aAngular acceleration.m/s2

Behavior

ddtdspline.phi(t)dt=a(t)spline.tau(t)=0

Source

dyad
# Defines an initial angular acceleration for a rotational mechanical spline.
#
# This component sets a specific initial angular acceleration via its internal `Spline` subcomponent.
# The user provides the desired initial angular acceleration as the parameter `a0`.
# At the commencement of the simulation, an internal variable `a` is equated to `a0`.
# This acceleration `a` is then imposed as the second time derivative of the `Spline`'s
# angular displacement (`phi`), as described by the equation:
# ```math
# \frac{d^2\\phi_{spline}}{dt^2} = a
# ```
# Simultaneously, the torque (`tau`) associated with the `spline` is maintained at zero,
# ensuring that this component only dictates kinematic motion (specifically initial acceleration)
# without applying any torque.
component PrescribeInitialAcceleration
  spline = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # User-defined initial angular acceleration to be prescribed.
  parameter a0::Acceleration
  # Angular acceleration.
  variable a::Acceleration
relations
  initial a = a0
  der(der(spline.phi)) = a
  spline.tau = 0
metadata {
  "Dyad": {
    "labels": [{"label": "initial a=$(a0)", "x": 500, "y": 800, "rot": 0}],
    "icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.svg"}
  }
}
end
Flattened Source
dyad
# Defines an initial angular acceleration for a rotational mechanical spline.
#
# This component sets a specific initial angular acceleration via its internal `Spline` subcomponent.
# The user provides the desired initial angular acceleration as the parameter `a0`.
# At the commencement of the simulation, an internal variable `a` is equated to `a0`.
# This acceleration `a` is then imposed as the second time derivative of the `Spline`'s
# angular displacement (`phi`), as described by the equation:
# ```math
# \frac{d^2\\phi_{spline}}{dt^2} = a
# ```
# Simultaneously, the torque (`tau`) associated with the `spline` is maintained at zero,
# ensuring that this component only dictates kinematic motion (specifically initial acceleration)
# without applying any torque.
component PrescribeInitialAcceleration
  spline = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # User-defined initial angular acceleration to be prescribed.
  parameter a0::Acceleration
  # Angular acceleration.
  variable a::Acceleration
relations
  initial a = a0
  der(der(spline.phi)) = a
  spline.tau = 0
metadata {
  "Dyad": {
    "labels": [{"label": "initial a=$(a0)", "x": 500, "y": 800, "rot": 0}],
    "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