---
url: /dyad/stable/stdlib/RotationalComponents/components/Sources.TorqueSource.md
description: >-
  Dyad Sources.TorqueSource docs.  Ideal source applying an externally specified
  torque to a rotational spline.
---

# `Sources.TorqueSource` {#Sources.TorqueSource}

Ideal source applying an externally specified torque to a rotational spline.

This component models an ideal torque source for rotational mechanical systems. It takes an external signal, `tau`, which defines the accelerating torque to be applied to the connected mechanical `spline`. The component inherits its mechanical connection interface, `spline`, from `PartialTorque`. The core behavior is established by the following equation that relates the input signal `tau` to the torque at the `spline` connector:

$$spline.\tau = -\tau$$

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

## Usage {#Usage}

`RotationalComponents.Sources.TorqueSource()`

## 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))

* `tau` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

## Variables {#Variables}

|          Name |                             Description | Units |
| -------------:| ---------------------------------------:| -----:|
| `phi_support` |    Absolute angle of the support spline |   rad |
|         `phi` | Angle of spline with respect to support |     – |

## 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) \\
\mathtt{spline.tau}\left( t \right) &=  - \mathtt{tau}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Ideal source applying an externally specified torque to a rotational spline.

This component models an ideal torque source for rotational mechanical systems.
It takes an external signal, `tau`, which defines the accelerating torque
to be applied to the connected mechanical `spline`. The component inherits
its mechanical connection interface, `spline`, from `PartialTorque`.
The core behavior is established by the following equation that relates the
input signal `tau` to the torque at the `spline` connector:
```math
spline.\tau = -\tau
```
"""
component TorqueSource
  extends RotationalComponents.Interfaces.PartialTorque
  "Accelerating torque acting at spline"
  tau = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
relations
  spline.tau = -tau
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/Torque.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1195, "rot": 0}]
  }
}
end
````

````dyad
"""
Ideal source applying an externally specified torque to a rotational spline.

This component models an ideal torque source for rotational mechanical systems.
It takes an external signal, `tau`, which defines the accelerating torque
to be applied to the connected mechanical `spline`. The component inherits
its mechanical connection interface, `spline`, from `PartialTorque`.
The core behavior is established by the following equation that relates the
input signal `tau` to the torque at the `spline` connector:
```math
spline.\tau = -\tau
```
"""
component TorqueSource
  "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
  "Accelerating torque acting at spline"
  tau = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
relations
  support.phi = phi_support
  support.tau = -spline.tau
  phi = spline.phi - phi_support
  spline.tau = -tau
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/Torque.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1195, "rot": 0}]
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
