Learn R Programming

lorentz (version 1.1-1)

fourvel: Four velocities

Description

Create and test for four-velocities.

Usage

as.4vel(u)
is.consistent.4vel(U, give=FALSE, TOL=1e-10)
inner4(U,V=U)
to3(U)

Arguments

u

A vector of three-velocities

U,V

A vector of four-velocities

give

In function is.consistent.4vel(), Boolean with TRUE meaning to return \(U\cdot U+c^2\), which is zero for a four-velocity, and default FALSE meaning to return whether the four-velocity is consistent to numerical precision

TOL

Small positive value used for tolerance

Author

Robin K. S. Hankin

Details

Function as.4vel() takes a three-velocity and returns a four-velocity.

Given a four-vector \(V\), function inner4() returns the Lorentz invariant \(V^iV_i=\eta_{ij}V^iV^j\). This quantity is unchanged under Lorentz transforms. Note that function inner4() works for any four-vector, not just four-velocities. It will work for (eg) a four-displacement, a four-momentum vector or a four-frequency. In electromagnetism, we could have a four-current or a four-potential. If \(U\) is a four-velocity, then \(U^iU_i=-c^2\); if \(U\) is a 4-displacement, then \(U^iU_i\) is the squared interval. If \(P\) is the four-momentum of a photon then \(P^iP_i=0\).

Function to3() is a low-level helper function used when as.3vel() is given a four-velocity.

Function is.consistent.4vel() checks for four-velocities being consistent in the sense that \(U^iU_i=-c^2\). Giving this function a vector, for example, is.consistent.4vel(1:5), will return an error.

Compare the functions documented here with boost(), which returns a \(4\times 4\) transformation matrix (which also includes rotation information).

See Also

boost

Examples

Run this code

a <- r3vel(10)
as.4vel(a)     # a four-velocity

as.3vel(as.4vel(a))-a   # zero to numerical precision

inner4(as.4vel(a))   #  -1 to numerical precision

stopifnot(all(is.consistent.4vel(as.4vel(a))))


## check Lorentz invariance of dot product:
U <- as.4vel(r3vel(10))
V <- as.4vel(r3vel(10))
B <- boost(as.3vel(1:3/10))

frame1dotprod <- inner4(U, V)
frame2dotprod <- inner4(U %*% B, V %*% B)
max(abs(frame1dotprod-frame2dotprod))  # zero to numerical precision

Run the code above in your browser using DataLab