Advertisement
bolverk

relativistic optical depth

Aug 20th, 2015
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. import sympy
  2. sympy.init_printing()
  3.  
  4. b = sympy.Symbol('beta')
  5. g = sympy.Symbol('gamma')
  6. dx = sympy.Symbol('dx')
  7. q = sympy.Symbol('theta')
  8. boost = sympy.Matrix([[1,0,0,0],
  9.                       [0,g,0,-g*b],
  10.                       [0,0,1,0],
  11.                       [0,-g*b,0,g]])
  12. start = sympy.Matrix([0,-dx,0,0])
  13. end = sympy.Matrix([sympy.sin(q)*dx/(sympy.cos(q)-b),
  14.                     b*dx/(sympy.cos(q)-b),
  15.                     0,
  16.                     dx/(sympy.cos(q)-b)])
  17. boost.dot(end-start)[-1].simplify()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement