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:
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
:
This effectively means that the connected mechanical component starts from a standstill with no initial forces applied through this specific constraint.
Usage
PrescribeInitialEquilibrium()
Connectors
flange
- (Flange
)
Variables
Name | Description | Units |
---|---|---|
v | Velocity associated with the flange's motion. | m/s |
a | Acceleration associated with the flange's motion. | m/s2 |
Behavior
Source
# 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
# 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.
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"
Related
Examples
Experiments
Analyses