relativistic_energy¶

plasmapy.formulary.
relativistic_energy
(m: Unit("kg"), v: Unit("m / s")) > Unit("J")¶ Calculate the relativistic energy (in Joules) of an object of mass
m
and velocityv
.\[E = \gamma m c^{2}\]where \(\gamma\) is the
Lorentz_factor
.Parameters: Returns: The relativistic energy (in Joules) of an object of mass
m
moving at velocityv
.Return type: Quantity
Raises: TypeError
– If input arguments are not instancesQuantity
or convertible to aQuantity
.UnitConversionError
– If thev
is not in appropriate units.ValueError
– If the magnitude ofm
is negative or arguments are complex.RelativityError
– If the velocityv
is greater than the speed of light.
Warns: UnitsWarning
– If units are not provided, SI units are assumed.Examples
>>> from astropy import units as u >>> velocity = 1.4e8 * u.m / u.s >>> mass = 1 * u.kg >>> relativistic_energy(mass, velocity) <Quantity 1.01638929e+17 J> >>> relativistic_energy(mass, 299792458*u.m / u.s) <Quantity inf J> >>> relativistic_energy(1 * u.mg, 1.4e8 * u.m / u.s) <Quantity 1.01638929e+11 J> >>> relativistic_energy(mass, velocity) Traceback (most recent call last): ... ValueError: The argument 'm' to function relativistic_energy() can not contain negative numbers.