Spring
IconSpring
Linear 1D rotational spring
This component extends from PartialCompliant
Usage
Spring(c, phi_rel0=0.0)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
c | Spring constant | N.m/rad | |
phi_rel0 | Unstretched spring angle | rad | 0 |
Connectors
Variables
Name | Description | Units |
---|---|---|
phi_rel | Relative rotation angle between splines | rad |
tau | Torque between splines | N.m |
Behavior
\[ \begin{align} \mathtt{phi\_rel}\left( t \right) &= \mathtt{spline\_b.phi}\left( t \right) - \mathtt{spline\_a.phi}\left( t \right) \\ \mathtt{spline\_b.tau}\left( t \right) &= \mathtt{tau}\left( t \right) \\ \mathtt{spline\_a.tau}\left( t \right) &= - \mathtt{tau}\left( t \right) \\ \mathtt{tau}\left( t \right) &= c \left( - \mathtt{phi\_rel0} + \mathtt{phi\_rel}\left( t \right) \right) \end{align} \]
Source
# Linear 1D rotational spring
component Spring
extends PartialCompliant
# Spring constant
parameter c::RotationalSpringConstant
# Unstretched spring angle
parameter phi_rel0::Angle = 0.0
relations
tau = c*(phi_rel-phi_rel0)
metadata {"JuliaSim": {"icons": {"default": "jsml://RotationalComponents/Spring.svg"}}}
end
Flattened Source
# Linear 1D rotational spring component Spring spline_a = Spline() [{ "JuliaSim": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}} }] spline_b = Spline() [{ "JuliaSim": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}} }] # Relative rotation angle between splines variable phi_rel::Angle # Torque between splines variable tau::Torque # Spring constant parameter c::RotationalSpringConstant # Unstretched spring angle parameter phi_rel0::Angle = 0.0 relations phi_rel = spline_b.phi-spline_a.phi spline_b.tau = tau spline_a.tau = -tau tau = c*(phi_rel-phi_rel0) metadata {"JuliaSim": {"icons": {"default": "jsml://RotationalComponents/Spring.svg"}}} end
Test Cases
Related
- Examples
- Experiments
- Analyses
- Tests