





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






= +
2
2
1
1
0
4
1
r
q
r
q V
πε
E-Field Governing
Equation
The MeshGrid Plot
% Bruce Mayer, PE * 04Nov % ENGR % file = Prob5_57_Point_Charges_meshgrid_Plot_0611.m % Surface Plot eField from two Point Charges % % CLEAR out any previous runs clear % The Constant Parameters q1 = 2e-10; q2 = 4e-10; % in Coulombs epsilon = 8.854e-12; % in Farad/m % % Note the distances, r1 & r2, to any point(x,y) in the field by pythagorus % * r1 = sqrt((x-0.3)^2 + y^2) % * r2 = sqrt((x+0.3)^2 + y^2) % % Construct a 25x25 mesh [X Y] = meshgrid(-0.25:0.010:0.25); % % find r1 & r2 by pythagorus and array-ops r1 = sqrt((X-0.3).^2 +Y.^2); % note dots used with array operation r2 = sqrt((X-(-0.3)).^2 +Y.^2); % note dots used with array operation % use vectors r1 & r2, and array ops to find V V = (1/(4piepsilon))*(q1./r1 + q2./r2); % % use %-Comment to toggle between SURF & MESHC plots % surf(X,Y,V), xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on meshc(X,Y,V), , xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on
X-distance
2 Point-Charges Electical Field
Y-distance
Elect. Potential (V)
The Loop Plot
% Bruce Mayer, PE * 04Nov06 * ENGR % file = Prob5_57_Point_Charges_Loop_Plot_0611.m % Surface Plot eField from two Point Charges Clear % CLEAR out any previous runs % The Constant Parameters q1 = 2e-10; q2 = 4e-10; % in Coulombs epsilon = 8.854e-12; % in Farad/m % Note the distances, r1 & r2, to any point(x,y) in the field by pythagorus % * r1 = sqrt((x-0.3)^2 + y^2) % * r2 = sqrt((x+0.3)^2 + y^2) % Build up From Square XY Plane %% r1 goes to q1 at (0.3,0) %% r2 goes to q2 at (-0.3,0) x = linspace(-.25, .25, 50); %50 pts over x-range y = linspace(-.25, .25, 50); %50 pts over y-range for k = 1:length(x) for m = 1:length(y) % calc r1 & r2 using pythagorus r1 = sqrt((x(k)-0.3)^2 + y(m)^2); r2 = sqrt((x(k)-(-0.3))^2 + y(m)^2); % Find V based on r1 and r V(k,m) = (1/(4piepsilon))*(q1/r1 +q2/r2); % Note that V is a 2D array using the x & y indices end end X = x; Y = y; % use %-Comment to toggle between SURF & MESHC plots surf(X,Y,V), xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on %meshc(X,Y,V), , xlabel('X-distance'), ylabel('Y-distance'),... zlabel('Elect. Potential (V)'), title('2 Point-Charges Electical Field'),... grid on
X-distance
2 Point-Charges Electical Field
Y-distance
Elect. Potential (V)
Note that plot
is TURNED