Learn R Programming

lorentz (version 1.1-1)

fourmom: Four momentum

Description

Create and test for four-momentum

Usage

# S3 method for 4mom
Ops(e1, e2)
# S3 method for 4mom
sum(..., na.rm=FALSE)
vel_to_4mom(U,m=1)
p_to_4mom(p,E=1)
as.4mom(x)
is.4mom(x)
fourmom_mult(P,n)
fourmom_add(e1,e2)

Arguments

x,P,e1,e2

Four-momentum

p

Three-momentum

E

Scalar; energy

U

Object coerced to four-velocity

m

Scalar; rest mass

n

Multiplying factor

...,na.rm

Arguments sent to sum()

Author

Robin K. S. Hankin

Details

Four-momentum is a relativistic generalization of three-momentum, with the object's energy as the first element. It can be defined as \(mU\), where \(m\) is the rest mass and \(U\) the four-velocity. Equivalently, one can define four-momentum as \((E/c,p_x,p_y,p_z)\) where \(E\) is the energy and \((p_x,p_y,p_z)\) the three-momentum.

Function vel_to_4mom() converts three-velocity to four-momentum, and function p_to_4mom()) converts a three-momentum to a four-momentum.

The function Ops.4mom() passes unary and binary arithmetic operators “+”, “-” and “*” to the appropriate specialist function.

The package is designed so that natural R idiom may be used for physically meaningful operations such as combining momenta of different objects, using the conservation of four-momentum.

For the four-momentum of a photon, use as.photon().

See Also

boost,as.photon

Examples

Run this code

# Define 5 random three velocities:
v <- r3vel(5)

# convert to four-velocity:
as.4vel(v)

# Now convert 'v' to four-momentum, specifying rest mass:
vel_to_4mom(v)         # 4mom of five objects with 3vel v, all unit mass
vel_to_4mom(v,   1:5)  # 4mom of five objects with 3vel v, masses 1-5
vel_to_4mom(v[1],1:5)  # 4mom of five objects with same 3vel, masses 1..5

# Now convert 'v' to four-momentum, specifying energy E:
p_to_4mom(v,E=1)
p_to_4mom(v,E=10)   # slower
p_to_4mom(v,E=100)  # even slower

# Four-momentum of objects moving closely parallel to the x-axis:
P <- vel_to_4mom(as.3vel(c(0.8,0,0)) + r3vel(7,0.01))

reflect(P)
reflect(P,c(1,1,1))

sum(P)

Run the code above in your browser using DataLab