I'm trying to plot the electrostatic field generated from a single charge on a plane. Without the $\frac{1}{4\pi\varepsilon_0}$ factor and the value of the charge $q$, as a function of $x, y$ the electric field is
$$
\vec{E}(\vec{r})\equiv\vec{E}(x,y) = \frac{\vec{r}}{|\vec{r}|^3}\equiv\begin{cases}\frac{x}{(x^2+y^2)^{\frac{3}{2}}}\\
\frac{y}{(x^2+y^2)^{\frac{3}{2}}}\end{cases}
$$
I thought the best way to plot this plane field was the function VectorPlot
. Here is the code I entered and the output result
VectorPlot[{x/((x^2 + y^2)^(3/2)), y/((x^2 + y^2)^(3/2))}, {x, -1, 1}, {y, -1, 1}]
I tried to change x_min\x_max
and y_min\y_max
but I got the same outcome. Why is it plotting only one vector? What am I missing?
I then decided to look at the StreamDensityPlot
:
StreamDensityPlot[{x/((x^2 + y^2)^(3/2)), y/((x^2 + y^2)^(3/2))}, {x, -1, 1}, {y, -1, 1}, ColorFunction -> "Rainbow"]
The only result I got was this "purply" plot...
Now I'm a little bit confused on the use of these two plotting function, as on the mathematica documentation online it uses only simple vectorial fields such as $f(x,y) = (x,y)$ and everything looks so cool, but when I approach the basic vectorial field of physics I get only terrible results. Any ideas?
StreamPlot
, which is thought to show the direction of the field in each point, regardless of its intensity $\endgroup$