Back

Line integrals: path dependence and Stokes

What you are seeing: a vector field in the plane, and two paths from A=(1,0)A = (-1, 0) to B=(1,0)B = (1, 0): the straight line (orange) and the upper semicircular arc (cyan). The line integral ABFdr\int_A^B \mathbf{F} \cdot d\mathbf{r} is computed on each path using Simpson quadrature. For a conservative field the two values coincide; for a non-conservative field they differ, and the closed-loop integral around the semicircle equals the curl integrated over the enclosed area (Stokes' theorem).

The selector switches between two conservative fields (F=(2xy,x2)\mathbf{F} = (2xy, x^2) and F=(x,y)\mathbf{F} = (x, y)) and two non-conservative fields (F=(y,x)\mathbf{F} = (-y, x) with curl 2, F=(y,0)\mathbf{F} = (y, 0) with curl 1-1). The readout reports both path integrals and their difference (the closed-loop value).

Figure 1. Line integrals of a vector field along two paths from A to B. Method: Simpson quadrature at n=200n = 200 subintervals.
field conservative

WHAT TO TRY

  • Vary each control and watch the rail readouts respond.
  • Compare the diagnostic plot against the live scene.