TrainCar
IconTrainCar
This component extends from TranslationalComponents.Mass
Usage
TrainCar(L=0.0, m, g=-9.80665, theta=0.0)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
L | Length of component, from left flange to right flange | m | 0 |
m | Mass of the sliding mass | kg | |
g | Gravity (defaults to standard acceleration of gravity) | m/s2 | -9.80665 |
theta | Angle of motion w.r.t. gravity, 0 = horizontal, pi / 2 = vertical with gravity pulling backward | rad | 0 |
Connectors
Variables
Name | Description | Units |
---|---|---|
s | Absolute position of center of component | m |
v | Absolute velocity of component | m/s |
a | Absolute acceleration of component | m/s2 |
Behavior
\[ \begin{align} \mathtt{flange\_a.s}\left( t \right) &= - \frac{1}{2} L + s\left( t \right) \\ \mathtt{flange\_b.s}\left( t \right) &= \frac{1}{2} L + s\left( t \right) \\ v\left( t \right) &= \frac{\mathrm{d} s\left( t \right)}{\mathrm{d}t} \\ a\left( t \right) &= \frac{\mathrm{d} v\left( t \right)}{\mathrm{d}t} \\ \left( a\left( t \right) + g \sin\left( \mathtt{theta} \right) \right) m &= \mathtt{flange\_b.f}\left( t \right) + \mathtt{flange\_a.f}\left( t \right) \end{align} \]
Source
component TrainCar
extends TranslationalComponents.Mass
metadata {
"JuliaSim": {"icons": {"default": "jsml://JuliaSimExampleComponents/mass.svg"}}
}
end
Flattened Source
component TrainCar 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}}} }] # Absolute position of center of component variable s::JSML.Position # Length of component, from left flange to right flange parameter L::Length = 0.0 # Mass of the sliding mass parameter m::JSML.Mass # Absolute velocity of component variable v::Velocity # Absolute acceleration of component variable a::Acceleration # Gravity (defaults to standard acceleration of gravity) parameter g::Acceleration = -9.80665 # Angle of motion w.r.t. gravity, 0 = horizontal, pi / 2 = vertical with gravity pulling backward parameter theta::Angle = 0.0 relations flange_a.s = s-L/2 flange_b.s = s+L/2 v = der(s) a = der(v) m*(a+g*sin(theta)) = flange_a.f+flange_b.f metadata { "JuliaSim": {"icons": {"default": "jsml://JuliaSimExampleComponents/mass.svg"}} } end
Test Cases
Related
- Examples
- Experiments
- Analyses