---
url: /dyad/stable/stdlib/MultibodyComponents/components/PlanarMechanics.PrescribedAcceleration.md
description: >-
  Dyad PlanarMechanics.PrescribedAcceleration docs.  Prescribed acceleration of
  frame_b via input connectors.
---

# `PlanarMechanics.PrescribedAcceleration` {#PlanarMechanics.PrescribedAcceleration}

Prescribed acceleration of `frame_b` via input connectors.

The absolute acceleration of `frame_b` is driven by the two real inputs `a_x`, `a_y`, resolved in the planar world frame. Velocity and position are obtained by integrating the acceleration inputs, starting from `v_start` and `r_start` respectively.

When `fixed_orientation` is true, the rotation angle is locked to zero. When false, no orientation constraint is imposed and no torque is applied — the orientation must be determined by connected components.

## Usage {#Usage}

`MultibodyComponents.PlanarMechanics.PrescribedAcceleration(r_start=[0, 0], v_start=[0, 0])`

## Parameters: {#Parameters:}

|                Name |                                                                  Description | Units | Default value |
| -------------------:| ----------------------------------------------------------------------------:| -----:| -------------:|
| `fixed_orientation` |                                                                              |     – |          true |
|     `statePriority` |                                                                              |     – |             2 |
|           `r_start` | Initial position vector from world frame to frame_b, resolved in world frame |     m |        \[0, 0] |
|           `v_start` |                Initial absolute velocity of frame_b, resolved in world frame |   m/s |        \[0, 0] |

## Connectors {#Connectors}

* `frame_b` - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. ([`Frame2D`](/stdlib/Dyad/connectors/Frame2D#Frame2D))

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

* `a_y` - 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}
a\_{1}\left( t \right) &= \mathtt{a_x}\left( t \right) \\
a\_{2}\left( t \right) &= \mathtt{a_y}\left( t \right) \\
\mathtt{frame_b.x}\left( t \right) &= r\_{1}\left( t \right) \\
\mathtt{frame_b.y}\left( t \right) &= r\_{2}\left( t \right) \\
\frac{\mathrm{d}r\_{1}\left( t \right)}{\mathrm{d}t} &= v\_{1}\left( t \right) \\
\frac{\mathrm{d}r\_{2}\left( t \right)}{\mathrm{d}t} &= v\_{2}\left( t \right) \\
\frac{\mathrm{d}v\_{1}\left( t \right)}{\mathrm{d}t} &= a\_{1}\left( t \right) \\
\frac{\mathrm{d}v\_{2}\left( t \right)}{\mathrm{d}t} &= a\_{2}\left( t \right) \\
\mathtt{frame_b.phi}\left( t \right) &= 0
\end{align}
$$

## Source {#Source}

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

The absolute acceleration of `frame_b` is driven by the two real inputs `a_x`, `a_y`,
resolved in the planar world frame. Velocity and position are obtained by integrating
the acceleration inputs, starting from `v_start` and `r_start` respectively.

When `fixed_orientation` is true, the rotation angle is locked to zero.
When false, no orientation constraint is imposed and no torque is applied —
the orientation must be determined by connected components.
"""
component PrescribedAcceleration
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  a_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 250, "x2": 50, "y2": 350, "rot": 0}
      },
      "tags": []
    }
  }
  a_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 650, "x2": 50, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_orientation::Boolean = true
  structural parameter statePriority::Integer = 2 # Higher than plain body variables so that the initialized, prescribed variables become the selected states
  "Initial position vector from world frame to frame_b, resolved in world frame"
  parameter r_start::Position[2] = [0, 0]
  "Initial absolute velocity of frame_b, resolved in world frame"
  parameter v_start::Velocity[2] = [0, 0]
  "Position vector from world frame to frame_b, resolved in world frame"
  variable r::Position(statePriority = statePriority, initial = r_start)[2]
  "Absolute velocity of frame_b, resolved in world frame"
  variable v::Velocity(statePriority = statePriority, initial = v_start)[2]
  "Absolute acceleration of frame_b, resolved in world frame"
  variable a::Acceleration[2]
relations
  a = [a_x, a_y]
  frame_b.x = r[1]
  frame_b.y = r[2]
  der(r) = v
  der(v) = a
  if fixed_orientation
    frame_b.phi = 0
  else
    frame_b.tau = 0
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedAcceleration.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

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

The absolute acceleration of `frame_b` is driven by the two real inputs `a_x`, `a_y`,
resolved in the planar world frame. Velocity and position are obtained by integrating
the acceleration inputs, starting from `v_start` and `r_start` respectively.

When `fixed_orientation` is true, the rotation angle is locked to zero.
When false, no orientation constraint is imposed and no torque is applied —
the orientation must be determined by connected components.
"""
component PrescribedAcceleration
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 900, "y1": 450, "x2": 1000, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  a_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 250, "x2": 50, "y2": 350, "rot": 0}
      },
      "tags": []
    }
  }
  a_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 650, "x2": 50, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_orientation::Boolean = true
  structural parameter statePriority::Integer = 2 # Higher than plain body variables so that the initialized, prescribed variables become the selected states
  "Initial position vector from world frame to frame_b, resolved in world frame"
  parameter r_start::Position[2] = [0, 0]
  "Initial absolute velocity of frame_b, resolved in world frame"
  parameter v_start::Velocity[2] = [0, 0]
  "Position vector from world frame to frame_b, resolved in world frame"
  variable r::Position(statePriority = statePriority, initial = r_start)[2]
  "Absolute velocity of frame_b, resolved in world frame"
  variable v::Velocity(statePriority = statePriority, initial = v_start)[2]
  "Absolute acceleration of frame_b, resolved in world frame"
  variable a::Acceleration[2]
relations
  a = [a_x, a_y]
  frame_b.x = r[1]
  frame_b.y = r[2]
  der(r) = v
  der(v) = a
  if fixed_orientation
    frame_b.phi = 0
  else
    frame_b.tau = 0
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PrescribedAcceleration.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
  * [`PrescribedAccelerationTest`](PlanarMechanics.PrescribedAcceleration.md)
