perfectfluid(10,1)
u <- as.3vel(c(0.4,0.4,0.2))
## In the following, LHS is stationary dust and RHS is dust moving at
## velocity 'u', but transformed to a frame also moving at velocity 'u':
LHS <- dust(1)
RHS <- transform_uu(dust(1,u),boost(u))
max(abs(LHS-RHS)) # should be small
## In the following, negative sign needed because active/passive
## difference:
LHS <- dust(1,u)
RHS <- transform_uu(dust(1),boost(-u))
max(abs(LHS-RHS)) # should be small
## Now test behaviour when c!=1:
sol(299792458)
perfectfluid(1.225,101325) # air at STP
LHS <- transform_uu(perfectfluid(1.225,101325),boost(as.3vel(c(1000,0,0))))
RHS <- perfectfluid(1.225,101325)
LHS-RHS # should be small
sol(10)
u <- as.3vel(4:6)
LHS <- photongas(1,u)
RHS <- transform_uu(photongas(1),boost(-u))
LHS-RHS # should be small
B1 <- boost(r3vel(1)) %*% boost(r3vel(1))
B2 <- boost(r3vel(1)) %*% boost(r3vel(1))
LHS <- transform_uu(transform_uu(dust(1),B1),B2)
RHS <- transform_uu(dust(1),B2 %*% B1) # note order
LHS-RHS # should be small
## remember to re-set c:
sol(1)
Run the code above in your browser using DataLab