linalg(deprecated)
diverge
divergence of a vector function
Calling Sequence
Parameters
Description
Examples
diverge(f, v)
diverge(f, v, co)
f
-
vector or list of expressions
v
vector or list (same length as f) of the variables of f
co
(optional), is either of type `=` or a list of three elements. This option is used to compute the divergence in orthogonally curvilinear coordinate systems.
Important: The linalg package has been deprecated. Use the superseding command VectorCalculus[Divergence], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The function diverge computes the divergence of f with respect to v, where f is a vector function of the variables given by v.
The divergence of f with respect to v is defined as the sum of ∂∂vifi as i ranges over the length of f.
In the case of three dimensions, where f is a three-dimensional function of three variables and v is a list or a vector of three variables:
If the optional third argument co is of the form coords = coords_name or coords = coords_name([const]), diverge will operate on commonly used orthogonally curvilinear coordinate systems. See ?coords for the list of the coordinate systems supported by Maple.
For orthogonally curvilinear coordinates v[1], v[2], v[3]
with unit vectors a[1], a[2], a[3], and scale factors
h[1], h[2], h[3].
Let the rectangular coordinates x, y, z be defined in terms of the
specified orthogonally curvilinear coordinates. We have:
h[n]^2 = [diff(x,v[n])^2 + diff(y,v[n])^2 + diff(z,v[n])^2], n=1,2,3.
The formula for the divergence of f is:
diverge(f) = 1/(h[1]*h[2]*h[3])*sum(diff(h[1]*h[2]*h[3]*
f[n]/h[n],v[n]),n=1..3)
If the optional third argument co is a list of three elements which specify the scale factors, diverge will operate on orthogonally curvilinear coordinate systems.
To compute the divergence in other orthogonally curvilinear coordinate systems, use the addcoords routine.
The two dimensional case is similar to the three dimensional one.
The command with(linalg,diverge) allows the use of the abbreviated form of this command.
with⁡linalg:
f≔vector⁡x,y2,z:v≔vector⁡x,y,z:
diverge⁡f,v
2+2⁢y
h≔vector⁡r,sin⁡θ,z:v≔vector⁡r,θ,z:
diverge⁡h,v,coords=cylindrical
3⁢r+cos⁡θr
i≔vector⁡r,sin⁡θ⁢r,cos⁡φ⁢r:v≔vector⁡r,θ,φ:
diverge⁡i,v,coords=spherical
2⁢sin⁡θ⁢cos⁡θ+3⁢sin⁡θ−sin⁡φsin⁡θ
define the scale factors in spherical coordinates
s≔1,r,r⁢sin⁡θ:
diverge⁡i,v,s
See Also
addcoords
coords
linalg(deprecated)[curl]
linalg(deprecated)[grad]
linalg(deprecated)[laplacian]
LinearAlgebra
VectorCalculus[Divergence]
Download Help Document