Mathematics

# Divergence

[latexpage]

## Introduction

Divergence vs. convergence

• Divergence = movement towards a point (i.e., source)
• Convergence = movement away from a point (i.e., sink)

Question: for a given point in a vector field $\overrightarrow{v}(x,y)$, does “fluid” tend to flow towards (i.e., converge) or away from (i.e., diverge) it?

• The operator, $\nabla \cdot$ (i.e., the dot product with the gradient operator) measures this!
• Aside:

$\nabla = \begin{bmatrix} \frac { \partial }{ \partial x_{ 1 } } \\ \vdots \\ \frac { \partial }{ \partial x_{ n } } \end{bmatrix}$

• Specifically, $\nabla \cdot \overrightarrow{v}(x,y,...)$ for a particular input $(x,y,...)$ returns a scalar value output indicating whether fluid tends to flow towards that input point or away from it:

Note: for the purposes of this article, we are going to assume $overrightarrow{v}$ is a vector field with a 2D input → 2D output

Three possibilities for interpreting the divergence of a point in a vector field

## Constructing the Divergence Formula

Consider the following 2D vector field:

$\overrightarrow{v}_x(x,y) = \begin{bmatrix} P(x,y) \\ 0 \end{bmatrix}$

where $P(x,y)$ is an arbitrary 2D input → 1D output multivariable function

• This vector field “reduces” such that there is only an $x$-component in the output ⇒ all vectors in the vector field either point left or right
• Here are some cases for positive divergence
• Note: assume the three vectors in each diagram sampled from our vector field $\overrightarrow{v}_x(x,y)$
• Case 1:
• Case 2:
• Case 3:
• Here, even though the $P(x,y)$ is negative at each individual point, it becomes less negative as $x$ increases
• Importantly, all these cases satisfy the following  properties
• The only change in input (i.e., origins of the three output vectors) occurs in the $x$-direction
• We can tell that $\frac{\partial P}{\partial x} > 0$ because the change in $P(x,y)$ with respect to $x$ increases as $x$ increases
• Conclusions:
• Recall: a positive change in $P(x,y)$ resulting from positive changes in $x$ corresponds with positive with positive divergence
• Thus, our formula for divergence will include a term containing $\frac{\partial P}{\partial x}$

Now, let’s consider another 2D vector:

$\overrightarrow{v}_y(x,y) = \begin{bmatrix} 0 \\ Q(x,y) \end{bmatrix}$

where $Q(x,y)$ is an arbitrary 2D input → 1D output multivariable function

• This vector field “reduces” such that there is only an $y$-component in the output ⇒ all vectors in the vector field either point up or down
• Again, here are some cases for positive divergence:
• Note: assume the three vectors in each diagram sampled from our vector field $\overrightarrow{v}_y(x,y)$
• Case 1:
• Case 2:
• Case 3:
• Here, even though the $Q(x,y)$ is negative at each individual point, it becomes less negative as $y$ increases
• Importantly, all these cases satisfy the following  properties
• The only change in input (i.e., origins of the three output vectors) occurs in the $y$-direction
• We can tell that $\frac{\partial P}{\partial x} > 0$ because the change in $Q(x,y)$ with respect to $x$ increases as $x$ increases
• Conclusions:
• Recall: a positive change in $Q(x,y)$ resulting from positive changes in $y$ corresponds with positive divergence
• In addition to our $\frac{\partial P}{\partial x}$-term, the formula for divergence will include a term containing $\frac{\partial Q}{\partial y}$

It turns out that $\frac{\partial P}{\partial x}$ and $\frac{\partial Q}{\partial y}$ are the only two quantities we need to know for determining the divergence of a 2D vector field $\overrightarrow{v}(x,y)$

• Specifically, if we let

$\overrightarrow{v}(x,y) = \begin{bmatrix} P(x,y) \\ Q(x,y) \end{bmatrix}$

where $P(x,y)$ andd $Q(x,y)$ are arbitrary 2D input → 1D output multivariable functions then,

$\nabla \cdot \overrightarrow{v}(x,y) = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}$

## Take-home-message:

• For a 2D vector field,
• $\frac{\partial P}{\partial x}$ accounts for the $x$ components in the output
• $\frac{\partial Q}{\partial y}$ accounts for the $y$ components in the output
• For any input point in an arbitrary 2D vector field, we can break down all the outputs associated with neighboring input points into $x$ and $y$ components
• In the context that our vector field models fluid flow, this can be thought of as determining the net amount of fluid flowing into our input point in the $x$ and $y$ directions (i.e., the divergence!)

Note: we can also extend these findings to n-dimensional vector fields

• For example, consider an arbitrary 3D vector field:

$\overrightarrow{v}(x,y,z) = \begin{bmatrix} P(x,y,z) \\ Q(x,y,z) \\ R(x,y,z) \end{bmatrix}$

• We would write the divergence for a point $(x,y,z)$ in this vector field as

$\nabla \cdot \overrightarrow{v}(x,y,z) = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}$

## References:

This site uses Akismet to reduce spam. Learn how your comment data is processed.