Skip to content
PrescribeInitialEquilibrium.md

PrescribeInitialEquilibrium

Sets the initial velocity and acceleration of a connected flange to zero.

This component is used to define an initial equilibrium state for a mechanical system connected via its flange. It ensures that at the beginning of the simulation, the velocity v and acceleration a of the connected element are both zero. This is achieved through the equations:

v(0)=0a(0)=0

Additionally, the component ensures that the force flange.f at the connection point is zero. The velocity and acceleration are locally defined as derivatives of the flange's position s:

v=d(flange.s)dta=dvdt

This effectively means that the connected mechanical component starts from a standstill with no initial forces applied through this specific constraint.

Usage

PrescribeInitialEquilibrium()

Connectors

Variables

NameDescriptionUnits
vVelocity associated with the flange's motion.m/s
aAcceleration associated with the flange's motion.m/s2

Behavior

flange.f(t)=0v(t)=dflange.s(t)dta(t)=dv(t)dt

Source

dyad
# Sets the initial velocity and acceleration of a connected flange to zero.
#
# This component is used to define an initial equilibrium state for a mechanical
# system connected via its `flange`. It ensures that at the beginning of the
# simulation, the velocity `v` and acceleration `a` of the connected element
# are both zero. This is achieved through the equations:
# ```math
# \begin{align*}
# v(0) &= 0\\
# a(0) &= 0
# \end{align*}
# ```
# Additionally, the component ensures that the force `flange.f` at the connection
# point is zero. The velocity and acceleration are locally defined as derivatives
# of the flange's position `s`:
# ```math
# v = \frac{d(\text{flange.s})}{dt}
# ```
# ```math
# a = \frac{dv}{dt}
# ```
# This effectively means that the connected mechanical component starts from a
# standstill with no initial forces applied through this specific constraint.
component PrescribeInitialEquilibrium
  # Mechanical connection point (flange).
  flange = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Velocity associated with the flange's motion.
  variable v::Velocity
  # Acceleration associated with the flange's motion.
  variable a::Acceleration
relations
  initial v = 0
  initial a = 0
  flange.f = 0
  v = der(flange.s)
  a = der(v)
metadata {
  "Dyad": {
    "labels": [
      {"label": "initial v = 0", "x": 500, "y": 150, "rot": 0},
      {"label": "initial a = 0", "x": 500, "y": 800, "rot": 0}
    ],
    "icons": {"default": "dyad://TranslationalComponents/Position.svg"}
  }
}
end
Flattened Source
dyad
# Sets the initial velocity and acceleration of a connected flange to zero.
#
# This component is used to define an initial equilibrium state for a mechanical
# system connected via its `flange`. It ensures that at the beginning of the
# simulation, the velocity `v` and acceleration `a` of the connected element
# are both zero. This is achieved through the equations:
# ```math
# \begin{align*}
# v(0) &= 0\\
# a(0) &= 0
# \end{align*}
# ```
# Additionally, the component ensures that the force `flange.f` at the connection
# point is zero. The velocity and acceleration are locally defined as derivatives
# of the flange's position `s`:
# ```math
# v = \frac{d(\text{flange.s})}{dt}
# ```
# ```math
# a = \frac{dv}{dt}
# ```
# This effectively means that the connected mechanical component starts from a
# standstill with no initial forces applied through this specific constraint.
component PrescribeInitialEquilibrium
  # Mechanical connection point (flange).
  flange = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Velocity associated with the flange's motion.
  variable v::Velocity
  # Acceleration associated with the flange's motion.
  variable a::Acceleration
relations
  initial v = 0
  initial a = 0
  flange.f = 0
  v = der(flange.s)
  a = der(v)
metadata {
  "Dyad": {
    "labels": [
      {"label": "initial v = 0", "x": 500, "y": 150, "rot": 0},
      {"label": "initial a = 0", "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