Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

use matlab The electric field intensity, E(z), due to a ring of radius R at any

ID: 3803566 • Letter: U

Question

use matlab

The electric field intensity, E(z), due to a ring of radius R at any point z along the axis of the ring is given by E(z) = lambda/2 epsilon_0 Rz/(z^2 + R^2)^3/2 where lambda is the charge density, epsilon_0 = 8.85 times 10^-12 is the electric constant, and R is the radius of the ring. Consider the case where lambda = 1.7 times 10^-7 C/m and R = 6 cm. Determine E(z) at z = 0, 2, 4, 6, 8, and 10 cm. Determine the distance z where E is maximum. Do it by creating a vector z with elements ranging from 2 cm to 6 cm and spacing of 0.01 cm. Calculate E for each value of z and then find the maximum E and associated z with MATLAB's built-in function max.

Explanation / Answer

Matlab code

Lam = 1.7*10^-7; % Charge density
Eo = 8.85810^-12; % electric constant
R = 6; % radius
Ez = @(z) (Lam/(2*Eo))*(R*z)./sqrt((z.^2+R^2).^3);
% Part a
z = 0:2:10; % values of z 0,2,4..,10
fprintf('E(z=%d) = %f ',[z;Ez(z)]); % Printing the result
% Part b
z = 0:0.01:6; % z vector
[MaxE,IMax] = max(Ez(z)); % findoing the max E
fprintf('E is maximun if z = % 0.2f ',z(IMax)); % Printing the result

OUTPUT

>> test
E(z=0) = 0.000000
E(z=2) = 941.016265
E(z=4) = 1269.732095
E(z=6) = 1168.986854
E(z=8) = 952.241508
E(z=10) = 750.496651
E is maximun if z = 4.24
>>