---
url: /dyad/stable/stdlib/TranslationalComponents/components/Components.RollingResistance.md
description: Dyad Components.RollingResistance docs.  Resistance of a rolling wheel.
---

# `Components.RollingResistance` {#Components.RollingResistance}

Resistance of a rolling wheel.

Simplified model of rolling resistance dependent on vertical wheel load (due to gravity, i.e. static only), inclination and rolling resistance coefficient.

Matches MSL `Modelica.Mechanics.Translational.Components.RollingResistance`. Since Dyad does not support conditional connectors, the `cr` and `inclination` inputs are always visible. Connect them to `BlockComponents.Sources.Constant` blocks for constant values.

The nominal (unregularised) rolling resistance force is:

$$f\_{nominal} = -C_r \cdot f\_{Weight} \cdot \cos(\arctan(\text{inclination}))$$

The rolling resistance is independent of speed but changes direction with velocity. To avoid numerical problems near zero velocity the force is regularised within `[-v0, v0]`. The regularisation type is selected by the structural parameter `reg` (see `Regularization` enum).

Connect the `support` flange to a `Fixed` component for grounded behaviour.

This component extends from [`TranslationalComponents.Interfaces.PartialForce`](../types/Interfaces.PartialForce.md)

## Usage {#Usage}

`TranslationalComponents.Components.RollingResistance(fWeight, v0=0.1)`

## Parameters: {#Parameters:}

|      Name |               Description | Units |             Default value |
| ---------:| -------------------------:| -----:| -------------------------:|
|     `reg` |    Type of regularisation |     – | Translation...ation.Exp() |
| `fWeight` | Wheel load due to gravity |     N |                           |
|      `v0` |   Regularisation below v0 |   m/s |                       0.1 |

## Connectors {#Connectors}

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

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

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

## Variables {#Variables}

|        Name |                                                  Description | Units |
| -----------:| ------------------------------------------------------------:| -----:|
|         `s` | Distance between flange and support (= flange.s - support.s) |     m |
|         `f` |             Accelerating force acting at flange (= flange.f) |     N |
|         `v` |        Velocity of flange with respect to support (= der(s)) |   m/s |
| `f_nominal` |      Nominal rolling resistance force without regularisation |     N |

## Behavior {#Behavior}

$$ \begin{align}
s\left( t \right) &= \mathtt{flange.s}\left( t \right) - \mathtt{support.s}\left( t \right) \\
\mathtt{support.f}\left( t \right) &=  - \mathtt{flange.f}\left( t \right) \\
f\left( t \right) &= \mathtt{flange.f}\left( t \right) \\
v\left( t \right) &= \frac{\mathrm{d}s\left( t \right)}{\mathrm{d}t} \\
\mathtt{f_nominal}\left( t \right) &=  - \cos\left( \arctan\left( \mathtt{inclination}\left( t \right) \right) \right) ~ \mathtt{cr}\left( t \right) ~ \mathtt{fWeight} \\
f\left( t \right) &=  - \left( -1 + \frac{2}{1 + e^{\frac{ - v\left( t \right)}{0.01 ~ \mathtt{v0}}}} \right) ~ \mathtt{f_nominal}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Resistance of a rolling wheel.

Simplified model of rolling resistance dependent on vertical wheel load
(due to gravity, i.e. static only), inclination and rolling resistance
coefficient.

Matches MSL `Modelica.Mechanics.Translational.Components.RollingResistance`.
Since Dyad does not support conditional connectors, the `cr` and
`inclination` inputs are always visible. Connect them to
`BlockComponents.Sources.Constant` blocks for constant values.

The nominal (unregularised) rolling resistance force is:
```math
f_{nominal} = -C_r \\cdot f_{Weight} \\cdot \\cos(\\arctan(\\text{inclination}))
```

The rolling resistance is independent of speed but changes direction with
velocity. To avoid numerical problems near zero velocity the force is
regularised within `[-v0, v0]`. The regularisation type is selected by
the structural parameter `reg` (see `Regularization` enum).

Connect the `support` flange to a `Fixed` component for grounded behaviour.
"""
component RollingResistance
  extends TranslationalComponents.Interfaces.PartialForce
  "Rolling resistance coefficient"
  cr = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 150, "x2": 50, "y2": 250}}}}
  "Inclination = tan(angle)"
  inclination = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 700, "x2": 50, "y2": 800}}}}
  "Wheel load due to gravity"
  parameter fWeight::Dyad.Force
  "Type of regularisation"
  structural parameter reg::TranslationalComponents.Components.Regularization = TranslationalComponents.Components.Regularization.Exp()
  "Regularisation below v0"
  parameter v0::Velocity(min = eps(Float64)) = 0.1
  "Velocity of flange with respect to support (= der(s))"
  variable v::Velocity
  "Nominal rolling resistance force without regularisation"
  variable f_nominal::Dyad.Force
relations
  v = der(s)
  f_nominal = -cr * fWeight * cos(atan(inclination))
  switch reg
    case Exp
      f = -f_nominal * (2 / (1 + exp(-v / (0.01 * v0))) - 1)
    case Sine
      f = -f_nominal * ifelse(abs(v) >= v0, sign(v), sin(π / 2 * v / v0))
    case Linear
      f = -f_nominal * ifelse(abs(v) >= v0, sign(v), v / v0)
    case Cosine
      f = -f_nominal * ifelse(abs(v) >= v0, sign(v), sign(v) * (1 - cos(π / 2 * v / v0)))
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/RollingResistance.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1194, "rot": 0}]
  }
}
end
````

````dyad
"""
Resistance of a rolling wheel.

Simplified model of rolling resistance dependent on vertical wheel load
(due to gravity, i.e. static only), inclination and rolling resistance
coefficient.

Matches MSL `Modelica.Mechanics.Translational.Components.RollingResistance`.
Since Dyad does not support conditional connectors, the `cr` and
`inclination` inputs are always visible. Connect them to
`BlockComponents.Sources.Constant` blocks for constant values.

The nominal (unregularised) rolling resistance force is:
```math
f_{nominal} = -C_r \\cdot f_{Weight} \\cdot \\cos(\\arctan(\\text{inclination}))
```

The rolling resistance is independent of speed but changes direction with
velocity. To avoid numerical problems near zero velocity the force is
regularised within `[-v0, v0]`. The regularisation type is selected by
the structural parameter `reg` (see `Regularization` enum).

Connect the `support` flange to a `Fixed` component for grounded behaviour.
"""
component RollingResistance
  "Flange of component"
  flange = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Support/housing of component"
  support = Flange() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}}
  "Distance between flange and support (= flange.s - support.s)"
  variable s::Length
  "Accelerating force acting at flange (= flange.f)"
  variable f::Dyad.Force
  "Rolling resistance coefficient"
  cr = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 150, "x2": 50, "y2": 250}}}}
  "Inclination = tan(angle)"
  inclination = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 700, "x2": 50, "y2": 800}}}}
  "Wheel load due to gravity"
  parameter fWeight::Dyad.Force
  "Type of regularisation"
  structural parameter reg::TranslationalComponents.Components.Regularization = TranslationalComponents.Components.Regularization.Exp()
  "Regularisation below v0"
  parameter v0::Velocity(min = eps(Float64)) = 0.1
  "Velocity of flange with respect to support (= der(s))"
  variable v::Velocity
  "Nominal rolling resistance force without regularisation"
  variable f_nominal::Dyad.Force
relations
  s = flange.s - support.s
  support.f = -flange.f
  f = flange.f
  v = der(s)
  f_nominal = -cr * fWeight * cos(atan(inclination))
  switch reg
    case Exp
      f = -f_nominal * (2 / (1 + exp(-v / (0.01 * v0))) - 1)
    case Sine
      f = -f_nominal * ifelse(abs(v) >= v0, sign(v), sin(π / 2 * v / v0))
    case Linear
      f = -f_nominal * ifelse(abs(v) >= v0, sign(v), v / v0)
    case Cosine
      f = -f_nominal * ifelse(abs(v) >= v0, sign(v), sign(v) * (1 - cos(π / 2 * v / v0)))
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/RollingResistance.svg"},
    "labels": [{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1194, "rot": 0}]
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
