184_projects:particle_accel_24

  1. Read through the main problem & given code for Part 1. What does it mean for a vector (like Electric Field) to be “constant”? Can you draw a constant electric field?
  2. Given a vector $\vec{r} = R < \cos(\theta) , \sin(\theta) , 0 >$, what is the value of the vector at $\theta = 0$? At $\theta = \frac{\pi}{4}$? At $\theta = \frac{\pi}{2}$? What shape is created as theta is evaluated from $0$ to $2\pi?$? What is the R in this vector?
  3. Comment the Part 1 code line-by-line and make sure everyone understands what each line is doing.

With the Super-Mega-Storm-Cloud-Meter 9000TM taking data, you head back to Lakeview for some well-deserved rest. In town, you find Manny and Jo arguing about animals they say they've seen near town - Manny is waving hairs that he caught on his tape traps and insisting they're some kind of big cat, but Jo insists they are just wild boars that live in the forest. Before you hear anything more, your boss calls you out to S.P.A.R.T.A.N.'s secret FTOE research lab, the Facility for Transformative Observations of Electromagnetism.

When you get there, you find that it contains a miniature particle accelerator. Your boss says that it produces exotic charged particles called Hawkions, which may be able to disrupt the storms besetting Lakeview. But the accelerator malfunctioned immediately after it was first turned on and with all the storms around Lakeview, the FTOE engineers haven't been able to figure out what's wrong.

Your team is tasked with modeling the first stage of the accelerator, which uses a constant electric field to accelerate the charges. The concept is that the particles will enter a tube that is encapsulated by rings of charge. Your team needs to demonstrate that this concept will produce a constant electric field.

Part 1:

The first bit of code that you have received is from the previous team who were able to construct a single ring of charge and show the electric field due to that ring at some point. Your team should construct the electric field vectors for a circle inside the accelerator (smaller than the ring) at a distance of a few centimeters from the ring face.

GlowScript 2.7 VPython

display(background = color.white)

#Set up constants
R = 0.02
r_obs = 0.05

Q = 1e-9 
N = 20
dq = Q/N

scale=1e-4
oofpez = 9e9 #1/(4pi epsilon_0) in N m^2/C^2

#Defining a ring at the origin
myring = ring(pos = vector(0,0,0), radius = R, axis = vector(0,0,1), color = color.blue, thickness = 0.02*R)

#Create an empty list for the charges
ChargeList=[]

#Set up the step size and angle for creating the charges
dtheta = 2*pi/N 
theta = dtheta/2 

#Create charges in a circle and add them to the ChargeList
while theta < 2*pi:
    rpiece = R*vector(cos(theta),sin(theta),0) #location of piece
    
    particle = sphere(pos = rpiece, radius = R/20, color = color.yellow)
    ChargeList.append(particle)
        
    theta = theta + dtheta

#Create an empty list for the observation points
ObsList = []

#Set up the step size and angle for creating the observation points
phi = 0
dphi = pi/4

#Create observation points in a circle and add them to the ObsList
while phi < 2*pi:
    r_obs_piece = r_obs*vector(cos(phi),sin(phi),1) #location of piece
    
    obs_particle = sphere(pos = r_obs_piece, radius = R/20, color = color.red)
    
    ObsList.append(obs_particle)
        
    phi = phi + dphi

#Find the electric field at each observation point
for obs_point in ObsList:
        
    for charge in ChargeList:
        Enet=vec(0,0,0)     

Part 2

After you got this initial code working, your team was able to construct a model of a tube consisting of multiple rings, all with the same charge. But, the field doesn't look quite right - it's not constant as expected. Your bosses seem to think the field can be made constant in the tube, so it's up to you to figure out how.

display(background = color.white)

num_points = 10
num_rings = 11
N = 11
spacing = 0.02

# Set some constants and stuff
R=0.02 #radius of ring in m
ax = vector(0,0,1) # simplify things
Q=1e-9 #charge of ring in C
oofpez=9e9 #1/(4pi epsilon_0) in N m^2/C^2

#draw axis
zaxis=cylinder(pos=-2*R*ax, radius=0.015*R, axis=4*R*ax, color=color.black)

#draw points
points = []
for i in range(num_points):
    
    xr = 0.01*sin(i*2*pi/num_points)
    yr = 0.01*cos(i*2*pi/num_points)
    
    points.append(sphere(pos=vector(xr,yr,0.01), color=color.red, radius=5*zaxis.radius))

#make and draw rings
rings = []
ring_charge = [Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q]

for i in range(num_rings):
    
    loc = i - (num_rings)//2
    rings.append(ring(pos=vector(0,0,spacing*loc), radius=R, axis=ax, color=color.blue, thickness=0.02*R))

# Find net field
for apoint in points:

    Enet = vector(0,0,0)
    for i in range(len(rings)):
        aring = rings[i] # look at one ring

        dq = ring_charge[i]/N #charge of a piece
        dtheta = 2*pi/N #theta increment for our loop
        theta=dtheta/2 #initial theta for first piece of loop
        Ering = vector(0,0,0) #net electric field for single ring

        rpoint = apoint.pos

        scale=1.2*mag(rpoint)/8000 #used to scale the arrows representing E-field

        while theta<2*pi:
            rpiece = R*vector(cos(theta),sin(theta),aring.pos.z/R) #location of piece
            r = rpoint-rpiece #vector from piece to point in space
            rmag = mag(r) #magnitude of r
            rhat = norm(r) #unit vector for r
            dE = oofpez * dq / rmag / rmag * rhat # Electric field of peice of ring
            Enet = Enet + dE
            particle=sphere(pos=rpiece, radius=apoint.radius, color=color.yellow) #draw a particlee
            theta=theta+dtheta

    Evector=arrow(pos=rpoint, axis=scale*Enet, color=color.orange, shaftwidth=apoint.radius/2)

Learning Goals

  • Review ideas of electric field, superposition, separation vectors, and distributions of charge
  • Review ideas of interpreting code: while and for loops, lists, creating objects/shapes
  • Explain how you created a constant electric field using rings of charge
  • Explain what would happen to a charge if it were placed in the electric field
  1. When you have multiple rings of charge, how do you get a constant electric field?
  2. What is a surface charge gradient?
  3. Why does this set up count as an “accelerator”? What would you need to change to make the accelerator stronger?
  4. What questions do you have going into the first exam?
  • 184_projects/particle_accel_24.txt
  • Last modified: 2024/02/07 13:46
  • by dmcpadden