---
url: /dyad/stable/stdlib/MultibodyComponents/components/PrescribedPose.md
description: >-
  Dyad PrescribedPose docs.  Prescribed position and orientation of frame_b via
  input connectors.
---

# `PrescribedPose` {#PrescribedPose}

Prescribed position and orientation of `frame_b` via input connectors.

Position is driven by `r_x`, `r_y`, `r_z` (world frame). Orientation is driven by quaternion inputs `q_w`, `q_x`, `q_y`, `q_z` (scalar-first convention: \[w, i, j, k]).

## Usage {#Usage}

`MultibodyComponents.PrescribedPose(render=true)`

## Parameters: {#Parameters:}

|     Name |                        Description | Units | Default value |
| --------:| ----------------------------------:| -----:| -------------:|
| `render` | Render the component in animations |     – |          true |

## Connectors {#Connectors}

* `frame_b` - 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))

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

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

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

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

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

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

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

## Variables {#Variables}

| Name |                                                          Description | Units |
| ----:| --------------------------------------------------------------------:| -----:|
|  `r` | Position vector from world frame to frame_b, resolved in world frame |     m |
|  `v` |                Absolute velocity of frame_b, resolved in world frame |   m/s |
|  `a` |            Absolute acceleration of frame_b, resolved in world frame |  m/s2 |

## Behavior {#Behavior}

$$ \begin{align}
r\_{1}\left( t \right) &= \mathtt{r_x}\left( t \right) \\
r\_{2}\left( t \right) &= \mathtt{r_y}\left( t \right) \\
r\_{3}\left( t \right) &= \mathtt{r_z}\left( t \right) \\
\mathtt{frame_b.r_0}\_{1}\left( t \right) &= r\_{1}\left( t \right) \\
\mathtt{frame_b.r_0}\_{2}\left( t \right) &= r\_{2}\left( t \right) \\
\mathtt{frame_b.r_0}\_{3}\left( t \right) &= r\_{3}\left( t \right) \\
v\_{1}\left( t \right) &= \frac{\mathrm{d}r\_{1}\left( t \right)}{\mathrm{d}t} \\
v\_{2}\left( t \right) &= \frac{\mathrm{d}r\_{2}\left( t \right)}{\mathrm{d}t} \\
v\_{3}\left( t \right) &= \frac{\mathrm{d}r\_{3}\left( t \right)}{\mathrm{d}t} \\
a\_{1}\left( t \right) &= \frac{\mathrm{d}v\_{1}\left( t \right)}{\mathrm{d}t} \\
a\_{2}\left( t \right) &= \frac{\mathrm{d}v\_{2}\left( t \right)}{\mathrm{d}t} \\
a\_{3}\left( t \right) &= \frac{\mathrm{d}v\_{3}\left( t \right)}{\mathrm{d}t} \\
\mathtt{frame_b.R}\_{1,1}\left( t \right) &= \left( \mathtt{q_w}\left( t \right) \right)^{2} + \left( \mathtt{q_x}\left( t \right) \right)^{2} - \left( \mathtt{q_y}\left( t \right) \right)^{2} - \left( \mathtt{q_z}\left( t \right) \right)^{2} \\
\mathtt{frame_b.R}\_{2,1}\left( t \right) &= 2 ~ \left(  - \mathtt{q_w}\left( t \right) ~ \mathtt{q_z}\left( t \right) + \mathtt{q_x}\left( t \right) ~ \mathtt{q_y}\left( t \right) \right) \\
\mathtt{frame_b.R}\_{3,1}\left( t \right) &= 2 ~ \left( \mathtt{q_w}\left( t \right) ~ \mathtt{q_y}\left( t \right) + \mathtt{q_x}\left( t \right) ~ \mathtt{q_z}\left( t \right) \right) \\
\mathtt{frame_b.R}\_{1,2}\left( t \right) &= 2 ~ \left( \mathtt{q_w}\left( t \right) ~ \mathtt{q_z}\left( t \right) + \mathtt{q_x}\left( t \right) ~ \mathtt{q_y}\left( t \right) \right) \\
\mathtt{frame_b.R}\_{2,2}\left( t \right) &= \left( \mathtt{q_w}\left( t \right) \right)^{2} - \left( \mathtt{q_x}\left( t \right) \right)^{2} + \left( \mathtt{q_y}\left( t \right) \right)^{2} - \left( \mathtt{q_z}\left( t \right) \right)^{2} \\
\mathtt{frame_b.R}\_{3,2}\left( t \right) &= 2 ~ \left(  - \mathtt{q_w}\left( t \right) ~ \mathtt{q_x}\left( t \right) + \mathtt{q_y}\left( t \right) ~ \mathtt{q_z}\left( t \right) \right) \\
\mathtt{frame_b.R}\_{1,3}\left( t \right) &= 2 ~ \left(  - \mathtt{q_w}\left( t \right) ~ \mathtt{q_y}\left( t \right) + \mathtt{q_x}\left( t \right) ~ \mathtt{q_z}\left( t \right) \right) \\
\mathtt{frame_b.R}\_{2,3}\left( t \right) &= 2 ~ \left( \mathtt{q_w}\left( t \right) ~ \mathtt{q_x}\left( t \right) + \mathtt{q_y}\left( t \right) ~ \mathtt{q_z}\left( t \right) \right) \\
\mathtt{frame_b.R}\_{3,3}\left( t \right) &= \left( \mathtt{q_w}\left( t \right) \right)^{2} - \left( \mathtt{q_x}\left( t \right) \right)^{2} - \left( \mathtt{q_y}\left( t \right) \right)^{2} + \left( \mathtt{q_z}\left( t \right) \right)^{2}
\end{align}
$$

## Source {#Source}

```dyad
"""
Prescribed position and orientation of `frame_b` via input connectors.

Position is driven by `r_x`, `r_y`, `r_z` (world frame).
Orientation is driven by quaternion inputs `q_w`, `q_x`, `q_y`, `q_z`
(scalar-first convention: [w, i, j, k]).
"""
component PrescribedPose
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 50, "x2": 50, "y2": 150, "rot": 0}
      },
      "tags": []
    }
  }
  r_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 230, "x2": 50, "y2": 330, "rot": 0}
      },
      "tags": []
    }
  }
  r_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 410, "x2": 50, "y2": 510, "rot": 0}
      },
      "tags": []
    }
  }
  q_w = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 570, "x2": 50, "y2": 670, "rot": 0}
      },
      "tags": []
    }
  }
  q_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 630, "x2": 50, "y2": 730, "rot": 0}
      },
      "tags": []
    }
  }
  q_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 690, "x2": 50, "y2": 790, "rot": 0}
      },
      "tags": []
    }
  }
  q_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 750, "x2": 50, "y2": 850, "rot": 0}
      },
      "tags": []
    }
  }
  "Render the component in animations"
  parameter render::Boolean = true
  "Position vector from world frame to frame_b, resolved in world frame"
  variable r::Position[3]
  "Absolute velocity of frame_b, resolved in world frame"
  variable v::Velocity[3]
  "Absolute acceleration of frame_b, resolved in world frame"
  variable a::Acceleration[3]
relations
  r = [r_x, r_y, r_z]
  frame_b.r_0 = r
  v = der(r)
  a = der(v)
  frame_b.R = from_Q([q_w, q_x, q_y, q_z])
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedPose.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

```dyad
"""
Prescribed position and orientation of `frame_b` via input connectors.

Position is driven by `r_x`, `r_y`, `r_z` (world frame).
Orientation is driven by quaternion inputs `q_w`, `q_x`, `q_y`, `q_z`
(scalar-first convention: [w, i, j, k]).
"""
component PrescribedPose
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 50, "x2": 50, "y2": 150, "rot": 0}
      },
      "tags": []
    }
  }
  r_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 230, "x2": 50, "y2": 330, "rot": 0}
      },
      "tags": []
    }
  }
  r_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 410, "x2": 50, "y2": 510, "rot": 0}
      },
      "tags": []
    }
  }
  q_w = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 570, "x2": 50, "y2": 670, "rot": 0}
      },
      "tags": []
    }
  }
  q_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 630, "x2": 50, "y2": 730, "rot": 0}
      },
      "tags": []
    }
  }
  q_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 690, "x2": 50, "y2": 790, "rot": 0}
      },
      "tags": []
    }
  }
  q_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 750, "x2": 50, "y2": 850, "rot": 0}
      },
      "tags": []
    }
  }
  "Render the component in animations"
  parameter render::Boolean = true
  "Position vector from world frame to frame_b, resolved in world frame"
  variable r::Position[3]
  "Absolute velocity of frame_b, resolved in world frame"
  variable v::Velocity[3]
  "Absolute acceleration of frame_b, resolved in world frame"
  variable a::Acceleration[3]
relations
  r = [r_x, r_y, r_z]
  frame_b.r_0 = r
  v = der(r)
  a = der(v)
  frame_b.R = from_Q([q_w, q_x, q_y, q_z])
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedPose.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`PlanarToMultiBodyEmbeddedTest`](PrescribedPose.md)

  * [`PlanarToMultiBodyKinematicTest`](PrescribedPose.md)

  * [`PrescribedPoseTest`](PrescribedPose.md)
