Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# sympy.physics.mechanics.RigidBody.set_potential_energy

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
```Used to set the potential energy of this RigidBody.

Parameters
==========

scalar: Sympifyable
The potential energy (a scalar) of the RigidBody.

Examples
========(more...)
```

```    P.set_pos(O, r * b.y)
assert B.angular_momentum(O, N) == omega * b.x - M*v*r*b.z
B.set_potential_energy(M * g * h)
assert B.potential_energy == M * g * h
assert B.kinetic_energy(N) == (omega**2 + M * v**2) / 2
```

```    # and potential energies, T and U, respectively. L is defined as the
# difference between T and U.
D.set_potential_energy(m * g * (l - y) * sin(alpha))
L = Lagrangian(N, D)

```
```    # Finally we form the equations of motion, using the same steps we did
# before. Supply the Lagrangian, the generalized speeds.
BodyD.set_potential_energy(- m * g * r * cos(q2))
Lag = Lagrangian(N, BodyD)
q = [q1, q2, q3]
```

```    A = RigidBody('A', Ac, a, M, (I, Ac))