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'>,
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 ofV
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
) – Thenumpy
data type to use to store the inputs.
Notes
At most one of
V
,momentum
,total_energy
,kinetic_energy
,v_over_c
, andlorentz_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
The kinetic energy of the body.
The Lorentz factor of the body.
The rest mass of the body, \(m_0\).
The rest mass energy of the body, \(m_0 c^2\).
The magnitude of the momentum of the body.
Representation of the particle(s).
The sum of the rest mass energy and the kinetic energy of the body.
The velocity of the body divided by the velocity of light: \(\frac{V}{c}\).
The velocity of the body, \(V\).
Attributes Documentation
- lorentz_factor
The Lorentz factor of the body.
\[γ ≡ \frac{1}{\sqrt{1 - \frac{V^2}{c^2}}}.\]- Return type:
- particle
Representation of the particle(s).
- Return type:
- 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:
- v_over_c
The velocity of the body divided by the velocity of light: \(\frac{V}{c}\).
- Return type: