curl

Curl and angular velocity of a vector field.

Category: Graphics > 2-D and 3-D Plots

Syntax

cz = curl(X, Y, U, V)

Z-component of the curl of a 2-D field.

[cz, cav] = curl(X, Y, U, V)

Also returns the angular velocity.

[curlx, curly, curlz, cav] = curl(X, Y, Z, U, V, W)

Curl components and angular velocity of a 3-D field.

Description

The curl measures how much a field rotates around each point. It is estimated with finite differences on the grid. For the solid-body rotation (U, V) = (-y, x) the z-curl is 2 everywhere, and for a field with no rotation, such as (x, y), it is 0.

The angular velocity is half the curl.

Input arguments

X, Y, Z
Grid coordinates, as from meshgrid.
U, V, W
Components of the vector field, with the size of the grid.

Output arguments

cz
Z-component of the curl, dV/dx - dU/dy.
cav
Angular velocity: half the curl.

Example

Rotation versus radial field

[X, Y] = meshgrid(1:4);
cz = curl(X, Y, -Y, X)
cz0 = curl(X, Y, X, Y)
Output
cz = 4×4

     2     2     2     2
     2     2     2     2
     2     2     2     2
     2     2     2     2
cz0 = 4×4

     0     0     0     0
     0     0     0     0
     0     0     0     0
     0     0     0     0

See also

divergence gradient del2 quiver meshgrid