Derivation of Gradient Divergence Curl in Spherical Coordinates

9
Derivation of Gradient, Divergence, Curl and Laplacian Operator in Spherical and General Orthogonal Coordinates (A Thorough Discussion) by Shule Yu September 29, 2013 Denotation and Convention We will use the following denotation in the discussion. e with a hat for unit vector. e.g. ˆ e x is the Cartesian coordinates unit vector along the x direction, ˆ e r is the Spherical coordinates unit vector along the r direction, ˆ e p is the general coordinates unit vector along p direction. p =1, 2, 3 in a 3-D problem. c p is the coordinate of a point in general coordinates. e.g. coordinate of P in Cartesian is (x, y, z ), in spherical Coordinate is (r, θ, φ), in general orthogonal coordinates is (c 1 ,c 2 ,c 3 ). Einstein summation convention ONLY for subscripts. Superscripts is free. e.g. a i b i = 3 i=1 a i · b i , however, a p b p =a p · b p ,p =1, 2, 3. For convenience, in Cartesian coordinate, we also use x i as the coordinates of ~x, namely, ~x =(x, y, z )= (x 1 ,x 2 ,x 3 ). Similarly as above, we also will use ˆ x i denote unit vectors in Cartesian coordinate, namely, ˆ x 1 = ˆ e x , ˆ x 2 e y x 3 e z . Thus we have: ˆ x i = ∂~x ∂x i (1) Orthogonal Coordinates Orthogonal means: ˆ e p · ˆ e q = δ pq = 1 p = q 0 p 6= q (2) Right hand convention (orthogonal property as well, we have): ˆ e 1 × ˆ e 2 = ˆ e 3 (3) Scales. We use h p as the scales in the p direction in general coordinates. (see below)

description

Div, Curl

Transcript of Derivation of Gradient Divergence Curl in Spherical Coordinates

Page 1: Derivation of Gradient Divergence Curl in Spherical Coordinates

Derivation of Gradient, Divergence, Curl and LaplacianOperator in Spherical and General Orthogonal Coordinates

(A Thorough Discussion)by Shule Yu

September 29, 2013

Denotation and Convention

We will use the following denotation in the discussion.

• e with a hat for unit vector. e.g. ex is the Cartesian coordinates unit vector along the x direction, er is

the Spherical coordinates unit vector along the r direction, ep is the general coordinates unit vector along

p direction. p = 1, 2, 3 in a 3-D problem.

• cp is the coordinate of a point in general coordinates. e.g. coordinate of P in Cartesian is (x, y, z), in

spherical Coordinate is (r, θ, φ), in general orthogonal coordinates is (c1, c2, c3).

• Einstein summation convention ONLY for subscripts. Superscripts is free. e.g. aibi =3∑i=1

ai · bi, however,

apbp =ap · bp, p = 1, 2, 3.

• For convenience, in Cartesian coordinate, we also use xi as the coordinates of ~x, namely, ~x = (x, y, z) =

(x1, x2, x3).

• Similarly as above, we also will use xi denote unit vectors in Cartesian coordinate, namely, x1 = ex,

x2 = ey, x3 = ez. Thus we have:

xi =∂~x

∂xi(1)

Orthogonal Coordinates

• Orthogonal means:

ep · eq = δpq =

1 p = q

0 p 6= q(2)

• Right hand convention (orthogonal property as well, we have):

e1 × e2 = e3 (3)

• Scales. We use hp as the scales in the p direction in general coordinates. (see below)

Page 2: Derivation of Gradient Divergence Curl in Spherical Coordinates

Scales

• Definition of unit vectors for general coordinates. The directions of unit vectors equal the direction of

gradient of corresponding coordinate; The length of unit vectors should be 1.

• Thus we introduce Scales denoted as hp:

ep = hp · ∇cp (4)

• Use Cartesian coordinates solve the gradient. (∇f =∂

∂xex +

∂yey +

∂zez):

ep = hp∂cp

∂xixi (5)

• Decompose ep in Cartesian coordinates:

ep = npi xi (6)

• Compare equation (5) and (6) we have:∂cp

∂xi=npihp

(7)

• Pure mathematic deduction:

ep = npi xi = npi∂~x

∂xieq. (1) & (6)

= npi∑q

∂~x

∂cq∂cq

∂xichain rule

= npi∑q

∂~x

∂cqnqihq

eq. (7)

=∑q

∂~x

∂cqnpin

qi

hqchange the order of summation

=∑q

∂~x

∂cqδpqhq

eq. (2)

=1

hp∂~x

∂cpsummation with δ function

(8)

• Through the deduction, eq.(8), we have:∂~x

∂cp= hpep (9)

Page 3: Derivation of Gradient Divergence Curl in Spherical Coordinates

Meaning of Scales and Infinitesimal elements

• Consider dl is the infinitesimal path of point P when its coordinates changes dcp, p = 1, 2, 3. We can

calculate the path length using dot product:

(dl)2 = d~x · d~x =∑q

(∂~x

∂cqdcq) ·

∑p

(∂~x

∂cpdcp) (chain rule) (10)

Use eq.(9) in the above equation:

(dl)2 =∑q

(hq eq dcq) ·∑p

(hpep dcp) (11)

Remember we have the orthogonal condition, eq.(2), we have :

(dl)2 =∑p

(hp dcp)2 = (h1 dc1)2 + (h2 dc2)2 + (h3 dc3)2 (12)

• Thus we come to a very very important equation, eq.(12).

– if the path is along one coordinates axis, its length is:

dl1

∣∣∣∣dc2=0dc3=0

= h1 dc1 (13)

– which means the area of surface element is:

dS = dl1 · dl2 = h1h2 dc1 dc2 (14)

– and the volume of volume element is:

dV = dl1 · dl2 · dl3 = h1h2h3 dc1 dc2 dc3 (15)

Calculation of Scales

• Consider the path is along the 1st coordinates axis, use eq.(13)

(dl)2 = (h1 dc1)2 = (dx)2 + (dy)2 + (dz)2 (16)

Because dc2 = dc3 = 0, use the partial derivative, we have:

(h1 dc1)2 = (∂x

∂c1dc1)2 + (

∂y

∂c1dc1)2 + (

∂z

∂c1dc1)2 (17)

Page 4: Derivation of Gradient Divergence Curl in Spherical Coordinates

Thus,

(h1)2 = (∂x

∂c1)2 + (

∂y

∂c1)2 + (

∂z

∂c1)2 (18)

• Take spherical coordinates as an example. We have:

x = r sin θ cosφ

y = r sin θ sinφ

z = r cos θ

c1 = r c2 = θ c3 = φ

(19)

After calculation, one can easily find that:

hr = 1 hθ = r hφ = r sin θ (20)

Gradient

• Consider a scalar function f(x, y, z). Use chain rule on the gradient:

∇f =∑p

∂f

∂cp∇cp (21)

And we have eq.(4), so the gradient in general coordinates is:

∇f ≡∑p

1

hp∂f

∂cpep (22)

The scales in orthogonal coordinates can be calculated use the method in the former section.

• Examples.

– In Spherical coordinates we have eq.(20) Thus the Gradient Operation in Spherical coordinates is:

∇f =∑p

1

hp∂f

∂cpep =

∂f

∂rer +

1

r

∂f

∂θeθ +

1

r sin θ

∂f

∂φeφ (23)

Namely, in spherical coordinates:

∇ ≡ ∂

∂rer +

1

r

∂θeθ +

1

r sin θ

∂φeφ (24)

Page 5: Derivation of Gradient Divergence Curl in Spherical Coordinates

Divergence

• The definition of Divergence.

– divergence measure the amount of ma-

terial comming out of a volumn element

at certain point.

– mathematically, that’s mean calcula-

tion of divergence can be written as:

∇ · ~f = lim∆V→0

∫∫∫∆V

∇ · ~f dV

∆V(25)

use Gauss Theorem:

∫∫∫∆V

∇ · ~f dV =

∮∂∆V

~f · d~S (26)

• Calculate the closed surface integral. Let

surface units pointing outside in the figure

on the right, decompose ~f into ~f = f1e1 +

f2e2 + f3e3, we have:

Figure 1: Divergence at (c1, c2, c3)

∮∂∆V

~f · d~S = f1(c1 + dc1, c2, c3)h2′h3′ dc2 dc3 − f1(c1, c2, c3)h2h3 dc2 dc3

+ f2(c1, c2 + dc2, c3)h3′′h1′′ dc3 dc1 − f2(c1, c2, c3)h3h1 dc3 dc1

+ f3(c1, c2, c3 + dc3)h1′′′h2′′′ dc1 dc2 − f3(c1, c2, c3)h1h2 dc1 dc2

=∂(h2h3f1)

∂c1dc1 dc2 dc3 +

∂(h3h1f2)

∂c2dc2 dc1 dc3 +

∂(h1h2f3)

∂c3dc3 dc1 dc2

(27)

• The Divergence in general coordinates.

– combine with eq.(15), we have:

∇ · ~f ≡ 1

h1h2h3

[∂(h2h3f1)

∂c1+∂(h3h1f2)

∂c2+∂(h1h2f3)

∂c3

](28)

• Take spherical coordinates as an example.

h1 = 1 h2 = r h3 = r sin θ

c1 = r c2 = θ c3 = φ

f1 = fr f2 = fθ f3 = fφ

(29)

Page 6: Derivation of Gradient Divergence Curl in Spherical Coordinates

Thus,

∇ · ~f =1

r2 sin θ

[∂(r2 sin θfr)

∂r+∂(r sin θfθ)

∂θ+∂(rfφ)

∂φ

](30)

Namely,

∇ · ~f ≡ 1

r2 sin θ

∂r(r2fr) +

1

r sin θ

∂θ(sin θfθ) +

1

r sin θ

∂fφ∂φ

(31)

Curl

• The definition of Curl.

– curl represent the amount how vector field swirl

around.

– mathematically, we can represent the 3rd compo-

nent of curl of ~f as follows:

[∇× ~f

]p=3= lim

∆S3→0

∫∫∆S3

∇× ~f · d ~S3

∆S3(32)

Figure 2: Curl in e3 at (c1, c2, c3)

• Use Stokes’ Theorem: ∫∫∆S3

∇× ~f · d ~S3 =

∮∂S3

~f · d~l (33)

• Calculate the closed line calculus, choosing the positive direction according to right hand rule:∮∂S3

~f · d~l =− f1(c1, c2 + dc2, c3)h1′ dc1 + f1(c1, c2, c3)h1 dc1

+ f2(c1 + dc1, c2, c3)h2′ dc2 − f2(c1, c2, c3)h2 dc2

=− ∂(f1h1)

∂c2dc2 dc1 +

∂(f2h2)

∂c1dc1 dc2

(34)

• The Curl in general coordinates.

– combine with eq.(14) we have the 3rd component of curl:

[∇× ~f

]p=3=

1

h1h2

[∂(f2h2)

∂c1− ∂(f1h2)

∂c2

](35)

Page 7: Derivation of Gradient Divergence Curl in Spherical Coordinates

– consider the rotational symmetry of three direction, we can write the curl in general coordinates:

∇× ~f ≡ 1

h2h3

[∂(f3h3)

∂c2− ∂(f2h2)

∂c3

]e1

+1

h3h1

[∂(f1h1)

∂c3− ∂(f3h3)

∂c1

]e2 +

1

h1h2

[∂(f2h2)

∂c1− ∂(f1h1)

∂c2

]e3

(36)

• Take spherical coordinates as an example. we have eq.(29), thus:

∇× ~f =1

r2 sin θ

[∂(r sin θfφ)

∂θ− ∂(rfθ)

∂φ

]er

+1

r sin θ

[∂fr∂φ−∂(r sin θfφ)

∂r

]eθ +

1

r

[∂(rfθ)

∂r− ∂fr

∂θ

]eφ

(37)

Namely,

∇× ~f ≡ 1

r sin θ

[∂

∂θ(sin θfφ)− ∂fθ

∂φ

]er +

1

r

[1

sin θ

∂fr∂φ− ∂

∂r(rfφ)

]eθ +

1

r

[∂

∂r(rfθ)−

∂fr∂θ

]eφ (38)

Laplacian Operator

• We can consider Laplacian Operator as a combined operator that divergence of a gradient:

∇2f ≡ ∇ · (∇f) (39)

Thus, combine eq.(22) and eq.(28), we can get the general coordinates Laplacian Operator.

• Laplacian Operator in general coordinates. Let

fp =1

hp∂f

∂cp, p = 1, 2, 3 (40)

which is in eq.(22). substitute it in eq.(28), we have:

∇2f ≡ 1

h1h2h3

[∂

∂c1(h2h3

h1

∂f

∂c1) +

∂c2(h3h1

h2

∂f

∂c2) +

∂c3(h1h2

h3

∂f

∂c3)

](41)

• Take spherical coordinates as an example. we have eq.(29), thus:

∇2f ≡ 1

r2

∂r

(r2∂f

∂r

)+

1

r2 sin θ

∂θ

(sin θ

∂f

∂θ

)+

1

r2 sin2 θ

∂2f

∂φ2(42)

Page 8: Derivation of Gradient Divergence Curl in Spherical Coordinates

Additional Discussion

• Partial derivative of the unit vector against coordinates.

– from eq.(2) we have:

ep · ∂eq

∂cr+ eq · ∂e

p

∂cr= 0 (43)

p, q = 1, 2, 3, r = 1, 2, 3. which contains 18(6*3) distinct scalar equations.

– from eq.(9) we have:∂

∂cq(hpep) =

∂cp(hq eq) (44)

which contains 3 nontrivial vector equations (9 scalar equations).

• Use the equation set eq.(43) & eq.(44) we can solve the partial derivative of the unit vector against

coordinates (∂ep

∂cq):

∂ep

∂cq=eq

hp∂hq

∂cp− δpq

[e1

h1

∂hp

∂c1+e2

h2

∂hp

∂c2+e3

h3

∂hp

∂c3

](45)

• Take spherical coordinates as an example.

– use spherical coordinates characters, eq.(29), in the equation above, we have:

∂er∂r

= 0∂eθ∂r

= 0∂eφ∂r

= 0

∂er∂θ

= eθ∂eθ∂θ

= −er∂eφ∂θ

= 0

∂er∂φ

= sin θeφ∂eθ∂φ

= cos θeφ∂eφ∂φ

= − sin θer − cos θeθ

(46)

• This can be useful in directly (violently) derive the operators in general coordinates:

– use the rule of partial derivatives:

(∂

∂cpeq) · (f rer) =

(∂f r

∂cp

)(eq · er) + (f r)(eq) ·

(∂er

∂cp

)(47)

(∂

∂cpeq)× (f rer) =

(∂f r

∂cp

)(eq × er) + (f r)(eq)×

(∂er

∂cp

)(48)

Page 9: Derivation of Gradient Divergence Curl in Spherical Coordinates

– take Laplacian operator in spherical coordinates as an example, use eq.(47) and eq.(48):

∇2f =∇ · (∇f) =

(∂

∂rer +

1

r

∂θeθ +

1

r sin θ

∂φeφ

)·(∂f

∂rer +

1

r

∂f

∂θeθ +

1

r sin θ

∂f

∂φeφ

)

=∂2f

∂r2(er · er) +

∂f

∂r(er) ·

∂er∂r

+∂

∂r(1

r

∂f

∂θ)(er · eθ) +

1

r

∂f

∂θ(er) ·

∂eθ∂r

+

+∂

∂r(

1

r sin θ

∂f

∂φ)(er · eφ) +

1

r sin θ

∂f

∂φ(er) ·

∂eφ∂r

+ · · ·

(many terms equal zero so it is not a hard problem, just complicate)

=∂2f

∂r2+

2

r

∂f

∂r+

1

r2

∂2f

∂θ2+

cos θ

r2 sin θ

∂f

∂θ+

1

r2 sin2 θ

∂2f

∂φ2

=1

r2

∂r

(r2∂f

∂r

)+

1

r2 sin θ

∂θ

(sin θ

∂f

∂θ

)+

1

r2 sin2 θ

∂2f

∂φ2

(49)

Reference

1. Aki, K. & Richards, P. G. Quatitative Seismology. Page 31 - 32. (2002).

2. Wangyi Wu. Fluid Mechanics Book 1. Page 37 - 41. (1982)