First some basic definitions:
\begin{align*} &\mathbf F=\left(F_x,F_y\right)=-\nabla U=-\mathbf i\,\frac{\partial U}{\partial x}-\mathbf j\,\frac{\partial U}{\partial y}=-\mathbf u_r\,\frac{\partial U}{\partial r}-\mathbf u_{\theta}\,\frac{1}{r}\frac{\partial U}{\partial \theta}\\ & \text{div} \,\mathbf F=\nabla\cdot\mathbf F=\frac{\partial F_x}{\partial x}+\frac{\partial F_y}{\partial y}=\frac{1}{r}\frac{\partial (rF_{r})}{\partial r}+\frac{1}{r}\frac{\partial F_{\theta}}{\partial_{\theta}}\\ &\text{curl}\, \mathbf F=\nabla \times \mathbf F=\left(\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\right)\mathbf k=\frac{1}{r}\left[\frac{\partial (rF_{\theta})}{\partial r}-\frac{\partial F_r}{\partial_{\theta}}\right]\mathbf k \end{align*}
Next, here is a list of all the vector fields in this simulation:
This is a two-dimensional cross section of a three-dimensional field.
In three dimensions, the divergence of this field is nonzero; but in
this cross section, the divergence is zero everywhere except the
origin. (It is important to realize that the two-dimensional
divergence of a field can be different than its three-dimensional divergence.)
\begin{align*}
&\mathbf F=-\frac{\mathbf u_r}{r}=-\frac{\mathbf r}{r^2}=\left(-\frac{x}{x^2+y^2},-\frac{y}{x^2+y^2}\right)\\
& U= \log r\\
& \nabla \times \mathbf F=0\\
&\nabla \cdot \mathbf F=0\quad(r\neq0)
\end{align*}
This is a two-dimensional cross section of a three-dimensional field.
In three dimensions, the divergence of this field is zero except at
the origin; but in
this cross section, the divergence is positive everywhere (except at the
origin, where it is negative).
\begin{align*}
&\mathbf F=-\frac{\mathbf u_r}{r^2}=-\frac{\mathbf r}{r^3}=\left(-\frac{x}{(x^2+y^2)^{3/2}},-\frac{y}{(x^2+y^2)^{3/2}}\right)\\
& U= -\frac{1}{r}\\
& \nabla \times \mathbf F=0\\
&\nabla \cdot \mathbf F=\frac{1}{r^3}\quad(r\neq0)
\end{align*}
The divergence of this field is zero everywhere as we would expect for a magnetic field. Surprisingly, the curl is also zero everywhere except at the origin, even though the particles are clearly moving in a circle. To see why, set the particle movement to "Curl Detectors". You can see that even though the particles are moving in a circle, the particles themselves are not turning. This is because the force on the far side of the particles (the side away from the center) is slightly weaker than the force on the near side; this is just enough to cause the particles to turn slightly in the opposite direction of the force. This counterbalances the rotation caused by the circular motion of the particles. So, the particles remain pointed in the same direction as they go around in a circle.
Since the curl is nonzero at the origin, we cannot come up with a potential function for this field.
\begin{align*} &\mathbf F=-\frac{\mathbf u_{\theta}}{r}=\frac{1}{r^2}(-y,x)=\left(-\frac{y}{x^2+y^2},\frac{x}{x^2+y^2}\right)\\ & \nabla \times \mathbf F=0\quad(r\neq0)\\ &\nabla \cdot \mathbf F=0 \end{align*}
\begin{align*} & U=-\theta\\ &\mathbf F=-\frac{\mathbf u_{\theta}}{r}=\frac{1}{r^2}(-y,x)=\left(-\frac{y}{x^2+y^2},\frac{x}{x^2+y^2}\right)\quad(\theta\neq0)\\ & \nabla \times \mathbf F=0\quad(\theta\neq0)\\ &\nabla \cdot \mathbf F=0\quad(\theta\neq0) \end{align*}
\begin{align*} &\mathbf F=a\,\mathbf i=(a,0)\\ & U=-a\,x\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=0 \end{align*}
Outside the planet:
\begin{align*}
&\mathbf F=-\frac{\mathbf r}{r^3}=\left(-\frac{x}{(x^2+y^2)^{3/2}},-\frac{y}{(x^2+y^2)^{3/2}}\right)\\
& U=-\frac{1}{r}\\
& \nabla \times \mathbf F=0\\
&\nabla \cdot \mathbf F=\frac{1}{r^3}
\end{align*}
Inside the planet (radius = a):
\begin{align*}
&\mathbf F=-\frac{\mathbf r}{a^3}=\left(-\frac{x}{a^3},-\frac{y}{a^3}\right)\\
& U=-\frac{3}{2a}+\frac{r^2}{2a^3}\\
& \nabla \times \mathbf F=0\\
&\nabla \cdot \mathbf F=-\frac{2}{a^3}
\end{align*}
\begin{align*} &\mathbf F=a\,\mathbf u_r\\ & U=a\,r\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-\frac{a}{r} \end{align*}
\begin{align*} &\mathbf F=-k\,r \,\mathbf u_r\\ & U=\frac12 k\, r^2\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-2kr \end{align*}
\begin{align*} &\mathbf F=-\frac{a|x|}{x}\,\mathbf i\\ & U=|ax|\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=0\quad (x\neq 0) \end{align*}
\begin{align*} &\mathbf F=-(k\,x,0)\\ & U=\frac12\,k\,x^2\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-k \end{align*}
\begin{align*} &\mathbf F=(-k_1\,x,-k_2\,y)\\ & U=\frac12\left(k_1\,x^2+k_2\,y^2\right)\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-k_1-k_2 \end{align*}
\begin{align*} &\mathbf F=-\frac{1}{x}\mathbf i\\ & U=-\frac{1}{2x^2}\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=\frac{1}{x^2} \end{align*}
The curl of this field is nonzero everywhere as we might expect for a field that causes particles to rotate. However, note that the curl is negative everywhere (except at the center); this means that the curl vector is in the negative z direction, which implies clockwise movement. This is surprising, since the particles are clearly moving counter-clockwise. To see why this is, set the particle movement to "Curl Detectors". You can see that even though the particles are moving counter-clockwise, the particles themselves are turning very slowly in a clockwise direction. This is because the force on the far side of the particles (the side away from the center) is weaker than the force on the near side; this is enough to cause the particles to turn slightly in the opposite direction of the force. This more than makes up for the counter-clockwise rotation caused by the motion of the particles.
\begin{align*} &\mathbf F=-\frac{\mathbf u_{\theta}}{r^2}=\frac{1}{r^3}(-y,x)=\left(-\frac{y}{(x^2+y^2)^{3/2}},\frac{x}{(x^2+y^2)^{3/2}}\right)\\ & \nabla \times \mathbf F=-\frac{\mathbf k}{r^3}\quad (r\neq 0)\\ &\nabla \cdot \mathbf F=0 \end{align*}
\begin{align*} &\mathbf F=r\,\mathbf u_{\theta}=(-y,x)\\ & \nabla \times \mathbf F=\mathbf 2k\\ &\nabla \cdot \mathbf F=0 \end{align*}
\begin{align*} &\mathbf F=k\,\mathbf u_{\theta}=\left(-\frac{ky}{\sqrt{x^2+y^2}},-\frac{kx}{\sqrt{x^2+y^2}}\right)\\ & \nabla \times \mathbf F=-\frac{k\,\mathbf k}{r}\quad (r\neq 0)\\ &\nabla \cdot \mathbf F=0 \end{align*}
\begin{align*} &\mathbf F=(y,0)\\ & \nabla \times \mathbf F=-\mathbf k\\ &\nabla \cdot \mathbf F=0 \end{align*}
\begin{align*} &\mathbf F=(y^2,0)\\ & \nabla \times \mathbf F=-2y\,\mathbf k\\ &\nabla \cdot \mathbf F=0 \end{align*}
\begin{align*} & U=x^2-\frac{y^2}{2} &\mathbf F=(-2x,y)\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-1 \end{align*}
\begin{align*} &\mathbf F=\mathbf u_r+r\,\mathbf U_{\theta}=(x-y,x+y)\\ & \nabla \times \mathbf F=2\mathbf k\\ &\nabla \cdot \mathbf F=2 \end{align*}
\begin{align*} &\mathbf F=\mathbf u_r+r\,\mathbf u_{\theta}=(x-y,x+y)\\ & \nabla \times \mathbf F=2\mathbf k\\ &\nabla \cdot \mathbf F=2 \end{align*}
\begin{align*} &\mathbf F=(x^2-y,x+y^2)\\ & \nabla \times \mathbf F=2\mathbf k\\ &\nabla \cdot \mathbf F=2x+2y \end{align*}
\begin{align*} &\mathbf F=(x,x^2)\\ & \nabla \times \mathbf F=2x\,\mathbf k\\ &\nabla \cdot \mathbf F=1 \end{align*}
\begin{align*} & U=x^2+y\\ &\mathbf F=(-2x,-1)\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-2 \end{align*}
If we replace theta with x and phi with y, then we can graph the potential energy, and we can treat the force on the pendulum as a vector field, and see how particles act when placed in the vector field.
In this demonstration, the angles range from -pi to pi (-180 to 180). The center of the graph is when both angles are zero and the pendulum is at rest. If you set the particle movement to "Force", you can see the particles swing back and forth like a pendulum would. You can see this better if you set the number of particles to a small number.
If you set the floor colors to "Potential", you can see a white line around the center red area; this is the point where one or both of the angles is at 90 degrees; in this case the pendulum is at the same height as its support and it doesn't matter what the other angle is. In the green areas, the pendulum is actually above its support.
Sometimes the particles manage to make it over the top of the hills on either side; this corresponds to a pendulum swinging up and over the top.
\begin{align*} & U=-\cos x\cos y\\ &\mathbf F=(-\sin x\cos y,-\cos x \sin y)\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=-2\cos x \cos y \end{align*}
\begin{align*} & U=\frac{\sin r^2}{r^2}\\ &\mathbf F=\left(\frac{2\sin r^2}{r^3}-\frac{2\cos r^2}{r}\right)\mathbf u_r\\ & \nabla \times \mathbf F=0\\ &\nabla \cdot \mathbf F=4\sin r^2+\frac{4\cos r^2}{r^2} -\frac{4\sin r^2}{r^4} \end{align*}
x+y
-x^2+5.2*y
2*sin(x)+3*y
1000/(r^2)-5*y
abs(x)
exp(2*log(x+10))+sqrt(y+10)
After entering a new potential, press return so that the change
takes effect. If nothing happens, then the field may be too weak; either
increase the field strength, or multiply the field by a large constant.
If particles jump around randomly with no apparent pattern, the field
may be too strong.
Each coordinate ranges from -10 to 10, so the edges of the view are at (±10,±10). The center of the view is the origin.
Click here to go to the simulation.
Note: This is an adaptation of the open-source code VecDemo.java written by Paul Falstad (www.falstad.com).