---
url: /dyad/stable/stdlib/RotationalComponents/components/Components.RackAndPinion.md
description: >-
  Dyad Components.RackAndPinion docs.  Models an ideal rack and pinion system,
  converting rotational motion to translational motion.
---

# `Components.RackAndPinion` {#Components.RackAndPinion}

Models an ideal rack and pinion system, converting rotational motion to translational motion.

This component represents a one-dimensional, inertia-less rack and pinion mechanism. It establishes a kinematic relationship between the rotation of the pinion (circular gear) and the translation of the rack (linear gear). The core behavior is inherited from the `IdealRollingWheel` component. This model assumes no slip between the rack and pinion and neglects any inertial effects.

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

## Usage {#Usage}

`RotationalComponents.Components.RackAndPinion(radius)`

## Parameters: {#Parameters:}

|     Name |                                                                                                                  Description | Units | Default value |
| --------:| ----------------------------------------------------------------------------------------------------------------------------:| -----:| -------------:|
| `radius` | Specifies the radius of the pinion gear, determining the kinematic relationship between rotational and translational motion. |     m |               |

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

* `flange` - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. ([`Flange`](/stdlib/Dyad/connectors/Flange#Flange))

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

* `support_t` - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. ([`Flange`](/stdlib/Dyad/connectors/Flange#Flange))

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{support_r.tau}\left( t \right) &=  - \mathtt{spline.tau}\left( t \right) \\
\mathtt{support_t.f}\left( t \right) &=  - \mathtt{flange.f}\left( t \right) \\
\mathtt{radius} ~ \left( \mathtt{spline.phi}\left( t \right) - \mathtt{support_r.phi}\left( t \right) \right) &= \mathtt{flange.s}\left( t \right) - \mathtt{support_t.s}\left( t \right) \\
0 &= \mathtt{spline.tau}\left( t \right) + \mathtt{flange.f}\left( t \right) ~ \mathtt{radius}
\end{align}
$$

## Source {#Source}

```dyad
"""
Models an ideal rack and pinion system, converting rotational motion to translational motion.

This component represents a one-dimensional, inertia-less rack and pinion mechanism.
It establishes a kinematic relationship between the rotation of the pinion
(circular gear) and the translation of the rack (linear gear). The core behavior
is inherited from the `IdealRollingWheel` component. This model assumes no slip
between the rack and pinion and neglects any inertial effects.
"""
component RackAndPinion
  extends RotationalComponents.Interfaces.PartialElementaryRotationalToTranslational
  "Specifies the radius of the pinion gear, determining the kinematic relationship between rotational and translational motion."
  parameter radius::Length
relations
  (spline.phi - support_r.phi) * radius = flange.s - support_t.s
  0 = radius * flange.f + spline.tau
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/IdealRollingWheel.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1154, "rot": 0}]
  }
}
end
```

```dyad
"""
Models an ideal rack and pinion system, converting rotational motion to translational motion.

This component represents a one-dimensional, inertia-less rack and pinion mechanism.
It establishes a kinematic relationship between the rotation of the pinion
(circular gear) and the translation of the rack (linear gear). The core behavior
is inherited from the `IdealRollingWheel` component. This model assumes no slip
between the rack and pinion and neglects any inertial effects.
"""
component RackAndPinion
  "Flange of rotational shaft"
  spline = Spline() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Flange of translational rod"
  flange = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Rotational support/housing of component"
  support_r = Spline() {"Dyad": {"placement": {"icon": {"x1": 100, "y1": 950, "x2": 200, "y2": 1050}}}}
  "Translational support/housing of component"
  support_t = Flange() {"Dyad": {"placement": {"icon": {"x1": 800, "y1": 950, "x2": 900, "y2": 1050}}}}
  "Specifies the radius of the pinion gear, determining the kinematic relationship between rotational and translational motion."
  parameter radius::Length
relations
  support_r.tau = -spline.tau
  support_t.f = -flange.f
  (spline.phi - support_r.phi) * radius = flange.s - support_t.s
  0 = radius * flange.f + spline.tau
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/IdealRollingWheel.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1154, "rot": 0}]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
