---
url: /dyad/dev/stdlib/MultibodyComponents/components/PrescribedPosition.md
description: >-
  Dyad PrescribedPosition docs.  Prescribed position of frame_b via input
  connectors.
---

# `PrescribedPosition` {#PrescribedPosition}

Prescribed position of `frame_b` via input connectors.

The position of `frame_b` is driven by the three real inputs `r_x`, `r_y`, `r_z`, resolved in the world frame.

When `fixed_orientation` is true, the orientation is locked to the identity (world frame). When false, no orientation constraint is imposed and no torque is applied — orientation must be determined by connected components.

## Usage {#Usage}

`MultibodyComponents.PrescribedPosition(render=true)`

## Parameters: {#Parameters:}

|                Name |                        Description | Units | Default value |
| -------------------:| ----------------------------------:| -----:| -------------:|
| `fixed_orientation` |                                    |     – |          true |
|            `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))

## 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) &= 1 \\
\mathtt{frame_b.R}\_{2,1}\left( t \right) &= 0 \\
\mathtt{frame_b.R}\_{3,1}\left( t \right) &= 0 \\
\mathtt{frame_b.R}\_{1,2}\left( t \right) &= 0 \\
\mathtt{frame_b.R}\_{2,2}\left( t \right) &= 1 \\
\mathtt{frame_b.R}\_{3,2}\left( t \right) &= 0 \\
\mathtt{frame_b.R}\_{1,3}\left( t \right) &= 0 \\
\mathtt{frame_b.R}\_{2,3}\left( t \right) &= 0 \\
\mathtt{frame_b.R}\_{3,3}\left( t \right) &= 1
\end{align}
$$

## Source {#Source}

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

The position of `frame_b` is driven by the three real inputs `r_x`, `r_y`, `r_z`,
resolved in the world frame.

When `fixed_orientation` is true, the orientation is locked to the identity
(world frame). When false, no orientation constraint is imposed and no
torque is applied — orientation must be determined by connected components.
"""
component PrescribedPosition
  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": 100, "x2": 50, "y2": 200, "rot": 0}
      },
      "tags": []
    }
  }
  r_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 780, "x2": 50, "y2": 880, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_orientation::Boolean = true
  "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)
  if fixed_orientation
    frame_b.R = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
  else
    frame_b.tau = [0, 0, 0]
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedPosition.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

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

The position of `frame_b` is driven by the three real inputs `r_x`, `r_y`, `r_z`,
resolved in the world frame.

When `fixed_orientation` is true, the orientation is locked to the identity
(world frame). When false, no orientation constraint is imposed and no
torque is applied — orientation must be determined by connected components.
"""
component PrescribedPosition
  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": 100, "x2": 50, "y2": 200, "rot": 0}
      },
      "tags": []
    }
  }
  r_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  r_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 780, "x2": 50, "y2": 880, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_orientation::Boolean = true
  "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)
  if fixed_orientation
    frame_b.R = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
  else
    frame_b.tau = [0, 0, 0]
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedPosition.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
  * [`PrescribedPositionTest`](PrescribedPosition.md)
