Physics[Vectors][Curl] - compute the curl by using the nabla differential operator
Physics[Vectors][Divergence] - compute the divergence by using the nabla differential operator
Physics[Vectors][Gradient] - compute the gradient by using the nabla differential operator
Physics[Vectors][Laplacian] - compute the Laplacian by using the nabla differential operator
Calling Sequence
Curl(A)
Divergence(A)
Gradient(A)
Laplacian(A)
Remark: these calling sequences are also valid with the inert %Curl, %Divergence, %Gradient, %Laplacian commands
Parameters
A
-
any algebraic (vector or scalar) expression
Description
Curl, Divergence, Gradient and Laplacian, respectively return the curl, the divergence, the gradient and the Laplacian of a given vectorial or scalar function. When the command's name is prefixed by %, an unevaluated representation for these operations is returned.
The %Curl, %Divergence, %Gradient and %Laplacian are the inert forms of Curl, Divergence, Gradient and Laplacian, that is: they represent the same mathematical operations while holding the operations unperformed. To activate the operations use value.
Curl, Divergence and Gradient check their arguments (for consistency) before sending the task to Nabla. So, if A_ is a vector, then Gradient(A_) will interrupt the computation with an error message, as well as Divergence(A) and Curl(A) when A is a scalar (not a vector). All these differential operations are realized just w.r.t the geometrical coordinates φ,r,ρ,θ,x,y,z. Therefore, if A does not depend on these global geometrical coordinates, these commands (as well as Nabla) return 0.
For the conventions about the geometrical coordinates and vectors see ?conventions
Examples
with⁡PhysicsVectors
&x,`+`,`.`,Assume,ChangeBasis,ChangeCoordinates,CompactDisplay,Component,Curl,DirectionalDiff,Divergence,Gradient,Identify,Laplacian,∇,Norm,ParametrizeCurve,ParametrizeSurface,ParametrizeVolume,Setup,Simplify,`^`,diff,int
Setup⁡mathematicalnotation=true
mathematicalnotation=true
The Gradient of a function
Gradient⁡f⁡x,y,z
∂∂xf⁡x,y,z⁢i∧+∂∂yf⁡x,y,z⁢j∧+∂∂zf⁡x,y,z⁢k∧
The Divergence of a Gradient is equal to the Laplacian
Divergence⁡Gradient⁡f⁡x,y,z
∂2∂x2f⁡x,y,z+∂2∂y2f⁡x,y,z+∂2∂z2f⁡x,y,z
Laplacian⁡f⁡x,y,z
The Laplacian of a vector function in spherical coordinates
Laplacian⁡A_⁡r,θ,φ
∂2∂r2A→⁡r,θ,φ⁢r2+2⁢∂∂rA→⁡r,θ,φ⁢r+∂∂θA→⁡r,θ,φ⁢cot⁡θ+∂2∂θ2A→⁡r,θ,φ+∂2∂φ2A→⁡r,θ,φ⁢csc⁡θ2r2
The Curl of a Gradient is identically zero
eq≔Gradient⁡A⁡r,θ,φ
eq≔∂∂rA⁡r,θ,φ⁢r∧+∂∂θA⁡r,θ,φ⁢θ∧r+∂∂φA⁡r,θ,φ⁢φ∧r⁢sin⁡θ
Curl⁡eq
0
Depending on the context the inert representations of these commands, obtained by prefixing the command's name with %, serve better the purpose of representing the mathematical objects
%Gradient⁡A⁡r,θ,φ
∇A⁡r,θ,φ
Curl⁡
The Curl of non-projected vector function (note the underscore in 'V_' to represent vectors)
eq≔Curl⁡V_⁡r,θ,φ
eq≔∇×V→⁡r,θ,φ
The Divergence of a Curl is identically zero
Divergence⁡eq
The Divergence and Curl of a projected vector function (projected vectors don't need an "arrow" - the underscore "_" mentioned in the previous example to be represented)
V≔_r+f1⁡θ,φ⁢_θ+f2⁡θ,φ⁢_φ
V≔r∧+f1⁡θ,φ⁢θ∧+f2⁡θ,φ⁢φ∧
Divergence⁡V
2r+∂∂θf1⁡θ,φ⁢sin⁡θ+f1⁡θ,φ⁢cos⁡θr⁢sin⁡θ+∂∂φf2⁡θ,φr⁢sin⁡θ
Curl⁡V
∂∂θf2⁡θ,φ⁢sin⁡θ+f2⁡θ,φ⁢cos⁡θ−∂∂φf1⁡θ,φ⁢r∧r⁢sin⁡θ−f2⁡θ,φ⁢θ∧r+f1⁡θ,φ⁢φ∧r
See Also
convert,VectorCalculus, operations, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics/Vectors, Setup
Download Help Document