{"cells":[{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","collapsed":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a"},"cell_type":"markdown","source":"# Particle trajectories\nI will derive particle trajectories wrt time for a particle that is not acted upon by any force and for a particle that is interacting with a constant magnetic field.\nThis might be an idealized view of what goes on in the detector, neglecting particle-particle ineractions, particle- detector interactions, inhomogenous magnetic field and other things I cannot think of :). Might be a bit confusing, but hope that you will find use for the final equations at least. They are boxed.\n\n## Special relativity\nSince the particles have high energies and thus speeds, one should use special relativity to describe the trajectories.\nAs you might be aware of, time is relative in special relativity. This means that, starting off, one parametrizes the trajectories in terms of \"proper time\" $\\tau$ instead of \"regular time\" $t$.\nProper time is time measured in a coordinate system moving with the same speed and direction as the particle. I.e. the particle is at rest in this coordinate system.\nRegular time (time in our coordinate frame, where the detector is at rest) is treated in many ways as a spatial coordinate.\n\nLets get started.\n\nI will use $\\vec{overhead arrow}$ for regular coordinate vectors and $\\bf{Boldface}$ for four-vecors. That is vectors that also contains this new \"time dimension\" as the first entry.\n\nSome examples of four-vecors:\n\n$\\bf{f}$ - four force\n\n$\\bf{p}$ - four momentum\n\n$\\bf{u}$ - four velocity\n\nRegular vectors:\n\n$\\vec{r} = \\langle x,y,z\\rangle$\n\n## No force\n\n$$\\bf{f} = \\frac{\\partial \\bf{p}}{\\partial\\tau} = 0$$\n\nThis means four-momentum is conserved:\n\n$$ m\\langle \\frac{\\partial c t}{\\partial\\tau}, \\frac{\\partial x}{\\partial\\tau}, \\frac{\\partial y}{\\partial\\tau}, \\frac{\\partial z}{\\partial\\tau} \\rangle = m\\langle \\frac{\\partial c t}{\\partial\\tau}, \\frac{\\partial \\vec{r}}{\\partial\\tau}\\rangle =\\bf{p_0}$$\n\nBy intagrating we can conclude that:\n$$ \\vec{r} = \\frac{\\vec{p_0}}{m}\\tau + \\vec{r_0}$$\n\nFrom the first \"time component \" of the four-vector we have:\n$$ mc\\frac{\\partial t}{\\partial \\tau} = \\frac{E}{c} \\rightarrow \\tau = \\frac{mc^2}{E} t, $$\nassuming $t(0)=0$. Where $E$ is the energy of the particle (The time-component of the four-momentum is energy divided by c). Also note that if the energy is not much higher than the resting energy $mc^2$, time ticks at the same rate in both coordinate systems.\nLets plug this into our parametrized trajectory:\n\n$$ \\boxed{ \\vec{r} = \\frac{\\vec{p_0} c^2}{E} t+ \\vec{r_0} =\\frac{\\vec{p_0}}{m\\sqrt{1+\\frac{|\\vec{p_0}|^2}{(mc)^2}}} t+ \\vec{r_0} }$$\n\nNote that for small momentums(much smaller than $mc$), we get back the non-relativistic result $\\vec{r} = \\frac{\\vec{p}}{m} t + \\vec{r_0}$\n\n## Constant magnetic field (z-direction)\nThe forces acting upon a chared particle by electromagnetism is called the lorentz force. Or four-force in special relativity. For constant magnetic field in z-dir, we have the lorentz four-force:\n$$ \\frac{\\partial \\bf{p}}{\\partial \\tau} = q \\begin{bmatrix}\n    0   & 0 & 0 & 0 \\\\\n    0  & 0 & -B  & 0 \\\\ \n    0  & B & 0  & 0 \\\\\n    0  & 0 & 0 &0 \n\\end{bmatrix}\\begin{bmatrix}\n   \\frac{\\partial t}{\\partial \\tau}\\\\\n   \\frac{\\partial x}{\\partial \\tau}\\\\ \n   \\frac{\\partial y}{\\partial \\tau}\\\\\n   \\frac{\\partial z}{\\partial \\tau}  \n\\end{bmatrix} = qB\\langle 0, -  \\frac{\\partial y}{\\partial \\tau},  \\frac{\\partial x}{\\partial \\tau},0\\rangle,$$\nwhere q is the particle's charge and B is the magnitude of the magnetic field.\n\nLets look at the x and y coordinatesof the particle, since there now is a force acting in the x and y directions.\n\nWe have:\n$$ m\\frac{\\partial^2 x}{\\partial \\tau^2} = -qB\\frac{\\partial y}{\\partial \\tau} \\\\\n    m\\frac{\\partial^2 y}{\\partial \\tau^2} = qB \\frac{\\partial x}{\\partial \\tau} $$\n    \n   Integrating:\n    $$ m\\frac{\\partial x}{\\partial \\tau} = -qB( y-y_0) + p_{0,x}\\\\\n    m\\frac{\\partial y}{\\partial \\tau} = qB (x-x_0) + p_{0,y}$$\n    \n  This set of first-order differential equations has the solution:\n  $$ x(\\tau)=\\frac{p_{0,y}}{qB}\\cos[\\frac{qB}{m}\\tau] + \\frac{p_{0,x}}{qB}\\sin[\\frac{qB}{m}\\tau] - \\frac{p_{0,y}}{qB}  +x_0\\\\\n         y(\\tau)=\\frac{p_{0,y}}{qB}\\sin[\\frac{qB}{m}\\tau] - \\frac{p_{0,x}}{qB}\\cos[\\frac{qB}{m}\\tau] + \\frac{ p_{0,x}}{qB} + y_0$$\n \n       \n  In terms of t:\n     $$ \\boxed{x(t)=\\frac{p_{0,y}}{qB}\\cos[\\frac{qB}{m}k t] + \\frac{p_{0,x}}{qB}\\sin[\\frac{qB}{m}k t] - \\frac{p_{0,y}}{qB} +x_0} \\\\\n        \\boxed{ y(t)=\\frac{p_{0,y}}{qB}\\sin[\\frac{qB}{m}k t] - \\frac{p_{0,x}}{qB}\\cos[\\frac{qB}{m}k t] + \\frac{ p_{0,x}}{qB}+y_0 } \\\\\n       \\boxed{ z(t) = \\frac{p_{0,z}}{m} k t + z_0 }$$\n    With $$ k = \\frac{1}{\\sqrt{1+\\frac{|\\vec{p_0}|^2}{(mc)^2}}} $$\n    \n       \n    \n\n\n\n\n\n\n\n\n\n"},{"metadata":{"_cell_guid":"67d06b82-c86e-4e2a-ac04-53edb0a1b44d","collapsed":true,"_uuid":"042c7bd5bfcd3b6a5f4a2138b48b2343649ab085"},"cell_type":"markdown","source":"# Shortest distance from a point to a trajectory\n\nGiven a point in space $\\vec{c}$, the squared distance between this point and a line $\\vec{r} = \\vec{a}t + \\vec{r_0}$ is \n$$ |\\vec{r}-\\vec{c}|^2 = |\\vec{a}|^2t^2 + |\\vec{r_0}|^2 + |\\vec{c}|^2 + 2(\\vec{r_0}-\\vec{c})\\cdot\\vec{a}t - 2\\vec{r_0}\\cdot\\vec{c}$$\n\nBy taking the derivative wrt $t$ and setting to zero, we find that the this distance is minimized at time: \n$$ t_{min} = \\frac{(\\vec{c}-\\vec{r_0})\\cdot\\vec{a}}{|\\vec{a}|^2}$$\n\n\n## No force\n\nWith no external force, the particles move as given by the equation above  $\\vec{r} = \\frac{\\vec{p_0}k}{m}t +\\vec{r_0}$\n$$\\vec{a} = \\frac{\\vec{p_0}k}{m}$$\n\n\n\n\n\n"},{"metadata":{"_cell_guid":"1ba473e6-3abc-4caf-9b1b-2266ddd5efbe","collapsed":true,"_uuid":"2b60cfe9eb2735e2e2ca6957b2039c669120b29d","trusted":false},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"1d0a5d90-0fd7-4886-adbd-b2efdc024c9b","collapsed":true,"_uuid":"893fdd544828d7b9ee8c46007d5ce1c1802717f7","trusted":false},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"language_info":{"name":"python","version":"3.6.5","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}},"nbformat":4,"nbformat_minor":1}