---
url: /dyad/stable/stdlib/MultibodyComponents/components/Kinematic5.md
description: Dyad Kinematic5 docs.  A component emitting a 5th order polynomial trajectory.
---

# `Kinematic5` {#Kinematic5}

A component emitting a 5th order polynomial trajectory.

`traj5` is a simple trajectory planner that plans a 5th order polynomial trajectory between two points, subject to specified boundary conditions on the position, velocity and acceleration.

The outputs are:

* `q`: Position

* `qd`: Velocity

* `qdd`: Acceleration

## Usage {#Usage}

`MultibodyComponents.Kinematic5(tf=1, q0=fill(0.0, nout), q1=fill(1.0, nout), qd0=fill(0.0, nout), qd1=fill(0.0, nout), qdd0=fill(0.0, nout), qdd1=fill(0.0, nout))`

## Parameters: {#Parameters:}

|   Name |                        Description | Units |   Default value |
| ------:| ----------------------------------:| -----:| ---------------:|
| `nout` |              Number of output axes |     – |               1 |
|   `tf` |      Final time for the trajectory |     – |               1 |
|   `q0` |     Initial position for each axis |     – | fill(0.0, nout) |
|   `q1` |       Final position for each axis |     – | fill(1.0, nout) |
|  `qd0` |     Initial velocity for each axis |     – | fill(0.0, nout) |
|  `qd1` |       Final velocity for each axis |     – | fill(0.0, nout) |
| `qdd0` | Initial acceleration for each axis |     – | fill(0.0, nout) |
| `qdd1` |   Final acceleration for each axis |     – | fill(0.0, nout) |

## Connectors {#Connectors}

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

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

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

## Behavior {#Behavior}

$$ \begin{align}
q\_{1}\left( t \right) &= \mathtt{q0}*{1} + t ~ \left( \mathtt{qd0}*{1} + t ~ \left( \frac{\mathtt{qdd0}*{1}}{2} + t ~ \left( \frac{ - 20 ~ \mathtt{q0}*{1} + 20 ~ \mathtt{q1}*{1} - \left( 12 ~ \mathtt{qd0}*{1} + 8 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} - \mathtt{tf}^{2} ~ \left( 3 ~ \mathtt{qdd0}*{1} - \mathtt{qdd1}*{1} \right)}{2 ~ \mathtt{tf}^{3}} + t ~ \left( \frac{30 ~ \mathtt{q0}*{1} - 30 ~ \mathtt{q1}*{1} + \left( 16 ~ \mathtt{qd0}*{1} + 14 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} + \mathtt{tf}^{2} ~ \left( 3 ~ \mathtt{qdd0}*{1} - 2 ~ \mathtt{qdd1}*{1} \right)}{2 ~ \mathtt{tf}^{4}} + \frac{\left(  - 12 ~ \mathtt{q0}*{1} + 12 ~ \mathtt{q1}*{1} - \left( 6 ~ \mathtt{qd0}*{1} + 6 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} - \mathtt{tf}^{2} ~ \left( \mathtt{qdd0}*{1} - \mathtt{qdd1}*{1} \right) \right) ~ t}{2 ~ \mathtt{tf}^{5}} \right) \right) \right) \right) \\
\mathtt{qd}\_{1}\left( t \right) &= \mathtt{qd0}*{1} + t ~ \left( \mathtt{qdd0}*{1} + t ~ \left( \frac{3 ~ \left(  - 20 ~ \mathtt{q0}*{1} + 20 ~ \mathtt{q1}*{1} - \left( 12 ~ \mathtt{qd0}*{1} + 8 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} - \mathtt{tf}^{2} ~ \left( 3 ~ \mathtt{qdd0}*{1} - \mathtt{qdd1}*{1} \right) \right)}{2 ~ \mathtt{tf}^{3}} + t ~ \left( \frac{2 ~ \left( 30 ~ \mathtt{q0}*{1} - 30 ~ \mathtt{q1}*{1} + \left( 16 ~ \mathtt{qd0}*{1} + 14 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} + \mathtt{tf}^{2} ~ \left( 3 ~ \mathtt{qdd0}*{1} - 2 ~ \mathtt{qdd1}*{1} \right) \right)}{\mathtt{tf}^{4}} + \frac{5 ~ \left(  - 12 ~ \mathtt{q0}*{1} + 12 ~ \mathtt{q1}*{1} - \left( 6 ~ \mathtt{qd0}*{1} + 6 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} - \mathtt{tf}^{2} ~ \left( \mathtt{qdd0}*{1} - \mathtt{qdd1}*{1} \right) \right) ~ t}{2 ~ \mathtt{tf}^{5}} \right) \right) \right) \\
\mathtt{qdd}\_{1}\left( t \right) &= \mathtt{qdd0}*{1} + t ~ \left( \frac{3 ~ \left(  - 20 ~ \mathtt{q0}*{1} + 20 ~ \mathtt{q1}*{1} - \left( 12 ~ \mathtt{qd0}*{1} + 8 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} - \mathtt{tf}^{2} ~ \left( 3 ~ \mathtt{qdd0}*{1} - \mathtt{qdd1}*{1} \right) \right)}{\mathtt{tf}^{3}} + t ~ \left( \frac{6 ~ \left( 30 ~ \mathtt{q0}*{1} - 30 ~ \mathtt{q1}*{1} + \left( 16 ~ \mathtt{qd0}*{1} + 14 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} + \mathtt{tf}^{2} ~ \left( 3 ~ \mathtt{qdd0}*{1} - 2 ~ \mathtt{qdd1}*{1} \right) \right)}{\mathtt{tf}^{4}} + \frac{10 ~ \left(  - 12 ~ \mathtt{q0}*{1} + 12 ~ \mathtt{q1}*{1} - \left( 6 ~ \mathtt{qd0}*{1} + 6 ~ \mathtt{qd1}*{1} \right) ~ \mathtt{tf} - \mathtt{tf}^{2} ~ \left( \mathtt{qdd0}*{1} - \mathtt{qdd1}*{1} \right) \right) ~ t}{\mathtt{tf}^{5}} \right) \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
A component emitting a 5th order polynomial trajectory.

`traj5` is a simple trajectory planner that plans a 5th order polynomial trajectory
between two points, subject to specified boundary conditions on the position, velocity
and acceleration.

The outputs are:
- `q`: Position
- `qd`: Velocity
- `qdd`: Acceleration
"""
component Kinematic5
  "Position output for each axis"
  q = [RealOutput() for i in 1:nout] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 150, "x2": 1060, "y2": 250, "rot": 0}
      },
      "tags": []
    }
  }
  "Velocity output for each axis"
  qd = [RealOutput() for i in 1:nout] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Acceleration output for each axis"
  qdd = [RealOutput() for i in 1:nout] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 750, "x2": 1060, "y2": 850, "rot": 0}
      },
      "tags": []
    }
  }
  "Number of output axes"
  structural parameter nout::Integer = 1
  "Final time for the trajectory"
  parameter tf::Real = 1
  "Initial position for each axis"
  parameter q0::Real[nout] = fill(0.0, nout)
  "Final position for each axis"
  parameter q1::Real[nout] = fill(1.0, nout)
  "Initial velocity for each axis"
  parameter qd0::Real[nout] = fill(0.0, nout)
  "Final velocity for each axis"
  parameter qd1::Real[nout] = fill(0.0, nout)
  "Initial acceleration for each axis"
  parameter qdd0::Real[nout] = fill(0.0, nout)
  "Final acceleration for each axis"
  parameter qdd1::Real[nout] = fill(0.0, nout)
  "Trajectory of all axes, planned once: positions, velocities and accelerations"
  structural variable traj::Native[3] = MultibodyComponents.traj5_trajectory(time, tf, q0, q1, qd0, qd1, qdd0, qdd1)
relations
  q = traj[1]
  qd = traj[2]
  qdd = traj[3]
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/Kinematic5.svg"}}}
end
```

```dyad
"""
A component emitting a 5th order polynomial trajectory.

`traj5` is a simple trajectory planner that plans a 5th order polynomial trajectory
between two points, subject to specified boundary conditions on the position, velocity
and acceleration.

The outputs are:
- `q`: Position
- `qd`: Velocity
- `qdd`: Acceleration
"""
component Kinematic5
  "Position output for each axis"
  q = [RealOutput() for i in 1:nout] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 150, "x2": 1060, "y2": 250, "rot": 0}
      },
      "tags": []
    }
  }
  "Velocity output for each axis"
  qd = [RealOutput() for i in 1:nout] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Acceleration output for each axis"
  qdd = [RealOutput() for i in 1:nout] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 960, "y1": 750, "x2": 1060, "y2": 850, "rot": 0}
      },
      "tags": []
    }
  }
  "Number of output axes"
  structural parameter nout::Integer = 1
  "Final time for the trajectory"
  parameter tf::Real = 1
  "Initial position for each axis"
  parameter q0::Real[nout] = fill(0.0, nout)
  "Final position for each axis"
  parameter q1::Real[nout] = fill(1.0, nout)
  "Initial velocity for each axis"
  parameter qd0::Real[nout] = fill(0.0, nout)
  "Final velocity for each axis"
  parameter qd1::Real[nout] = fill(0.0, nout)
  "Initial acceleration for each axis"
  parameter qdd0::Real[nout] = fill(0.0, nout)
  "Final acceleration for each axis"
  parameter qdd1::Real[nout] = fill(0.0, nout)
  "Trajectory of all axes, planned once: positions, velocities and accelerations"
  structural variable traj::Native[3] = MultibodyComponents.traj5_trajectory(time, tf, q0, q1, qd0, qd1, qdd0, qdd1)
relations
  q = traj[1]
  qd = traj[2]
  qdd = traj[3]
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/Kinematic5.svg"}}}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
