Download The Rolling Sphere – 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Circular dichroism wikipedia , lookup

Speed of gravity wikipedia , lookup

Length contraction wikipedia , lookup

Maxwell's equations wikipedia , lookup

Lorentz force wikipedia , lookup

Aharonov–Bohm effect wikipedia , lookup

Field (physics) wikipedia , lookup

Electric charge wikipedia , lookup

Electrostatics wikipedia , lookup

Transcript
Physics 232
January 26, 2012
Lab 3
Electric field of a rod and disk
Goals
 To practice adding up electric field contributions for all pieces (Step 3) without doing an integral.
 To practice writing computer programs, including intermediate steps.
 To write a VPython program that calculates and displays an electric field vector at any location
in space around a thin uniformly charged rod of length 1.0 m carrying charge 1 x 108 C.
 To write a VPython program that calculates and displays an electric field vector at any location
in space around a uniformly charged square plate of edge length 1.0 m, thickness 0.001 m and
carrying charge 1 x 108 C.
Reading:
 This entire lab assignment
 Review section 16.2: A general procedure for calculating electric field
Before-Programming Problems:
1. To get an idea how the calculation for the field due to a charged rod will be done in the program,
do it by hand first. Suppose a 1-m rod with a total charge of 1 10 8 C is oriented along the y axis
with its center at the origin. Divide the rod into 5 pieces and calculate the net electric field at
point P located at < 0.05, 0, 0 > m.
a. Sketch the rod showing each piece.

b. Write the coordinates for the center of each piece ( < x, y, z > ).
c. Calculate r , rˆ , and r to P for the center of each piece.
d. Calculate the electric field due to each piece at point P.
e. Calculate the net electric field at point P.
2. What constants will you need to define in each of these programs?
3. In each program, what objects will you need to create?
4. In each case, what calculations will you need to perform?
5. How many pieces will you divide the object into?
6. Which program will you write first? Why?
7. For a vertical rod centered on the origin, in terms of the length of the rod, L, and the length of
each piece, dL
a. What is the location of the center of the lowermost piece?
b. What is the location of the center of the uppermost piece?
c. What is the spacing between pieces?
Lab Procedure and intermediate questions:
 For every direction to “Run your program” you MUST do this in front of the instructor.
 You may want to refer to the program that found the electric field for a dipole. In this case, the
field will be the sum of the fields from several pieces of the rod which are treated as point
charges.
 Create a long, skinny cylinder to represent the rod by typing:
cylinder(pos=(0,-L/2,0), axis=(0,L,0), radius=0.005,
color=color.blue)

This will make a cylinder with one end at <0, -L /2, 0> with an axis of length L along the y axis.
The radius of the rod will be 5 mm which will be small enough. Note that you must have the line
“from __future__ import division” at the beginning of the program or the “2” must be
“2.0”.
Run the program to test the appearance of the rod.
Physics 232
January 26, 2012



Lab 3
Electric field of a rod and disk
Set initial observation location (obs) to the vector < 0.05, 0, 0 > m. You will eventually want to
instruct VPython to calculate the electric field at many different observation locations, but it is
best to start with one point.
Calculate the charge (dQ) and the length (dL) of each piece of the rod.
Define a list of N point charges which will be called rod. Make an empty list by writing
rod = []


Approximate each segment of the rod of length dL by a point at its middle. The function arange
can be used to make a list of heights beginning with the lowermost point (let’s call it x for now,
but use your answer to 7a) to the uppermost point y (again, use your answer to 7b) and point
spacing z (again, use your answer to 7c):
ptcharge_heights = arange (x, y, z)
Make a for loop where i loops over the values
in the list ptcharge_heights. Inside the loop,
create a sphere to represent each point and append it to the list rod:
a = sphere(pos=(0,i,0), color=color.red, radius=0.01, charge=dQ)
rod, append(a)














Run your program to check that it makes the right number of spheres spaced appropriately along
the rod. Try changing the value of N.
Initialize the electric field to zero and use for loop over the point charges which approximate the
segments of the rod.
Inside the loop add the contributions to the electric field for each point charge. The position of a
point charge is ptcharge.pos and its charge is ptcharge.charge. Print the field so that you can
compare with the hand calculation. Also, an arrow needs to be defined outside of the loop to
display the electric field vector.
Run your program to check that it correctly calculates the electric field at the single point.
Change the number of segments that the rod is divided into to see how that affects the
calculation. How many segments are needed for the result to converge?
Also change the location of the point where the electric field is calculated.
Modify the program to find the electric field at several points 5 cm from the rod as shown in
Figure 15.10. Begin by initializing a list called locations which will be filled with the
observation locations. Use two nested for loops to define the locations. One loop should define
the vertical location (y) while the other defines the angle in xz plane then calculates x and z from
the angle (called theta).
Run your program to check that it works correctly and make sure the number of segments is
large enough.
Write a separate program to calculate the field due to a plate. Divide the plate into square
segments with sides of length dL = L/Nside. Define a list of point charges called plate and
draw a sphere representing each charge. Each sphere should have a property charge.
Run your program to check that it makes the right number of spheres spaced appropriately on the
plate. Try changing the value of Nside.
Initialize the electric field to zero and use for loop over the point charges which approximate the
segments of the rod. Inside the loop add the contributions to the electric field for each point
charge.
Run your program to check that it correctly calculates the electric field at the single point.
Change the number of segments that the rod is divided into to see how that affects the
calculation. How many segments are needed for the result to converge?
Run your program to check that it correctly calculates the field at two different points.