RelativisticBody

class plasmapy.formulary.relativity.RelativisticBody(particle: str | int | ~numpy.integer | ~plasmapy.particles.particle_class.Particle | ~plasmapy.particles.particle_class.CustomParticle | ~astropy.units.quantity.Quantity, V: ~astropy.units.quantity.Quantity = None, momentum: ~astropy.units.quantity.Quantity = None, *, total_energy: ~astropy.units.quantity.Quantity = None, kinetic_energy: ~astropy.units.quantity.Quantity = None, v_over_c: float | None = None, lorentz_factor: float | None = None, Z: int | None = None, mass_numb: int | None = None, dtype: ~numpy.dtype[~typing.Any] | None | type[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | tuple[~typing.Any, int] | tuple[~typing.Any, ~typing.SupportsIndex | ~collections.abc.Sequence[~typing.SupportsIndex]] | list[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | tuple[~typing.Any, ~typing.Any] = <class 'numpy.longdouble'>)[source]

Bases: object

A physical body that is moving at a velocity relative to the speed of light.

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, optional) – The velocity of the relativistic body in units convertible to m/s. The absolute magnitude of V cannot be greater than \(c\).

  • momentum (Quantity, optional) – The momentum of the relativistic body in units convertible to kg·m/s.

  • total_energy (Quantity, keyword-only, optional) – The sum of the mass energy and the kinetic energy in units convertible to joules. Must be non-negative.

  • kinetic_energy (Quantity, keyword-only, optional) – The kinetic energy of the relativistic body in units convertible to joules. Must be non-negative.

  • v_over_c (real number or Quantity, keyword-only, optional) – The ratio of the velocity to the speed of light. Must have an absolute magnitude \(≤ 1\).

  • lorentz_factor (real number or Quantity, keyword-only, optional) – The Lorentz factor, \(γ\) of the relativistic body. Must have \(γ ≥ 1\).

  • Z (integer, keyword-only, optional) – The charge number associated with particle.

  • mass_numb (integer, keyword-only, optional) – The mass number associated with particle.

  • dtype (DTypeLike, keyword-only, default: numpy.longdouble) – The numpy data type to use to store the inputs.

Notes

At most one of V, momentum, total_energy, kinetic_energy, v_over_c, and lorentz_factor must be provided.

Caution

For ultra-high-energy cosmic rays (UHECRs), the velocity may be within roundoff error of \(c\) and \(\frac{V}{c}\) may be within roundoff error of 1.

Examples

>>> import astropy.units as u
>>> relativistic_proton = RelativisticBody("p+", total_energy=1 * u.GeV)
>>> relativistic_proton.particle
Particle("p+")
>>> relativistic_proton.velocity
<Quantity 1.03697...e+08 m / s>
>>> relativistic_proton.v_over_c
0.3458980898746...
>>> relativistic_proton.lorentz_factor
1.0657889247888...
>>> relativistic_proton.mass_energy.to("GeV")
<Quantity 0.93827... GeV>
>>> relativistic_proton.total_energy.to("GeV")
<Quantity 1. GeV>
>>> relativistic_proton.mass
<Quantity 1.67262...e-27 kg>

RelativisticBody also works with multiple particles and/or velocities.

>>> particles = ["p+", "e-"]
>>> velocities = [2e5, 2e8] * u.m / u.s
>>> relativistic_particles = RelativisticBody(particles, velocities)
>>> relativistic_particles.momentum
<Quantity [3.345244...e-22, 2.445659...e-22] kg m / s>

Attributes Summary

kinetic_energy

The kinetic energy of the body.

lorentz_factor

The Lorentz factor of the body.

mass

The rest mass of the body, \(m_0\).

mass_energy

The rest mass energy of the body, \(m_0 c^2\).

momentum

The magnitude of the momentum of the body.

particle

Representation of the particle(s).

total_energy

The sum of the rest mass energy and the kinetic energy of the body.

v_over_c

The velocity of the body divided by the velocity of light: \(\frac{V}{c}\).

velocity

The velocity of the body, \(V\).

Attributes Documentation

kinetic_energy

The kinetic energy of the body.

\[E_K ≡ m_0 c^2 (γ-1).\]
Return type:

Quantity

lorentz_factor

The Lorentz factor of the body.

\[γ ≡ \frac{1}{\sqrt{1 - \frac{V^2}{c^2}}}.\]
Return type:

float

mass

The rest mass of the body, \(m_0\).

Return type:

Quantity

mass_energy

The rest mass energy of the body, \(m_0 c^2\).

Return type:

Quantity

momentum

The magnitude of the momentum of the body.

\[p ≡ γ m_0 V.\]
Return type:

Quantity

particle

Representation of the particle(s).

Return type:

Particle, CustomParticle, or ParticleList

total_energy

The sum of the rest mass energy and the kinetic energy of the body.

\[E_\mathrm{tot} ≡ γ m_0 c^2.\]
Return type:

Quantity

v_over_c

The velocity of the body divided by the velocity of light: \(\frac{V}{c}\).

Return type:

float

velocity

The velocity of the body, \(V\).

Return type:

Quantity