+
Relativistic Dynamics in 1D with a constant force
Developed by Larry Engelhardt  Published July 31, 2016
In these exercises, you will determine the motion of a proton in a uniform electric field. We will begin by simulating a proton in an electric field using the NONrelativistic version of Newton's 2nd Law. Then we will modify this simulation to take special relativity into account. In the process, we will observe the transition from nonrelativistic to relativistic dynamics. In order to generate results, we will see that we need to be careful when working with nonSI units. In particular, we will need to pay close attention to factors of eV and $c$.
Subject Area  Modern Physics 

Level  Beyond the First Year 
Available Implementations  IPython/Jupyter Notebook, Python, and Easy Java Simulations 
Learning Objectives 
Students will be able to:
* Execute a working simulation, and explain nonrelativistic, constant force motion (**Exercise 1**)
* Manipulate and explain the units that appear in the context of relativistic motion (**Exercise 2**)
* Interpret plots of energy vs. time for nonrelativistic motion (**Exercises 2**)
* Observe and explain when the nonrelativistic form of Newton's 2nd Law breaks down (**Exercise 3**)
* Derive the relativistic form of Newton's 2nd Law (**Exercise 4**)
* Modify a nonrelativistic simulation to incorporate relativity (**Exercise 5**)
* Produce and interpret plots for relativistic motion (**Exercises 6, 7, 8**)
* Validate numerical results by comparing with an analytical solution (**Exercise 7**)
* Apply simulated results to a particle accelerator (**Exercises 9 and 10**)
* Rewrite code to store data in arrays using array indices rather than by appending data to arrays (**Exercise 11**)

Time to Complete  120 min 
These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).
**Exercise 1:**
The file ending with "Version1" contains code to simulate
a proton in an electric field using the nonrelativistic acceleration derived above.
(This code uses the "Euler algorithm" described in the "Theory" section.)
Execute this code, and look at the plots of position versus time and speed versus time.
Explain why these plots have the shapes that they have.
**Exercise 2:**
The file ending with "Version2" contains the same code as the file ending with
"Version1" except that a few lines have been added in order to also calculate and plot the nonrelativistic *energy*.
Locate the line where the nonrelativistic energy is calculated.
(The same line appears both inside the loop and before the loop.)
Explain why this line is correct. You will need to be very careful with the units and the factors of $c^2$. Write down the equation for nonrelativistic energy (including both rest energy and nonrelativistic kinetic energy),
and carefully argue why this line of code is correct.
Execute this code, and look at the plot of energy versus time.
Why does this plot have the shape that it has?
How large is the kinetic energy compared to the rest energy
after the proton has been accelerating for 1 second?
**Exercise 3:**
Again use the file ending with "Version2"
but now increase the value of the maximum time
from 1 second to 5 seconds.
How large is the kinetic energy compared to the rest energy
after the proton has been accelerating for 5 seconds?
Look at the plot of speed versus time.
Something should bother you! Explain what is wrong.
**Exercise 4:**
Derive the relativistic form of Newton's 2nd Law,
$$ a = \frac{F}{\gamma^3 m}, $$
from the equation $F = dp/dt$.
See the "Theory" section for additional background.
**Exercise 5:**
Save a copy of the file ending with "Version2"
using a file name ending with "Version3".
In this new file, you are going to modify the code
in order to take special relativity into account.
This will involve the following steps:
1. Compute the value of the Lorentz factor, $\gamma$.
2. Use the Lorentz factor to compute the acceleration.
3. Modify the equation for the energy
(both before the loop and within the loop)
in order to compute the *relativistic* energy.
Hint: Once you have computed the Lorentz factor,
the relativistic energy is actually very simple to compute,
but be very careful of the units and factors of $c^2$.
Execute your modified program, and fix any bugs!
**Exercise 6:**
Execute your modified program (Version3)
using a maximum time of 5 seconds,
and look at the plot of speed versus time.
Does the plot look better than the plot that you looked at in Exercise 3?
It should! If it doesn't, there is a bug in your code that needs to be fixed
before you continue.
Explain why the new plot of speed versus time has the shape that it has.
**Exercise 7:**
Now that you have created a new program,
you should attempt to validate your program
(to test how accurate the numbers actually are).
One simple way to do this is using the energy.
From the workenergy theorem, the kinetic energy
of the proton (starting from rest) is
$$ KE = W = \int F dx, $$
and since the force is constant, the kinetic energy is simply
the product of the (constant) force times the distance traveled.
This "analytical" result (which does not involve any approximations)
can be compared with the "numerical" kinetic energy from your program,
$$KE = \gamma m c^2  mc^2.$$
Add code to your program (after the program's loop has completed)
to compute the kinetic energy both analytically and numerically.
Print both results, and make sure that they are similar.
(If they aren't you need to fix something!)
Compute the percent error in the numerical kinetic energy.
How large is the error?
Increase the value of your program's time step by a factor of 10.
How does this affect the error? Why does this happen?
(This code uses the "Euler algorithm" described in the "Theory" section.)
Before you continue to the next exercise,
make sure that the error is a small fraction of a percent.
**Exercise 8:**
Increase the maximum time for your simulation until you are able to get
the total energy of the proton up to 100 GeV.
Discuss the shape of each of the three plots (position, speed, and energy).
Why do they have the shapes that they have?
(Incorporate the term "ultrarelativistic" into your answer.)
**Exercise 9:**
Using an electric field of $\epsilon = 1$ Volt/meter,
how much time does it take to accelerate a proton
to an energy of 100 GeV? How far does it travel in that time?
(Use your plots from Exercise 8.)
At the Large Hadron Collider (LHC), protons are accelerated
to an energy of 8 TeV.
Instead of using a longer simulation,
*extrapolate* your results
in order to determine how long it would take to accelerate
a proton up to $E = 8$ TeV using $\epsilon = 1$ Volt/meter.
How far does the proton travel during this time?
How many trips around the LHC would the proton make during this time?
How does this distance compare to the circumference of the
Earth's orbit around the sun?
**EXTRACREDIT EXERCISES:**
**Exercise 10:**
At the LHC, protons are accelerated using
much larger electric fields, $\epsilon = 5\times 10^6$ Volts/meter.
Use your program to simulate a proton at the LHC
being accelerated by this large electric field.
(Tip: You will need to significantly change the values
of both the time step and the maximum time.)
Discuss your results.
**Exercise 11 (RELEVANT FOR PYTHON OR MATLAB, NOT RELEVANT FOR ALL PROGRAMMING LANGAUGES):**
You might have noticed that your program becomes very slow
if you have a very large number of time steps.
Part of this is unavoidable; each time step requires the
computer to do some processessing.
However, much of the computation time is consumed
by appending new values onto the arrays.
Rewrite your program so that, instead of repeatedly appending to the arrays,
you create large empty arrays *before* the loop;
then in each iteration of the loop, you record
the new numbers in the appropriate element of the array.
Observe and discuss how this affects the computation time.
Download Options
Share a Variation
Did you have to edit this material to fit your needs? Share your changes by
Creating a Variation
Credits and Licensing
Larry Engelhardt, "Relativistic Dynamics in 1D with a constant force," Published in the PICUP Collection, July 2016.
The instructor materials are ©2016 Larry Engelhardt.
The exercises are released under a Creative Commons AttributionNonCommercialShareAlike 4.0 license