RobinHankin / lorentz

Relativistic physics: noncommutative and nonassociative Lorentz velocity addition; gyrogroups
https://robinhankin.github.io/lorentz/
GNU General Public License v3.0
4 stars 1 forks source link

bug in pureboost() with infinite speed of light #24

Closed RobinHankin closed 5 years ago

RobinHankin commented 5 years ago

Infinite speed of light is handled wrongly in pureboost() when the boost matrix includes spatial rotation:

 options(digits=2)
 (O <- eigen(crossprod(matrix(rnorm(9),3,3)))$vectors)
      [,1]   [,2] [,3]
[1,]  0.78 -0.076 0.62
[2,] -0.46 -0.736 0.49
[3,] -0.42  0.673 0.61
 crossprod(O)  # demonstrate orthogonality
         [,1] [,2]     [,3]
[1,]  1.0e+00    0 -1.7e-16
[2,]  0.0e+00    1  0.0e+00
[3,] -1.7e-16    0  1.0e+00
 BB <- rbind(c(1,0,0,0),cbind(1:3,O))  # perfectly respectable Galilean transform if c=Inf
 BB
     [,1]  [,2]   [,3] [,4]
[1,]    1  0.00  0.000 0.00
[2,]    1  0.78 -0.076 0.62
[3,]    2 -0.46 -0.736 0.49
[4,]    3 -0.42  0.673 0.61
 sol(Inf)
[1] Inf
 pureboost(BB)
     [,1]  [,2]   [,3] [,4]
[1,]    1  0.00  0.000 0.00
[2,]    1  0.78 -0.076 0.62
[3,]    2 -0.46 -0.736 0.49
[4,]    3 -0.42  0.673 0.61
 sol(1e90)
[1] 1e+90
 pureboost(BB)
  t        x       y        z
t 1  0.0e+00 0.0e+00  0.0e+00
x 0  1.0e+00 2.4e-16 -1.1e-16
y 0  2.4e-16 1.0e+00  1.1e-16
z 0 -1.1e-16 1.2e-16  1.0e+00

See also issue #23

RobinHankin commented 5 years ago

I no longer think there is a bug in the software, I now think the problem was my testing.

THE FOLLOWING IS WRONG

 sol(10)  # fine
[1] 10
 (B <- boost(as.3vel(1:3)))  #fine 
      t       x       y       z
t  1.08 -0.0108 -0.0216 -0.0323
x -1.08  1.0056  0.0112  0.0168
y -2.16  0.0112  1.0224  0.0336
z -3.23  0.0168  0.0336  1.0504
 pureboost(B)  # also fine
      t       x       y       z
t  1.08 -0.0108 -0.0216 -0.0323
x -1.08  1.0056  0.0112  0.0168
y -2.16  0.0112  1.0224  0.0336
z -3.23  0.0168  0.0336  1.0504
> sol(1000)  # hmm.....
[1] 1000
> pureboost(B)  # WRONG WRONG WRONG
          t         x         y         z
t    0.0535 -0.000288 -0.000576 -0.000864
x -287.8419  3.810526  5.621052  8.431578
y -575.6837  5.621052 12.242104 16.863156
z -863.5256  8.431578 16.863156 26.294734

It is wrong because B was created with c=10 but analysed with c=1000.

RobinHankin commented 5 years ago

actually I think that there is a bug:

> sol(10000)  # nominal large speed of light
 [1] 10000
> (B <- O %*% boost(as.3vel(1:3)))
               t           x           y           z
[1,]  1.00000007 -0.00000001 -0.00000002 -0.00000003
[2,] -0.09561053 -0.03184052  0.85071601 -0.52466032
[3,] -3.41807142  0.63609021  0.42214875  0.64589457
[4,]  1.51909458  0.77095748 -0.31316569 -0.55457356
> pureboost(B)
   t        x      y        z
t  1 -1.0e-08 -2e-08 -3.0e-08
x -1  1.0e+00  1e-08  1.5e-08
y -2  1.0e-08  1e+00  3.0e-08
z -3  1.5e-08  3e-08  1.0e+00

In the above, see how the first column of pureboost(B) shows the velocity vector 1:3, but the first column of B is different. Now try an infinite speed of light:

> sol(Inf)
[1] Inf
> (B <- O %*% boost(as.3vel(1:3)))
               t           x          y          z
[1,]  1.00000000  0.00000000  0.0000000  0.0000000
[2,] -0.09561052 -0.03184052  0.8507160 -0.5246603
[3,] -3.41807118  0.63609019  0.4221487  0.6458945
[4,]  1.51909447  0.77095749 -0.3131657 -0.5545735
> pureboost(B)
            [,1] [,2] [,3] [,4]
[1,]  1.00000000    0    0    0
[2,] -0.09561052    1    0    0
[3,] -3.41807118    0    1    0
[4,]  1.51909447    0    0    1

in the above, see how the first column of the boost matrix B is copied. This is wrong.

RobinHankin commented 5 years ago

OK here is some numerical evidence that supports the fix:

sol(Inf)
 O <- adiag(1,eigen(crossprod(matrix(rnorm(9),3,3)))$vectors)
 (B <- O %*% boost(as.3vel(1:3)))
           t     x      y       z
[1,]  1.0000 0.000  0.000  0.0000
[2,] -1.9511 0.852  0.522  0.0179
[3,]  3.1920 0.218 -0.324 -0.9206
[4,] -0.0678 0.475 -0.789  0.3900
 orthog(B)
     [,1]  [,2]   [,3]    [,4]
[1,]    1 0.000  0.000  0.0000
[2,]    0 0.852  0.522  0.0179
[3,]    0 0.218 -0.324 -0.9206
[4,]    0 0.475 -0.789  0.3900
 pureboost(B)
      t         x        y         z
[1,]  1  0.00e+00 0.00e+00  0.00e+00
[2,] -1  1.00e+00 1.67e-16 -1.39e-16
[3,] -2  1.67e-16 1.00e+00  2.78e-16
[4,] -3 -1.39e-16 2.78e-16  1.00e+00
 orthog(B) %*% pureboost(B) - B
             t         x         y         z
[1,]  0.00e+00  0.00e+00  0.00e+00  0.00e+00
[2,] -8.88e-16  1.11e-16  3.33e-16  3.82e-17
[3,]  2.22e-15  8.33e-17 -3.89e-16 -7.77e-16
[4,]  4.44e-16 -1.67e-16 -1.11e-16  0.00e+00

although thinking about it we could tidy up pureboost.galilean() and force elements [2:4,2:4] to be diag(3)