Calculus/Vector calculus

From testwiki
Revision as of 22:14, 3 April 2020 by imported>Math buff (Calculating Path Integrals)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Calculus/Top Nav Vector calculus specifically refers to multi-variable calculus applied to scalar and vector fields. While vector calculus can be generalized to n dimensions (n), this chapter will specifically focus on 3 dimensions (3)

Fields in vector calculus

A depiction of xyz Cartesian coordinates with the ijk elementary basis vectors.

Scalar fields

A scalar field is a function f:3 that assigns a real number to each point in space. Scalar fields typically denote densities or potentials at each specific point. For the sake of simplicity, all scalar fields considered by this chapter will be assumed to be defined at all points and differentiable at all points.

Vector fields

A vector field is a function 𝐅:33 that assigns a vector to each point in space. Vector fields typically denote flow densities or potential gradients at each specific point. For the sake of simplicity, all vector fields considered by this chapter will be assumed to be defined at all points and differentiable at all points.

A depiction of cylindrical coordinates and the accompanying orthonormal basis vectors.

Vector fields in cylindrical coordinates

The cylindrical coordinate system used here has the three parameters: (ρ,ϕ,z). The Cartesian coordinate equivalent to the point (ρ,ϕ,z) is

x=ρcosϕ

y=ρsinϕ

z=z

Any vector field in cylindrical coordinates is a linear combination of the following 3 mutually orthogonal unit length basis vectors:

ρ^=cosϕ𝐢+sinϕ𝐣

ϕ^=sinϕ𝐢+cosϕ𝐣

𝐳^=𝐤

Note that these basis vectors are not constant with respect to position. The fact that the basis vectors change from position to position should always be considered. The cylindrical basis vectors change according to the following rates:

ρ ϕ z
ρ^ ρ^ρ=𝟎 ρ^ϕ=ϕ^ ρ^z=𝟎
ϕ^ ϕ^ρ=𝟎 ϕ^ϕ=𝐫^ ϕ^z=𝟎
𝐳^ 𝐳^ρ=𝟎 𝐳^ϕ=𝟎 𝐳^z=𝟎

Any vector field 𝐅 expressed in cylindrical coordinates has the form: 𝐅(𝐪)=Fρ(𝐪)ρ^+Fϕ(𝐪)ϕ^+Fz(𝐪)𝐳^

Given an arbitrary position 𝐪=(ρ,ϕ,z) that changes with time, the velocity of the position is:

d𝐪dt=dρdtρ^+ρdϕdtϕ^+dzdt𝐳^

The coefficient of ρ for the term ρdϕdtϕ^ originates from the fact that as the azimuth angle ϕ increases, the position 𝐪 swings around at a speed of ρ.

A depiction of spherical coordinates and the accompanying orthonormal basis vectors.

Vector fields in spherical coordinates

The spherical coordinate system used here has the three parameters: (r,θ,ϕ). The Cartesian coordinate equivalent to the point (r,θ,ϕ) is

x=rsinθcosϕ

y=rsinθsinϕ

z=rcosθ

Any vector field in spherical coordinates is a linear combination of the following 3 mutually orthogonal unit length basis vectors:

𝐫^=sinθcosϕ𝐢+sinθsinϕ𝐣+cosθ𝐤

θ^=cosθcosϕ𝐢+cosθsinϕ𝐣sinθ𝐤

ϕ^=sinϕ𝐢+cosϕ𝐣

Note that these basis vectors are not constant with respect to position. The fact that the basis vectors change from position to position should always be considered. The spherical basis vectors change according to the following rates:

r θ ϕ
𝐫^ 𝐫^r=𝟎 𝐫^θ=θ^ 𝐫^ϕ=sinθϕ^
θ^ θ^r=𝟎 θ^θ=𝐫^ θ^ϕ=cosθϕ^
ϕ^ ϕ^r=𝟎 ϕ^θ=𝟎 ϕ^ϕ=(sinθ𝐫^+cosθθ^)

Any vector field 𝐅 expressed in spherical coordinates has the form: 𝐅(𝐪)=Fr(𝐪)𝐫^+Fθ(𝐪)θ^+Fϕ(𝐪)ϕ^

Given an arbitrary position 𝐪=(r,θ,ϕ) that changes with time, the velocity of this position is:

d𝐪dt=drdt𝐫^+rdθdtθ^+rsinθdϕdtϕ^

The coefficient of r for the term rdθdtθ^ arises from the fact that as the latitudinal angle θ changes, the position 𝐪 traverses a great circle at a speed of r.

The coefficient of rsinθ for the term rsinθdϕdtϕ^ arises from the fact that as the longitudinal angle ϕ changes, the position 𝐪 traverses a latitude circle at a speed of rsinθ.

Volume, path, and surface integrals

Volume Integrals

Volume integrals have already been discussed in the chapter Multivariable calculus, but a brief review is given here for completeness.

Given a scalar field ρ:3 that denotes a density at each specific point, and an arbitrary volume Ω3, the total "mass" M inside of Ω can be determined by partitioning Ω into infinitesimal volumes. At each position 𝐪Ω, the volume of the infinitesimal volume is denoted by the infinitesimal dV. This gives rise to the following integral:

M=𝐪Ωρ(𝐪)dV

Path Integrals

Given any oriented path C (oriented means that there is a preferred direction), the differential d𝐪=dx𝐢+dy𝐣+dz𝐤 denotes an infinitesimal displacement along C in the preferred direction. This differential can be used in various path integrals. Letting f:3 denote an arbitrary scalar field, and 𝐅:33 denote an arbitrary vector field, various path integrals include:

𝐪Cf(𝐪)d𝐪, 𝐪Cf(𝐪)|d𝐪|, 𝐪C𝐅(𝐪)d𝐪, 𝐪C𝐅(𝐪)|d𝐪|, and many more.

𝐪Cd𝐪 denotes the total displacement along C, and 𝐪C|d𝐪| denotes the total length of C.

Calculating Path Integrals

To compute a path integral, the continuous oriented curve C must be parameterized. 𝐪C(t) will denote the point along C indexed by t from the range [t0,t1]. 𝐪C(t0)=𝐪0 must be the starting point of C and 𝐪C(t1)=𝐪1 must be the ending point of C. As t increases, 𝐪C(t) must proceed along C in the preferred direction. An infinitesimal change in t, dt, results in the infinitesimal displacement d𝐪=d𝐪Cdtdt along C. In the path integral 𝐪C𝐅(𝐪)d𝐪, the differential d𝐪 can be replaced with d𝐪Cdtdt to get t=t0t1𝐅(𝐪C(t))d𝐪Cdtdt

Template:DropBox

If a vector field 𝐅 denotes a "force field", which returns the force on an object as a function of position, the work performed on a point mass that traverses the oriented curve C is W=𝐪C𝐅(𝐪)d𝐪

Template:DropBox


Template:DropBox

Surface Integrals

Given any oriented surface σ (oriented means that the there is a preferred direction to pass through the surface), an infinitesimal portion of the surface is defined by an infinitesimal area |dS|, and a unit length outwards oriented normal vector 𝐧. 𝐧 has a length of 1 and is perpendicular to the surface of σ, while penetrating σ in the preferred direction. The infinitesimal portion of the surface is denoted by the infinitesimal "surface vector": 𝐝𝐒=|dS|𝐧. If a vector field 𝐅:33 denotes a flow density, then the flow through the infinitesimal surface portion in the preferred direction is 𝐅(𝐪)𝐝𝐒.

The infinitesimal "surface vector" 𝐝𝐒=𝐧|dS| describes the infinitesimal surface element in a manner similar to how the infinitesimal displacement d𝐪 describes an infinitesimal portion of a path. More specifically, similar to how the interior points on a path do not affect the total displacement, the interior points on a surface to not affect the total surface vector.

The displacement between two points is independent of the path that connects them.

Consider for instance two paths C1 and C2 that both start at point A, and end at point B. The total displacements, 𝐪C1d𝐪 and 𝐪C2d𝐪, are both equivalent and equal to the displacement between A and B. Note however that the total lengths 𝐪C1|d𝐪| and 𝐪C2|d𝐪| are not necessarily equivalent.

Similarly, given two surfaces S1 and S2 that both share the same counter-clockwise oriented boundary C, the total surface vectors 𝐪S1𝐝𝐒 and 𝐪S2𝐝𝐒 are both equivalent and are a function of the boundary C. This implies that a surface can be freely deformed within its boundaries without changing the total surface vector. Note however that the surface areas 𝐪S1|𝐝𝐒| and 𝐪S2|𝐝𝐒| are not necessarily equivalent.

The fact that the total surface vectors of S1 and S2 are equivalent is not immediately obvious. To prove this fact, let 𝐅 be a constant vector field. S1 and S2 share the same boundary, so the flux/flow of 𝐅 through S1 and S2 is equivalent. The flux through S1 is Φ1=𝐪S1𝐅𝐝𝐒=𝐅𝐪S1𝐝𝐒, and similarly for S2 is Φ2=𝐪S2𝐅𝐝𝐒=𝐅𝐪S2𝐝𝐒. Since 𝐅𝐪S1𝐝𝐒=𝐅𝐪S2𝐝𝐒 for every choice of 𝐅, it follows that 𝐪S1𝐝𝐒=𝐪S2𝐝𝐒.

The geometric significance of the total surface vector is that each component measures the area of the projection of the surface onto the plane formed by the other two dimensions. Let σ be a surface with surface vector 𝐒=Sx𝐢+Sy𝐣+Sz𝐤. It is then the case that: Sx is the area of the projection of σ onto the yz-plane; Sy is the area of the projection of σ onto the xz-plane; and Sz is the area of the projection of σ onto the xy-plane.

The boundary Σ of Σ is counter-clockwise oriented.

Given an oriented surface Σ, another important concept is the oriented boundary. The boundary of Σ is an oriented curve Σ but how is the orientation chosen? If the boundary is "counter-clockwise" oriented, then the boundary must follow a counter-clockwise direction when the oriented surface normal vectors point towards the viewer. The counter-clockwise boundary also obeys the "right-hand rule": If you hold your right hand with your thumb in the direction of the surface normals (penetrating the surface in the "preferred" direction), then your fingers will wrap around in the direction of the counter-clockwise oriented boundary.

Template:DropBox

Template:DropBox


Calculating Surface Integrals

To calculate a surface integral, the oriented surface σ must be parameterized. Let 𝐪σ(u,v) be a continuous function that maps each point (u,v) from a two-dimensional domain Du,v to a point in σ. 𝐪σ(u,v) must be continuous and onto. While 𝐪σ(u,v) does not necessarily have to be one to one, the parameterization should never "fold back" on itself. The infinitesimal increases in u and v are respectively du and dv. These respectively give rise to the displacements 𝐪σudu and 𝐪σvdv. Assuming that the surface's orientation follows the right hand rule with respect to the displacements 𝐪σudu and 𝐪σvdv, the surface vector that arises is 𝐝𝐒=(𝐪σu×𝐪σv)dudv.

In the surface integral 𝐪σ𝐅(𝐪)𝐝𝐒, the differential 𝐝𝐒 can be replaced with (𝐪σu×𝐪σv)dudv to get (u,v)Du,v𝐅(𝐪σ(u,v))(𝐪σu×𝐪σv)dudv.

Template:DropBox

The Gradient and Directional Derivatives

Given a scalar field ϕ:3 that denotes a potential, and given a curve C, a commonly sought after quantity is the rate of change in ϕ as C is being traversed. Let t be an arbitrary parameter for C, and let 𝐪C(t)=(x(t),y(t),z(t)) denote the point indexed by t. Given an arbitrary t=t0 which corresponds to the point 𝐪C(t0)=𝐪0=(x0,y0,z0), then using the chain rule gives the following expression for the rate of increase of ϕ at t=t0, dϕdt|t0:

dϕdt|t0=ϕx|𝐪0dxdt|t0+ϕy|𝐪0dydt|t0+ϕz|𝐪0dzdt|t0=(ϕ)|𝐪0𝐯|t0

where ϕ=ϕx𝐢+ϕy𝐣+ϕz𝐤 is a vector field that denotes the "gradient" of ϕ, and 𝐯=dxdt𝐢+dydt𝐣+dzdt𝐤 is the unnormalized tangent of C.

If t is an arc-length parameter, i.e. |𝐯|=1, then the direction of the gradient is the direction of maximum gain: Given any unit length tangent 𝐯, the direction 𝐯=ϕ|ϕ| will maximize the rate of increase in ϕ. This maximum rate of increase is |ϕ|.

Calculating total gain

Given the gradient of a scalar field ϕ: ϕ, the difference between ϕ at two different points can be calculated, provided that there is a continuous path that links the two points. Let C denote an arbitrary continuous path that starts at point 𝐪0 and ends at point 𝐪1. Given an infinitesimal path segment P with endpoints 𝐪l and 𝐪u, let 𝐪cP be an arbitrary point in P. Δ𝐪=𝐪u𝐪l denotes the infinitesimal displacement denoted by P. The increase in ϕ along P is:

ϕ(𝐪u)ϕ(𝐪l)(ϕ)|𝐪cΔ𝐪

The relative error in the approximations vanish as Δ𝐪𝟎. Adding together the above equation over all infinitesimal path segments of C yields the following path integral equation:

ϕ(𝐪1)ϕ(𝐪0)=𝐪C(ϕ)|𝐪d𝐪

This is the path integral analog of the fundamental theorem of calculus.

The gradient in cylindrical coordinates

Let f:3 be a scalar field that denotes a potential and a curve C that is parameterized by t: 𝐪C(t)=(ρ(t),ϕ(t),z(t)). Let the rate of change in 𝐪C(t) be quantified by the vector d𝐪Cdt=dρdtρ^+ρdϕdtϕ^+dzdt𝐳^=vρρ^+vϕϕ^+vz𝐳^. The rate of change in f is:

dfdt=fρdρdt+fϕdϕdt+fzdzdt=fρvρ+fϕvϕρ+fzvz=(fρρ^+1ρfϕϕ^+fz𝐳^)(vρρ^+vϕϕ^+vz𝐳^)=(f)d𝐪Cdt

Therefore in cylindrical coordinates, the gradient is: f=fρρ^+1ρfϕϕ^+fz𝐳^

The gradient in spherical coordinates

Let f:3 be a scalar field that denotes a potential and a curve C that is parameterized by t: 𝐪C(t)=(r(t),θ(t),ϕ(t)). Let the rate of change in 𝐪C(t) be quantified by the vector d𝐪Cdt=drdt𝐫^+rdθdtθ^+rsinθdϕdtϕ^=vr𝐫^+vθθ^+vϕϕ^. The rate of change in f is:

dfdt=frdrdt+fθdθdt+fϕdϕdt=frvr+fθvθr+fϕvϕrsinθ=(fr𝐫^+1rfθθ^+1rsinθfϕϕ^)(vr𝐫^+vθθ^+vϕϕ^)=(f)d𝐪Cdt

Therefore in spherical coordinates, the gradient is: f=fr𝐫^+1rfθθ^+1rsinθfϕϕ^

The Directional Derivative

Given a scalar field f and a vector 𝐯, scalar field g=𝐯(f) computes the rate of change in f at each position 𝐪 where the velocity of 𝐪 is d𝐪dt=𝐯. Scalar field g can also be expressed as g=(𝐯)f. Velocity 𝐯 can also be a vector field 𝐕 so d𝐪dt depends on the position 𝐪. Scalar field g becomes g=(𝐕)f.

In Cartesian coordinates where 𝐕=vx𝐢+vy𝐣+vz𝐤 the directional derivative is:

(𝐕)f=vxfx+vyfy+vzfz

In cylindrical coordinates where 𝐕=vρρ^+vϕϕ^+vz𝐳^ the directional derivative is:

(𝐕)f=vρfρ+vϕρfϕ+vzfz

In spherical coordinates where 𝐕=vr𝐫^+vθθ^+vϕϕ^ the directional derivative is:

(𝐕)f=vrfr+vθrfθ+vϕrsinθfϕ

What makes the discussion of directional derivatives nontrivial is the fact that f can instead be a vector field 𝐅. Vector field 𝐆=(𝐕)𝐅 computes d𝐅dt at each position 𝐪 where d𝐪dt=𝐕(𝐪).

In cylindrical coordinates, basis vectors ρ^ and ϕ^ are not fixed, and in spherical coordinates, all of the basis vectors 𝐫^, θ^, and ϕ^ are not fixed. This makes determining the directional derivative of a vector field that is expressed using the cylindrical or spherical basis vectors non-trivial. To directly compute the directional derivative, the rates of change of each basis vector with respect to each coordinate should be used. Alternatively, the following identities related to the directional derivative can be used (proofs can be found here):

Given vector fields 𝐕, 𝐅, and 𝐆, then (𝐕)(𝐅+𝐆)=(𝐕)𝐅+(𝐕)𝐆

Given vector fields 𝐕 and 𝐆, and scalar field f, then (𝐕)(f𝐆)=((𝐕)f)𝐆+f((𝐕)𝐆)

In cylindrical coordinates, ((vρρ^+vϕϕ^+vz𝐳^))ρ^=vϕρϕ^ and ((vρρ^+vϕϕ^+vz𝐳^))ϕ^=vϕρρ^

In spherical coordinates, ((vr𝐫^+vθθ^+vϕϕ^))𝐫^=1r(vθθ^+vϕϕ^), and ((vr𝐫^+vθθ^+vϕϕ^))θ^=1r(vθ𝐫^+cotθvϕϕ^), and ((vr𝐫^+vθθ^+vϕϕ^))ϕ^=vϕrsinθ(sinθ𝐫^+cosθθ^)

Template:DropBox

The Divergence and Gauss's Divergence Theorem

Let 𝐅=Fx𝐢+Fy𝐣+Fz𝐤 denote a vector field that denotes "flow density". For any infinitesimal surface vector 𝐝𝐒=dSx𝐢+dSy𝐣+dSz𝐤 at position 𝐪, the flow through 𝐝𝐒 in the preferred direction is 𝐅(𝐪)𝐝𝐒=Fx(𝐪)dSx+Fy(𝐪)dSy+Fz(𝐪)dSz. Fx is the flow density parallel to the x-axis etc.

Given a volume Ω with a closed surface boundary Ω with an outwards orientation, the total outwards flow/flux through Ω is given by the surface integral 𝐪Ω𝐅(𝐪)𝐝𝐒. This outwards flow is equal to the total flow that is being generated in the interior of Ω.

For an infinitesimal rectangular prism R=[xl,xu]×[yl,yu]×[zl,zu] (Δx=xuxl, Δy=yuyl, and Δz=zuzl) that is centered on position (xc,yc,zc), the outwards flow through the surface R is:

𝐪R𝐅(𝐪)𝐝𝐒 𝐅(xu,yc,zc)(ΔyΔz𝐢)+𝐅(xl,yc,zc)(ΔyΔz𝐢)+ 𝐅(xc,yu,zc)(ΔxΔz𝐣)+𝐅(xc,yl,zc)(ΔxΔz𝐣)+ 𝐅(xc,yc,zu)(ΔxΔy𝐤)+𝐅(xc,yc,zl)(ΔxΔy𝐤)=

Fx(xu,yc,zc)Fx(xl,yc,zc)Δx(ΔxΔyΔz)+ Fy(xc,yu,zc)Fy(xc,yl,zc)Δy(ΔxΔyΔz)+ Fz(xc,yc,zu)Fz(xc,yc,zl)Δz(ΔxΔyΔz)

(Fxx|(xc,yc,zc)+Fyy|(xc,yc,zc)+Fzz|(xc,yc,zc))ΔxΔyΔz

𝐪R(Fxx+Fyy+Fzz)dV

All relative errors vanish as Δx,Δy,Δz0+.

𝐅=Fxx+Fyy+Fzz is the "divergence" of 𝐅 and is the density of "flow generation" at (xc,yc,zc). As noted above, the total outwards flow through Ω is the total flow generated inside of Ω, which gives Gauss's divergence theorem:

𝐪Ω𝐅(𝐪)𝐝𝐒=𝐪Ω(𝐅)|𝐪dV

This image depicts an example of the total flow across a closed boundary being the total flow generated inside the boundary.

In the image to the right, an example of the total flow across a closed boundary being the total flow generated in the interior of the boundary is given. The direction of the flow across each edge is denoted by the direction of the arrows, and the rate is denoted by the number of arrows. Each node inside the boundary is labelled with the rate of flow generation at the current node. It can be checked that a net total of 2 units of flow is being drawn into the boundary, and the total rate of flow generation across all interior nodes is a net consumption of 2 units.


The divergence in cylindrical coordinates

Let 𝐅=Fρρ^+Fϕϕ^+Fz𝐳^ denote a vector field that denotes "flow density". In order to compute the divergence (flow generation density) of 𝐅, consider an infinitesimal volume R defined by all points (ρ,ϕ,z) where ρ[ρl,ρu], ϕ[ϕl,ϕu], and z[zl,zu]. Note that R is not a rectangular prism. Let Δρ=ρuρl, Δϕ=ϕuϕl, and Δz=zuzl. Let (ρc,ϕc,zc)R be an arbitrary point from R.

The volume of R is approximately ΔρρcΔϕΔz. The 6 surfaces bounding R are described in the following table:

Surface approximate area direction approximate flow density
ρ=ρu, ϕ[ϕl,ϕu], z[zl,zu] ρuΔϕΔz +ρ^ 𝐅(ρu,ϕc,zc)
ρ=ρl, ϕ[ϕl,ϕu], z[zl,zu] ρlΔϕΔz ρ^ 𝐅(ρl,ϕc,zc)
ρ[ρl,ρu], ϕ=ϕu, z[zl,zu] ΔρΔz +ϕ^ 𝐅(ρc,ϕu,zc)
ρ[ρl,ρu], ϕ=ϕl, z[zl,zu] ΔρΔz ϕ^ 𝐅(ρc,ϕl,zc)
ρ[ρl,ρu], ϕ[ϕl,ϕu], z=zu ΔρρcΔϕ +𝐳^ 𝐅(ρc,ϕc,zu)
ρ[ρl,ρu], ϕ[ϕl,ϕu], z=zl ΔρρcΔϕ 𝐳^ 𝐅(ρc,ϕc,zl)

The total outwards flow through the surface R of R is:

𝐪R𝐅(𝐪)𝐝𝐒 𝐅(ρu,ϕc,zc)(ρuΔϕΔzρ^)+𝐅(ρl,ϕc,zc)(ρlΔϕΔzρ^)+ 𝐅(ρc,ϕu,zc)(ΔρΔzϕ^)+𝐅(ρc,ϕl,zc)(ΔρΔzϕ^)+ 𝐅(ρc,ϕc,zu)(ΔρρcΔϕ𝐳^)+𝐅(ρc,ϕc,zl)(ΔρρcΔϕ𝐳^)=

ρuFρ(ρu,ϕc,zc)ρlFρ(ρl,ϕc,zc)Δρ(ΔρΔϕΔz)+ Fϕ(ρc,ϕu,zc)Fϕ(ρc,ϕl,zc)Δϕ(ΔρΔϕΔz)+ ρcFz(ρc,ϕc,zu)Fz(ρc,ϕc,zl)Δz(ΔρΔϕΔz)

(ρ(ρFρ)|(ρc,ϕc,zc)+ϕ(Fϕ)|(ρc,ϕc,zc)+ρcz(Fz)|(ρc,ϕc,zc))(ΔρΔϕΔz)=

(1ρcρ(ρFρ)|(ρc,ϕc,zc)+1ρcϕ(Fϕ)|(ρc,ϕc,zc)+z(Fz)|(ρc,ϕc,zc))(ΔρρcΔϕΔz)

𝐪R(1ρρ(ρFρ)+1ρϕ(Fϕ)+z(Fz))dV

All relative errors vanish as Δρ,Δϕ,Δz0+.

The divergence (flow generation density) is therefore:

𝐅=1ρρ(ρFρ)+1ρϕ(Fϕ)+z(Fz)

Template:DropBox

The divergence in spherical coordinates

Let 𝐅=Fr𝐫^+Fθθ^+Fϕϕ^ denote a vector field that denotes "flow density". In order to compute the divergence (flow generation density) of 𝐅, consider an infinitesimal volume R defined by all points (r,θ,ϕ) where r[rl,ru], θ[θl,θu], and ϕ[ϕl,ϕu]. Note that R is not a rectangular prism. Let Δr=rurl, Δθ=θuθl, and Δϕ=ϕuϕl. Let (rc,θc,ϕc)R be an arbitrary point from R.

The volume of R is approximately ΔrrcΔθrcsinθcΔϕ. The 6 surfaces bounding R are shown in the following table:

Surface approximate area direction approximate flow density
r=ru, θ[θl,θu], ϕ[ϕl,ϕu] ruΔθrusinθcΔϕ +𝐫^ 𝐅(ru,θc,ϕc)
r=rl, θ[θl,θu], ϕ[ϕl,ϕu] rlΔθrlsinθcΔϕ 𝐫^ 𝐅(rl,θc,ϕc)
r[rl,ru], θ=θu, ϕ[ϕl,ϕu] ΔrrcsinθuΔϕ +θ^ 𝐅(rc,θu,ϕc)
r[rl,ru], θ=θl, ϕ[ϕl,ϕu] ΔrrcsinθlΔϕ θ^ 𝐅(rc,θl,ϕc)
r[rl,ru], θ[θl,θu], ϕ=ϕu ΔrrcΔθ +ϕ^ 𝐅(rc,θc,ϕu)
r[rl,ru], θ[θl,θu], ϕ=ϕl ΔrrcΔθ ϕ^ 𝐅(rc,θc,ϕl)

The total outwards flow through the surface R of R is:

𝐪R𝐅(𝐪)𝐝𝐒

𝐅(ru,θc,ϕc)(ruΔθrusinθcΔϕ𝐫^)+𝐅(rl,θc,ϕc)(rlΔθrlsinθcΔϕ𝐫^)+

𝐅(rc,θu,ϕc)(ΔrrcsinθuΔϕθ^)+𝐅(rc,θl,ϕc)(ΔrrcsinθlΔϕθ^)+

𝐅(rc,θc,ϕu)(ΔrrcΔθϕ^)+𝐅(rc,θc,ϕl)(ΔrrcΔθϕ^)=

(sinθcru2Fr(ru,θc,ϕc)rl2Fr(rl,θc,ϕc)Δr+rcsinθuFθ(rc,θu,ϕc)sinθlFθ(rc,θl,ϕc)Δθ+rcFϕ(rc,θc,ϕu)Fϕ(rc,θc,ϕl)Δϕ)ΔrΔθΔϕ

(sinθcr(r2Fr)|(rc,θc,ϕc)+rcθ(sinθFθ)|(rc,θc,ϕc)+rcϕ(Fϕ)|(rc,θc,ϕc))(ΔrΔθΔϕ)=

(1rc2r(r2Fr)|(rc,θc,ϕc)+1rcsinθcθ(sinθFθ)|(rc,θc,ϕc)+1rcsinθcϕ(Fϕ)|(rc,θc,ϕc))(ΔrrcΔθrcsinθcΔϕ)

𝐪R(1r2r(r2Fr)+1rsinθθ(sinθFθ)+1rsinθϕ(Fϕ))dV

All relative errors vanish as Δr,Δθ,Δϕ0+

The divergence (flow generation density) is therefore:

𝐅=1r2r(r2Fr)+1rsinθθ(sinθFθ)+1rsinθϕ(Fϕ)


Divergence free vector fields

A vector field 𝐅 for which 𝐅=0 is a "divergence free" vector field. 𝐅 can also be referred to as "incompressible" (since the flow density of an incompressible fluid is divergence free) or "solenoidal" (since magnetic fields are divergence free).

A key property of a divergence free vector field 𝐅 is that the flux of 𝐅 through a surface is purely a function of the surface's boundary. If σ1 and σ2 are two surfaces which share the same counterclockwise oriented boundary C, then 𝐪σ1𝐅(𝐪)𝐝𝐒=𝐪σ2𝐅(𝐪)𝐝𝐒. In other words, the flux is purely a function of C. This property can be derived from Gauss's divergence theorem as follows:

To begin, it will be assumed that σ1 and σ2 do not intersect each other, except for at the common boundary C. The argument presented here easily generalizes to cases where σ1 and σ2 do intersect each other. Invert the orientation of σ2 to get σ2 and combine σ1 and σ2 to get a closed surface σ3=σ1σ2, stitching the surfaces together along the seam C. Let Ω denote the volume which is the interior of σ3, and it will also be assumed that σ3 is oriented outwards (which is the case if σ1 is "in front" of σ2).

Gauss's divergence theorem states that 𝐪σ3𝐅(𝐪)𝐝𝐒=𝐪Ω(𝐅)|𝐪dV=0. The flux through σ3 is the flux through σ1 minus the flux through σ2: 𝐪σ3𝐅(𝐪)𝐝𝐒=𝐪σ1𝐅(𝐪)𝐝𝐒+𝐪σ2𝐅(𝐪)𝐝𝐒 =𝐪σ1𝐅(𝐪)𝐝𝐒𝐪σ2𝐅(𝐪)𝐝𝐒. Therefore:

𝐪σ3𝐅(𝐪)𝐝𝐒=0 𝐪σ1𝐅(𝐪)𝐝𝐒=𝐪σ2𝐅(𝐪)𝐝𝐒

The Laplacian Operator

Given a scalar field f, if the gradient f is interpreted as denoting flow density, the rate of flow generation at each point is (f) which is referred to as the "Laplacian" of f and is denoted by 2f (or alternately Δf).

The laplacian 2f is effectively a measure of the "convexity" of f at each point 𝐪. When there is a net flow of the gradient away from 𝐪, this means that f(𝐪) is "low" compared to its neighboring points and that the convexity (2f)|𝐪 is positive. When there is a net flow of the gradient towards 𝐪, this means that f(𝐪) is "high" compared to its neighboring points and that the convexity (2f)|𝐪 is negative.

In Cartesian coordinates, the Laplacian is:

2f=(f)=(fx𝐢+fy𝐣+fz𝐤)=2fx2+2fy2+2fz2

In cylindrical coordinates, the Laplacian is:

2f=(f)=(fρρ^+1ρfϕϕ^+fz𝐳^)=1ρρ(ρfρ)+1ρ22fϕ2+2fz2

In spherical coordinates, the Laplacian is:

2f=(f)=(fr𝐫^+1rfθθ^+1rsinθfϕϕ^)=1r2r(r2fr)+1r2sinθθ(sinθfθ)+1r2sin2θ2fϕ2

The Laplacian and Vector fields

Occasionally, the Laplacian operator is applied to a vector field as opposed to a scalar field. Other than for Cartesian coordinates, the Laplacian cannot be applied directly to each component, as in non-Cartesian coordinate systems, the basis vectors are subject to change. In cylindrical coordinates, basis vectors ρ^ and ϕ^ are not fixed, and in spherical coordinates, all of the basis vectors 𝐫^, θ^, and ϕ^ are not fixed. This makes determining the Laplacian of a vector field that is expressed using the cylindrical or spherical basis vectors non-trivial. To directly compute the Laplacian, the rates of change of each basis vector with respect to each coordinate should be used. Alternatively, the following identities related to the Laplacian can be used (proofs can be found here):

Given vector fields 𝐅 and 𝐆, then 2(𝐅+𝐆)=2𝐅+2𝐆

Given scalar field f and vector field 𝐆, then 2(f𝐆)=(2f)𝐆+2((f))𝐆+f(2𝐆)

In cylindrical coordinates, 2ρ^=1ρ2ρ^ and 2ϕ^=1ρ2ϕ^

In spherical coordinates, 2𝐫^=2r2𝐫^, and 2θ^=1r2sin2θ(sin(2θ)𝐫^+θ^), and 2ϕ^=1r2sin2θϕ^

Template:DropBox

The Curl and Stokes' Theorem

Given a scalar field f:3 and a curve C with endpoints 𝐪0 and 𝐪1, the difference between f(𝐪1) and f(𝐪0) is given by the following path integral involving the gradient field 𝐅=f: f(𝐪1)f(𝐪0)=𝐪C𝐅(𝐪)d𝐪. If C is closed (𝐪1=𝐪0), then 𝐪C𝐅(𝐪)d𝐪=0. In other words, the "gain" of 𝐅=f around a closed curve C is always 0. Most vector fields 𝐅:33 are not the gradient of any scalar field however, and the gain of 𝐅 around a closed curve C may not always be 0. This gives rise to the notion of circulation or "curl".

The path integral 𝐪C𝐅(𝐪)d𝐪 for a closed curve C is the "circulation" of 𝐅 around C. Stokes' theorem will show that the circulation around C is the total circulation accumulated in the interior of C.

Green's Theorem

A demonstration of how a large loop can be decomposed into a family of infinitesimal loops.

Quantifying "circulation density" is best introduced in 2 dimensions. Given a large counter-clockwise oriented loop C that is confined to 2 dimensions, C can be decomposed into a family of infinitesimal loops as shown on the right. Boundaries that are common to adjacent loops cancel each other out due to their opposite orientations, so the total circulation around C is the sum of the circulations around each infinitesimal loop.

An infinitesimal rectangular loop.

Consider the infinitesimal rectangle R=[xl,xu]×[yl,yu]. Let (xc,yc)R be an arbitrary point inside the rectangle, let Δx=xuxl and Δy=yuyl, and let R be the counterclockwise boundary of R.

The circulation around R is approximately (the relative error vanishes as Δx,Δy0+):

𝐪R𝐅(𝐪)d𝐪𝐅(xu,yc)(+Δy𝐣)+𝐅(xc,yu)(Δx𝐢)+𝐅(xl,yc)(Δy𝐣)+𝐅(xc,yl)(+Δx𝐢) =Fy(xu,yc)ΔyFx(xc,yu)ΔxFy(xl,yc)Δy+Fx(xc,yl)Δx =(Fy(xu,yc)Fy(xl,yc)ΔxFx(xc,yu)Fx(xc,yl)Δy)ΔxΔy (Fyx|(xc,yc)Fxy|(xc,yc))ΔxΔy R(FyxFxy)dxdy

As Δx,Δy0+, the relative errors present in the approximations vanish, and therefore, for an infinitesimal rectangle, 𝐪R𝐅(𝐪)d𝐪=𝐪R(FyxFxy)dxdy

FyxFxy is the "circulation density" at (xc,yc). Let C be a counter-clockwise oriented loop with interior D. The circulation around loop C is the total circulation contained by D: 𝐪C𝐅(𝐪)d𝐪=𝐪D(FyxFxy)dxdy. This is Green's theorem.

Stokes' Theorem

Stokes' Theorem is effectively a generalization of Green's theorem to 3 dimensions, and the "curl" is a generalization of the quantity FyxFxy to 3 dimensions. An arbitrary oriented surface σ can be articulated into a family of infinitesimal surfaces, some parallel to the xy-plane, others parallel to the zx-plane, and the remainder parallel to the yz-plane. Let 𝐅 denote an arbitrary vector field.

Let σ be a surface that is parallel to the yz-plane with counter-clockwise oriented boundary C. Green's theorem gives:

𝐪C𝐅(𝐪)d𝐪=𝐪σ(FzyFyz)(𝐝𝐒𝐢)=𝐪σ((FzyFyz)𝐢)𝐝𝐒

𝐝𝐒𝐢 is positive if the normal direction to σ points in the positive x direction and is negative if otherwise. If the normal direction to σ points in the negative x direction, then C is oriented clockwise instead of counter-clockwise in the yz-plane.

Decomposing a 3D loop into an ensemble of infinitesimal loops that are parallel to the yz, zx, or xy planes.

Repeating this argument for σ being parallel to the zx-plane and xy-plane respectively gives:

𝐪C𝐅(𝐪)d𝐪=𝐪σ(FxzFzx)(𝐝𝐒𝐣)=𝐪σ((FxzFzx)𝐣)𝐝𝐒

and

𝐪C𝐅(𝐪)d𝐪=𝐪σ(FyxFxy)(𝐝𝐒𝐤)=𝐪σ((FyxFxy)𝐤)𝐝𝐒

Treating σ as an ensemble of infinitesimal surfaces parallel to the yz-plane, zx-plane, or xy-plane gives:

𝐪C𝐅(𝐪)d𝐪=𝐪σ((FzyFyz)𝐢+(FxzFzx)𝐣+(FyxFxy)𝐤)𝐝𝐒

This is Stokes' theorem, and ×𝐅=(FzyFyz)𝐢+(FxzFzx)𝐣+(FyxFxy)𝐤 is the "curl" of 𝐅 which generalizes the "circulation density" to 3 dimensions.

The direction of ×𝐅 at 𝐪 is effectively an "axis of rotation" around which the counterclockwise circulation density in a plane whose normal is parallel to ×𝐅 is |×𝐅|. Out of all planes that pass through 𝐪, the plane whose normal is parallel to ×𝐅 has the largest counterclockwise circulation density at 𝐪 which is |×𝐅|.

An arbitrary vector field 𝐅 that is differentiable everywhere is considered to be "irrotational" or "conservative" if ×𝐅=𝟎 everywhere, or equivalently that 𝐪C𝐅(𝐪)d𝐪=0 for all continuous closed curves C.

The curl in cylindrical coordinates

Let 𝐅=Fρρ^+Fϕϕ^+Fz𝐳^ denote an arbitrary vector field in cylindrical coordinates. By calculating the circulation densities in surfaces perpendicular to ρ^, ϕ^, and 𝐳^, the curl can be computed:

×𝐅=1ρ(ϕ(Fz)z(ρFϕ))ρ^+(z(Fρ)ρ(Fz))ϕ^+1ρ(ρ(ρFϕ)ϕ(Fρ))𝐳^ =(1ρϕ(Fz)z(Fϕ))ρ^+(z(Fρ)ρ(Fz))ϕ^+1ρ(ρ(ρFϕ)ϕ(Fρ))𝐳^

The curl in spherical coordinates

Let 𝐅=Fr𝐫^+Fθθ^+Fϕϕ^ denote an arbitrary vector field in spherical coordinates. By calculating circulation densities in surfaces perpendicular to 𝐫^, θ^, and ϕ^, the curl can be computed:

×𝐅=1r2sinθ(θ(rsinθFϕ)ϕ(rFθ))𝐫^+1rsinθ(ϕ(Fr)r(rsinθFϕ))θ^+1r(r(rFθ)θ(Fr))ϕ^

=1rsinθ(θ(sinθFϕ)ϕ(Fθ))𝐫^+1r(1sinθϕ(Fr)r(rFϕ))θ^+1r(r(rFθ)θ(Fr))ϕ^


Irrotational vector fields

A vector field 𝐅 for which ×𝐅=𝟎 at all points is an "irrotational" vector field. 𝐅 can also be referred to as being "conservative" since the gain around any closed curve is always 0.

A key property of an irrotational vector field 𝐅 is that the gain of 𝐅 along a continuous curve is purely a function of the curve's end points. If C1 and C2 are two continuous curves which share the same starting point 𝐪0 and end point 𝐪1, then 𝐪C1𝐅(𝐪)d𝐪=𝐪C2𝐅(𝐪)d𝐪. In other words, the gain is purely a function of 𝐪0 and 𝐪1. This property can be derived from Stokes' theorem as follows:

Invert the orientation of C2 to get C2 and combine C1 and C2 to get a continuous closed curve C3=C1C2, linking the curves together at the endpoints 𝐪0 and 𝐪1. Let σ denote a surface for which C3 is the counterclockwise oriented boundary.

Stokes' theorem states that 𝐪C3𝐅(𝐪)d𝐪=𝐪σ(×𝐅)|𝐪𝐝𝐒=0. The gain around C3 is the gain along C1 minus the gain along C2: 𝐪C3𝐅(𝐪)d𝐪=𝐪C1𝐅(𝐪)d𝐪+𝐪C2𝐅(𝐪)d𝐪 =𝐪C1𝐅(𝐪)d𝐪𝐪C2𝐅(𝐪)d𝐪. Therefore:

𝐪C3𝐅(𝐪)d𝐪=0 𝐪C1𝐅(𝐪)d𝐪=𝐪C2𝐅(𝐪)d𝐪

Summary and Extensions

In summary:

The gradient of a scalar field f is f=fx𝐢+fy𝐣+fz𝐤 which denotes the rate of change in f in each direction, at each point.
Given an oriented curve C which starts at 𝐪0 and ends at 𝐪1, the increase in f along C is: f(𝐪1)f(𝐪0)=𝐪C(f)|𝐪d𝐪 (the gradient theorem)
If a vector field 𝐅=Fx𝐢+Fy𝐣+Fz𝐤 denotes "flow density", then the divergence is 𝐅=Fxx+Fyy+Fzz which denotes the density of "flow generation" at each point.
Given a volume Ω with outwards oriented surface Ω, the total flow being generated inside Ω is: 𝐪Ω𝐅(𝐪)𝐝𝐒=𝐪Ω(𝐅)|𝐪dV (Gauss's divergence theorem)
The curl of a vector field 𝐅=Fx𝐢+Fy𝐣+Fz𝐤 is ×𝐅=(FzyFyz)𝐢+(FxzFzx)𝐣+(FyxFxy)𝐤 which denotes the "circulation density" at each point.
Given an oriented surface σ with a counter-clockwise oriented boundary σ, the total circulation present in σ is: 𝐪σ𝐅(𝐪)d𝐪=𝐪σ(×𝐅)|𝐪𝐝𝐒 (Stokes' theorem)


Extending the gradient theorem

The gradient theorem states that given an everywhere differentiable scalar field f and a continuous oriented curve C with endpoints 𝐪0 and 𝐪1, that f(𝐪1)f(𝐪0)=𝐪C(f)|𝐪d𝐪. This theorem can be extended to equate a surface integral with a volume integral, as opposed to equating a difference with a path integral.

Let Ω be an arbitrary volume with outwards oriented surface Ω. Let L=(xl,y,z)(xu,y,z) be an arbitrary line segment parallel to the x-axis that is completely contained by Ω and that starts and ends on the surface of Ω. Let this line segment have an infinitesimal cross-sectional area of t. The volume integral of fx over L is: 𝐪LfxdV=tx=xlxufxdx=t(f(xu,y,z)f(xl,y,z)). Let 𝐝𝐒l and 𝐝𝐒u be the infinitesimal surface portions of Ω formed when L intersects Ω at (xl,y,z) and (xu,y,z) respectively. The x-component of 𝐝𝐒l and 𝐝𝐒u is t and t respectively. Adding up all possible line segments L gives:

𝐪ΩfxdV=𝐪Ωf(𝐪)dSx where dSx is the x-component of the differential 𝐝𝐒.

Repeating for the y-axis and z-axis gives:

𝐪ΩfydV=𝐪Ωf(𝐪)dSy where dSy is the y-component of the differential 𝐝𝐒.

𝐪ΩfzdV=𝐪Ωf(𝐪)dSz where dSz is the z-component of the differential 𝐝𝐒.

This yields:

𝐪Ω(fx𝐢+fy𝐣+fz𝐤)dV=𝐪Ωf(𝐪)(dSx𝐢+dSy𝐣+dSz𝐤)

and hence:

𝐪Ωf(𝐪)𝐝𝐒=𝐪Ω(f)|𝐪dV

The above integral equation is effectively a generalization of the gradient theorem.


Extending Stokes' Theorem

Stokes' theorem states that given an everywhere differentiable vector field 𝐅=Fx𝐢+Fy𝐣+Fz𝐤 and an oriented surface σ with counterclockwise boundary σ, that 𝐪σ𝐅(𝐪)d𝐪=𝐪σ(×𝐅)|𝐪𝐝𝐒. This theorem can be extended to equate a surface integral with a volume integral, as opposed to equating a path integral with a surface integral.

Let Ω be an arbitrary volume with outwards oriented surface Ω. Let xc be arbitrary, and let D be the cross-section of Ω in the plane x=xc. Let D be the counter-clockwise boundary of D (the surface normal vectors of D point in the positive x-direction). Green's theorem gives:

𝐪D𝐅(𝐪)d𝐪=𝐪D(FzyFyz)dydz

Now let the cross-section D have an infinitesimal thickness dx, forming the volume slice D. Let E denote the infinitesimal strip of Ω that wraps the cross-section (E is similar to D except that E is a surface with a non-zero infinitesimal width). Let 𝐝𝐒 be an infinitesimal portion of E. Ignoring the component of 𝐝𝐒 that is parallel to D, dSy𝐣+dSz𝐤 denotes a thin strip of surface that wraps around D, and is parallel to the x-axis. The counterclockwise displacement d𝐪 along the boundary of D manifested by dSy𝐣+dSz𝐤 is d𝐪=dSzdx𝐣+dSydx𝐤. Substituting into the path integral around D gives:

𝐪E(Fz(𝐪)dSydxFy(𝐪)dSzdx)=𝐪D(FzyFyz)dydz

𝐪E(Fz(𝐪)dSyFy(𝐪)dSz)=𝐪D(FzyFyz)dV

Integrating over all cross-sections gives:

𝐪Ω(Fz(𝐪)dSyFy(𝐪)dSz)=𝐪Ω(FzyFyz)dV

Repeating the above argument for the y-axis and z-axis gives:

𝐪Ω(Fx(𝐪)dSzFz(𝐪)dSx)=𝐪Ω(FxzFzx)dV

𝐪Ω(Fy(𝐪)dSxFx(𝐪)dSy)=𝐪Ω(FyxFxy)dV

This yields:

𝐪Ω((Fz(𝐪)dSyFy(𝐪)dSz)𝐢+(Fx(𝐪)dSzFz(𝐪)dSx)𝐣+(Fy(𝐪)dSxFx(𝐪)dSy)𝐤) =𝐪Ω((FzyFyz)𝐢+(FxzFzx)𝐣+(FyxFxy)𝐤)dV

𝐪Ω𝐝𝐒×𝐅(𝐪)=𝐪Ω(×𝐅)|𝐪dV

The above integral equation is effectively a generalization of Stokes' theorem.

Template:BookCat