About
Developed by Larry Engelhardt
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 NON-relativistic 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 non-relativistic to relativistic dynamics. In order to generate results, we will see that we need to be careful when working with non-SI units. In particular, we will need to pay close attention to factors of eV and style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-top-width: 0px; border-right-style: none; border-right-width: 0px; border-bottom-style: none; border-bottom-width: 0px; border-left-style: none; border-left-width: 0px; display: inline; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: normal">.
Subject Area | Modern Physics |
---|---|
Level | Beyond the First Year |
Available Implementations | IPython/Jupyter Notebook and Python |
Learning Objectives |
Students will be able to:
|
Time to Complete | 120 min |
Exercise 10:
At the LHC, protons are accelerated using much larger electric fields, style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-top-width: 0px; border-right-style: none; border-right-width: 0px; border-bottom-style: none; border-bottom-width: 0px; border-left-style: none; border-left-width: 0px; display: inline; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: normal"> 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.
# relativisticDynamicsVersion3.py
from pylab import *
from time import time
start = time()
c = 2.998e8 # Speed of light in m/s
m = 0.938e9 # Mass in eV/c^2
Efield = 5e6 # Electric field in Volts per meter
x = 0 # Position in meters
v = 0 # Velocity in meters/second
t = 0 # Time in seconds
dt = 1e-8 # Time STEP in seconds
tMax = 1e-3
N = int(tMax / dt)
tArray = zeros(N)
xArray = zeros(N)
vArray = zeros(N)
EArray = zeros(N)
lorentzArray = zeros(N)
for i in range(N):
# The dynamics:
lorentz = 1 / sqrt(1 - v**2 / c**2)
a = Efield*c**2/(lorentz**3*m)
t = t + dt
x = x + v*dt
v = v + a*dt
E = lorentz * m
# Write the new values into the arrays
tArray[i] = t
xArray[i] = x
vArray[i] = v
EArray[i] = E
lorentzArray[i] = lorentz
end = time()
print('Elapsed time:', end-start)
# The following lines are added for Exercise 7
KE_numerical = lorentz * m - m
KE_analytical = Efield*x
print('Numerical KE: ', KE_numerical)
print('Analytical KE:', KE_analytical)
print('Percent Difference:', 100*abs(KE_numerical-KE_analytical)/KE_analytical)
# Create plots
figure(1)
plot(tArray, vArray, linewidth=2)
xlabel('Time (sec)')
ylabel('Speed (m/s)')
grid(True)
ylim([0, 3.1e8])
savefig('ultrarelativistic_v_vs_t.png')
show()
figure(2)
plot(tArray, xArray, linewidth=2)
xlabel('Time (sec)')
ylabel('Position (m)')
grid(True)
savefig('ultrarelativistic_x_vs_t.png')
show()
figure(3)
plot(tArray, EArray, linewidth=2)
xlabel('Time (sec)')
ylabel('Energy (eV)')
grid(True)
savefig('ultrarelativistic_E_vs_t.png')
show()
Translations
Code | Language | Translator | Run | |
---|---|---|---|---|
![]() |
Credits
Fremont Teng; Loo Kang Wee; based on codes by Larry Engelhardt
Sources: Excerpts from the webpage with the same title (provided twice).
1. Overview
This resource from Open Educational Resources / Open Source Physics @ Singapore provides a set of exercises and a JavaScript simulation applet (built using EasyJavaScriptSimulations) focused on understanding relativistic dynamics in one dimension under a constant force. The primary goal is to help students transition from non-relativistic (Newtonian) to relativistic mechanics by simulating the motion of a proton in a uniform electric field. The exercises guide students through setting up simulations, analyzing units, interpreting results (including plots), observing the breakdown of non-relativistic physics, and applying these concepts to real-world scenarios like particle accelerators (specifically the LHC).
2. Main Themes and Important Ideas/Facts
- Transition from Non-Relativistic to Relativistic Dynamics: The core theme is to illustrate the differences between classical and relativistic mechanics. The exercises begin with non-relativistic simulations and then progressively introduce relativistic corrections. The "About" section explicitly states: "We will begin by simulating a proton in an electric field using the NON-relativistic 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 non-relativistic to relativistic dynamics."
- Importance of Units in Relativistic Motion: The resource emphasizes the necessity of careful unit handling, particularly with electron volts (eV) and the speed of light (c). The "About" section highlights the need to "be careful when working with non-SI units. In particular, we will need to pay close attention to factors of eV and c c style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-top-width: 0px; border-right-style: none; border-right-width: 0px; border-bottom-style: none; border-bottom-width: 0px; border-left-style: none; border-left-width: 0px; display: inline; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: normal"> style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-top-width: 0px; border-right-style: none; border-right-width: 0px; border-bottom-style: none; border-bottom-width: 0px; border-left-style: none; border-left-width: 0px; display: inline; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: normal"> ." Exercise 2 specifically focuses on manipulating and explaining these units.
- Breakdown of Non-Relativistic Newton's 2nd Law: A key learning objective is for students to "Observe and explain when the non-relativistic form of Newton’s 2nd Law breaks down ( Exercise 3 )." This likely involves observing that as the proton's speed approaches the speed of light, the classical relationship between force, mass, and acceleration no longer accurately describes the motion.
- Relativistic Form of Newton's 2nd Law: The exercises lead students to "Derive the relativistic form of Newton’s 2nd Law ( Exercise 4 )" and subsequently "Modify a non-relativistic simulation to incorporate relativity ( Exercise 5 )." This signifies a progression towards understanding the correct physical laws in high-speed scenarios.
- Simulation and Data Analysis: The resource heavily relies on a provided JavaScript simulation. Students are expected to "Execute a working simulation..." and "Produce and interpret plots for relativistic motion ( Exercises 6, 7, 8 )" such as energy vs. time, speed vs. time, and position vs. time. This emphasizes computational physics and data analysis skills.
- Validation and Analytical Solutions: Exercise 7 involves validating numerical results obtained from the simulation by comparing them with an analytical solution, promoting understanding of the accuracy and limitations of numerical methods. The provided Python code snippet calculates both "Numerical KE" and "Analytical KE" and then prints the "Percent Difference."
- Application to Particle Accelerators: Exercises 9 and 10 directly apply the simulated concepts to a real-world context: particle accelerators. Exercise 10 specifically asks students to simulate a proton at the LHC, which uses a very large electric field: "At the LHC, protons are accelerated using much larger electric fields, ϵ = 5 × 10 6 Volts/meter. Use your program to simulate a proton at the LHC being accelerated by this large electric field." This connects the theoretical concepts to cutting-edge physics research.
- Computational Efficiency (Exercise 11): Exercise 11, relevant for programming languages like Python or MATLAB, addresses computational efficiency. It highlights the performance impact of repeatedly appending data to arrays and instructs students to rewrite their code to pre-allocate array sizes. This demonstrates a practical aspect of scientific computing. The provided Python code in "Complete_RelativisticDynamics_Faster.py" already implements this pre-allocation using zeros(N). The exercise suggests that "much of the computation time is consumed by appending new values onto the arrays." Rewriting the code to pre-allocate aims to improve the program's speed.
- Availability in Multiple Implementations: The "Available Implementations" section indicates that the exercises are available in "IPython/Jupyter Notebook and Python," suggesting flexibility in how students can engage with the material beyond the JavaScript applet.
- Open Educational Resource: The resource is explicitly labeled as an "Open Educational Resource" and uses a "Creative Commons Attribution-Share Alike 4.0 Singapore License," encouraging sharing and adaptation.
3. JavaScript Simulation Applet
The resource provides an embedded iframe link to a JavaScript simulation applet. This applet is central to the exercises, allowing students to visually explore the motion of a proton under a constant electric field and observe the effects of relativity.
4. Python Code Example
The provided Python code ("Complete_RelativisticDynamics_Faster.py") serves as an example of how one might implement the relativistic dynamics simulation. Key aspects of the code include:
- Defining physical constants like the speed of light (c) and the mass of the proton (m).
- Setting initial conditions for position (x), velocity (v), and time (t).
- Defining simulation parameters like the time step (dt) and maximum time (tMax).
- Pre-allocating arrays (tArray, xArray, vArray, EArray, lorentzArray) to store simulation data.
- Implementing a loop that iteratively calculates the Lorentz factor (lorentz), relativistic acceleration (a), updates position and velocity, and calculates relativistic energy (E).
- Calculating and comparing numerical and analytical kinetic energy.
- Generating plots of speed vs. time, position vs. time, and energy vs. time using pylab.
5. Learning Objectives
The listed learning objectives clearly outline the intended outcomes for students engaging with this resource. They range from basic simulation execution to a deeper understanding of relativistic concepts and their application.
6. Exercise 10 and 11 Details
- Exercise 10 (LHC Simulation): This exercise requires students to adapt their simulation parameters (time step and maximum time) to model the acceleration of a proton in the significantly larger electric field found in the LHC. The expected outcome is a discussion of the simulation results under these extreme conditions.
- Exercise 11 (Code Optimization): This exercise focuses on improving the efficiency of the simulation code by pre-allocating arrays instead of dynamically appending data. Students are asked to observe and discuss the impact on computation time.
7. Credits and Licensing
The resource credits Larry Engelhardt for the initial development, with Fremont Teng and Loo Kang Wee contributing to its current form. The content is openly licensed under a Creative Commons license.
8. Connections to Other Resources
The webpage includes a long list of other interactive simulations and resources available on the platform, indicating a broader collection of open educational materials. The "Popular Tags" section highlights related subject areas like "Modern Physics," "PICUP," and concepts like "Newtonian Mechanics" and "Calculus."
In conclusion, this resource provides a comprehensive and interactive approach to learning about relativistic dynamics in one dimension. It combines conceptual explanations with hands-on simulation, data analysis, and real-world applications, making it a valuable tool for students beyond their first year of physics education
Relativistic Dynamics Study Guide
Key Concepts
- Non-relativistic Motion: Motion described by Newtonian mechanics, where mass is constant and velocities are much smaller than the speed of light.
- Relativistic Motion: Motion where speeds are significant compared to the speed of light, requiring the principles of special relativity, where mass increases with velocity and time dilation occurs.
- Newton's Second Law: In its non-relativistic form (F=ma), force equals mass times acceleration. In its relativistic form, the relationship between force and acceleration becomes more complex due to the velocity-dependence of mass.
- Uniform Electric Field: An electric field with constant magnitude and direction.
- Proton Acceleration: The process of increasing the kinetic energy of a proton by subjecting it to an electric field, resulting in an increase in its velocity.
- Electronvolt (eV): A unit of energy equal to the work done on an electron when it is accelerated through an electric potential difference of one volt. It is often used in particle physics.
- Speed of Light (c): The fundamental physical constant representing the speed at which electromagnetic radiation propagates in a vacuum, approximately 2.998 × 10⁸ m/s.
- Lorentz Factor (γ): A factor that describes how measurements of time, length, and mass change for an object that is moving relative to an observer. It is given by γ = 1 / √(1 - v²/c²).
- Relativistic Mass: The mass of an object as measured by an observer who is moving relative to the object. It is given by m_rel = γm₀, where m₀ is the rest mass.
- Relativistic Energy: The total energy of a particle, including its rest mass energy and kinetic energy. It is given by E = γmc² or E² = (pc)² + (mc²)², where p is the relativistic momentum.
- Kinetic Energy (KE): The energy an object possesses due to its motion. In relativistic terms, KE = E - mc² = (γ - 1)mc².
- Simulation: A computational model used to represent and study the behavior of a real-world system.
- Time Step (dt): The discrete intervals of time used in a numerical simulation to approximate continuous changes.
- Maximum Time (tMax): The total duration of a simulation.
- Arrays: Data structures used in programming to store a collection of elements of the same data type, accessed by an index.
- Appending to Arrays: Adding new elements to the end of an existing array. This can be computationally expensive for large arrays.
- Pre-allocation of Arrays: Creating arrays with a fixed size at the beginning of a program, which can improve performance compared to repeated appending.
- Analytical Solution: An exact mathematical solution to a problem, as opposed to a numerical approximation.
- Numerical Solution: An approximate solution to a problem obtained through numerical methods, such as computer simulations.
- Large Hadron Collider (LHC): The world's largest and most powerful particle accelerator located at CERN near Geneva, Switzerland.
Quiz
Answer the following questions in 2-3 sentences each.
- What is the fundamental difference between non-relativistic and relativistic dynamics in terms of how mass is treated?
- Explain the role of a uniform electric field in the context of accelerating a charged particle like a proton.
- Why is it important to consider special relativity when dealing with particles moving at speeds approaching the speed of light?
- Define the electronvolt (eV) and explain why it is a convenient unit of energy in particle physics.
- How does the Lorentz factor relate to the speed of an object, and what happens to its value as the object's speed approaches the speed of light?
- In relativistic dynamics, how does the relationship between force and acceleration differ from Newton's second law (F=ma)?
- What is the purpose of running a simulation of relativistic motion, and what kind of insights can it provide?
- Explain the concept of a time step in a simulation and why choosing an appropriate time step is important for accuracy and efficiency.
- According to the provided text, why can repeatedly appending data to arrays in a simulation lead to slower computation times?
- What was the specific modification suggested in Exercise 11 to improve the efficiency of storing data in arrays during a simulation?
Quiz Answer Key
- In non-relativistic dynamics, mass is considered a constant property of an object, regardless of its velocity. However, in relativistic dynamics, the mass of an object increases as its velocity increases, approaching infinity as the velocity approaches the speed of light.
- A uniform electric field exerts a constant force on a charged particle placed within it, according to the equation F = qE (where q is the charge and E is the electric field). This constant force causes the particle to accelerate along the direction of the field (for a positive charge like a proton).
- When particles move at speeds approaching the speed of light, the predictions of non-relativistic mechanics start to deviate significantly from experimental observations. Special relativity provides the correct framework for describing the motion and energy of these particles, taking into account effects like time dilation and mass increase.
- An electronvolt (eV) is the amount of kinetic energy gained by a single electron accelerating from rest through an electric potential difference of one volt. It is convenient in particle physics because the energies of individual particles involved in experiments are often on the order of electronvolts or its multiples (keV, MeV, GeV).
- The Lorentz factor (γ) is given by 1 / √(1 - v²/c²) and increases as the speed (v) of an object approaches the speed of light (c). As v gets closer to c, the denominator approaches zero, causing the Lorentz factor to approach infinity.
- In relativistic dynamics, the relativistic mass of an object changes with its velocity, so the simple form F=ma is no longer directly applicable with the rest mass. The relativistic form of Newton's second law involves the rate of change of relativistic momentum (p = γmv), making the relationship between force and acceleration more complex, with acceleration not necessarily being in the same direction as the force.
- Running a simulation of relativistic motion allows us to observe and analyze the behavior of particles under conditions where relativistic effects are significant. This can help in understanding the transition from non-relativistic to relativistic dynamics, interpreting experimental results from particle accelerators, and validating theoretical predictions.
- A time step (dt) is the small increment of time by which a simulation progresses in each iteration. Choosing an appropriate time step is crucial; too large a time step can lead to inaccurate results and instability, while too small a time step can make the simulation computationally expensive and time-consuming.
- Repeatedly appending data to arrays in a simulation can be inefficient because many programming languages need to create a new, larger array and copy the existing elements whenever an element is appended. This overhead can significantly slow down the computation, especially for simulations with a very large number of time steps.
- Exercise 11 suggested rewriting the simulation code to pre-allocate large empty arrays before the main loop. Then, within each iteration of the loop, the newly calculated values are directly assigned to the corresponding element of the pre-allocated array using its index, avoiding the overhead of repeated appending.
Essay Format Questions
- Discuss the limitations of using non-relativistic Newtonian mechanics to describe the motion of particles in high-energy environments like the Large Hadron Collider. How does the incorporation of special relativity provide a more accurate description?
- Explain the significance of the Lorentz factor in relativistic dynamics. Describe how it affects different physical quantities such as mass, time, and length for objects moving at relativistic speeds.
- The provided simulation involves the motion of a proton in a uniform electric field. Analyze the energy transformations occurring in this system, contrasting the non-relativistic and relativistic perspectives on kinetic energy and total energy.
- Exercise 11 focuses on optimizing the computational efficiency of the simulation by changing how data is stored. Discuss the trade-offs between different methods of storing data in simulations (e.g., appending vs. pre-allocation) and explain why pre-allocation can be advantageous in certain scenarios.
- Based on the information provided about Exercise 10, discuss the challenges and considerations involved in simulating particle motion at the scale of the Large Hadron Collider. What adjustments to simulation parameters (like time step and maximum time) might be necessary, and why?
Glossary of Key Terms
- Acceleration (a): The rate of change of velocity with respect to time.
- Constant Force: A force that maintains a consistent magnitude and direction over time.
- Dynamics: The branch of physics concerned with the motion of objects and the forces that cause these motions.
- Electric Field (E): A region of space around an electrically charged particle or object within which a force would be exerted on other electrically charged particles or objects.
- Energy (E): The capacity to do work.
- Force (F): An interaction that, when unopposed, will change the motion of an object.
- JavaScript: A high-level, often just-in-time compiled language that conforms to the ECMAScript specification. It is used to make web pages interactive.
- Mass (m): A fundamental property of an object that measures its resistance to acceleration when a force is applied.
- Momentum (p): A measure of the quantity of motion of a body. In non-relativistic mechanics, it is the product of mass and velocity (p = mv). In relativistic mechanics, it is given by p = γmv.
- Numerical Method: A technique used to approximate the solution to a mathematical problem using numerical calculations.
- Position (x): The location of an object in space with respect to a reference point.
- Proton: A subatomic particle with a positive electric charge of +1e, where e is the elementary charge.
- Relativity (Special): A physical theory of the relationship between space and time. Postulates include the constancy of the speed of light in all inertial frames of reference and the principle that the laws of physics are invariant under Lorentz transformations.
- Velocity (v): The rate of change of position with respect to time, with a specified direction.
- Volt (V): The SI derived unit for electric potential, electric potential difference (voltage), and electromotive force.
Version:
- https://www.compadre.org/PICUP/exercises/exercise.cfm?I=103&A=RelativisticDynamics-1D-ConstantForce
- http://weelookang.blogspot.com/2018/06/picup-relativistic-dynamics-in-1d-with.html
- http://weelookang.blogspot.com/2018/06/relativistic-dynamics-in-1d-with.html
Other Resources
end faq
{accordionfaq faqid=accordion4 faqclass="lightnessfaq defaulticon headerbackground headerborder contentbackground contentborder round5"}
Frequently Asked Questions: Relativistic Dynamics Simulation
What is the purpose of the "PICUP Relativistic Dynamics in 1D with a constant force" simulation?
The primary goal of this simulation is to allow users to explore and understand the motion of a charged particle (specifically a proton) under the influence of a uniform electric field, comparing non-relativistic Newtonian dynamics with the predictions of special relativity. By running and modifying the simulation, users can observe when classical mechanics breaks down and the relativistic effects become significant.
What key physical concepts does this simulation aim to illustrate?
This simulation focuses on several fundamental concepts in physics, including Newton's Second Law of Motion (both non-relativistic and relativistic forms), the concept of electric force, the effects of special relativity on dynamics (such as the increase of mass with velocity and the speed limit of light), the relationship between energy and velocity in relativistic scenarios, and the importance of using appropriate units in relativistic calculations.
How does the simulation allow users to observe the transition from non-relativistic to relativistic dynamics?
The exercises associated with the simulation guide users to first simulate the motion using the non-relativistic form of Newton's Second Law. Then, users are instructed to modify the simulation to incorporate relativistic corrections, specifically the relativistic mass increase. By comparing the results of these two simulations (e.g., plots of velocity vs. time and energy vs. time), users can directly observe the point at which the non-relativistic model deviates significantly from the relativistic one, typically at very high velocities approaching the speed of light.
What is the significance of the units (eV and c) mentioned in the context of relativistic motion within the simulation?
In relativistic physics, it is often convenient to use energy units of electron volts (eV) and to express speeds as fractions of the speed of light (c). This avoids dealing with very large or very small numbers in SI units. The simulation likely requires users to pay attention to conversion factors involving eV and c when setting up parameters, especially the mass of the proton, which is given in eV/c². Understanding these units is crucial for accurate relativistic calculations and interpreting the simulation results.
How does Exercise 10 relate the simulation to real-world applications, such as the Large Hadron Collider (LHC)?
Exercise 10 provides a practical context by asking users to apply the relativistic simulation to model a proton being accelerated by the strong electric fields present in the LHC. By using the specified electric field strength and adjusting simulation parameters like the time step and maximum time, users can gain insight into the behavior of particles in high-energy accelerators where relativistic effects are dominant. This exercise highlights the real-world relevance and importance of relativistic dynamics.
What is the purpose of deriving the relativistic form of Newton's Second Law (Exercise 4) in the context of this simulation?
Deriving the relativistic form of Newton's Second Law (F = dp/dt, where p is the relativistic momentum) helps students understand the theoretical underpinnings of the relativistic simulation. It emphasizes that as an object's velocity approaches the speed of light, its momentum increases in a non-linear way with velocity due to the relativistic mass increase (m = γm₀), leading to a different relationship between force and acceleration compared to the non-relativistic case (F = ma).
Why does Exercise 11 focus on rewriting the code to store data in arrays differently, and how does this affect computation time?
Exercise 11 addresses a practical aspect of numerical simulation efficiency. In many programming environments, repeatedly appending data to arrays can be computationally expensive as it may involve creating new, larger arrays in each step. By pre-allocating the full size of the arrays before the simulation loop and then filling in the elements by index in each iteration, the program can avoid this overhead, leading to a significant reduction in computation time, especially for simulations with a large number of time steps. This exercise highlights the importance of efficient coding practices in scientific computing.
What types of plots are generated and interpreted in this simulation, and what information do they provide about the motion?
The simulation generates plots of time versus speed, time versus position, and time versus energy. The speed vs. time plot illustrates how the proton's velocity changes under the constant electric force, showing the deviation from the linear increase predicted by non-relativistic physics as the speed approaches the speed of light. The position vs. time plot shows the trajectory of the proton. The energy vs. time plot demonstrates how the proton's total energy (including its relativistic mass energy) increases over time due to the work done by the electric field. Interpreting these plots allows users to visually observe and analyze the characteristics of relativistic motion.
- Details
- Written by Loo Kang Wee
- Parent Category: Physics
- Category: 06 Modern Physics
- Hits: 4266