---
url: /dyad/stable/stdlib/MultibodyComponents/tests/PlanarMechanics.BodyShapePendulumTest.md
description: >-
  Dyad PlanarMechanics.BodyShapePendulumTest docs.  Pendulum with BodyShape:
  Fixed -> Revolute -> BodyShape.
---

# `PlanarMechanics.BodyShapePendulumTest` {#PlanarMechanics.BodyShapePendulumTest}

Pendulum with BodyShape: Fixed -> Revolute -> BodyShape.

A 1m BodyShape pendulum starting at rest, swinging under gravity. Translates the "Pendulum with body shape" test from test_PlanarMechanics.jl.

## Usage {#Usage}

`MultibodyComponents.PlanarMechanics.BodyShapePendulumTest()`

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
Pendulum with BodyShape: Fixed -> Revolute -> BodyShape.

A 1m BodyShape pendulum starting at rest, swinging under gravity.
Translates the "Pendulum with body shape" test from test_PlanarMechanics.jl.
"""
test component BodyShapePendulumTest
  world = World() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 220, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  revolute = Revolute(phi(initial = 0.0), w(initial = 0.0)) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 280, "y1": 20, "x2": 480, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  rod = BodyShape(r = [1.0, 0.0], m = 1.0, I = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 540, "y1": 20, "x2": 740, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(world.frame_b, revolute.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(revolute.frame_b, rod.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {"Dyad": {"tests": {"case1": {"stop": 3}}}}
end
```

```dyad
"""
Pendulum with BodyShape: Fixed -> Revolute -> BodyShape.

A 1m BodyShape pendulum starting at rest, swinging under gravity.
Translates the "Pendulum with body shape" test from test_PlanarMechanics.jl.
"""
test component BodyShapePendulumTest
  world = World() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 220, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  revolute = Revolute(phi(initial = 0.0), w(initial = 0.0)) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 280, "y1": 20, "x2": 480, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  rod = BodyShape(r = [1.0, 0.0], m = 1.0, I = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 540, "y1": 20, "x2": 740, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(world.frame_b, revolute.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(revolute.frame_b, rod.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {"Dyad": {"tests": {"case1": {"stop": 3}}}}
end
```

## Test Cases {#Test-Cases}

### Test Case `case1` {#Test-Case-case1}

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`BodyShape`](PlanarMechanics.BodyShapePendulumTest.md)

  * [`Revolute`](PlanarMechanics.BodyShapePendulumTest.md)

  * [`World`](PlanarMechanics.BodyShapePendulumTest.md)
