Lab 201: Electric Field by Point Charges
Section: 121A-H02
Date: February 8, 2012
Objective:
To compute electric field and corresponding field lines caused by point charges using MATLAB.
Theoretical Background:
-electrons are negative, protons are positive
-magnitude of force between A and B is:
, is 8.98755E9.
-electric field is the region around a charged object
-strength of electric field:
=
-electric field lines are used to visually show the field
Procedure:
Our procedure for this lab was very simple. We had to determine a correct MATLAB code to write. We inputted a code into MATLAB and received figure 1.1, the pot of the electric filed of a positive point charge. Our next goal was to plot the graph of the x position of a test charge in the presence of two positive charges versus the total electric filed at that point, we ended up with figure 1.2. We then repeated this plot, but with a positive and negative charge (figure 1.3). Lastly, we proceeded to plot the electric filed with two positive charges using a vector field plot (figure 1.4); and it was repeated for a positively and negatively charged particle in order to receive figure 1.5.
Results:
Figure 1.1
Figure 1.2
Figure 1.3
Figure 1.4
Figure 1.5
Part II
Procedure:
This was just copying code directly from the lab manual and seeing the results of the electric fields for various charged particles.
Data:
Part One Code:
clear all esp0 = 8.85e-12; k = 1/(4*pi*esp0); q1 = 1e-9; %First Charge q2 = -1e-9; %Second Charge a = 1; x = -2.1:0.1:2.1;
E1 = q1*k*(x+a)./abs(x+a).^3;
E2 = q2*k*(x-a)./abs(x-a).^3;
Etotal = E1 + E2; plot(x, Etotal) xlabel 'x'; ylabel 'Etotal'; grid on title 'Total Electric field vs. x';
Part One Graph
Part Two Code:
[x, y] = meshgrid(-2.1:0.2:2.1, -2.1:0.2:2.1); r1S = (x).^2 + (y-a).^2; r1 = sqrt(r1S); r2S = (x).^2 + (y+a).^2; r2 = sqrt(r2S); e1x = (x)./r1; e1y = (y-a)./r1; e2x = (x)./r2; e2y =