(Inherits from Potential)
| Parameters: |
|
|---|
Gravity implements a basic constant acceleration gravity (\(F = m\vec{g}\)).
| Calculation | Implemented |
|---|---|
| V | Y |
| V_dq | Y |
| V_dqdq | Y |
| V_dqdqdq | Y |
Adding gravity to a system is as easy as declaring an instance of Gravity:
>>> system = build_custom_system()
>>> trep.potentials.Gravity(system)
<Gravity 0.000000 0.000000 -9.800000>
The System saves a reference to the new Gravity, so we do not have to save a refence to prevent it from being garbage collected.
The default gravity points in the negative Z direction. We can specify a new gravity vector when we add the gravity. For example, we can make gravity point in the positive Y direction:
>>> system = build_custom_system()
>>> trep.potentials.Gravity(system, (0, 9.8, 0))
<Gravity 0.000000 9.800000 0.000000>