curl

Curl of vector field

Syntax

curl(V,X)
curl(V)

Description

example

curl(V,X) returns the curl of the vector field V with respect to the vector X. The vector field V and the vector X are both three-dimensional.

curl(V) returns the curl of the vector field V with respect to the vector of variables returned by symvar(V,3).

Examples

collapse all

Compute the curl of this vector field with respect to vector X = (x, y, z) in Cartesian coordinates.

syms x y z
V = [x^3*y^2*z, y^3*z^2*x, z^3*x^2*y];
X = [x y z];
curl(V,X)
ans =
   x^2*z^3 - 2*x*y^3*z
   x^3*y^2 - 2*x*y*z^3
 - 2*x^3*y*z + y^3*z^2

Compute the curl of the gradient of this scalar function. The curl of the gradient of any scalar function is the vector of 0s.

syms x y z
f = x^2 + y^2 + z^2;
vars = [x y z];
curl(gradient(f,vars),vars)
ans =
 0
 0
 0

The vector Laplacian of a vector field V is defined as follows.

2V=(V)×(×V)

Compute the vector Laplacian of this vector field using the curl, divergence, and gradient functions.

syms x y z
V = [x^2*y, y^2*z, z^2*x];
vars = [x y z];
gradient(divergence(V,vars)) - curl(curl(V,vars),vars)
ans =
 2*y
 2*z
 2*x

Input Arguments

collapse all

Input, specified as a three-dimensional vector of symbolic expressions or symbolic functions.

Variables, specified as a vector of three variables

More About

collapse all

Curl of a Vector Field

The curl of the vector field V = (V1, V2, V3) with respect to the vector X = (X1, X2, X3) in Cartesian coordinates is this vector.

curl(V)=×V=(V3X2V2X3V1X3V3X1V2X1V1X2)

Introduced in R2012a