Skip to main content
Open In Colab
Prerequisites. If you are unfamiliar with ODEs or the Euler integration step, first read ODEs and the Euler method. The discrete update in that section is also used here to track particles through the storm field.
A storm is a familiar example of a velocity field. Its wind has three properties:
  • Wind has direction.
  • Wind has magnitude.
  • Different locations experience different winds.
Mathematically, the wind in a storm forms a velocity field: v(x,y,t)\mathbf{v}(x, y, t) At each location (x,y)(x, y) and time tt, the vector gives the direction and speed of the air.

A rotating storm

A simple 2D rotating storm centered at the origin is v(x,y)=[−yx].\mathbf{v}(x, y) = \begin{bmatrix} -y \\ x \end{bmatrix}. This field produces pure rotation. Its values at two points are:
  • At (1,0)(1, 0), v=(0,1)\mathbf{v} = (0, 1), so the wind blows upward.
  • At (0,1)(0, 1), v=(−1,0)\mathbf{v} = (-1, 0), so the wind blows to the left.
The field therefore rotates counterclockwise around the origin.
Output from cell 1

Velocity weakens with distance

A real storm is strongest near the eye and weakens outward. A simple model for this behavior is v(x,y)=1x2+y2+ε[−yx],\mathbf{v}(x, y) = \frac{1}{x^2 + y^2 + \varepsilon} \begin{bmatrix} -y \\ x \end{bmatrix}, where ε>0\varepsilon > 0 avoids the singularity at the origin. The field is strong near the center and decays with distance. The following plot shows this behavior.
Output from cell 2

Particles in the storm

Particle motion in a velocity field is a dynamical system. A particle at position x(t)\mathbf{x}(t) moves according to dxdt=v(x).\frac{d \mathbf{x}}{d t} = \mathbf{v}(\mathbf{x}). You can integrate this numerically. The simplest scheme is the Euler step, x(t+Δt)=x(t)+Δt⋅v(x(t)),\mathbf{x}(t + \Delta t) = \mathbf{x}(t) + \Delta t \cdot \mathbf{v}(\mathbf{x}(t)), Repeat this update to follow many particles released at t=0t = 0. The resulting trajectories model the motion of raindrops, leaves, and debris in a storm.
Output from cell 4

Divergence: rotation against contraction

Rotation moves particles without changing how crowded they are. A cloud of particles with a rotationally symmetric density looks the same after the storm has turned it. To see a field that does change the density, set a contracting field beside the rotation: vrot(x,y)=[−yx],vcon(x,y)=[−x−y].\mathbf{v}_{\text{rot}}(x, y) = \begin{bmatrix} -y \\ x \end{bmatrix}, \qquad \mathbf{v}_{\text{con}}(x, y) = \begin{bmatrix} -x \\ -y \end{bmatrix}. The contracting field points at the origin everywhere, with speed proportional to the distance from it. The divergence measures how much a field spreads particles apart at a point: ∇⋅v=∂vx∂x+∂vy∂y.\nabla \cdot \mathbf{v} = \frac{\partial v_x}{\partial x} + \frac{\partial v_y}{\partial y}. For the rotation, ∇⋅vrot=0+0=0\nabla \cdot \mathbf{v}_{\text{rot}} = 0 + 0 = 0. It preserves area, so a rotationally symmetric density does not change. For the contraction, ∇⋅vcon=−1−1=−2\nabla \cdot \mathbf{v}_{\text{con}} = -1 - 1 = -2. Particles crowd together and the density rises. Both fields are linear, v=Ax\mathbf{v} = A\mathbf{x}, so the flow map over a time tt is the matrix etAe^{tA}. Its determinant is ettr⁡A=et∇⋅ve^{t \operatorname{tr} A} = e^{t \nabla \cdot \mathbf{v}}. The rotation has determinant 11 and the contraction has determinant e−2te^{-2t}. The code below moves a cloud of particles drawn from a standard Gaussian with the Euler step from the section on particles in the storm.
Output from cell 6 Both panels start from the same Gaussian cloud and run for time T=1T = 1. The left panel shows the cloud after the rotation: a round Gaussian blob, because turning a rotationally symmetric cloud leaves it unchanged. The right panel shows the cloud after the contraction: it is concentrated near the origin, with a higher peak. The area claim can be measured directly. Follow the corners of a small square and measure the polygon area with the shoelace formula. The rotation keeps the area and the contraction shrinks it by e−2Te^{-2T}.
The same factor shows up in the Gaussian. A contraction maps N(0,Σ)\mathcal{N}(0, \Sigma) to N(0,e−2tΣ)\mathcal{N}(0, e^{-2t}\Sigma), so the covariance of the cloud shrinks by e−2te^{-2t}. The rotation maps N(0,I)\mathcal{N}(0, I) to itself.
Divergence alone does not give the new density. The dynamic transport section derives the continuity equation, where the divergence of p vp\,\mathbf{v} is what changes the density.
Found an error on this page? Report an issue.