PHYSICS 133 – General Physics: Electromagnetism

advertisement
PHYSICS 202 – Physics and the Computer
Projects
Point particle near a fixed dipole
In particle accelerators and particle detectors we often control the path of particles using
charged conductors. Let’s consider two conducting spheres radius = 1.0 mm separated by a
distance, d = 2 cm, and charged to +/- Q = +/- 1 nC. Let the positive charge reside at +d/2 and
the negative charge reside at –d/2 along the x-axis.
(x0, y0)
y
(vx0, vy0)
-Q
+Q
x
d
Write reusable functions to calculate the potential, V, and the electric fields, Ex, and Ey for the
conductors. The new functions may use the dipolePotential.m and dipoleField.m functions and
then set the potential to a constant inside the conductor, and the electric field to NaN inside the
conductor so that particles do not propagate further after hitting the surface of the conductor.
Plot the results using:
Q = 1e-9;
d = 0.01;
r = 0.001;
[x,y] = meshgrid(-.02:0.0003:0.02, -.02:0.0003:0.02);
V = dipoleConductorPotential(x,y,Q,d,r);
[Ex, Ey] = dipoleConductorField(x,y,Q,d,r);
figure(1)
surf(V)
% plot the potential surface
figure(2)
levels = [8 4 2 1 0.5 0.25 0 -0.25 -0.5 -1 -2 -4 -8]*1e3;
contour(x,y,V,levels); % contour plot of the potential surface
hold on
mjm 2/12/16 106736849
PHYSICS 202 – Physics and the Computer
Projects
quiver(x,y,Ex,Ey,2);
hold off;
% overlay E-field vectors
Assume an electron (mass m=9.109e-31 kg, charge q=-1.602e-19 C) is initially located in the
plane at (x0,y0) and released with an initial velocity (vx0, vy0).
a) Write a routine to determine the position as a function of time for the electron. You should
be solving for x(t), y(t), vx(t), and vy(t).
b) Try the following test cases to debug the program.
 (x0,y0)=(0 cm, 0 cm) and (vx0,vy0)=(0 m/s, 0 m/s)
 (x0,y0)=(0 cm, 2 cm) and (vx0,vy0)=(0 m/s, 0 m/s)
 (x0,y0)=( -0.5 cm, 2 cm) and (vx0,vy0)=(0 m/s, 0 m/s)
Plot x(t) and y(t) vs. t on the same axes, vx(t) and vy(t) vs. t on the same axes to help debug the
program. When things start working, plot the trajectory, y vs. x.
c) When everything looks good, add the trajectory to the graph (figure 2 above) of electric
potential contours and electric field vectors.
d) Use quiver(x,y,vx,vy) to add the velocity vectors to the plot.
e) Take the derivative of vx and vy to find ax and ay. Add these to the plot using Matlab’s
quiver function. Explain with words and the graphics you’ve created why the electric fields
and acceleration vectors are aligned. Are there places where this is not true along your
trajectory? (quiver won’t plot NaN. You’ll need to find(~isnan(ax) & ~isnan(ay)) and plot
just these quivers. Also, you’ll need to modify finiteDifference.m so that if dx or dy is NaN,
then it returns NaN.)
f) How does the energy vary with time? Plot E vs t. Explain the relationship between the
contours and the velocities.
g) Choose several different starting locations and initial velocities. Be sure to include some
initial locations and velocities where you know the answer so you can check your results.
h) If you have time, plot the trajectory of a proton. You’ll need to adjust some parameters due
to the mass of the proton. These differences in trajectories and timing are exploited in
particle detectors to distinguish between protons and electrons.
mjm 2/12/16 106736849
Download