Vector Calculus Interactive Simulation

Gradient ($$\nabla f$$)

The gradient of a scalar field produces a vector field that points in the direction of steepest ascent.

Low Value
High Value
Gradient Vector

Mathematics of Gradient

For a scalar function $$f(x,y)$$, the gradient is defined as:

$$\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right)$$

This vector points in the direction of the steepest increase of the function.

Applications

In electrical fields, the gradient of the electric potential gives us the electric field: $$\mathbf{E} = -\nabla V$$.

In neural networks, gradient descent minimizes the loss function by moving opposite to the gradient.

Divergence ($$\nabla\cdot\mathbf{F}$$)

Divergence measures how much a vector field “spreads out” from a point.

Negative Divergence (Sink)
Zero Divergence
Positive Divergence (Source)

Mathematics of Divergence

For a vector field $$\mathbf{F} = (P, Q)$$, divergence is defined as:

$$\nabla\cdot\mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}$$

Positive divergence indicates a source; negative divergence indicates a sink.

Applications

Gauss's law in electromagnetics and fluid expansion in fluid dynamics both use divergence.

Curl ($$\nabla\times\mathbf{F}$$)

Curl measures the rotation or circulation of a vector field around a point.

Negative Curl (Clockwise)
Zero Curl
Positive Curl (Counter-Clockwise)

Mathematics of Curl

For a 2D vector field $$\mathbf{F} = (P, Q)$$, the curl (in the $$\mathbf{k}$$ direction) is defined as:

$$\nabla\times\mathbf{F} = \left(\frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y}\right)\mathbf{k}$$

The magnitude indicates the intensity of rotation, while the sign shows the direction.

Applications

Faraday's law and fluid vorticity use curl to quantify rotational behavior.

Applications in Electrical Fields & Neural Computations

Electric Fields and Vector Calculus

Electric fields can be represented as vector fields. Recall:

  • Gradient: $$\mathbf{E} = -\nabla V$$
  • Divergence: Gauss's law: $$\nabla\cdot\mathbf{E} = \frac{\rho}{\varepsilon_0}$$
  • Curl: For static fields: $$\nabla\times\mathbf{E} = 0$$

This simulation shows the electric field produced by a configurable number of point charges. Positive charges are shown in red; negative in blue.