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:
-
Compute the value of the Lorentz factor, γ.
-
Use the Lorentz factor to compute the acceleration.
-
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 c2.
Execute your modified program, and fix any bugs!