Electric field caused by a collection of uniformly-charged parallel lines

Consider a rod aligned parallel to the $z$-axis with a uniform charge distribution $\lambda$. The electrostatic potential outside the rod is,

$\large \varphi (\vec{r})= \frac{-\lambda}{2\pi \epsilon_0 }\ln\left(|\vec{r}-\vec{r}_{\text{rod}}|\right)= \frac{-\lambda}{2\pi \epsilon_0 }\ln\left(\sqrt{(x-x_{\text{rod}})^2+(y-y_{\text{rod}})^2}\right)$ [V].

Here $\vec{r}_{\text{rod}}=x_{\text{rod}}\hat{x}+y_{\text{rod}}\hat{y}$ is the position of the rod in the $x$-$y$ plane. 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}$. Since the potential does not depend on $z$, the electric field in the $z$-direction is zero.

$\large \vec{E}(\vec{r})=\frac{\lambda(\vec{r}-\vec{r}_{\text{rod}})}{2\pi \epsilon_0|\vec{r}-\vec{r}_{\text{rod}}|^2}$ [V/m].

In terms of the $x$ and $y$ coordinates, the electric field is,

$\large \vec{E}(\vec{r})= \frac{\lambda(x-x_{\text{rod}})}{2\pi \epsilon_0 \left((x-x_{\text{rod}})^2+(y-y_{\text{rod}})^2\right)}\hat{x}+\frac{\lambda(y-y_{\text{rod}})}{2\pi \epsilon_0 \left((x-x_{\text{rod}})^2+(y-y_{\text{rod}})^2\right)}\hat{y}$ [V/m].

If there are more rod all aligned parallel to the $z$-axis with charge densities $\lambda_i$ and positions in the $x$-$y$ plane given by $\vec{r}_i$, the electrostatic potential caused by this collection of rods is,

$\Large \varphi (\vec{r})=\sum \limits_{i=1}^{N} \frac{-\lambda_i}{2\pi \epsilon_0 }\ln\left(|\vec{r}-\vec{r}_i|\right)=\sum \limits_{i=1}^{N} \frac{-\lambda_i}{2\pi \epsilon_0 }\ln\left(\sqrt{(x-x_i)^2+(y-y_i)^2}\right)$ [V].

The corresponding electric field is,

$\large \vec{E}(\vec{r})=\sum \limits_{i=1}^{N} \left[ \frac{\lambda_i(x-x_i)}{2\pi \epsilon_0 \left((x-x_i)^2+(y-y_i)^2\right)}\hat{x}+\frac{\lambda_i(y-y_i)}{2\pi \epsilon_0 \left((x-x_i)^2+(y-y_i)^2\right)}\hat{y}\right]$ [V/m].

The form below lets you specify the charge densities and positions of up to 10 rods and then calculates the electrostatic potential and the electric field at position $\vec{r}$.

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

$\varphi (\vec{r}) = $ [V]

$\vec{E}(\vec{r}) = $ $\hat{x} + $ $\hat{y}$ [V/m]

$\lambda_{1}=$

[C/m]  

$\vec{r}_{1}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{2}=$

[C/m]  

$\vec{r}_{2}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{3}=$

[C/m]  

$\vec{r}_{3}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{4}=$

[C/m]  

$\vec{r}_{4}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{5}=$

[C/m]  

$\vec{r}_{5}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{6}=$

[C/m]  

$\vec{r}_{6}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{7}=$

[C/m]  

$\vec{r}_{7}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{8}=$

[C/m]  

$\vec{r}_{8}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{9}=$

[C/m]  

$\vec{r}_{9}=$

$\hat{x} + $ $\hat{y}$ [m]

$\lambda_{10}=$

[C/m]  

$\vec{r}_{10}=$

$\hat{x} + $ $\hat{y}$ [m]