TrainCarCoupler
IconTrainCarCoupler
This component extends from TranslationalComponents.SpringDamper
Usage
TrainCarCoupler(c, d, s_rel0=0)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
c | Spring constant defining the stiffness of the spring element | N/m | |
d | Damping constant defining the viscous friction of the damper element | N.s/m | |
s_rel0 | Unstretched spring length | m | 0 |
Connectors
flange_a
- This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange
)flange_b
- This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange
)
Variables
Name | Description | Units |
---|---|---|
s_rel | Relative displacement between flangeb and flangea (flangeb.s - flangea.s). | m |
v_rel | Relative velocity between flangeb and flangea, defined as der(s_rel). | m/s |
f | Internal force exerted by the compliant element between the flanges. | N |
lossPower | Power dissipated by the damper element due to viscous friction | W |
f_c | Force exerted by the spring element | N |
f_d | Force exerted by the damper element | N |
Behavior
\[ \begin{align} \mathtt{s\_rel}\left( t \right) &= \mathtt{flange\_b.s}\left( t \right) - \mathtt{flange\_a.s}\left( t \right) \\ \mathtt{v\_rel}\left( t \right) &= \frac{\mathrm{d} \mathtt{s\_rel}\left( t \right)}{\mathrm{d}t} \\ \mathtt{flange\_b.f}\left( t \right) &= f\left( t \right) \\ \mathtt{flange\_a.f}\left( t \right) &= - f\left( t \right) \\ \mathtt{f\_c}\left( t \right) &= c \left( - \mathtt{s\_rel0} + \mathtt{s\_rel}\left( t \right) \right) \\ \mathtt{f\_d}\left( t \right) &= d \mathtt{v\_rel}\left( t \right) \\ f\left( t \right) &= \mathtt{f\_c}\left( t \right) + \mathtt{f\_d}\left( t \right) \\ \mathtt{lossPower}\left( t \right) &= \mathtt{v\_rel}\left( t \right) \mathtt{f\_d}\left( t \right) \end{align} \]
Source
component TrainCarCoupler
extends TranslationalComponents.SpringDamper(s_rel0 = 0)
metadata {
"Dyad": {"icons": {"default": "dyad://DyadExampleComponents/spring_damper.svg"}}
}
end
Flattened Source
component TrainCarCoupler
# Port for the first mechanical translational flange.
flange_a = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
# Port for the second mechanical translational flange.
flange_b = Flange() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
# Relative displacement between flange_b and flange_a (flange_b.s - flange_a.s).
variable s_rel::Distance
# Relative velocity between flange_b and flange_a, defined as der(s_rel).
variable v_rel::Velocity
# Internal force exerted by the compliant element between the flanges.
variable f::Dyad.Force
# Spring constant defining the stiffness of the spring element
parameter c::TranslationalSpringConstant
# Damping constant defining the viscous friction of the damper element
parameter d::TranslationalDampingConstant
# Unstretched spring length
parameter s_rel0::Length
# Power dissipated by the damper element due to viscous friction
variable lossPower::Power
# Force exerted by the spring element
variable f_c::Dyad.Force
# Force exerted by the damper element
variable f_d::Dyad.Force
relations
s_rel = flange_b.s - flange_a.s
v_rel = der(s_rel)
flange_b.f = f
flange_a.f = -f
f_c = c * (s_rel - s_rel0)
f_d = d * v_rel
f = f_c + f_d
lossPower = f_d * v_rel
metadata {
"Dyad": {"icons": {"default": "dyad://DyadExampleComponents/spring_damper.svg"}}
}
end
Test Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses