This is an old revision of the document!


Magnetic Field Deflection

Activity Information

Learning Goals

  • Understanding the relationship between force and motion
  • Calculating cross products
  • Ask questions about data to determine the factors that affect the strength of electric and magnetic forces ( MS-PS2-3)

Prior Knowledge Required

  • Lorentz force
    • $F=qE+qv \times B$
  • Vector manipulation
  • Graphing data points

Code Manipulation

  • Copying/pasting code
  • Modifying existing code
  • Using while loops
  • Translating physical quantities and equations into code

—-

Activity

Handout

Magnetic Field Deflection

In this activity you will be simulating the effect of a charged particle moving perpendicularly through a uniform magnetic field. The starter code assumes a positive particle moving to the right (+x direction) moving through a magnetic field oriented out of the screen (+z direction). Load the provided code into your GlowScript workspace.

Run the code. The red particle passes straight through the region defining the magnetic field without deflection. Your task is to add to the existing code so that the program will simulate the motion of the particle as it experiences the effect of the magnetic force. Use the provided charge, mass, velocity, and field strength values as you add the necessary lines of code to accurately simulate the deflection effect.

Once the code is working properly, answer the following questions. Be sure to take note of the initial values for charge, mass, velocity, and field strength (assume standard SI units):

  1. Increase the initial speed of the charged particle. What effect does this have on the radius of the curved path compared to the original path?
  2. Reset the speed to the initial conditions. Now, increase the magnitude of the charge of the particle. What effect does this have on the radius of the curved path compared to the original path?
  3. Reset the charge to the initial conditions. Now, increase the mass of the particle. What effect does this have on the radius of the curved path compared to the original path?
  4. Reset the mass to the initial conditions. Now, increase the magnetic field strength. What effect does this have on the radius of the curved path compared to the original path?
  5. Based on your observations, describe the relationship between the radius of curvature and:
    1. speed
    2. charge
    3. mass
    4. field strength
  6. Make the charge of the particle negative and run the code. What happened?
  7. What effect does the influence of the magnetic field have on the particle velocity? How can you check this with the program code?

Code

Link

  1. GlowScript 2.8 VPython
  2.  
  3. scene.width = 824
  4. scene.height = 568
  5.  
  6. #consider the charge to be positive and the magnetic field to be in the positive z direction--out of the screen.
  7. field = box(pos=vector(0,0,0), size=vector(200,200,10), axis=vector(1,0,0), color=color.white, opacity=0.3)
  8. charge = sphere(pos=vector(-150,90,0), radius=2, color=color.red, make_trail=True)
  9.  
  10. vcharge = vector(5,0,0)
  11.  
  12. dt = .1
  13.  
  14. while charge.pos.y > 0:
  15. rate(120)
  16. charge.pos = charge.pos + vcharge*dt

Answer Key

Handout

Code

Link

  1. GlowScript 2.8 VPython
  2.  
  3. scene.width = 800
  4.  
  5. #consider the charge to be positive and the magnetic field to be in the positive z direction--out of the screen.
  6. field = box(pos=vector(0,0,0), size=vector(200,200,10), axis=vector(1,0,0), color=color.white, opacity=0.3)
  7. charge = sphere(pos=vector(-149,90,0), radius=2, color=color.red, make_trail=True)
  8. qval = 2E-4
  9. mass = 0.1
  10. vcharge = vector(5,0,0)
  11. mom = mass*vcharge
  12. B = vector(0,0,30.0)
  13.  
  14. dt = .1
  15.  
  16. while charge.pos.y > -150 and charge.pos.x > -150:
  17. rate(120)
  18. if charge.pos.x < -100:
  19. charge.pos = charge.pos + vcharge*dt
  20. else:
  21. if charge.pos.x < 100 and charge.pos.y > -100:
  22. force = qval*cross(vcharge,B)
  23. mom = mom + force*dt
  24. charge.pos = charge.pos +mom/mass*dt
  25. vcharge = mom/mass
  26. else:
  27. charge.pos = charge.pos + vcharge*dt

See Also

  • repository/magnetic_field_deflection.1599590411.txt.gz
  • Last modified: 2020/09/08 18:40
  • by porcaro1