Engineering Math

Curl, line integrals, and circulation

Line integrals

Consider a curve \(C\) in a Euclidean vector space \(\mathbb{R}^3\). Let \(\bm{r}(t) = [x(t),y(t),z(t)]\) be a parametric representation of \(C\). Furthermore, let \(\bm{F}: \mathbb{R}^3 \rightarrow \mathbb{R}^3\) be a vector-valued function of \(\bm{r}\) and let \(\bm{r}'(t)\) be the tangent vector. The is \[\begin{align} \int\limits_C \bm{F}(\bm{r}(t)) \cdot \bm{r}'(t) \diff t \end{align}\] which integrates \(\bm{F}\) along the curve. For more on computing line integrals, see (Schey 2005, 63–74) and (Kreyszig 2011, sec. 10.1 and 10.2).

If \(\bm{F}\) is a being applied to an object moving along the curve \(C\), the line integral is the done by the force. More generally, the line integral integrates \(\bm{F}\) along the tangent of \(C\).

Circulation

Consider the line integral over a closed curve \(C\), denoted by \[\begin{align} \oint\limits_C \bm{F}(\bm{r}(t)) \cdot \bm{r}'(t) \diff t. \end{align}\] We call this quantity the of \(\bm{F}\) around \(C\).

For certain vector-valued functions \(\bm{F}\), the circulation is zero for every curve. In these cases (static electric fields, for instance), this is sometimes called the .

Curl

Consider the division of the circulation around a curve in \(\mathbb{R}^3\) by the surface area it encloses \(\Delta S\), \[\begin{align} \frac{1}{\Delta S} \oint\limits_C \bm{F}(\bm{r}(t)) \cdot \bm{r}'(t) \diff t. \end{align}\] In a manner analogous to the operation that gaves us the divergence, let’s consider shrinking this curve to a point and the surface area to zero, \[\begin{align} \lim_{\Delta S \rightarrow 0} \frac{1}{\Delta S} \oint\limits_C \bm{F}(\bm{r}(t)) \cdot \bm{r}'(t) \diff t. \end{align}\] We call this quantity the “scalar” of \(\bm{F}\) at each point in \(\mathbb{R}^3\) in the direction normal to \(\Delta S\) as it shrinks to zero. Taking three (or \(n\) for \(\mathbb{R}^n\)) “scalar” curls in indepedent normal directions (enough to span the vector space), we obtain the proper, which is a vector-valued function \(\curl: \mathbb{R}^3 \rightarrow \mathbb{R}^3\).

The curl is coordinate-independent. In cartesian coordinates, it can be shown to be equivalent to the following.

But what does the curl of \(\bm{F}\) represent? It quantifies the local rotation of \(\bm{F}\) about each point. If \(\bm{F}\) represents a fluid’s velocity, \(\curl\bm{F}\) is the local rotation of the fluid about each point and it is called the .

Zero curl, circulation, and path independence

Circulation

It can be shown that if the circulation of \(\bm{F}\) on all curves is zero, then in each direction \(\bm{n}\) and at every point \(\curl \bm{F} = 0\) (i.e. \(\bm{n} \cdot \curl \bm{F} = 0\)). Conversely, for \(\curl \bm{F} = 0\) in a simply connected region1, \(\bm{F}\) has zero circulation.

Succinctly, informally, and without the requisite qualifiers above, \[\begin{align} \text{zero circulation} &\Rightarrow \text{zero curl} \\ \text{zero curl } + \text{simply connected region} &\Rightarrow \text{zero circulation}. \end{align}\]

Path independence

It can be shown that if the path integral of \(\bm{F}\) on all curves between any two points is , then in each direction \(\bm{n}\) and at every point \(\curl \bm{F} = 0\) (i.e. \(\bm{n} \cdot \curl \bm{F} = 0\)). Conversely, for \(\curl \bm{F} = 0\) in a simply connected region, all line integrals are independent of path.

Succinctly, informally, and without the requisite qualifiers above, \[\begin{align} \text{path independence} &\Rightarrow \text{zero curl} \\ \text{zero curl } + \text{simply connected region} &\Rightarrow \text{path independence}. \end{align}\]

And how they relate

It is also true that \[\begin{align} \text{path independence} &\Leftrightarrow \text{zero circulation}. \end{align}\] So, putting it all together, we get fig. ¿fig:curl-independence-circulation-connectedness?.

 Figure 5.5
Figure 5.5: An implication graph relating zero curl, zero circulation, path independence, and connectedness. Blue edges represent implication (a implies b) and black edges represent logical conjunctions.

Exploring curl

Curl is perhaps best explored by considering it for a vector field in \(\mathbb{R}^2\). Such a field in cartesian coordinates \(\bm{F} = F_x \bm{\hat{i}} + F_y \bm{\hat{j}}\) has curl \[\begin{align} \curl\bm{F} &= \begin{bmatrix} \partial_y 0 - \partial_z F_y & \partial_z F_x - \partial_x 0 & \partial_x F_y - \partial_y F_x \end{bmatrix}^\top \nonumber \\ &= \begin{bmatrix} 0 - 0 & 0 - 0 & \partial_x F_y - \partial_y F_x \end{bmatrix}^\top \nonumber \\ &= \begin{bmatrix} 0 & 0 & \partial_x F_y - \partial_y F_x \end{bmatrix}^\top. \end{align}\] That is, \(\curl\bm{F} = (\partial_x F_y - \partial_y F_x)\bm{\hat{k}}\) and the only nonzero component is normal to the \(xy\)-plane. If we overlay a quiver plot of \(\bm{F}\) over a “color density” plot representing the \(\bm{\hat{k}}\)-component of \(\curl\bm{F}\), we can increase our intuition about the curl. First, load some Python packages.

import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
from matplotlib.ticker import LogLocator
from matplotlib.colors import *

Now we define some symbolic variables and functions.

x = sp.Symbol('x', real=True)
y = sp.Symbol('y', real=True)
F_x = sp.Function('F_x')(x, y)
F_y = sp.Function('F_y')(x, y)

We use a variation of the quiver_plotter_2D() from above to make several of these plots.

def quiver_plotter_2D(
  field={F_x: x*y, F_y: x*y},
  grid_width=3,
  grid_decimate_x=8,
  grid_decimate_y=8,
  norm=Normalize(),
  density_operation='div',
  print_density=True,
):
  # Define symbolics
  x, y = sp.symbols('x y', real=True)
  F_x = sp.Function('F_x')(x, y)
  F_y = sp.Function('F_y')(x, y)
  field_sub = field
  # Compute density
  if density_operation == 'div':
    den = F_x.diff(x) + F_y.diff(y)
  elif density_operation == 'curl':
    den = F_y.diff(x) - F_x.diff(y)  # in the k direction
  else:
    raise ValueError('div and curl are the only density operators')
  den_simp = den.subs(field_sub).doit().simplify()
  if den_simp.is_constant():
    print('Warning: density operator is constant (no density plot)')
  if print_density:
    print(f'The {density_operation} is: {den_simp}')
  # Lambdify for numerics
  F_x_sub = F_x.subs(field_sub)
  F_y_sub = F_y.subs(field_sub)
  F_x_fun = sp.lambdify((x, y),F_x.subs(field_sub), 'numpy')
  F_y_fun = sp.lambdify((x, y), F_y.subs(field_sub), 'numpy')
  if F_x_sub.is_constant:
    F_x_fun1 = F_x_fun # Dummy
    F_x_fun = lambda x, y: F_x_fun1(x, y)*np.ones(x.shape)
  if F_y_sub.is_constant:
    F_y_fun1 = F_y_fun # Dummy
    F_y_fun = lambda x, y: F_y_fun1(x, y)*np.ones(x.shape)
  if not den_simp.is_constant():
    den_fun = sp.lambdify((x, y), den_simp,'numpy') 
  # Create grid
  w = grid_width
  Y, X = np.mgrid[-w:w:100j, -w:w:100j]
  # Evaluate numerically
  F_x_num = F_x_fun(X, Y)
  F_y_num = F_y_fun(X, Y)
  if not den_simp.is_constant():
    den_num = den_fun(X, Y)
  # Plot
  fig, ax = plt.subplots()
  if not den_simp.is_constant():
    cmap = plt.get_cmap('coolwarm')
    im = plt.pcolormesh(X, Y, den_num, cmap=cmap, norm=norm)
    plt.colorbar()
  dx = grid_decimate_y
  dy = grid_decimate_x
  plt.quiver(
    X[::dx,::dy],Y[::dx,::dy], 
    F_x_num[::dx,::dy], F_y_num[::dx,::dy], 
    units='xy', scale=10)
  plt.title(fr'$F(x, y) = \left[ {sp.latex(F_x.subs(field_sub))},' + \
            fr'{sp.latex(F_y.subs(field_sub))} \right]$')
  return fig, ax

Let’s inspect several cases.

fig, ax = quiver_plotter_2D(
  field={F_x: 0, F_y: sp.cos(2*sp.pi*x)}, density_operation='curl',
  grid_decimate_x=2, grid_decimate_y=10, grid_width=1
)
plt.draw()
 Figure 5.6
Figure 5.6: Quiver plot of F(x,y) = [0,cos(2πx)]
fig, ax = quiver_plotter_2D(
  field={F_x: 0, F_y: x**2}, density_operation='curl',
  grid_decimate_x=2, grid_decimate_y=20,
)
plt.draw()
 Figure 5.7
Figure 5.7: Quiver plot of F(x,y) = [0,x2]
fig, ax = quiver_plotter_2D(
  field={F_x: y**2, F_y: x**2}, density_operation='curl',
  grid_decimate_x=2, grid_decimate_y=20,
)
plt.draw()
 Figure 5.8
Figure 5.8: Quiver plot of F(x,y) = [y2,x2]
fig, ax = quiver_plotter_2D(
  field={F_x: -y, F_y: x}, density_operation='curl',
  grid_decimate_x=6, grid_decimate_y=6,
)
plt.show()
 Figure 5.9
Figure 5.9: Quiver plot of F(x,y) = [−y,x]
Kreyszig, Erwin. 2011. Advanced Engineering Mathematics. 10^\text{th} ed. John Wiley & Sons, Limited.
Schey, H. M. 2005. Div, Grad, Curl, and All That: An Informal Text on Vector Calculus. W.W. Norton. https://books.google.com/books?id=sembQgAACAAJ.

  1. A region is simply connected if every curve in it can shrink to a point without leaving the region. An example of a region that is not simply connected is the surface of a toroid.↩︎

Online Resources for Section 5.2

No online resources.