TrainCarCoupler
IconTrainCarCoupler
This component extends from TranslationalComponents.SpringDamper
Usage
TrainCarCoupler(c, d)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
c | Spring constant | N/m | |
d | Damping constant | N.s/m |
Connectors
Variables
Name | Description | Units |
---|---|---|
s_rel | Relative distance between flange_b and flange_a | m |
v_rel | Relative velocity between flange_b and flange_a | m/s |
f | Forces between the flanges | N |
initial_stretch | Unstretched spring length | m |
lossPower | W | |
f_c | N | |
f_d | 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{initial\_stretch}\left( t \right) + \mathtt{s\_rel}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{initial\_stretch}\left( t \right)}{\mathrm{d}t} &= 0 \\ \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
metadata {
"JuliaSim": {"icons": {"default": "jsml://JuliaSimExampleComponents/spring_damper.svg"}}
}
end
Flattened Source
component TrainCarCoupler flange_a = Flange() [{ "JuliaSim": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}} }] flange_b = Flange() [{ "JuliaSim": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}} }] # Relative distance between `flange_b` and `flange_a` variable s_rel::Distance # Relative velocity between `flange_b` and `flange_a` variable v_rel::Velocity # Forces between the flanges variable f::JSML.Force # Spring constant parameter c::TranslationalSpringConstant # Damping constant parameter d::TranslationalDampingConstant # Unstretched spring length variable initial_stretch::Length(guess=0) variable lossPower::Power variable f_c::JSML.Force variable f_d::JSML.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-initial_stretch) der(initial_stretch) = 0 f_d = d*v_rel f = f_c+f_d lossPower = f_d*v_rel metadata { "JuliaSim": {"icons": {"default": "jsml://JuliaSimExampleComponents/spring_damper.svg"}} } end
Test Cases
Related
- Examples
- Experiments
- Analyses