=====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: - Where are Charge 1, Charge 2, and the Test Charge initially located? - What is the charge on Charge 1? Charge 2? the Test Charge? - Based on the charges, will the force of Charge 1 on the Test Charge be attractive or repulsive? - Based on the charges, will the force of Charge 2 on the Test Charge be attractive or repulsive? - 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=== GlowScript 2.7 VPython #Created by Meagan Brasseur, Sofia Villanueva, and John Plough on August 9,2019 ##Objects## Charge1 = sphere(pos=vec(0,0,0), radius=0.1, color=color.cyan) Charge2 = sphere(pos=vec(5,0,0), radius=0.1, color=color.cyan) Tcharge = sphere(pos=vec(2.5,2.5,0), radius=0.05, color=color.red) #Coulombic charges of our spheres q1 = 6.0*10**(-19) q2 = 6.0*10**(-19) qt = -1.6*10**(-19) ##Constants## k = 9*10**9 mTest = 9.11*10**(-31) vTest = vec(0,0,0) ## Create graphs to track force 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. 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. 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. 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. #Set up time variables for while loop t=0 dt=1*10**(-4) tf=1 #While loop to iterate over the time interval while t < tf: rate(100) # Defines the rate at which the program runs # ##Hint: For the following calculations, break them up into components!## #Come up with an equation for the force on your test charge from Charge 1 F1tx = if Tcharge.pos.x <= Charge1.pos.x : F1tx = F1ty = if Tcharge.pos.y <= Charge1.pos.y : F1ty = F1tz = if Tcharge.pos.z <= Charge1.pos.z : F1tz = F1t = vec(F1tx,F1ty,F1tz) # print("F1t = ", mag(F1t)) ##Come up with an equation for the force on your test charge from Charge 2 F2tx = if Tcharge.pos.x <= Charge2.pos.x : F2tx = F2ty = Tcharge.pos.y <= Charge2.pos.y : F2ty = F2tz = Tcharge.pos.z <= Charge2.pos.z : F2tz = F2t = vec(F2tx,F2ty,F2tz) # ##Come up with an equation for the net force on your test charge from both charges # Fnetx = Fnety = Fnetz = Fnet = #Come up with an equation for the net acceleration of your test charge from both charges at = at = #Update the position of the test charge using the equation you came up with for acceleration. vTest = vTest + at*dt Tcharge.pos = Tcharge.pos + vTest*dt #Graph the Net Force on the Test charge with regards to position. F1Graph.plot(mag(Tcharge.pos),mag(F1t)) F2Graph.plot(mag(Tcharge.pos),mag(F2t)) t = t + dt ---- ====Answer Key==== ===Handout=== - 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) - Charge 1 and Charge 2 are both $6.0*10^{-19}$ C, and the Test Charge is $-1.6*10^{-19}$ C. - Because Charge 1 is positive and the the Test Charge is negative, the force will be attractive. - See previous - 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=== GlowScript 2.7 VPython #Created by Meagan Brasseur, Sofia Villanueva, and John Plough on August 9,2019 ##Objects## Charge1 = sphere(pos=vec(0,0,0), radius=0.1, color=color.cyan) Charge2 = sphere(pos=vec(5,0,0), radius=0.1, color=color.cyan) Tcharge = sphere(pos=vec(2.5,2.5,0), radius=0.05, color=color.red) #Coulombic charges of our spheres q1 = 6.0*10**(-19) q2 = 6.0*10**(-19) qt = -1.6*10**(-19) ##Constants## k = 9*10**9 mTest = 9.11*10**(-31) vTest = vec(0,0,0) ## Create graphs to track force 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. 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. 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. 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. #Set up time variables for while loop t=0 dt=1*10**(-4) tf=1 #While loop to iterate over the time interval while t < tf: rate(100) # Defines the rate at which the program runs # ##Hint: For the following calculations, break them up into components!## #Come up with an equation for the force on your test charge from Charge 1 F1tx = k*q1*qt/((Tcharge.pos.x-Charge1.pos.x)**2) if Tcharge.pos.x <= Charge1.pos.x : F1tx = -F1tx F1ty = k*q1*qt/(((Tcharge.pos.y)-(Charge1.pos.y))**2) if Tcharge.pos.y <= Charge1.pos.y : F1ty = -F1ty F1tz = k*q1*qt/((Tcharge.pos.z-Charge1.pos.z)**2) if Tcharge.pos.z <= Charge1.pos.z : F1tz = -F1tz F1t = vec(F1tx,F1ty,F1tz) # print("F1t = ", mag(F1t)) ##Come up with an equation for the force on your test charge from Charge 2 F2tx = k*q2*qt/(((Tcharge.pos.x)-(Charge2.pos.x))**2) if Tcharge.pos.x <= Charge2.pos.x : F2tx = -F2tx F2ty = k*q2*qt/(((Tcharge.pos.y)-(Charge2.pos.y))**2) Tcharge.pos.y <= Charge2.pos.y : F2ty = -F2ty F2tz = k*q2*qt/(((Tcharge.pos.z)-(Charge2.pos.z))**2) Tcharge.pos.z <= Charge2.pos.z : F2tz = -F2tz F2t = vec(F2tx,F2ty,F2tz) # ##Come up with an equation for the net force on your test charge from both charges # Fnetx = F1tx + F2tx Fnety = F1ty + F2ty Fnetz = F1tz + F2tz Fnet = vec(Fnetx,Fnety,Fnetz) #Come up with an equation for the net acceleration of your test charge from both charges at = vec(Fnetx/mTest,Fnety/mTest,Fnetz/mTest) at = vec((F1tx)/mTest,0,0) #Update the position of the test charge using the equation you came up with for acceleration. vTest = vTest + at*dt Tcharge.pos = Tcharge.pos + vTest*dt #Graph the Net Force on the Test charge with regards to position. F1Graph.plot(mag(Tcharge.pos),mag(F1t)) F2Graph.plot(mag(Tcharge.pos),mag(F2t)) t = t + dt ---- ====See Also==== *