Electric strength at point P E = 8.000e+00 V/m Partial derivatives: numerical calculations gradE = 12.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 Divergence of E divE = 2.000e+01 m Average charge density at point P rho = 1.771e-10 C/m^3 Curl of E curlEx = 0.000e+00 m curlEy = -4.658e-12 m curlEz = 4.658e-12 m The results show that the divergence is not zero indicating a charge enclosed in a volume element at the point P . The curl of the electric field is zero since the electric field is radial (no twisting of the electric field lines). The second part of the mscript cemVE21.m calculates the variation in the divergence as a function of from 0 to 10 m radial line From the x . divergence, the charge density is calculated. The charge enclosed by a sphere of radius is given by the integral R This integral is evaluated by successively adding the area of rectangles of width and height dR % Charge Q enclosed by a sphere of radius R dx = x(2)-x(1); Q(1) = x(1)^2 * rhoR(1); Q = zeros(N,1); for n = 2 : N Q(n) = Q(n-1) + x(n)^2 * rhoR(n); end Q = Q .* (4*pi*dx); Graphical outputs are in Figure Windows
Electric strength at point P E = 8.000e+00 V/m Partial derivatives: numerical calculations gradE = 12.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 Divergence of E divE = 2.000e+01 m Average charge density at point P rho = 1.771e-10 C/m^3 Curl of E curlEx = 0.000e+00 m curlEy = -4.658e-12 m curlEz = 4.658e-12 m The results show that the divergence is not zero indicating a charge enclosed in a volume element at the point P . The curl of the electric field is zero since the electric field is radial (no twisting of the electric field lines). The second part of the mscript cemVE21.m calculates the variation in the divergence as a function of x from 0 to 10 m radial line . From the divergence, the charge density is calculated. The charge enclosed by a sphere of radius R is given by the integral This integral is evaluated by successively adding the area of rectangles of width dR and height % Charge Q enclosed by a sphere of radius R dx = x(2)-x(1); Q(1) = x(1)^2 * rhoR(1); Q = zeros(N,1); for n = 2 : N Q(n) = Q(n-1) + x(n)^2 * rhoR(n); end Q = Q .* (4*pi*dx); Graphical outputs are in Figure Windows
cemVEF.docx