This is an old revision of the document!


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.  

Answer Key

Handout

Code

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

See Also

  • repository/charged_particles.1612307205.txt.gz
  • Last modified: 2021/02/02 23:06
  • by porcaro1