relativistic_energy
- plasmapy.formulary.relativity.relativistic_energy(m: Unit('kg'), v: Unit('m / s'))
Calculate the relativistic energy (in joules) of an object of mass
m
and velocityv
.\[E = γ m c^2\]where \(γ\) is the
Lorentz_factor
. This function returns the sum of the mass energy and the kinetic energy.- Parameters
- Returns
The relativistic energy (in joules) of an object of mass
m
moving at velocityv
.- Return type
- Raises
TypeError – If input arguments are not instances
Quantity
or convertible to aQuantity
.UnitConversionError – If the
v
is not in appropriate units.ValueError – If the magnitude of
m
is negative or arguments are complex.RelativityError – If the velocity
v
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.