VectorCalculus
VectorField
create a vector field
Calling Sequence
Parameters
Description
Examples
VectorField(v, c)
v
-
list or Vector; components specifying the coefficients of the basis vectors at each point in space
c
(optional) symbol[name, name, ...]; specify the coordinate system and coordinate names of the vector field
The VectorField(v, c) command constructs a vector field, which is implemented as a Vector with the vectorfield attribute and a coordinate system attribute.
The vector field is one of the principal data structures of the Vector Calculus package.
Note that some VectorCalculus procedures require their input to be vector fields, but will accept Vector-valued operators as well; in this case, any input operator will be interpreted as a vector field, and the output will generally also be an operator.
The other principal data structures of the Vector Calculus package (free Vectors, position Vectors, and rooted Vectors) are not interpreted as constant vector fields.
If the second parameter, c, is not specified, the default coordinate system is used. In this case, the default coordinate system must be indexed by coordinate names; otherwise, an error is raised.
If Vectors are displayed in BasisFormat, the basis vectors for a vector field object are displayed using overbars to visually distinguish a vector field from a free Vector.
The routine evalVF can be used to evaluate a vector field at a point.
with⁡VectorCalculus:
Note the overbars on the basis Vectors
v≔VectorField⁡x,y,z,cartesianx,y,z
attributes⁡v
vectorfield,coords=cartesianx,y,z
About⁡v
Type: Vector FieldComponents: x,y,zCoordinates: cartesianx,y,z
evalVF⁡v,1,2,3
123
SetCoordinates⁡sphericalr,φ,θ
sphericalr,φ,θ
v≔VectorField⁡1r2,sin⁡φ,cos⁡θ
Type: Vector FieldComponents: 1r2,sin⁡φ,cos⁡θCoordinates: sphericalr,φ,θ
evalVF⁡v,1,π2,0
111
SetCoordinates⁡cylindricalr,θ,z
cylindricalr,θ,z
v≔VectorField⁡r⁢cos⁡θ,sin⁡θ,z2
Type: Vector FieldComponents: r⁢cos⁡θ,sin⁡θ,z2Coordinates: cylindricalr,θ,z
Curl⁡v
Note that the Divergence procedure accepts a Vector-valued operator in place of a vector field.
d≔Divergence⁡a,b,c↦b2+a2,1−c3,1
d≔a,b,c↦3⋅a2+b2a
d⁡2,2,2
8
See Also
attributes
convert/PhysicsVectors
coords
Physics/Vectors
VectorCalculus[AddCoordinates]
VectorCalculus[BasisFormat]
VectorCalculus[evalVF]
VectorCalculus[GetCoordinates]
VectorCalculus[MapToBasis]
VectorCalculus[SetCoordinates]
Download Help Document