---
url: /dyad/stable/stdlib/RotationalComponents/components/Components.SpringDamper.md
description: >-
  Dyad Components.SpringDamper docs.  Models a linear 1D rotational spring and
  damper acting in parallel.
---

# `Components.SpringDamper` {#Components.SpringDamper}

Models a linear 1D rotational spring and damper acting in parallel.

This component represents a parallel combination of a linear rotational spring and a linear rotational damper. It calculates the total torque based on the relative angular displacement and velocity between its mechanical connection flanges. The spring torque ($\tau*c$) is proportional to the angular displacement from an unstretched reference angle ($\phi*{rel0}$), defined by the spring constant ($c$). The damper torque ($\tau*d$) is proportional to the relative angular velocity ($w*{rel}$), defined by the damping constant ($d$). The governing equations are:

$$\begin{align\*}
\tau_c &= c (\phi\_{rel} - \phi\_{rel0}) \\
\tau_d &= d w\_{rel} \\
\tau &= \tau_c + \tau_d
\end{align\*}$$

This component extends from [`RotationalComponents.Interfaces.PartialCompliantWithRelativeStates`](../types/Interfaces.PartialCompliantWithRelativeStates.md)

## Usage {#Usage}

`RotationalComponents.Components.SpringDamper(d, c, phi_rel0=0.0)`

## Parameters: {#Parameters:}

|       Name |                                            Description |     Units | Default value |
| ----------:| ------------------------------------------------------:| ---------:| -------------:|
|        `d` |              Damping constant of the rotational damper | N.m.s/rad |               |
|        `c` |               Spring constant of the rotational spring |   N.m/rad |               |
| `phi_rel0` | Unstretched (zero torque) relative angle of the spring |       rad |           0.0 |

## Connectors {#Connectors}

* `spline_a` - This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. ([`Spline`](/stdlib/Dyad/connectors/Spline#Spline))

* `spline_b` - This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. ([`Spline`](/stdlib/Dyad/connectors/Spline#Spline))

## Variables {#Variables}

|      Name |                                           Description |  Units |
| ---------:| -----------------------------------------------------:| ------:|
| `phi_rel` | Relative rotation angle between spline_b and spline_a |    rad |
|     `tau` |                Torque transmitted between the splines |    N.m |
|   `w_rel` |             Relative angular velocity between splines |  rad/s |
|   `a_rel` |         Relative angular acceleration between splines | rad/s2 |
|   `tau_c` |                            Spring torque contribution |    N.m |
|   `tau_d` |                            Damper torque contribution |    N.m |

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{phi_rel}\left( t \right) &=  - \mathtt{spline_a.phi}\left( t \right) + \mathtt{spline_b.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) \\
\frac{\mathrm{d}\mathtt{phi_rel}\left( t \right)}{\mathrm{d}t} &= \mathtt{w_rel}\left( t \right) \\
\frac{\mathrm{d}\mathtt{w_rel}\left( t \right)}{\mathrm{d}t} &= \mathtt{a_rel}\left( t \right) \\
\mathtt{tau_c}\left( t \right) &= c ~ \left( \mathtt{phi_rel}\left( t \right) - \mathtt{phi_rel0} \right) \\
\mathtt{tau_d}\left( t \right) &= d ~ \mathtt{w_rel}\left( t \right) \\
\mathtt{tau}\left( t \right) &= \mathtt{tau_c}\left( t \right) + \mathtt{tau_d}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Models a linear 1D rotational spring and damper acting in parallel.

This component represents a parallel combination of a linear rotational spring and a linear rotational damper. It calculates the total torque based on the relative angular displacement and velocity between its mechanical connection flanges.
The spring torque (\$\tau_c\$) is proportional to the angular displacement from an unstretched reference angle (\$\\phi_{rel0}\$), defined by the spring constant (\$c\$).
The damper torque (\$\tau_d\$) is proportional to the relative angular velocity (\$w_{rel}\$), defined by the damping constant (\$d\$).
The governing equations are:
```math
\begin{align*}
\tau_c &= c (\\phi_{rel} - \\phi_{rel0}) \\
\tau_d &= d w_{rel} \\
\tau &= \tau_c + \tau_d
\end{align*}
```
"""
component SpringDamper
  extends RotationalComponents.Interfaces.PartialCompliantWithRelativeStates
  "Spring torque contribution"
  variable tau_c::Torque
  "Damper torque contribution"
  variable tau_d::Torque
  "Damping constant of the rotational damper"
  parameter d::RotationalDampingConstant
  "Spring constant of the rotational spring"
  parameter c::RotationalSpringConstant
  "Unstretched (zero torque) relative angle of the spring"
  parameter phi_rel0::Angle = 0.0
relations
  tau_c = c * (phi_rel - phi_rel0)
  tau_d = d * w_rel
  tau = tau_c + tau_d
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/SpringDamper.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1051, "rot": 0}]
  }
}
end
````

````dyad
"""
Models a linear 1D rotational spring and damper acting in parallel.

This component represents a parallel combination of a linear rotational spring and a linear rotational damper. It calculates the total torque based on the relative angular displacement and velocity between its mechanical connection flanges.
The spring torque (\$\tau_c\$) is proportional to the angular displacement from an unstretched reference angle (\$\\phi_{rel0}\$), defined by the spring constant (\$c\$).
The damper torque (\$\tau_d\$) is proportional to the relative angular velocity (\$w_{rel}\$), defined by the damping constant (\$d\$).
The governing equations are:
```math
\begin{align*}
\tau_c &= c (\\phi_{rel} - \\phi_{rel0}) \\
\tau_d &= d w_{rel} \\
\tau &= \tau_c + \tau_d
\end{align*}
```
"""
component SpringDamper
  "First rotational spline interface"
  spline_a = Spline() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Second rotational spline interface"
  spline_b = Spline() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Relative rotation angle between spline_b and spline_a"
  variable phi_rel::Angle
  "Torque transmitted between the splines"
  variable tau::Torque
  "Relative angular velocity between splines"
  variable w_rel::AngularVelocity
  "Relative angular acceleration between splines"
  variable a_rel::AngularAcceleration
  "Spring torque contribution"
  variable tau_c::Torque
  "Damper torque contribution"
  variable tau_d::Torque
  "Damping constant of the rotational damper"
  parameter d::RotationalDampingConstant
  "Spring constant of the rotational spring"
  parameter c::RotationalSpringConstant
  "Unstretched (zero torque) relative angle of the spring"
  parameter phi_rel0::Angle = 0.0
relations
  phi_rel = spline_b.phi - spline_a.phi
  spline_b.tau = tau
  spline_a.tau = -tau
  der(phi_rel) = w_rel
  der(w_rel) = a_rel
  tau_c = c * (phi_rel - phi_rel0)
  tau_d = d * w_rel
  tau = tau_c + tau_d
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/SpringDamper.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1051, "rot": 0}]
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
