Ece370 Lab3
Ece370 Lab3
EXPERIMENT # 3
ELECTRIC FIELD INTENSITY
Objective:
Equipment Required:
Computer having MATLAB software
Introduction:
ELECTRIC FIELD INTENSITY
We define the electric field intensity as the vector of force on a unit positive test charge. Electric field
intensity, E, is measured by the unit newtons per
coulomb (N/C) or volts per meter (V/m). The electric field intensity E at any point in space due to a
charge Q is given by:
Or In vector form
where:
E is the electric field intensity.
Q is the charge.
ε0 is the permittivity of free space.
r is the distance from the charge.
aR is a unit vector in the direction from the point at which the point
charge Q is located, to the point at which E is desired/measured
MATLAB CODE
Task 1) Electric Field around positive charge
% Constants
Q = 1e-9; % Positive charge in Coulombs (1 nC)
epsilon_0 = 8.854e-12; % Permittivity of free space (F/m)
% Calculate the distance of each point from the origin (positive charge location)
r = sqrt(x.^2 + y.^2 + z.^2);
r(r == 0) = eps; % Avoid division by zero at the origin
% Create a figure
figure;
hold on;
% Create a legend
legend('Electric Field Vectors', 'Positive Charge (1 nC)', 'Location', 'Best');
grid on;
axis equal;
hold off;
% Calculate the distance of each point from the origin (negative charge location)
r = sqrt(x.^2 + y.^2 + z.^2);
r(r == 0) = eps; % Avoid division by zero at the origin
% Create a figure
figure;
hold on;
% Create a legend
legend('Electric Field Vectors', 'Negative Charge (-1 µC)', 'Location', 'Best');
grid on;
axis equal;
hold off;
Task 3 ) E-Field for both a positive charge and a negative charge:
% Constants
Q_pos = 1e-9; % Positive charge in Coulombs (1 nC)
Q_neg = -1e-9; % Negative charge in Coulombs (-1 nC)
epsilon_0 = 8.854e-12; % Permittivity of free space (F/m)
% Create a figure
figure;
hold on;
% Create a legend
legend('Electric Field Vectors', 'Positive Charge (1 nC)', 'Negative Charge (-1 nC)', 'Location',
'Best');
grid on;
axis equal;
hold off;
% Constants
Q_pos = 1e-9; % Positive charge in Coulombs (1 nC)
Q_neg = -1e-9; % Negative charge in Coulombs (-1 nC)
epsilon_0 = 8.854e-12; % Permittivity of free space (F/m)
% Create a legend
legend('Location', 'Best');
grid on;
axis equal;
hold off;
% Create a legend
legend('Location', 'Best');
grid on;
axis equal;
hold off;
Q1) for the code given in Task 1 and Task 3 give comments for each line of code.
Q2) Write a Matlab code for the problem statement mentioned below
CONCLUSION