Skip to content
PrescribeInitialAcceleration.md

PrescribeInitialAcceleration

Defines a specific initial acceleration for a one-dimensional mechanical translational flange.

This component kinematically prescribes an initial acceleration via its flange connector. The value of this initial acceleration is determined by the parameter a0. The component exerts no force on the connected system. The governing equations are:

a(0)=a0d2flange.sdt2=aflange.f=0

Usage

PrescribeInitialAcceleration(a0)

Parameters:

NameDescriptionUnitsDefault value
a0Prescribed initial acceleration value for the flange.m/s2

Connectors

Variables

NameDescriptionUnits
aInternal variable representing the acceleration of the flange.m/s2

Behavior

ddtdflange.s(t)dt=a(t)flange.f(t)=0

Source

dyad
# Defines a specific initial acceleration for a one-dimensional mechanical translational flange.
#
# This component kinematically prescribes an initial acceleration via its `flange` connector.
# The value of this initial acceleration is determined by the parameter `a0`.
# The component exerts no force on the connected system.
# The governing equations are:
# ```math
# \begin{align*}
# a(0) &= a0 \\
# \frac{d^2 flange.s}{dt^2} &= a \\
# flange.f &= 0
# \end{align*}
# ```
component PrescribeInitialAcceleration
  # Mechanical translational connector to which the initial acceleration is applied.
  flange = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Prescribed initial acceleration value for the flange.
  parameter a0::Acceleration
  # Internal variable representing the acceleration of the flange.
  variable a::Acceleration
relations
  initial a = a0
  der(der(flange.s)) = a
  flange.f = 0
metadata {
  "Dyad": {
    "labels": [{"label": "initial a=$(a0)", "x": 500, "y": 800, "rot": 0}],
    "icons": {"default": "dyad://TranslationalComponents/Position.svg"}
  }
}
end
Flattened Source
dyad
# Defines a specific initial acceleration for a one-dimensional mechanical translational flange.
#
# This component kinematically prescribes an initial acceleration via its `flange` connector.
# The value of this initial acceleration is determined by the parameter `a0`.
# The component exerts no force on the connected system.
# The governing equations are:
# ```math
# \begin{align*}
# a(0) &= a0 \\
# \frac{d^2 flange.s}{dt^2} &= a \\
# flange.f &= 0
# \end{align*}
# ```
component PrescribeInitialAcceleration
  # Mechanical translational connector to which the initial acceleration is applied.
  flange = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Prescribed initial acceleration value for the flange.
  parameter a0::Acceleration
  # Internal variable representing the acceleration of the flange.
  variable a::Acceleration
relations
  initial a = a0
  der(der(flange.s)) = a
  flange.f = 0
metadata {
  "Dyad": {
    "labels": [{"label": "initial a=$(a0)", "x": 500, "y": 800, "rot": 0}],
    "icons": {"default": "dyad://TranslationalComponents/Position.svg"}
  }
}
end


Test Cases

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

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

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

  • Experiments

  • Analyses