Question

I need Matlab solution for this.

Option 2: Calculate the electric field of a charged rod at point w by treating the rod as several evenly spaced point charges and adding up the electric field contributions from each individual point charge. The total charge of all your point charges should add up to the charge of the rod. 1.5 m 0.4 m 0.5 m Do the calculation three times to see the result when you treat the rod as 100 point charges, 500 point charges, and finally 1,000 point charges

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Matlab program has been given below of 100 points

L = 1.5;        % Length of the rod
x = 0.5;        % Horizontal distance to the point W from the right end of the rod
h = 0.4;        % Vertical distance to the point W from the rod
Q = 4E-6;       % Total charge in the rod
N = 100;       % Total number of point charges
q = Q/N;        % Charge on a single point charge
d = L/(N-1);    % Distance between the adjacent point charge
j = 1;          % A dummy index
for i = 1:N
    t(j) = atan(h/(L-x-(i-1)*d));       % Angle that the position vector makes with the horizontal
    r2 = (L-x-(i-1)*d)^2+h^2;           % Square of the magnitude of the position vector
    E(j) = 9E9*q/r2;                    % Magniude of the electric field due to a point charge at W which is at a distance r from the point charge   
    if t(j)>0
        Ex(j) = E(j)*cos(t(j)); Ey(j) = E(j)*sin(t(j));            % X and Y components of the electric field at W due to a point charge
    else
        Ex(j) = -E(j)*cos(t(j)); Ey(j) = -E(j)*sin(t(j));          % X and Y components of the electric field at W due to a point charge
    end
    X(j) = j;
    j = j+1;
end
EX = sum(Ex);       % X componet of the electric field at W due to the rod
EY = sum(Ey);       % Y componet of the electric field at W due to the rod

\textrm{For 500 and 1000 points, only change the value of N in the program to 500 and 1000 as needed.}

\textrm{The electric field }\vec{E}\textrm{ at W due to the rod for 100 point charges is }

\vec{E} \ = \ \left (1.4848 \times 10^4 \ \hat{i} \ - \ 1.0186 \times 10^5 \ \hat{j} \right ) \ \textrm{V}/\textrm{m}

\textrm{Similarly, after running the program for 500 points , the electric field }\vec{E}\textrm{ at W }

\textrm{due to the rod for 500 point charges is }

\vec{E} \ = \ \left (1.5128 \times 10^4 \ \hat{i} \ - \ 1.0242 \times 10^5 \ \hat{j} \right ) \ \textrm{V}/\textrm{m}

\textrm{Similarly, after running the program for 1000 points , the electric field }\vec{E}\textrm{ at W }

\textrm{due to the rod for 1000 point charges is }

\vec{E} \ = \ \left (1.5163 \times 10^4 \ \hat{i} \ - \ 1.0249 \times 10^5 \ \hat{j} \right ) \ \textrm{V}/\textrm{m}

Add a comment
Know the answer?
Add Answer to:
I need Matlab solution for this. Option 2: Calculate the electric field of a charged rod...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT