Gradient, Divergence, Curl, Laplacian
- Overview
- Gradient — Scalar Field to Vector Field
- Divergence — Vector Field to Scalar Field
- Curl — Vector Field to Vector Field
- Laplacian — Scalar Field to Scalar Field
Overview
When a scalar or a vector value is defined at every point in the space, such a mapping, a point to value, is called a field. If a point is mapped to a scalar value, such as temperature or pressure, that is a scalar field. If a point is mapped to a vector, such as wind or ocean current, it becomes a vector field. The most commonly used operations are gradient, divergence, curl, and Laplacian. Gradient and Laplacian operations are mostly applied to scalar field, while the divergence and curl only apply to vector fields. Even though these concepts can be extended to -dimension, consider them only for a point here.
Gradient — Scalar Field to Vector Field
The gradient operator measures the rate and direction of change in a scalar field. It is simply a bundle of partial derivatives in all directions, which is perpendicular to the isocontour as mentioned in this note. That is, the gradient operator is denoted by , and for a scalar field ,
For example, let . Then,
A cross-section of this gradient field at is shown below.
Divergence — Vector Field to Scalar Field
For a given point in a vector field, the divergence operator measures incoming or outgoing flow with a scalar value. This operator can be derived by measuring vectors from a given vector field at each face of a tiny cube with its side length . If the sum of the magnitude of the vectors is greater than zero, then it means some flow is generated inside the cude. If the sum is less than zero, then something is sucking the flow. Let the vector field . Since the area of a face is , the total amount of stream towards the -direction is,
Note that the negative sign is because means the inward direction in the face. Summing these up for every cube face,
This result is the sum of the divergence for the whole volume of the cube. So it should be divided up with the cube’s volume .
Therefore, if approaches , the divergence operator can be derived as follows.
For example, let . Then,
A cross-section of this divergence field at is shown below.
Curl — Vector Field to Vector Field
The curl operator evaluates the rotational flow of a vector field at a given point. This operator can be derived by measuring the rotation around a square with its side length . First, for a tiny square in -plane, the difference of -directional vectors between and faces is evaluated. Then, the difference between and faces for -directional vectors is evaluated. Finally, these differences are summed up along the counterclockwise direction. Let the vector field .
If approaches ,
Since this result measures rotation in the -axis, this evaluation can be extended to - and -axes.
Note that the direction and the magnitude of the vector correspond to the rotational axis and the amount of the rotation, respectively.
For example, let . Then,
A cross-section of this curl field at is shown below.
Laplacian — Scalar Field to Scalar Field
The Laplacian operator measures how much the scalar field value at a given location is different from the average field value nearby. In other words, this operator evaluates the bumps on the scalar field. The plane or slope that does not have any curvature has zero Laplacian value. This operator can be explained with the intuitive approach as well.
- The goal is to find the operator that measures how much a scalar field converges or expands.
- Such an operator for a vector field is the divergence.
- However, the divergence operator can accept only a vector field as an input.
- Thus, the idea is to get an intermediate vector field by applying the gradient operator to the original scalar field.
- Now since the input field has become the vector field, the divergence operator can be applied to this field.
- The result scalar field describes the bumpiness of the input field.
Since the Laplacian operator measures peaks and edges, one of the popular applications is edge detection for a given scalar field because the output indicates where the edges are and how steep they are. Moreover, if this output is added or subtracted from the original scalar field, it acts like the blur or sharpen effect. Adding the Laplacian field to the original field will lower the sharpest point, thus making the feature point dull and blurry. Exactly the opposite thing happens when subtracting with the Laplacian field, which will sharpen the original.
For example, let . Then,
A cross-section of this Laplacian field at is shown below.
Reference
[1] Kim, Doyub. (2016). Fluid Engine Development.