---
url: /dyad/stable/stdlib/MultibodyComponents/components/AbsoluteVelocity.md
description: >-
  Dyad AbsoluteVelocity docs.  Measures the absolute velocity of a frame
  connector's origin.
---

# `AbsoluteVelocity` {#AbsoluteVelocity}

Measures the absolute velocity of a frame connector's origin.

Always differentiates the position resolved in World first, then rotates the result into `resolve_in_frame` – matching Modelica's AbsoluteVelocity.

This is a sensor: no forces or torques are exerted.

## Usage {#Usage}

`MultibodyComponents.AbsoluteVelocity()`

## Parameters: {#Parameters:}

|               Name | Description | Units |           Default value |
| ------------------:| -----------:| -----:| -----------------------:|
| `resolve_in_frame` |             |     – | ResolveInFrame.FrameA() |

## Connectors {#Connectors}

* `frame_a` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `frame_resolve` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `v_x` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `v_y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

* `v_z` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Variables {#Variables}

| Name |                                   Description | Units |
| ----:| ---------------------------------------------:| -----:|
| `v0` | Absolute velocity resolved in the world frame |   m/s |
|  `v` |                                               |   m/s |

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{frame_a.f}\_{1}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{2}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{3}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{1}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{2}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{3}\left( t \right) &= 0 \\
\mathtt{v0}\_{1}\left( t \right) &= \frac{\mathrm{d}\mathtt{frame_a.r_0}\_{1}\left( t \right)}{\mathrm{d}t} \\
\mathtt{v0}\_{2}\left( t \right) &= \frac{\mathrm{d}\mathtt{frame_a.r_0}\_{2}\left( t \right)}{\mathrm{d}t} \\
\mathtt{v0}\_{3}\left( t \right) &= \frac{\mathrm{d}\mathtt{frame_a.r_0}\_{3}\left( t \right)}{\mathrm{d}t} \\
\mathtt{v_x}\left( t \right) &= v\_{1}\left( t \right) \\
\mathtt{v_y}\left( t \right) &= v\_{2}\left( t \right) \\
\mathtt{v_z}\left( t \right) &= v\_{3}\left( t \right) \\
v\_{1}\left( t \right) &= \mathtt{frame_a.R}\_{1,1}\left( t \right) ~ \mathtt{v0}\_{1}\left( t \right) + \mathtt{frame_a.R}\_{1,2}\left( t \right) ~ \mathtt{v0}\_{2}\left( t \right) + \mathtt{frame_a.R}\_{1,3}\left( t \right) ~ \mathtt{v0}\_{3}\left( t \right) \\
v\_{2}\left( t \right) &= \mathtt{frame_a.R}\_{2,1}\left( t \right) ~ \mathtt{v0}\_{1}\left( t \right) + \mathtt{frame_a.R}\_{2,2}\left( t \right) ~ \mathtt{v0}\_{2}\left( t \right) + \mathtt{frame_a.R}\_{2,3}\left( t \right) ~ \mathtt{v0}\_{3}\left( t \right) \\
v\_{3}\left( t \right) &= \mathtt{frame_a.R}\_{3,1}\left( t \right) ~ \mathtt{v0}\_{1}\left( t \right) + \mathtt{frame_a.R}\_{3,2}\left( t \right) ~ \mathtt{v0}\_{2}\left( t \right) + \mathtt{frame_a.R}\_{3,3}\left( t \right) ~ \mathtt{v0}\_{3}\left( t \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
Measures the absolute velocity of a frame connector's origin.

Always differentiates the position resolved in World first, then rotates the
result into `resolve_in_frame` -- matching Modelica's AbsoluteVelocity.

This is a sensor: no forces or torques are exerted.
"""
component AbsoluteVelocity
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_resolve = Frame3D() if case(resolve_in_frame, ResolveInFrame.FrameResolve) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  v_x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 140, "x2": 1060, "y2": 240, "rot": 0}
      },
      "tags": []
    }
  }
  v_y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  v_z = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 760, "x2": 1060, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.FrameA()
  "Absolute velocity resolved in the world frame"
  variable v0::Velocity[3]
  variable v::Velocity[3]
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
  if case(resolve_in_frame, ResolveInFrame.FrameResolve)
    frame_resolve.f = [0, 0, 0]
    frame_resolve.tau = [0, 0, 0]
  end
  v0 = der(frame_a.r_0)
  switch resolve_in_frame
    case World
      v = v0
    case FrameA
      v = resolve2(frame_a.R, v0)
    case FrameResolve
      v = resolve2(frame_resolve.R, v0)
  end
  [v_x, v_y, v_z] = v
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      },
      {"label": "abs vel", "x": 500, "y": 680, "rot": 0}
    ]
  }
}
end
```

```dyad
"""
Measures the absolute velocity of a frame connector's origin.

Always differentiates the position resolved in World first, then rotates the
result into `resolve_in_frame` -- matching Modelica's AbsoluteVelocity.

This is a sensor: no forces or torques are exerted.
"""
component AbsoluteVelocity
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_resolve = Frame3D() if case(resolve_in_frame, ResolveInFrame.FrameResolve) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  v_x = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 140, "x2": 1060, "y2": 240, "rot": 0}
      },
      "tags": []
    }
  }
  v_y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  v_z = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 760, "x2": 1060, "y2": 860, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.FrameA()
  "Absolute velocity resolved in the world frame"
  variable v0::Velocity[3]
  variable v::Velocity[3]
relations
  frame_a.f = [0, 0, 0]
  frame_a.tau = [0, 0, 0]
  if case(resolve_in_frame, ResolveInFrame.FrameResolve)
    frame_resolve.f = [0, 0, 0]
    frame_resolve.tau = [0, 0, 0]
  end
  v0 = der(frame_a.r_0)
  switch resolve_in_frame
    case World
      v = v0
    case FrameA
      v = resolve2(frame_a.R, v0)
    case FrameResolve
      v = resolve2(frame_resolve.R, v0)
  end
  [v_x, v_y, v_z] = v
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/OneFrameSensor.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      },
      {"label": "abs vel", "x": 500, "y": 680, "rot": 0}
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`CentrifugalTest`](AbsoluteVelocity.md)

  * [`SensorsTest`](AbsoluteVelocity.md)
