---
url: /dyad/stable/stdlib/RotationalComponents/components/Sources.InverseSpeedDependentTorque.md
description: >-
  Dyad Sources.InverseSpeedDependentTorque docs.  Torque reciprocal dependent on
  speed.
---

# `Sources.InverseSpeedDependentTorque` {#Sources.InverseSpeedDependentTorque}

Torque reciprocal dependent on speed.

Model of inverse speed dependent torque. Parameter TorqueDirection chooses whether direction of torque is the same in both directions of rotation or not. If TorqueDirection = false, regularization near zero speed avoids numerical problems.

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

## Usage {#Usage}

`RotationalComponents.Sources.InverseSpeedDependentTorque(tau_nominal, w_nominal, w0=0.1)`

## Parameters: {#Parameters:}

|              Name |                                                                              Description | Units | Default value |
| -----------------:| ----------------------------------------------------------------------------------------:| -----:| -------------:|
| `TorqueDirection` |                                  Same direction of torque in both directions of rotation |     – |          true |
|     `tau_nominal` | Nominal torque (if negative, torque is acting as load in positive direction of rotation) |   N.m |               |
|       `w_nominal` |                                                                            Nominal speed | rad/s |               |
|              `w0` |                                                                  Regularization below w0 | rad/s |           0.1 |

## Connectors {#Connectors}

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

* `support` - 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_support` |                            Absolute angle of the support spline |   rad |
|         `phi` |                         Angle of spline with respect to support |     – |
|           `w` | Angular velocity of spline with respect to support (= der(phi)) | rad/s |
|         `tau` |            Accelerating torque acting at spline (= -spline.tau) |   N.m |

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{support.phi}\left( t \right) &= \mathtt{phi_support}\left( t \right) \\
\mathtt{support.tau}\left( t \right) &=  - \mathtt{spline.tau}\left( t \right) \\
\mathtt{phi}\left( t \right) &=  - \mathtt{phi_support}\left( t \right) + \mathtt{spline.phi}\left( t \right) \\
w\left( t \right) &= \frac{\mathrm{d}\mathtt{phi}\left( t \right)}{\mathrm{d}t} \\
\mathtt{tau}\left( t \right) &=  - \mathtt{spline.tau}\left( t \right) \\
\mathtt{tau}\left( t \right) &= ifelse\left( \left|w\left( t \right)\right| < \mathtt{w0}, \frac{\mathtt{tau_nominal} ~ \mathtt{w_nominal}}{\mathtt{w0}}, \frac{\mathtt{tau_nominal} ~ \mathtt{w_nominal}}{\left|w\left( t \right)\right|} \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
Torque reciprocal dependent on speed.

Model of inverse speed dependent torque. Parameter TorqueDirection chooses
whether direction of torque is the same in both directions of rotation or not.
If TorqueDirection = false, regularization near zero speed avoids numerical
problems.
"""
component InverseSpeedDependentTorque
  extends RotationalComponents.Interfaces.PartialTorque
  "Nominal torque (if negative, torque is acting as load in positive direction of rotation)"
  parameter tau_nominal::Torque
  "Same direction of torque in both directions of rotation"
  structural parameter TorqueDirection::Boolean = true
  "Nominal speed"
  parameter w_nominal::AngularVelocity(min = eps(Float64))
  "Regularization below w0"
  parameter w0::AngularVelocity(min = eps(Float64)) = 0.1
  "Angular velocity of spline with respect to support (= der(phi))"
  variable w::AngularVelocity
  "Accelerating torque acting at spline (= -spline.tau)"
  variable tau::Torque
relations
  w = der(phi)
  tau = -spline.tau
  if TorqueDirection
    tau = ifelse(abs(w) < w0, tau_nominal * w_nominal / w0, tau_nominal * w_nominal / abs(w))
  else
    tau = ifelse(abs(w) < w0, tau_nominal * w / w0, tau_nominal * w_nominal / w)
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/InverseSpeedDepTorque.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1203, "rot": 0}]
  }
}
end
```

```dyad
"""
Torque reciprocal dependent on speed.

Model of inverse speed dependent torque. Parameter TorqueDirection chooses
whether direction of torque is the same in both directions of rotation or not.
If TorqueDirection = false, regularization near zero speed avoids numerical
problems.
"""
component InverseSpeedDependentTorque
  "Primary rotational shaft spline connector"
  spline = Spline() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Support spline connector"
  support = Spline() {
    "Dyad": {
      "placement": {"icon": {"iconName": "support", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }
  "Absolute angle of the support spline"
  variable phi_support::Angle
  "Angle of spline with respect to support"
  variable phi::Real
  "Nominal torque (if negative, torque is acting as load in positive direction of rotation)"
  parameter tau_nominal::Torque
  "Same direction of torque in both directions of rotation"
  structural parameter TorqueDirection::Boolean = true
  "Nominal speed"
  parameter w_nominal::AngularVelocity(min = eps(Float64))
  "Regularization below w0"
  parameter w0::AngularVelocity(min = eps(Float64)) = 0.1
  "Angular velocity of spline with respect to support (= der(phi))"
  variable w::AngularVelocity
  "Accelerating torque acting at spline (= -spline.tau)"
  variable tau::Torque
relations
  support.phi = phi_support
  support.tau = -spline.tau
  phi = spline.phi - phi_support
  w = der(phi)
  tau = -spline.tau
  if TorqueDirection
    tau = ifelse(abs(w) < w0, tau_nominal * w_nominal / w0, tau_nominal * w_nominal / abs(w))
  else
    tau = ifelse(abs(w) < w0, tau_nominal * w / w0, tau_nominal * w_nominal / w)
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/InverseSpeedDepTorque.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1203, "rot": 0}]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`TestBraking`](Sources.InverseSpeedDependentTorque.md)
