184_projects:s18_project_5_sol

Project 5A: Mini-particle accelerator

Your team has been hired as part of a larger team that is developing a micro-particle accelerator. Your team is tasked with modelling the initial part 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.

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.

Part 1 is focused on getting the students to systematically calculate the electric field at different points. This is meant to move beyond copying and pasting to reproduce calculations for a different point and to move to setting up a list of locations at which the field will be calculated. In a sense, this is similar to Project 3A and 4B where the students loop over locations at the ground level for the field of a cloud. They should be reminded of this (i.e., that they have done something similar before).

For this code, the major change is wrapping the calculation of the field in a loop so it repeats at each identified point.

This is one way to do it, but there's many ways that someone could iterate through locations.

Part 1 Complete Solution

#Set up constants
R = 0.02
r_obs = 0.01

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 charges 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:
    
    Enet=vec(0,0,0)
    
    for charge in ChargeList:
        r_sep=obs_point.pos-charge.pos
        r_mag=mag(r_sep)
        
        E=oofpez*dq*r_sep/r_mag**3
        Enet=Enet+E
        
    Evector = arrow(pos = obs_point.pos, axis = scale*Enet, color = color.orange)

Discussion Prompts

  • Question: What changed when you moved your observation ring to be smaller than the radius of the charge ring?
  • Answer: The magnitude of the electric field increased (closer to the charges) and the direction became more uniform (all arrows point mostly in the z, rather than being spread out)
  • Question: What do each of the loops do in your code?
  • Answer: The first loop creates the ring of charges, the second loop creates the ring of observation points, the third/fourth loops (nested) calculate the electric field from all of the charges at each observation point.

Evaluation Questions

  • Question: How can you tell the electric field that you computed is right?
  • Expected Answer: Look at the direction of the electric field (away from positive toward negative). If you move it farther away the field should get smaller.
  • Question: How would you improve your model? (What would that do to the chunks of charge?)
  • Expected Answer: Increase the number of charges that we have around the ring, which would decrease the amount of q per charge
  • Question: What would you expect to happen if you placed a positive/negative charge in the center of your observation ring?
  • Answer: It would move away/toward the ring of charge.

Extension Questions

  • Question: If you wanted to compute the electric field at multiple locations (or with multiple rings), what would you need to change?
  • Expected Answer: Either duplicate the ring code (copy/paste) and change the x-value of the observation locations or create a second loop to vary the x position on each point

Part 2

For this code, all students need to figure out is that a charge gradient is what is needed. So the only line that needs to be changed is this one:

ring_charge = [-Q,-4*Q/5,-3*Q/5,-2*Q/5,-Q/5,0,Q/5,2*Q/5,3*Q/5,4*Q/5,Q]

Conceptually, this will be hard, but is a big part of the pre-class reading.

Possible tutor questions

Discussion Prompts

  • Question: Explain what the code is doing. Where you need to explain it, write comments to make sure that everyone understands what it is doing.
  • Expected Answer: (Do on own)
  • Question: How does it compute the electric field due to all the rings at a point? How does it cycle through the points? Can you draw a diagram or flow chart showing what it is doing?
  • Expected Answer: It creates points in a ring, then gives each of those ring a charge. Then in the loops it says for any given observation point, add up the E-field contributions from all the charges in all the rings.
  • Question: How did you make a constant electric field?
  • Expected Answer: Need to make a gradient of charge to get a constant electric field, constantly $\Delta Q$ between each pair of charges.
  • Question: How does this relate to current in a wire?
  • Expected Answer: We could approximate a wire as a cylinder of charge, in which case the charges would be the surface charges that create the constant electric field inside the wire (which then drives the electron current)

Evaluation Questions

  • Question: How did you simplify your model?
  • Expected Answer: point charges, approximate a cylinder of charge as multiple rings of charge, approximate multiple ring as points at evenly spaced thetas.
  • Question: How do you know your model is working well?
  • Expected Answer: Evaluation of output (E-field magnitude and direction match what we would predict), evaluation of assumptions

Extension Questions

  • Question: Does the gradient have to go from positive to negative?
  • Answer: Have them test out different kinds of gradients (more negative to less negative, lots of positive to less positive)
  • Question: Any lingering questions?
  • Expected Answer: ??
  • Question: How are you feeling about the exam? Are there any topics that you would like to go over?
Testing observations

Our testers had not experienced the gradient of rings of charge in their E&M class, so this involved a little more guiding. Once the concept was discussed, they knew precisely what to do. We had them talk through all the code before they made any changes to it. The found the list quickly and decided on their changes quickly.

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,-4*Q/5,-3*Q/5,-2*Q/5,-Q/5,0,Q/5,2*Q/5,3*Q/5,4*Q/5,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)

This is a very qualitative solution, which is different than most of the previous solution. Make sure you have the groups thoroughly explain what is happening and why, and also draw pictures for the surface charge distributions.

Before the wires are connected

Suppose we have a battery, with one positive end and one negative end (could be either the chemical model or mechanical model of the battery). At each end, we connect a conductive wire. Before we connect the wires, what would the charge distribution look like along the wire?

The wire that is connected to the negative end of the battery would have a negative distribution of charge because the excess electrons would be able to spread along the length of the wire. Since the wire is a conductor, those excess charges would spread out along the surface of the wire, leaving the interior of the wire with a net electric field equal to zero. A similar process would occur for the wire connected to the positive end of the battery. An approximate charge distribution is shown in the figure, ignoring the exact details of the charge distribution.

If we zoom in on the gap between the wires, We can see an electric field at the end of the wires; however that electric field is cancelled out by the electric field from the wire across the gap. So even in the ends of the wires, the net electric field is zero.

  • Question: In the broken circuit diagram that you are given at the beginning of the problem can you sketch the electric field? What does the electric field look like between the two ends of the wires?
  • Expected Answer: The electric field points directly from the positive end of the wire to the negative end of the wire. (see above)
  • Question: At this point is there current flowing in the wire?
  • Answer: No. The electric field is zero in the wire. (There may be a small/short current when the charges from the plates spread out over the wires, but not after this process is over.)

Immediately after the wires are connected

If we complete the circuit by connecting the wires, what happens to the surface charges in the wire? The charges on the ends of the wires neutralize each other (so there is no net charge in the middle of the wires). This leaves a “tube” of surface charge on the outside of the wire. In the instant that the two wires touch, there is a strong discontinuity in the charge distributions along the wires - one side of the wire is positive and one side is negative with no smooth transition between the two. This means that there is a separation of charge and therefore there is now an electric field in the now-touching ends of the wires.

  • Question: What does the electric field look like immediately after the light bulb has been inserted and the connection has been made?
  • Expected Answer: The electric field points toward the center of the wire on the positive side and toward the edges on the negative side.
  • Question: What creates the constant electric field inside the wires?
  • Expected Answer: The surface charges create the electric field. There is a constant change (gradient) in surface charges along the wire to create the constant electric field.

A moment after the wires are connected

Because there is now an electric field in the wire, the mobile sea of electrons will start to move, which changes the surface charge distributions. Note that this starts happening after only fractions of a nano-second. Electrons moving toward the positive region of the wire will make the surface charge in that region less positive. Likewise, electrons moving away from the negative region of the wire will make that region less negative. In the middle of the wires, this creates a region with smaller amounts of charge, making that discontinuity of positive and negative charges less drastic, and setting up an electric field between the positive and negative regions.

A short time after the wires are connected

Again moments later (fractions of nano-seconds), the charge distributions in each side of the wire have rearranged. The excess negative charges have spread out so they have shifted away from the battery and more towards the center of the wire, with a similar process occurring for the positive charges. This creates regions in the wires where close to the battery there is a more concentrated surface charge and closer to the center there is a weaker surface charge. This sets up the continuous charge distribution that we see for the steady state. With this continuous charge distribution, there is now an electric field set up within the wire, which starts to move the electrons in the electron current.

How long does this process take?

The electric field from the surface charges is set up between the two wires almost instantaneously. That electric field immediately starts pushing on the electrons in the region (from the electron sea), which then move. The electrons do not have to move very far to change the surface distribution of charge, which extends the electric field around the circuit. This causes a push on the electron in the region of the extended electric field, and so on. This means that the electric field is able to travel around the wire much more quickly than the individual electrons in the wires. In fact, the electric field travels at the speed of light ($3*10^8$ m/s) students may not know this ahead of time and may need prompting to look up, while the electrons in the wires are only traveling at close to $5*10^{-5} m/s$. So the circuit reaches a steady state long before a single electron makes a whole loop around the circuit.

This explains why when you turn on a switch, the light comes on almost immediately. You are not waiting for an electron from the switch to travel all the way to the lightbulb. You are waiting for an electric field to be set up in the wire to push the electrons that are already in and near the light bulb. Thankfully that process is much shorter!

Discussion Prompts

  • Question: Where does the current start flowing?
  • Expected Answer: Electric field starts in the middle where the wires are connected, thus the charges first start moving in the middle of wire. But the electric field spreads almost immediately through the wire, so the charges everywhere in the wire move almost immediately. The charges do not start from the battery, but the electric field in the wire pushes the electrons that are already in the wire.
  • Question: Based on what you found, what does it mean for the circuit to be in a steady state?
  • Expected Answer: Steady state happens when the surface charges are no longer moving. This means that the electric field in the wires is CONSTANT and makes a constant current everywhere in the circuit. It is automatically not a steady state if the current is changing.
  • Question: How fast does the electric field travel compared to the drift velocity of the electrons?
  • Expected Answer: The drift velocity of the electrons is much slower. The drift speed is approximately $10^{-4}-10^{-5} m/s$ whereas the electric field travels at the speed of light.
  • Question: Why does the lightbulb turn on quickly when the switch is flipped if the electron velocity is so slow?
  • Expected Answer: Because the field travels fast, which starts pushing electrons in all parts of the wire almost instantly. So a current is established everywhere within nanoseconds, even though it may take a very long time for an electron to start at the battery and reach the lightbulb.
  • Question: Why does the lightbulb turn on quickly when the switch is flipped if the electron velocity is so slow?
  • Expected Answer: Because the field travels fast, which starts pushing electrons in all parts of the wire almost instantly. So a current is established everywhere within nanoseconds, even though it may take a very long time for an electron to start at the battery and reach the lightbulb.
  • Question: What is the role of the battery in lighting up the lightbulb? (It may be easier to answer this question as: what would happen if that battery were removed?)
  • Answer: Initially the battery provides the excess surface charges, which then creates the electric field in the wire. Afterwards, the battery maintains the surface charge gradient and provides the electrons that move around the wire (i.e. the electrons in the electron current.)

Evaluation Questions

  • Question: In doing this problem, we have made a model of how current flows in a circuit. What are some of the things we have simplified/ignored in this situation? (Assumptions and approximations?)
  • Answer: We did not talk about how the electrons bend around the corners of the wires, we simplified the battery to a pair of charged parallel plates (keeping the voltage constant), we're simplifying a cylinder of surface charges to a couple +/-'s on each wire (this really happens in 3D around the surface of the wire).

Extension Questions

  • Question: Would a lightbulb turn on if it were only connected to the positive end of the battery?
  • Answer: No. If this were true there would only be positive surface charges, which means the electric field inside the wire would be zero - therefore, there is nothing to push the electrons through the wire so there is no current and the lightbulb would not turn on.
  • Question: Any lingering questions for this week? Anything still confusing?
Testing Observations

We (meaning Daryl) had too much about this process written into the notes. Since then, this page of notes has been removed and students are expected to reason through this on their own.

  • 184_projects/s18_project_5_sol.txt
  • Last modified: 2018/02/08 00:08
  • by dmcpadden