relativistic_energy
- plasmapy.formulary.relativity.relativistic_energy(
- particle: str | int | integer | Particle | CustomParticle | Quantity,
- V: Quantity,
- *,
- mass_numb: int | None = None,
- Z: int | None = None,
- m=None,
- v=None,
Calculate the sum of the mass energy and kinetic energy of a relativistic body.
The total energy of a relativistic body is:
\[E = γ m c^2,\]where \(m\) is the rest mass of the body and \(γ\) is its
Lorentz_factor
.- Parameters:
particle (particle-like) – A representation of a particle from which to get the mass of the relativistic body. If it is a
Quantity
, then it must have units of mass and describe the body’s rest mass.V (
Quantity
) – The velocity in units convertible to meters per second.mass_numb (integer, keyword-only, optional) – The mass number of an isotope, if not provided to
particle
.Z (integer, keyword-only, optional) – The charge number of an ion or neutral atom, if not provided to
particle
.m (
object
) – Formerly the mass of the body. Will raise aTypeError
if provided. Useparticle
instead.v (
object
) – Formerly the velocity of the body. Will raise aTypeError
if provided. UseV
instead.
- Returns:
The total energy of the relativistic body.
- Return type:
- Raises:
InvalidParticleError – If
particle
does not represent a validParticle
,CustomParticle
, orParticleList
.UnitConversionError – If
V
is not in appropriate units.RelativityError – If
V
exceeds the speed of light.
- Warns:
UnitsWarning
– If units are not provided, SI units are assumed.
Examples
>>> import astropy.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>