Charged Particles

Activity Information

Learning Goals

  • Calculated the electrostatic force between two point charged, such as electrons or protons
  • Given a collection of points, find the position where the net force on a test charge equals 0
  • Create a real-world environment given a minimally working code
  • Graph the relationship between net force and position of a test charge

Prior Knowledge Required

  • Coulomb's law
    • $F=k\dfrac{q_1q_2}{r^2}$
  • Vector mathematics
  • Principle of superposition

Code Manipulation

  • Copy/paste code
  • Modify existing code
  • while loops and if statements
  • Translate physical qualities and equations into code

—-

Activity

Handout

Charged Particles

Where should a particle be placed around two charged particles so that the total force acting on the particle is zero. Open the minimally working code (below) and answer the following questions:

  1. Where are Charge 1, Charge 2, and the Test Charge initially located?
  2. What is the charge on Charge 1? Charge 2? the Test Charge?
  3. Based on the charges, will the force of Charge 1 on the Test Charge be attractive or repulsive?
  4. Based on the charges, will the force of Charge 2 on the Test Charge be attractive or repulsive?
  5. Which force do you expect to be stronger?

Now within your program, develop an equation to calculate the force on your test particle by Charge 1. Likewise, develop an equation to calculate the force on your test particle by Charge 2. Using the forces you calculated, create an equation for the net force on your test particle, and subsequently the acceleration of the test particle. Use the acceleration to update the position of the particle within the while loop. Lastly, graph the force on the test particle with respect to distance from Charge 1, and do the same with Charge 2.

Code

  1. GlowScript 2.7 VPython
  2. #Created by Meagan Brasseur, Sofia Villanueva, and John Plough on August 9,2019
  3.  
  4. ##Objects##
  5. Charge1 = sphere(pos=vec(0,0,0), radius=0.1, color=color.cyan)
  6. Charge2 = sphere(pos=vec(5,0,0), radius=0.1, color=color.cyan)
  7. Tcharge = sphere(pos=vec(2.5,2.5,0), radius=0.05, color=color.red)
  8.  
  9. #Coulombic charges of our spheres
  10.  
  11. q1 = 6.0*10**(-19)
  12. q2 = 6.0*10**(-19)
  13. qt = -1.6*10**(-19)
  14.  
  15. ##Constants##
  16. k = 9*10**9
  17. mTest = 9.11*10**(-31)
  18. vTest = vec(0,0,0)
  19.  
  20. ## Create graphs to track force
  21. Grph1 = graph(title='Force (1) v Distance', xtitle='Distance (m)', ytitle='Force (N)', fast=False, ymin=-1.4E-28, ymax=-1.3E-28) #initialize our graphs.
  22. F1Graph = gcurve(color=color.green, label='Force of Charge 1 on Test Charge') #Make a graph for the force on the test charge with respect to distance from Charge1.
  23.  
  24. Grph1 = graph(title='Force (2) v Distance', xtitle='Distance (m)', ytitle='Force (N)', fast=False, ymin=1.4E-28, ymax=1.3E-28) #initialize our graphs.
  25. F2Graph = gcurve(color=color.green, label='Force of Charge 2 on Test Charge') #Make a graph for the force on the test charge with respect to distance from Charge2.
  26.  
  27. #Set up time variables for while loop
  28. t=0
  29. dt=1*10**(-4)
  30. tf=1
  31.  
  32. #While loop to iterate over the time interval
  33.  
  34. while t < tf:
  35. rate(100)
  36. # Defines the rate at which the program runs #
  37.  
  38. ##Hint: For the following calculations, break them up into components!##
  39.  
  40. #Come up with an equation for the force on your test charge from Charge 1
  41.  
  42. F1tx =
  43.  
  44. if Tcharge.pos.x <= Charge1.pos.x :
  45. F1tx =
  46.  
  47. F1ty =
  48.  
  49. if Tcharge.pos.y <= Charge1.pos.y :
  50. F1ty =
  51.  
  52. F1tz =
  53.  
  54. if Tcharge.pos.z <= Charge1.pos.z :
  55. F1tz =
  56.  
  57. F1t = vec(F1tx,F1ty,F1tz)
  58.  
  59. # print("F1t = ", mag(F1t))
  60.  
  61. ##Come up with an equation for the force on your test charge from Charge 2
  62.  
  63. F2tx =
  64.  
  65. if Tcharge.pos.x <= Charge2.pos.x :
  66. F2tx =
  67.  
  68. F2ty =
  69.  
  70. Tcharge.pos.y <= Charge2.pos.y :
  71. F2ty =
  72.  
  73. F2tz =
  74.  
  75. Tcharge.pos.z <= Charge2.pos.z :
  76. F2tz =
  77.  
  78. F2t = vec(F2tx,F2ty,F2tz)
  79. #
  80. ##Come up with an equation for the net force on your test charge from both charges
  81. #
  82. Fnetx =
  83. Fnety =
  84. Fnetz =
  85.  
  86. Fnet =
  87.  
  88. #Come up with an equation for the net acceleration of your test charge from both charges
  89.  
  90. at =
  91.  
  92. at =
  93.  
  94. #Update the position of the test charge using the equation you came up with for acceleration.
  95.  
  96. vTest = vTest + at*dt
  97.  
  98. Tcharge.pos = Tcharge.pos + vTest*dt
  99.  
  100.  
  101. #Graph the Net Force on the Test charge with regards to position.
  102.  
  103. F1Graph.plot(mag(Tcharge.pos),mag(F1t))
  104. F2Graph.plot(mag(Tcharge.pos),mag(F2t))
  105.  
  106. t = t + dt

Answer Key

Handout

  1. Charge 1 is at the origin (0,0,0), Charge 2 is at (5,0,0), and the Test Charge is at (2.5,2.5,0)
  2. Charge 1 and Charge 2 are both $6.0*10^{-19}$ C, and the Test Charge is $-1.6*10^{-19}$ C.
  3. Because Charge 1 is positive and the the Test Charge is negative, the force will be attractive.
  4. See previous
  5. The Test Charge is located exactly halfway between Charge 1 and Charge 2 and slightly above both. Because the sign and magnitude of Charge 1 and Charge 2 are the same, the force they exert on the test particle will also be the same.

Code

  1. GlowScript 2.7 VPython
  2. #Created by Meagan Brasseur, Sofia Villanueva, and John Plough on August 9,2019
  3.  
  4. ##Objects##
  5. Charge1 = sphere(pos=vec(0,0,0), radius=0.1, color=color.cyan)
  6. Charge2 = sphere(pos=vec(5,0,0), radius=0.1, color=color.cyan)
  7. Tcharge = sphere(pos=vec(2.5,2.5,0), radius=0.05, color=color.red)
  8.  
  9. #Coulombic charges of our spheres
  10.  
  11. q1 = 6.0*10**(-19)
  12. q2 = 6.0*10**(-19)
  13. qt = -1.6*10**(-19)
  14.  
  15. ##Constants##
  16. k = 9*10**9
  17. mTest = 9.11*10**(-31)
  18. vTest = vec(0,0,0)
  19.  
  20. ## Create graphs to track force
  21. Grph1 = graph(title='Force (1) v Distance', xtitle='Distance (m)', ytitle='Force (N)', fast=False, ymin=-1.4E-28, ymax=-1.3E-28) #initialize our graphs.
  22. F1Graph = gcurve(color=color.green, label='Force of Charge 1 on Test Charge') #Make a graph for the force on the test charge with respect to distance from Charge1.
  23.  
  24. Grph1 = graph(title='Force (2) v Distance', xtitle='Distance (m)', ytitle='Force (N)', fast=False, ymin=1.4E-28, ymax=1.3E-28) #initialize our graphs.
  25. F2Graph = gcurve(color=color.green, label='Force of Charge 2 on Test Charge') #Make a graph for the force on the test charge with respect to distance from Charge2.
  26.  
  27. #Set up time variables for while loop
  28. t=0
  29. dt=1*10**(-4)
  30. tf=1
  31.  
  32. #While loop to iterate over the time interval
  33.  
  34. while t < tf:
  35. rate(100)
  36. # Defines the rate at which the program runs #
  37.  
  38. ##Hint: For the following calculations, break them up into components!##
  39.  
  40. #Come up with an equation for the force on your test charge from Charge 1
  41.  
  42. F1tx = k*q1*qt/((Tcharge.pos.x-Charge1.pos.x)**2)
  43.  
  44. if Tcharge.pos.x <= Charge1.pos.x :
  45. F1tx = -F1tx
  46.  
  47. F1ty = k*q1*qt/(((Tcharge.pos.y)-(Charge1.pos.y))**2)
  48.  
  49. if Tcharge.pos.y <= Charge1.pos.y :
  50. F1ty = -F1ty
  51.  
  52. F1tz = k*q1*qt/((Tcharge.pos.z-Charge1.pos.z)**2)
  53.  
  54. if Tcharge.pos.z <= Charge1.pos.z :
  55. F1tz = -F1tz
  56.  
  57. F1t = vec(F1tx,F1ty,F1tz)
  58.  
  59. # print("F1t = ", mag(F1t))
  60.  
  61. ##Come up with an equation for the force on your test charge from Charge 2
  62.  
  63. F2tx = k*q2*qt/(((Tcharge.pos.x)-(Charge2.pos.x))**2)
  64.  
  65. if Tcharge.pos.x <= Charge2.pos.x :
  66. F2tx = -F2tx
  67.  
  68. F2ty = k*q2*qt/(((Tcharge.pos.y)-(Charge2.pos.y))**2)
  69.  
  70. Tcharge.pos.y <= Charge2.pos.y :
  71. F2ty = -F2ty
  72.  
  73. F2tz = k*q2*qt/(((Tcharge.pos.z)-(Charge2.pos.z))**2)
  74.  
  75. Tcharge.pos.z <= Charge2.pos.z :
  76. F2tz = -F2tz
  77.  
  78. F2t = vec(F2tx,F2ty,F2tz)
  79. #
  80. ##Come up with an equation for the net force on your test charge from both charges
  81. #
  82. Fnetx = F1tx + F2tx
  83. Fnety = F1ty + F2ty
  84. Fnetz = F1tz + F2tz
  85.  
  86. Fnet = vec(Fnetx,Fnety,Fnetz)
  87.  
  88. #Come up with an equation for the net acceleration of your test charge from both charges
  89.  
  90. at = vec(Fnetx/mTest,Fnety/mTest,Fnetz/mTest)
  91.  
  92. at = vec((F1tx)/mTest,0,0)
  93.  
  94. #Update the position of the test charge using the equation you came up with for acceleration.
  95.  
  96. vTest = vTest + at*dt
  97.  
  98. Tcharge.pos = Tcharge.pos + vTest*dt
  99.  
  100.  
  101. #Graph the Net Force on the Test charge with regards to position.
  102.  
  103. F1Graph.plot(mag(Tcharge.pos),mag(F1t))
  104. F2Graph.plot(mag(Tcharge.pos),mag(F2t))
  105.  
  106. t = t + dt

See Also

  • repository/charged_particles.txt
  • Last modified: 2021/02/02 23:29
  • by porcaro1