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:
Usage
PrescribeInitialAcceleration(a0)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
a0 | Prescribed initial acceleration value for the flange. | m/s2 |
Connectors
flange
- (Flange
)
Variables
Name | Description | Units |
---|---|---|
a | Internal variable representing the acceleration of the flange. | m/s2 |
Behavior
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"
Related
Examples
Experiments
Analyses