---
url: /dyad/dev/stdlib/MultibodyComponents/components/Force.md
description: >-
  Dyad Force docs.  Force acting between two frames, defined by 3 input signals
  resolved in the frame specified by resolve_in_frame.
---

# `Force` {#Force}

Force acting between two frames, defined by 3 input signals resolved in the frame specified by `resolve_in_frame`.

The force acts at the origin of `frame_b` with the reaction at `frame_a`. No torque is transmitted at `frame_b`; the torque at `frame_a` includes the lever-arm contribution from the relative position.

This component extends from [`PartialTwoFrames`](../types/PartialTwoFrames.md)

## Usage {#Usage}

`MultibodyComponents.Force()`

## Parameters: {#Parameters:}

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

## 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_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))

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

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

* `force_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_0` | Position vector from frame_a to frame_b in world frame |     m |
| `f_b_0` |               Force at frame_b resolved in world frame |     N |

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{r_0}\_{1}\left( t \right) &=  - \mathtt{frame_a.r_0}\_{1}\left( t \right) + \mathtt{frame_b.r_0}\_{1}\left( t \right) \\
\mathtt{r_0}\_{2}\left( t \right) &=  - \mathtt{frame_a.r_0}\_{2}\left( t \right) + \mathtt{frame_b.r_0}\_{2}\left( t \right) \\
\mathtt{r_0}\_{3}\left( t \right) &=  - \mathtt{frame_a.r_0}\_{3}\left( t \right) + \mathtt{frame_b.r_0}\_{3}\left( t \right) \\
\mathtt{frame_b.tau}\_{1}\left( t \right) &= 0 \\
\mathtt{frame_b.tau}\_{2}\left( t \right) &= 0 \\
\mathtt{frame_b.tau}\_{3}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{1}\left( t \right) + \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{frame_a.R}\_{1,1}\left( t \right) + \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{frame_a.R}\_{1,2}\left( t \right) + \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{frame_a.R}\_{1,3}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{2}\left( t \right) + \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{frame_a.R}\_{2,1}\left( t \right) + \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{frame_a.R}\_{2,2}\left( t \right) + \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{frame_a.R}\_{2,3}\left( t \right) &= 0 \\
\mathtt{frame_a.f}\_{3}\left( t \right) + \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{frame_a.R}\_{3,1}\left( t \right) + \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{frame_a.R}\_{3,2}\left( t \right) + \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{frame_a.R}\_{3,3}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{1}\left( t \right) + \left( \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{r_0}\_{3}\left( t \right) - \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{r_0}\_{1}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{1,2}\left( t \right) + \left(  - \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{r_0}\_{2}\left( t \right) + \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{r_0}\_{1}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{1,3}\left( t \right) + \left(  - \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{r_0}\_{3}\left( t \right) + \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{r_0}\_{2}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{1,1}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{2}\left( t \right) + \left( \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{r_0}\_{3}\left( t \right) - \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{r_0}\_{1}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{2,2}\left( t \right) + \left(  - \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{r_0}\_{2}\left( t \right) + \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{r_0}\_{1}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{2,3}\left( t \right) + \left(  - \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{r_0}\_{3}\left( t \right) + \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{r_0}\_{2}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{2,1}\left( t \right) &= 0 \\
\mathtt{frame_a.tau}\_{3}\left( t \right) + \left( \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{r_0}\_{3}\left( t \right) - \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{r_0}\_{1}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{3,2}\left( t \right) + \left(  - \mathtt{f_b_0}\_{1}\left( t \right) ~ \mathtt{r_0}\_{2}\left( t \right) + \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{r_0}\_{1}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{3,3}\left( t \right) + \left(  - \mathtt{f_b_0}\_{2}\left( t \right) ~ \mathtt{r_0}\_{3}\left( t \right) + \mathtt{f_b_0}\_{3}\left( t \right) ~ \mathtt{r_0}\_{2}\left( t \right) \right) ~ \mathtt{frame_a.R}\_{3,1}\left( t \right) &= 0 \\
\mathtt{f_b_0}\_{1}\left( t \right) &=  - \mathtt{force_x}\left( t \right) ~ \mathtt{frame_b.R}\_{1,1}\left( t \right) - \mathtt{force_y}\left( t \right) ~ \mathtt{frame_b.R}\_{2,1}\left( t \right) - \mathtt{force_z}\left( t \right) ~ \mathtt{frame_b.R}\_{3,1}\left( t \right) \\
\mathtt{f_b_0}\_{2}\left( t \right) &=  - \mathtt{force_x}\left( t \right) ~ \mathtt{frame_b.R}\_{1,2}\left( t \right) - \mathtt{force_y}\left( t \right) ~ \mathtt{frame_b.R}\_{2,2}\left( t \right) - \mathtt{force_z}\left( t \right) ~ \mathtt{frame_b.R}\_{3,2}\left( t \right) \\
\mathtt{f_b_0}\_{3}\left( t \right) &=  - \mathtt{force_x}\left( t \right) ~ \mathtt{frame_b.R}\_{1,3}\left( t \right) - \mathtt{force_y}\left( t \right) ~ \mathtt{frame_b.R}\_{2,3}\left( t \right) - \mathtt{force_z}\left( t \right) ~ \mathtt{frame_b.R}\_{3,3}\left( t \right) \\
\mathtt{frame_b.f}\_{1}\left( t \right) &=  - \mathtt{force_x}\left( t \right) \\
\mathtt{frame_b.f}\_{2}\left( t \right) &=  - \mathtt{force_y}\left( t \right) \\
\mathtt{frame_b.f}\_{3}\left( t \right) &=  - \mathtt{force_z}\left( t \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
Force acting between two frames, defined by 3 input signals resolved in
the frame specified by `resolve_in_frame`.

The force acts at the origin of `frame_b` with the reaction at `frame_a`.
No torque is transmitted at `frame_b`; the torque at `frame_a` includes
the lever-arm contribution from the relative position.
"""
component Force
  extends PartialTwoFrames
  force_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 90, "y1": -50, "x2": 190, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 810, "y1": -50, "x2": 910, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.FrameB()
  "Position vector from frame_a to frame_b in world frame"
  variable r_0::Position[3]
  "Force at frame_b resolved in world frame"
  variable f_b_0::Dyad.Force[3]
relations
  r_0 = frame_b.r_0 - frame_a.r_0
  frame_b.tau = [0, 0, 0]
  # Force and torque balance at frame_a
  frame_a.f + resolve2(frame_a.R, f_b_0) = [0, 0, 0]
  frame_a.tau + resolve2(frame_a.R, cross(r_0, f_b_0)) = [0, 0, 0]
  switch resolve_in_frame
    case FrameA
      f_b_0 = -resolve1(frame_a.R, [force_x, force_y, force_z])
      frame_b.f = resolve2(frame_b.R, f_b_0)
    case FrameB
      f_b_0 = -resolve1(frame_b.R, [force_x, force_y, force_z])
      frame_b.f = -[force_x, force_y, force_z]
    case World
      f_b_0 = -[force_x, force_y, force_z]
      frame_b.f = resolve2(frame_b.R, f_b_0)
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Force.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 200,
        "rot": 0,
        "attrs": {"font-size": "140"}
      }
    ]
  }
}
end
```

```dyad
"""
Force acting between two frames, defined by 3 input signals resolved in
the frame specified by `resolve_in_frame`.

The force acts at the origin of `frame_b` with the reaction at `frame_a`.
No torque is transmitted at `frame_b`; the torque at `frame_a` includes
the lever-arm contribution from the relative position.
"""
component Force
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  force_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 90, "y1": -50, "x2": 190, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 810, "y1": -50, "x2": 910, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.FrameB()
  "Position vector from frame_a to frame_b in world frame"
  variable r_0::Position[3]
  "Force at frame_b resolved in world frame"
  variable f_b_0::Dyad.Force[3]
relations
  r_0 = frame_b.r_0 - frame_a.r_0
  frame_b.tau = [0, 0, 0]
  # Force and torque balance at frame_a
  frame_a.f + resolve2(frame_a.R, f_b_0) = [0, 0, 0]
  frame_a.tau + resolve2(frame_a.R, cross(r_0, f_b_0)) = [0, 0, 0]
  switch resolve_in_frame
    case FrameA
      f_b_0 = -resolve1(frame_a.R, [force_x, force_y, force_z])
      frame_b.f = resolve2(frame_b.R, f_b_0)
    case FrameB
      f_b_0 = -resolve1(frame_b.R, [force_x, force_y, force_z])
      frame_b.f = -[force_x, force_y, force_z]
    case World
      f_b_0 = -[force_x, force_y, force_z]
      frame_b.f = resolve2(frame_b.R, f_b_0)
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Force.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 200,
        "rot": 0,
        "attrs": {"font-size": "140"}
      }
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
