Electric field produced by a uniformly-charged curved line

Consider a wire of length $L$ that has a uniform charge density $\lambda$. This wire can be bent into different shapes. The electrostatic potential $\varphi $ produced by this wire can be approximated by breaking the wire into short segments and adding all of the contributions of these segments together. The segments have a length $\Delta s$ and a charge $\Delta q=\lambda\Delta s$. The contribution to the electrostatic potential at position $\vec{r}$ is,

$\large \varphi (\vec{r})=\sum \limits_{i=1}^{N} \frac{\Delta q}{4\pi \epsilon_0 |\vec{r}-\vec{r}_i|}$ [V].

Here $\vec{r}_i=x_i\hat{x}+y_i\hat{y}+z_i\hat{z}$ are the positions of the point charges along the wire and $|\vec{r}-\vec{r}_i|=\sqrt{(x-x_i)^2+(y-y_i)^2+(z-z_i)^2}$. A constant can always be added to the electrostatic potential. We have assigned the electrostatic potential to zero for distances very far from the charges. The relationship between the electric field and the electrostatic potential is, $\vec{E} = -\nabla \varphi =-\frac{\partial \varphi }{\partial x}\hat{x} -\frac{\partial \varphi }{\partial y}\hat{y} -\frac{\partial \varphi }{\partial z}\hat{z}$.

$\large \vec{E}(\vec{r})=\sum \limits_{i=1}^{N} \frac{q_i(\vec{r}-\vec{r}_i)}{4\pi \epsilon_0 |\vec{r}-\vec{r}_i|^3}$ [V/m]

The position and shape of the wire can be specified by parametric equations in terms of a parameter $s$ that measures the distance along the wire. For instance, a straight wire from $\vec{r}_1$ to $\vec{r}_2$ is described by,

$\vec{r}_{wire}=(r_{1x}+s(r_{2x}-r_{1x}))\hat{x} + (r_{1y}+s(r_{2y}-r_{1y}))\hat{y} + (r_{1z}+s(r_{2z}-r_{1z}))\hat{z}$  where $s=[0,1]$.

For a wire loop of radius $R$ in the $x$-$y$ plane at $z=0$,

$ \vec{r}_{wire}=R\cos(2\pi s)\hat{x} + R\sin(2\pi s)\hat{y} + 0\hat{z}$  where $s=[0,1]$.

For a 10 turn spiral coil,

$ \vec{r}_{wire}=R\cos(2\pi s)\hat{x} + R\sin(2\pi s)\hat{y} + \frac{s}{n} \hat{z}$  where $s=[0,10]$,

where $n$ is the number of turns per meter of the coil. The form below can be used to specify the shape of the wire and to calculate the electric field at position $\vec{r}$ .

The charge density is,

$\lambda=$ [C/m].

The position where $\varphi $ and $\vec{E}$ are calculated:

$\vec{r}=$ $\hat{x} +$ $\hat{y} +$ $\hat{z}$ [m].

The parametric equations that describe the wire:

$\vec{r}_{wire}=$ $\hat{x} +$ $\hat{y} +$ $\hat{z}$ [m].

$s$ is defined from $s=$ to $s=$ in segments.

$\varphi =$ [V]  $L=$ [m].

$\vec{E}=$ $\hat{x} +$ $\hat{y} +$ $\hat{z}$ [V/m].

 

Plot the plane at

The longer the wire, the more segments are needed for an accurate answer. If the wire is a coil, about 300 segments per turn is appropriate.

The mathematical functions that can be used are list below. Multiplication must be specified with a '*' symbol, 3*cos(x) not 3cos(x). Powers are specified with the 'pow' function: x² is pow(x,2) not x^2.

  • abs(x) - absolute value
  • acos(x) - inverse cosine
  • asin(x) - inverse sine
  • atan(x) - inverse tangent
  • cos(x) - cosine
  • exp(x) - ex
  • log(x) - natural logarithm
  • pi = 3.141592653589793
  • pow(x,y) - compute xy
  • round(x) - round to the nearest integer
  • sin(x) - sine
  • sqrt(x) - square root
  • tan(x) - tangent
  • H(x) - Heaviside function