---
url: /dyad/stable/stdlib/MultibodyComponents/components/examples.OpenLoopCartpole.md
description: >-
  Dyad examples.OpenLoopCartpole docs.  Cartpole mounted in a world, with the
  force input exposed as a top-level variable for linearization and control
  design.
---

# `examples.OpenLoopCartpole` {#examples.OpenLoopCartpole}

Cartpole mounted in a world, with the force input exposed as a top-level variable for linearization and control design.

## Usage {#Usage}

`MultibodyComponents.examples.OpenLoopCartpole()`

## Variables {#Variables}

|  Name |                                      Description | Units |
| -----:| ------------------------------------------------:| -----:|
|   `x` |                                    Cart position |     m |
|   `v` |                                    Cart velocity |   m/s |
| `phi` | Pendulum angle, zero when the pendulum points up |   rad |
|   `w` |                        Pendulum angular velocity | rad/s |

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
Cartpole mounted in a world, with the force input exposed as a top-level
variable for linearization and control design.
"""
component OpenLoopCartpole
  world = MultibodyComponents.World()
  cartpole = Cartpole()
  "Cart position"
  variable x::Length
  "Cart velocity"
  variable v::Velocity
  "Pendulum angle, zero when the pendulum points up"
  variable phi::Angle
  "Pendulum angular velocity"
  variable w::AngularVelocity
relations
  x = cartpole.x
  v = cartpole.v
  phi = cartpole.phi
  w = cartpole.w
end
```

```dyad
"""
Cartpole mounted in a world, with the force input exposed as a top-level
variable for linearization and control design.
"""
component OpenLoopCartpole
  world = MultibodyComponents.World()
  cartpole = Cartpole()
  "Cart position"
  variable x::Length
  "Cart velocity"
  variable v::Velocity
  "Pendulum angle, zero when the pendulum points up"
  variable phi::Angle
  "Pendulum angular velocity"
  variable w::AngularVelocity
relations
  x = cartpole.x
  v = cartpole.v
  phi = cartpole.phi
  w = cartpole.w
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
