Interactive tool

Vector field explorer

Place a circle in a vector field and compare its circulation and flux with the double integrals of curl and divergence from Green's theorem.

Pick a field F=(P,Q)\mathbf{F} = (P, Q) and place the circle with the sliders, or drag it across the graph. The readouts compare the two line integrals around the circle with the double integrals over the disk inside it. Green’s theorem says each pair should agree, and the vortex shows what happens when one of its conditions fails.

−3−2−1123−2−112xy
0.0
0.0
1.0

You can also drag the circle or tap the graph to move its center. Longer arrows in fuller color mean a stronger field.

Circulation around the circle
6.2832Equals 2π
Integral of the curl over the disk
6.2832Equals 2π
Outward flux across the circle
0.0000Equals 0
Integral of the divergence over the disk
0.0000Equals 0
Curl at the center
2
Divergence at the center
0

Each line integral equals its double integral, as Green's theorem says.

Things to try

  • Start with the rotation field (−y,x)(-y, x) and the unit circle at the origin. The circulation is 2π≈6.28322\pi \approx 6.2832, and so is the integral of the curl, because the curl is 22 everywhere and the disk has area π\pi. Move the center anywhere and nothing changes. Set the radius to 22 and both become 8π≈25.13278\pi \approx 25.1327.
  • Switch to the radial field (x,y)(x, y). Now the circulation is 00 and the outward flux is 2πr22\pi r^2, which is the divergence 22 times the area. The sink (−x,−y)(-x, -y) gives the same numbers with the sign flipped.
  • Try the shear field (y,0)(y, 0). Every arrow points left or right, yet the circulation around the unit circle is −π≈−3.1416-\pi \approx -3.1416. Above the xx axis the arrows point right and below it they point left, so along both the top and the bottom of the circle they push against the counterclockwise direction. The curl is −1-1 everywhere.
  • Pick the gradient of x2−y2x^2 - y^2 and move the circle around. The circulation stays 00 for every center and radius, because the field is conservative and its curl is 00. The radial field is a gradient too, of (x2+y2)/2(x^2 + y^2)/2, and its circulation is also always 00.
  • With the polynomial field (x2,xy)(x^2, xy) the curl is yy and the divergence is 3x3x, so the numbers depend on where the circle sits. At the origin both integrals are 00 even though the field is not. Move the center to (1,0.5)(1, 0.5) with radius 11. The circulation becomes 0.5π≈1.57080.5\pi \approx 1.5708 and the flux becomes 3π≈9.42483\pi \approx 9.4248, which is the area times the curl and the divergence at the center.
  • Choose the vortex and keep the circle at the origin. The circulation is 2π2\pi, but the integral of the curl is 00 because the curl is 00 wherever the field is defined. Move the center to (0.5,0.3)(0.5, 0.3) or change the radius, and the circulation stays 2π2\pi as long as the origin is inside.
  • Now move the vortex circle to the center (2,0)(2, 0) with radius 11. The disk no longer contains the origin, the circulation drops to 00 and the two sides agree again. A circle through the origin, such as center (1,0)(1, 0) with radius 11, makes the line integrals undefined.

What you are seeing

The circle CC with center (a,b)(a, b) and radius rr is traced counterclockwise,

x=a+rcos⁡t,y=b+rsin⁡t,0≤t≤2π.\begin{gathered} x = a + r\cos t, \qquad y = b + r\sin t, \\[0.4em] 0 \le t \le 2\pi. \end{gathered}

The circulation adds up the part of F\mathbf{F} along the circle and the flux adds up the part pointing out of it. Green’s theorem turns each into a double integral over the disk DD, once with the scalar curl and once with the divergence.

∮CF⋅T ds=∮CP dx+Q dy=∬D(∂Q∂x−∂P∂y)dA\begin{aligned} \oint_C \mathbf{F} \cdot \mathbf{T} \, ds &= \oint_C P \, dx + Q \, dy \\[0.4em] &= \iint_D \left( \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} \right) dA \end{aligned} ∮CF⋅n ds=∮CP dy−Q dx=∬D(∂P∂x+∂Q∂y)dA\begin{aligned} \oint_C \mathbf{F} \cdot \mathbf{n} \, ds &= \oint_C P \, dy - Q \, dx \\[0.4em] &= \iint_D \left( \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} \right) dA \end{aligned}

The theorem needs PP and QQ to have continuous partial derivatives on an open region that contains the whole disk. The vortex field

F=(−yx2+y2, xx2+y2)\mathbf{F} = \left( \frac{-y}{x^2 + y^2}, \ \frac{x}{x^2 + y^2} \right)

has curl 00 at every point except the origin, where it is not defined at all. On a circle of radius rr around the origin it points along the circle with length 1r\frac{1}{r}, so

∮CF⋅T ds=1r⋅2πr=2π.\oint_C \mathbf{F} \cdot \mathbf{T} \, ds = \frac{1}{r} \cdot 2\pi r = 2\pi.

When the disk contains the origin, the condition fails and the theorem says nothing, which is why the two sides can differ. The flux of the vortex is 00 on both sides, but not because of the theorem. For this field P dy−Q dx=−d(ln⁡r)P \, dy - Q \, dx = -d(\ln r), and ln⁡r\ln r returns to its starting value after one trip around any circle that does not pass through the origin, even one that encloses it. When the disk misses the origin, the field is smooth on it and Green’s theorem gives a circulation of 00.

The explorer computes the line integrals numerically with the trapezoid rule in tt, using more points the closer a circle in the vortex field comes to the origin. For a smooth periodic integrand this rule is accurate to many digits. The double integrals use the exact curl and divergence formulas in polar coordinates around the center, with a Gauss rule in the radius and equally spaced angles. The note under a value writes it as a multiple of π\pi, except where the vortex needs a warning there instead.

Each arrow sits at the middle of a grid cell and points in the direction of F\mathbf{F} there. Its length and the strength of its color both grow with the magnitude ∣F∣|\mathbf{F}| up to a cap, so short faint arrows mark a weak field. The cap sits where most arrows stay below it. The few very strong vectors, such as those close to the center of the vortex, are drawn at the cap so they do not shrink all the others.

The theorem with all its hypotheses is in the lesson on Green’s theorem, the formulas are collected on the multivariable reference sheet, and the whole course is on the Multivariable and Vector Calculus course page.