In [33]:
from sympy import symbols, Eq, sqrt
In [16]:
x1, x2, t1, t2, v, gamma = symbols('x_1, x_2, t_1, t_2, v, gamma')
c = symbols('c', constant = True)
In [17]:
eq1 = Eq(x2, (x1 - v * t1) * gamma)
eq1
Out[17]:
In [11]:
eq2 = Eq(x1, (x2 + v * t2)*gamma)
eq2
Out[11]:
In [12]:
eq3 = Eq(x1 * x2, (x1 - v * t1) * gamma * (x2 + v * t2)*gamma)
eq3
Out[12]:
In [13]:
eq4 = eq3.expand()
eq4
Out[13]:
In [22]:
eq5 = Eq(t1, x1/c)
eq5
Out[22]:
In [23]:
eq6 = Eq(t2, x2/c)
eq6
Out[23]:
In [27]:
eq7 = eq4.subs({eq5.lhs : eq5.rhs, eq6.lhs : eq6.rhs})
eq7
Out[27]:
In [28]:
eq8 = Eq(gamma**2, c**2/(c**2-v**2))
eq8
Out[28]:
In [30]:
eq9 = Eq(gamma**2, 1/(1-(c**2/v**2)))
eq9
Out[30]:
In [35]:
eq10 = Eq(gamma, 1/sqrt(1-(c**2/v**2)))
eq10
Out[35]:
In [36]:
eq1
Out[36]:
In [41]:
eq11 = Eq(c*t2, gamma*(c*t1 - ( x1/c)*v))
eq11
Out[41]:
In [43]:
eq12 = Eq(t2, gamma*(c*t1 - ( x1/c**2)*v))
eq12
Out[43]:
In [44]:
eq2
Out[44]:
In [45]:
eq13 = Eq(c*t1, gamma*((x2/c)*v + c * t2))
eq13
Out[45]:
In [48]:
eq14 = Eq(t1, gamma*((x2/c**2)*v + t2))
eq14
Out[48]:
In [ ]: