electric field due to a line of charge

Started by
4 comments, last by Emergent 13 years ago
Hi guys,

I've been working on this problem for a while now. Basically what I want to do is calculate the electric field at an arbitrary point due to an arbitrary line of charge.

All physics classes, books and sites I've visited on the internet set this problem up in the exact same way -- the line of charge is restricted to an axis (usually the x-axis) and the point is floating over it. For my simulation, the finite line of charge might be anywhere, and the point might be anywhere in 3D. To overcome this, my previous solution was to rotate my frame of reference into a more favorable configuration so that I could solve the integral using the standard textbook method. This seemed to work, but I felt that I could save a lot of cycles by figuring out how to do the integration directly.

I have attempted to do this for a 2D example. Here, I parameterize my line as a function of time, letting time range from 0 to 1. Then I integrate with respect to t. On paper, everything looks like it should work. But when I plug in values, the results don't add up. Please see this picture for an example. The first solution is using the textbook method and setup for solving. I get Ex=-0.2163 and Ey=0.3121. When I use my method, the answers come out as Ex=-0.0270 and Ey=0.03901.

What am I doing wrong?? I should be able to do the 't' thingy because we do the exact same thing with theta for curves... I based my work off of these examples.

question.jpg
"a low level aho master like you couldn't kill me even if I let you"
Advertisement
Lets see first of lets take coulombs equation: E = k*q/r^2 * (r-hat)
q = P * dx, Where P is the linear charge density and dx is along the line of charge

Therefore, E = k*P*dx/r^2.

In your coord system r = sqrt( h^2 + x^2)
(r-hat) = ( x*(x-hat) + h*(h-hat) ) / sqrt( h^2 + x^2 )

E = K*P( x*(x-hat) + h(*h-hat) ) / (h^2 + x^2) ^ (3/2)

This is getting a little nastier to type than I thought. Basically instead of going into cosines and sines let r hat = <x,h> and divide it by its length ie: sqrt(h^2 + x^2). That should help out a bit, after this its just integration. If you have an integration table handy that would be the easiest route. This link Integral 41a) http://integral-table.com/. Don't do the hard work unless you have to =)

Let me know if you need any help I could work it on paper and send it to you.

Oh and for the 3D -> 2D coords you could use 3D coords by using (r hat) = <x,y,z>/sqrt(x^2 + y^2 + z^2) but this will become a double integration.
Sleep is for the weak, or at least that is what I tell myself every morning.
Hi jpmcmu,

First, thanks for the reply; I've posted this question on a physics form twice and I didn't even get a single reply... so I really need all the help I can get!

I followed your example--but it seems that your solution is the same as the first example in my image -- the text book solution, which I am able to solve already. Even though I wrote down the sin and cosine, I don't actually integrate over the angle. Rather, I use the geometry and pythagorean formulas to substitute for x*xhat and h*hhat, and then do the integration. This result I am sure is correct. What I'm confused about is parameterizing the line as a function of 't'. Once I do this and integrate, the answer I get doesn't match the popular / accepted text book solution that you described... yet I can't figure out where I erred. Help!
"a low level aho master like you couldn't kill me even if I let you"
I've only skimmed what you have there, but it looks like you're doing a bunch of integration? It shouldn't really be necessary...

From symmetry arguments, you can say that the E-field will be perpendicular to, and constant in norm on, the surface of any cylinder (of whatever radius) , whose axis is the line of charge. Then Gauss' Law (aka the Divergence Theorem) relates the flux across this cylinder to the charge contained within, which tells you what that magnitude is. Ta-da!
Hi Emergent,

It seems that I cannot effectively use Gauss' law on this one because of the major constraint that this is for a finite length line of charge. It does not have the symmetry required in order to use Gauss effectively (infinite length cylinder, sphere for point charge, etc.) Edge effects from the electric field about its endpoints would arise and the field will not be perpendicular to the line of charge, rather it would be bent in towards the endpoints. The Gaussian surface would need to be either parallel or orthogonal (for higher dimensions) to the electric field at all points. Because of this, integration is necessary and I have to stick to Coulomb's =T
"a low level aho master like you couldn't kill me even if I let you"

finite length line


Ah, my bad; I'd missed that.

This topic is closed to new replies.

Advertisement