def set_potential_energy(self, scalar):
"""Used to set the potential energy of the Particle.
Parameters
==========
scalar : Sympifyable
The potential energy (a scalar) of the Particle.
Examples
========
>>> from sympy.physics.mechanics import Particle, Point
>>> from sympy import symbols
>>> m, g, h = symbols('m g h')
>>> O = Point('O')
>>> P = Particle('P', O, m)
>>> P.set_potential_energy(m * g * h)
"""
self._pe = sympify(scalar)
评论列表
文章目录