Chapter

Vector Analysis Contents 3.1

3.2

3.3

3.4

Basic Laws of Vector Algebra . . . . . . . . . . . . . . 3.1.1 Equality of Two Vectors . . . . . . . . . . . . . 3.1.2 Vector Addition and Subtraction . . . . . . . . . 3.1.3 Position and Distance Vectors . . . . . . . . . . 3.1.4 Vector Multiplication . . . . . . . . . . . . . . . 3.1.5 Scalar and Vector Triple Products . . . . . . . . Orthogonal Coordinate Systems . . . . . . . . . . . . 3.2.1 Cartesian Coordinates . . . . . . . . . . . . . . 3.2.2 Cylindrical Coordinates . . . . . . . . . . . . . 3.2.3 Spherical Coordinates . . . . . . . . . . . . . . Coordinate Transformations . . . . . . . . . . . . . . 3.3.1 Cartesian to Cylindrical Transformations . . . . 3.3.2 Cartesian to Spherical Transformations . . . . . 3.3.3 Cylindrical to Spherical Transformations . . . . 3.3.4 Distance Between Two Points . . . . . . . . . . Gradient of a Scalar Field . . . . . . . . . . . . . . . . 3.4.1 Gradient Operator in Cylindrical and Spherical Coordinates . . . . . . . . . . . . . . . . . . . .

3-1

3-3 3-4 3-5 3-6 3-7 3-9 3-13 3-14 3-15 3-20 3-24 3-25 3-26 3-27 3-27 3-28 3-31

CHAPTER 3. VECTOR ANALYSIS

3.4.2

3-2

Properties of the Gradient Operator . . . . . . . 3-31

3.5

Divergence of a Vector Field . . . . . . . . . . . . . . 3-32

3.6

Curl of a Vector Field . . . . . . . . . . . . . . . . . . 3-40

3.7

Laplacian Operator . . . . . . . . . . . . . . . . . . . 3-44

3.1. BASIC LAWS OF VECTOR ALGEBRA

This chapter departs from the study and analysis of electromagnetic concepts where 1D scalar quantities was sufficient. Voltage, current, time, and 1D position will continue to be quantities of interest, but more is needed to prepare for future chapters. In what lies ahead the vector field quantities E and H are of central importance. To move forward with this agenda we will start with a review of vector algebra, review of some analytic geometry, review the orthogonal coordinate systems Cartesian (rectangular), cylindrical, and spherical, then enter into a review of vector calculus. The depth of this last topic will likely be more intense than any earlier experiences you can remember.

3.1

Basic Laws of Vector Algebra

The Cartesian coordinate system should be familiar to you from earlier math and physics courses The vector A is readily written in terms of the cartesian unit vectors xO , yO , and zO A D xO Ax C yO Ay C zO Az In linear algebra xO , yO , and zO are known as basis vectors, each having unit length, i.e., jOxj and mutually orthogonal Also, the length of A is q A D A2x C Ay2 C A2z and the unit vector in the A direction is xO Ax C yO Ay C zO Az A aO D D q A A2 C A2 C A2 x

y

z

3-3

CHAPTER 3. VECTOR ANALYSIS

z 3 2 1 zˆ 1

yˆ 2

1

3

y

xˆ

2 3

x (a) Base vectors z Az A Az Ay Ax

y

Ar

x (b) Components of A

Figure 3.1:Figure Expressing vectorcoordinate A in termssystem: the Cartesian 3-2 the Cartesian (a) base unit vecvectors xˆ , yˆ , and zˆ , and (b) components of vector A. tors.

3.1.1

Equality of Two Vectors

Vectors A and B are equal if their components are equal, i.e., Ax D Bx , etc. 3-4

3.1. BASIC LAWS OF VECTOR ALGEBRA

3.1.2

Vector Addition and Subtraction

Addition of vectors means that the individual components are added together, that is CDACB D xO .Ax C Bx / C yO .Ay C By / C zO .Az C Bz /; thus Cx D Ax C Bx , etc. Visually you can utilize the head-to-tail or parallelogram rules

A

C

C

B (a) Parallelogram rule

A

B (b) Head-to-tail rule

3.2: Vector addition rules. Figure 3-3Figure Vector addition by (a) the parallelogram rule and (b) the head-to-tail rule.

Vector subtraction is similar DDA B D xO .Ax Bx / C yO .Ay thus Dx D Ax

By / C zO .Az

Bz /;

Bx , etc. 3-5

CHAPTER 3. VECTOR ANALYSIS

3.1.3

Position and Distance Vectors z z2

P1 = (x1, y1, z1)

z1

R12 R1

R2 y1

O

P2 = (x2, y2, z2)

y2

y

x1 x2 x

Figure 3.3: The notion of the position vector−− to →a point, P , R , and Figure 3-4 Distance vector R12 = P1 P2 = R2 − Ri 1 , i distancewhere between, Pi and Pj , the Rij position are vectors. R and R are vectors of points P 1

2

1

and P2 , respectively.

Formally a position vector starts at the origin, so we use the notation ! Ri D OPi D xO xi C yO yi C zO zi where xi , yi , and zi correspond to the point Pi D .xi ; yi ; zi / The scara distance between two points is just d D jRij j q d D .xj xi /2 C .yj yi /2 C .zj zi /2

3-6

3.1. BASIC LAWS OF VECTOR ALGEBRA

3.1.4

Vector Multiplication

Vector multiplication takes the form – scalar vector: B D kA D element-by-element multiply by k – scalar product or dot product: A B D AB cos AB where AB is the angle between the vectors (as in linear algebra) – Note: A cos AB is the component of A along B and B cos AB is the component of B along A – Also, A A D jAj2 D A2 p A D jAj D A A – Using the inverse cosine AB D cos

1

AB p p AA BB

– Finally, A A D Ax Bx C Ay By C Az Bz – Commutative and Distributive ABDBA A .B C C/ D A B C A C 3-7

CHAPTER 3. VECTOR ANALYSIS

Vector product or cross product: O A B D nAB sin AB where nO is a unit vector normal to the plane containing A and B (see picture below for details) z A × B = nˆ AB sin θAB B

nˆ θAB

y A

x

(a) Cross product A×B

B

A (b) Right-hand rule

Figure 3.4: The product AA B× andB the right-hand Figure 3-6 cross Cross product points in the rule. ˆ which is perpendicular to the plane direction n, – containing The crossAproduct is anticommuntative and B and defined by the right-hand rule.

ABD 3-8

BA

3.1. BASIC LAWS OF VECTOR ALGEBRA

– The cross product is distributive A .B C C/ D A B C A C – To calculate use the determinant formula ˇ ˇ ˇ xO yO zO ˇ ˇ ˇ ˇ A B D ˇAx Ay Az ˇˇ ˇBx By Bz ˇ D xO .Ay Bz Az By / C yO .Az Bx C zO .Ax By Ay Bx /

3.1.5

A x Bz /

Scalar and Vector Triple Products

Certain, make sense, vector products arise in electromagnetics Scalar Triple Product Definition: A .B C/ D B .C A/ D C .A B/ ˇ ˇ ˇAx Ay Az ˇ ˇ ˇ D ˇˇBx By Bz ˇˇ ˇCx Cy Cz ˇ Vector Triple Product Definition A .B C/ Note: A .B C/ ¤ .A B/ C/ 3-9

CHAPTER 3. VECTOR ANALYSIS

It can however be shown that A .B C/ D B.A C/

C.A B/;

which is known as the “bac-cab” rule

Example 3.1: Numpy for Vector Numerics To make things more convenient define the helper function vec_fmt (see Chapter 3 Jupyter notebook)

Figure 3.5: Using Numpy for basic vector numerical calculations.

3-10

3.1. BASIC LAWS OF VECTOR ALGEBRA

Figure 3.6: Using Numpy for more vector numerical calculations.

3-11

CHAPTER 3. VECTOR ANALYSIS

Example 3.2: TI Nspire CAS The TI nspire CAS can do both numerical and symbolic calculations Numerical examples are given below

TI Nspire CAS: Portions of Text Example 3-1

Figure 3.7: Using the TI Nspire CAS for vector numerics.

3-12

3.2. ORTHOGONAL COORDINATE SYSTEMS

3.2

Orthogonal Coordinate Systems

There three orthogonal coordinate systems in common usage in electromagnetics: – The Cartesian or rectangular system: xO Ax C yO Ay C zO Az O C zO Az – The cylindrical system: rO Ar C A O R C A O C A O – The spherical system: RA Table 3.1: Vector relations in the three common coordinate systems. Table 3-1 Summary of vector relations.

Coordinate variables Vector representation A = Magnitude of A Position vector

|A| =

−→

OP1 =

Base vectors properties

Dot product

A·B =

Cross product

×B = A×

Cartesian Coordinates

Cylindrical Coordinates

Spherical Coordinates

x, y, z

r, φ , z rˆ Ar + φˆ Aφ + zˆ Az ( + A2 + A2 + A2 r z φ

R, θ , φ ˆ R + θˆ Aθ + φˆ Aφ RA ( + A2 + A2 + A2 R φ θ

xˆ Ax + yˆ Ay + zˆ Az ( + A2x + A2y + A2z xˆ x1 + yˆ y1 + zˆ z1 , for P(x1 , y1 , z1 )

xˆ · xˆ = yˆ · yˆ = zˆ · zˆ = 1 xˆ · yˆ = yˆ · zˆ = zˆ · xˆ = 0 xˆ × yˆ = zˆ yˆ × zˆ = xˆ zˆ × xˆ = yˆ Ax Bx + Ay By + Az Bz 4 4 4 xˆ yˆ zˆ 44 4 4 Ax Ay Az 4 4 4 4 Bx By Bz 4

rˆ r1 + zˆ z1 , for P(r1 , φ1 , z1 ) rˆ · rˆ = φˆ · φˆ = zˆ · zˆ = 1 rˆ · φˆ = φˆ · zˆ = zˆ · rˆ = 0 rˆ × φˆ = zˆ φˆ × zˆ = rˆ zˆ × rˆ = φˆ

ˆ 1, RR for P(R1 , θ1 , φ1 ) ˆ ˆ = θˆ · θˆ = φˆ · φˆ = 1 R·R ˆ ˆ · θ = θˆ · φˆ = φˆ · R ˆ =0 R ˆ × θˆ = φˆ R× ˆ θˆ × φˆ = R ˆφ × R ˆ = θˆ

ˆ dR + θˆ R d θ + φˆ R sin θ d φ R ˆ 2 sin θ d θ d φ dsR = RR ˆ dsθ = θ R sin θ dR d φ dsφ = φˆ R dR d θ R2 sin θ dR d θ d φ

Ar Br + Aφ Bφ + Az Bz 4 4 4 rˆ φˆ zˆ 44 4 4 Ar Aφ Az 4 4 4 4 Br Bφ Bz 4

Differential surface areas

dsx = xˆ dy dz dsy = yˆ dx dz dsz = zˆ dx dy

rˆ dr + φˆ r d φ + zˆ dz dsr = rˆ r d φ dz dsφ = φˆ dr dz dsz = zˆ r dr d φ

Differential volume d v =

dx dy dz

r dr d φ dz

Differential length

dl =

xˆ dx + yˆ dy + zˆ dz

AR BR + Aθ Bθ + Aφ Bφ 4 4 4 R θˆ φˆ 44 4 ˆ 4 AR Aθ Aφ 4 4 4 4 BR Bθ Bφ 4

The three systems are needed to best fit the problem geometry at hand 3-13

CHAPTER 3. VECTOR ANALYSIS

3.2.1

Cartesian Coordinates

We will have need of differential quantities of length, area and volume

Differential Length d l D xO d lx C yO d ly C zO d lz D xO dx C yO dy C zO dz

Differential Area A vector, d s, that is normal to the two coordinates describing the scalar area ds There are three different differential areas, d s, to consider: d sx D xO d ly d lz D xO dy dz (y d sy D xO dx dz (x z-plane) d sz D xO dx dy (x y-plane)

Differential Volume d V D dx dy dz 3-14

z-plane)

3.2. ORTHOGONAL COORDINATE SYSTEMS

dsz = zˆ dx dy

z

dy dx dsy = yˆ dx dz dz dz

dv = dx dy dz

dl dsx = xˆ dy dz dy

y

dx x

Figure3-8 3.8: Differential Figure Differential length, length, area, area, and and volume. volume in Cartesian coordinates.

3.2.2

Cylindrical Coordinates

The cylindrical system is used for problems involving cylindrical symmetry It is composed of: (1) the radial distance r 2 Œ0; 1/, (2) the azimuthal angle, 2 Œ0; 2/, and z 2 . 1; 1/, which can be thought of as height O and zO are mutually As in the case of the Cartesian system, rO ; , perpendicular or orthogonal to each other, e.g., rO O D 0, etc. Likewise the cross product of the unit vectors produces the cyclical result rO O D zO ;

O zO D rO ;

zO rO D O 3-15

CHAPTER 3. VECTOR ANALYSIS

z z = z1 plane

P = (r1, φ1, z1)

z1

R1

r = r1 cylinder

O

φ1

y r1

zˆ

ˆ φ

φ = φ1 plane

rˆ x

Figure 3-9 Point P(r1 , φ1 , zFigure r1 is the cylindrical radial distance from the origin in the x–y plane, φ1 is the 3.9: coordinates; A point in the system. 1 ) in cylindrical angle in the x–y plane measured from the x axis toward the y axis, and z1 is the vertical distance from the x–y plane.

The general vector expansion O C zO Az A D aO jAj D rO Ar C A is obvious, as is the scalar length q jAj D A2r C A2 C A2z Looking at 3.9 it is interesting to note that O is absent in the position vector ! OP D rO r1 C zO z1; but is present in the point P .r1; 1; z1/ itself 3-16

3.2. ORTHOGONAL COORDINATE SYSTEMS

z dsz = zˆ r dr dφ

dz r dφ

dr

dsφ = ϕˆ dr dz dv = r dr dφ dz

dz

dsr = rˆ r dφ dz

O

y

φ r x

dr

r dφ

Figure 3.10: Differential quantitiesareas in theand cylindical Figure 3-10 Differential volumesystem. in cylindrical coordinates.

Differential Quantities The differential quantities do not follow from the Cartesian system The differential length of the azimuthal component is also a function of the radial component, i.e., d lr D dr;

d l D rd;

d lz D dz

In the end O d l D rO dr C rd C zO dz 3-17

CHAPTER 3. VECTOR ANALYSIS

The differential surface follows likewise d sr D rO r d dz . z cylindrical surface/ d s D O dr dz .r z plane/ d sz D zO dr d .r plane/ The differential area is likely the most familiar from calculus d V D r dr dz

Example 3.3: Distance Vector from z-Axis to r

-Plane

When making field calculations due to charge or current along a line, we need the distance vector shown below: z P1 = (0, 0, h) aˆ h

A O φ0 r 0

y P2 = (r0, φ0, 0)

x

Figure 3.11: Distance vector from z-axis to point3-3. in r Figure 3-11 Geometry of Example 3-18

plane.

3.2. ORTHOGONAL COORDINATE SYSTEMS

The vector from a point P1 on the z-axis, .0; 0; h/, to a point P2 in the r-plane, .r0; 0; 0/, is ! A D OP 2 The unit vector is

! OP 1 D rO r0

zO h

rO r0 zO h aO D q r02 C h2

Note: is not present! Once D 0 is specified the unambiguous point direction resolved

Example 3.4: Volume of a Cylinder Consider a cylinder of height 2 cm and diameter 3 cm Using simple calculus, the surface area of the cylinder is ˇ Z 2 Z 2 ˇ SD r d dz ˇˇ D 6 (cm)2 0

0

rD3=2

The volume of the cylinder is VD

3=2 Z 2 Z 2

Z 0

0

0

ˇ r 2 ˇˇ3=2 9 r d dz dr D 4 ˇ D 2 0 2

(cm)3

3-19

CHAPTER 3. VECTOR ANALYSIS

3.2.3

Spherical Coordinates

In this coordinate system a single range variable R plus two angle variables and are employed z

ˆ R

θ = θ1 conical surface

R1

θˆ

ˆ φ P = (R1, θ1, φ1)

θ1 y

φ1 ˆ φ x

Figure 3.12: spherical coordinate system showing a point P1 FigureThe 3-13 Point P(R1 , θ1 , φ1 ) in spherical coordiO and position nates.vector R1 . It is composed of: (1) the radial distance r 2 Œ0; 1/, (2) the azimuthal angle (same as cylindrical), 2 Œ0; 2/, and the zenith angle 2 Œ0; , which is measured from the positive z-axis All coordinates are again mutually orthogonal to span a 3D space 3-20

3.2. ORTHOGONAL COORDINATE SYSTEMS

The cross product of the unit vectors produces the cyclical result O O D ; O R

O O O D R;

O D O O R

The general vector expansion O R C A O C A O A D aO jAj D RA is obvious, as is the scalar length q jAj D A2R C A2 C A2 The position vector R1 (3.12) is ! O 1; R1 D OP D RR but needs knowledge of 1 and 1 to be complete Differential Quantities The differential quantities are different yet again from the Catestian and the cylindrical systems The differential length of the zenith component is like the azimuthal component in the cylindrical system The differential length of the azimuthal component is now a function of both the radial component and the zenith component, i.e., d lR D dR;

d l D Rd;

d l D R sin d 3-21

CHAPTER 3. VECTOR ANALYSIS

In the end O O O sin dz d l D Rdr C Rd C R The differential surface follows O 2 sin d d . spherical surface/ d sR D RR d s D O R sin dR d .R conical plane/ O dR d .R plane/ d s D R Again the differential area is likely the most familiar from calculus d V D R2 sin dR d d z R sin θ dφ dν = R2 sin θ dR dθ dφ

dR R

θ

R dθ

dθ y

φ

dφ

x

Figure 3.13:3-14 The spherical coordinate differential volume. Figure Differential volume in spherical coordi3-22

nates.

3.2. ORTHOGONAL COORDINATE SYSTEMS

Example 3.5: Preview of Chapter 4 - A Charge density A volume charge density v D 4 cos2

.C/m3/

is present in a sphere of radius 2 cm To find the total charge in the sphere we integrate the charge density over the volume Z Q D v d V ZV 2 Z Z 0:02 D 4 cos2 R2 sin dR d d D0 D0 RD0 Z 2 Z 3 ˇ0:02 R ˇˇ sin cos2 d d D4 ˇ 3 0 0 Z 2 0 3 ˇ 32 cos ˇˇ 6 D 10 ˇ d 3 3 0 0 Z 2 128 64 D 10 6 d D 10 6 9 9 0 D 44:68 .C/ Just a little calculus review, especially the anti-derivative of sin cos2

3-23

CHAPTER 3. VECTOR ANALYSIS

3.3

Coordinate Transformations

Overview of the various transformations: .x; y; x/ , .r; ; z/, .x; y; z/ , .R; ; /, and .r; ; z/ , .R; ; / TableTable 3.2: Coordinate transformations. 3-2 Coordinate transformation relations. Transformation Cartesian to cylindrical Cylindrical to Cartesian Cartesian to spherical

Coordinate Variables + r = + x2 + y2 φ = tan−1 (y/x) z=z x = r cos φ y = r sin φ z=z + R = + x2 + y2 + z2

+ θ = tan−1 [ + x2 + y2/z]

φ = tan−1 (y/x) Spherical to Cartesian

Cylindrical to spherical Spherical to cylindrical

x = R sin θ cos φ y = R sin θ sin φ z = R cos θ √ R = + r2 + z2 θ = tan−1 (r/z) φ =φ r = R sin θ φ =φ z = R cos θ

Unit Vectors rˆ = xˆ cos φ + yˆ sin φ φˆ = −ˆx sin φ + yˆ cos φ zˆ = zˆ xˆ = rˆ cos φ − φˆ sin φ yˆ = rˆ sin φ + φˆ cos φ zˆ = zˆ ˆ = xˆ sin θ cos φ R + yˆ sin θ sin φ + zˆ cos θ ˆθ = xˆ cos θ cos φ + yˆ cos θ sin φ − zˆ sin θ ˆφ = −ˆx sin φ + yˆ cos φ ˆ sin θ cos φ xˆ = R + θˆ cos θ cos φ − φˆ sin φ ˆ sin θ sin φ yˆ = R + θˆ cos θ sin φ + φˆ cos φ ˆ zˆ = R cos θ − θˆ sin θ ˆ = rˆ sin θ + zˆ cos θ R ˆθ = rˆ cos θ − zˆ sin θ φˆ = φˆ ˆ sin θ + θˆ cos θ rˆ = R φˆ = φˆ ˆ cos θ − θˆ sin θ zˆ = R

Vector Components Ar = Ax cos φ + Ay sin φ Aφ = −Ax sin φ + Ay cos φ Az = Az Ax = Ar cos φ − Aφ sin φ Ay = Ar sin φ + Aφ cos φ Az = Az AR = Ax sin θ cos φ + Ay sin θ sin φ + Az cos θ Aθ = Ax cos θ cos φ + Ay cos θ sin φ − Az sin θ Aφ = −Ax sin φ + Ay cos φ

Ax = AR sin θ cos φ + Aθ cos θ cos φ − Aφ sin φ Ay = AR sin θ sin φ + Aθ cos θ sin φ + Aφ cos φ Az = AR cos θ − Aθ sin θ AR = Ar sin θ + Az cos θ Aθ = Ar cos θ − Az sin θ Aφ = Aφ

Ar = AR sin θ + Aθ cos θ Aφ = Aφ Az = AR cos θ − Aθ sin θ

There are three aspects of each to and from coordinate transformations: 1. The coordinate variables – .x; y; z/, .r; ; z/, and .R; ; / O ; O / O zO /, and .R; O 2. The unit vectors – .Ox; yO ; zO /, .Or; ; 3. The vector components – .Ax ; Ay ; Az /, .Ar ; A ; Az /, and .AR ; A ; A / 3-24

3.3. COORDINATE TRANSFORMATIONS

3.3.1

Cartesian to Cylindrical Transformations

This is the most obvious and most familiar y p 1 (watch the quadrant) r D x 2 C y 2; D tan x x D r cos ; y D r sin zDz z

2

1

φ r 123 y = r sin φ

3

P(x, y, z) z y

x = r cos φ

x

Figure 3.14: Cartesian and cylindrical variable relationships. Figure 3-16 Interrelationships between Cartesian coordinates (x, y, z) and cylindrical coordinates (r, φ , z). y

ϕ

ϕˆ

r

yˆ

−ϕˆ

ϕ rˆ xˆ

x

Figure 3.15: Cartesian and cylindrical unit vector relationships. Figure 3-17 Interrelationships between base vectors (ˆx, yˆ ) and (ˆr, φˆ ).

3-25

CHAPTER 3. VECTOR ANALYSIS

3.3.2

Cartesian to Spherical Transformations

These are less familiar, but very useful in this course p RD

p

x 2 C y 2 C z 2;

D tan

1

D tan

y

1

x2

C z

y2

!

(watch the quadrants)

x x D R sin cos ; z D R cos

y D R sin sin

z

θ zˆ

ˆ R (π/2 – θ)

R

θ

rˆ z = R cos θ y

φ

x = r cos φ

r

ˆ φ y = r sin φ x

rˆ

Figure 3.16: Cartesian and spherical variable and unit vector relaFigure 3-18 Interrelationships between (x, y, z) and tionships. (R, θ , φ ). 3-26

3.3. COORDINATE TRANSFORMATIONS

3.3.3

Cylindrical to Spherical Transformations

See Table 3.2 p R D r 2 C z 2; r D R sin ;

3.3.4

D tan 1.r=z/; D ;

D z D R sin

Distance Between Two Points

The distance between two points, P1 D .x1; y1; z1/ and P2 D .x2; y2; z2/, arises frequently In Cartesian coordinates the answer is obvious d D jR12j D .x2 x1/2 C .y2 y1/2 C .z2

z1/2

For the case of cylindrical coordinates we apply the variable transformations to arrive at d D .r2 cos 2 r1 cos 1/2 C .r2 sin 2 r1 sin 1/2 1=2 C .z2 z1/2 2 2 2 1=2 D r2 C r1 2r1r2 cos.2 1/ C .z2 z1/ Finally, for the spherical coordinates ˚ d D R22 C R12 2R1R2Œcos 2 cos 1 1=2 C sin 2 sin 1 cos.2 1/

3-27

CHAPTER 3. VECTOR ANALYSIS

3.4

Gradient of a Scalar Field

In this section we deal with the rate of change of a scalar quantity with respect to position in all three coordinates .x; y; z/ The result will be a vector quantity as the maximum rate of change of the scalar quantity will have direction – Think of skiing down a mountain; if you want to descend as quickly as possible you ski the path the follows the negative of the maximum rate of change in elevation – The route corresponds to the negative of the gradient Suppose T represent the scalar variable of temperature in a material as a function of .x; y; z/ The gradient of temperature T is written as rT D grad T D xO

@T @T @T C yO C zO @x @y @z

Note: A differential change in the distance vector d l dotted with the gradient gives the scalar change in temperature, d T , i.e. d T D rT d l D rT xO dx C yO dy C zO dz @T @T @T dx C dy C dz D @x @y @z 3-28

3.4. GRADIENT OF A SCALAR FIELD

As an operator we can write the so-called del operator in Cartesian coordinates as r D xO

@ @ @ C yO C zO @x @y @z

Directional Derivative In calculus you learn about the directional derivative dT D rT aO l dl as the derivative of T along aO , which is the unit vector of the differential distance d dl D aO l d l A nice extension is to find the difference T2 T1, which corresponds to points P1 D .x1; y1; z1/ and P2 D .x2; y2; z2/ We integrate both side of the directional derivative definition to obtain Z P2 rT d l T2 T1 D P1

Example 3.6: Directional Derivative of T D x 2 C y 2z We seek the directional derivative of T along the direction xO 2C yO 3 zO 2 evaluated at .1; 1; 2/ Start by finding the gradient rT D xO 2x C yO 2yz C zO y 2 3-29

CHAPTER 3. VECTOR ANALYSIS

Note that l D xO 2 C yO 3

zO 2;

so

xO 2 C yO 3 zO 2 p 17 The directional derivative is O O O dT x 2 C y 3 z 2 D xO 2x C yO 2yz C zO y 2 p dl 17 2 4x C 6yz 2y D ; p 17 aO l D

At the point .1; 1; 2/ we finally have ˇ d T ˇˇ 10 D D p d l ˇ.1; 1;2/ 17

0:588

The surface is dT/dl at z = 2

dT/dl

dT/dl

The point (1, -1, 2)

dT/dl

Figure 3.17: The directional derivative, d T =d l, as a surface over .x; y/ with z fixed at 2. 3-30

3.4. GRADIENT OF A SCALAR FIELD

3.4.1

Gradient Operator in Cylindrical and Spherical Coordinates

To move forward with the expressing gradient in the other two coordinate systems, requires a bit of calculus For cylindrical coordinates it can be shown that r D rO

1 @ @ @ C O C zO @r r @ @z

For spherical coordinates it can be shown that 1 @ O @ C O 1 @ C O rDR @R R @ R sin @

3.4.2

Properties of the Gradient Operator

From basic calculus it follows that r U C V D rU C rV r U V D U rU C V rU rV n D nV n 1 rV; for any n

Example 3.7: Gradiant of V Consider the scalar function V D x 2y C xy 2 C xz 2 The gradient is simply rV D xO .2xy C y 2 C z 2/ C yO .x 2 C 2xy/ C zO .2xz/ 3-31

CHAPTER 3. VECTOR ANALYSIS

At the point P1 D .1; 1; 2/ the gradiant vector is rV .1; 1; 2/ D xO 3

3.5

yO C zO 4

Divergence of a Vector Field

The divergence of a vector field is in a sense complementary to the gradient: Gradient of a scalar function ) Vector function Divergence of a vector function ) Scalar function So what is it? Take a look at https://en.wikipedia.org/ wiki/Divergence For a 3D vector field it measures the extent to which the vector field behaves as a source or sink A 3D field has field lines and corresponding flux density, which defines the outward flux crossing a unit surface ds – For the EE: Consider a point charge Cq; if we place a sphere (infinitesimally small) around it, there will be a net flow of flux over the surface of the sphere; move the sphere away from the charge location and the net flow of flux (in/out) is zero – For the ME: Consider heating or cooling of air in a region; the velocity of the air, which is influenced by the heating, is a vector field; the velocity points outward from 3-32

3.5. DIVERGENCE OF A VECTOR FIELD

the heated region just like the electric field from the Cq charge

nˆ

+q Imaginary spherical surface E Figure 3.18: The electric field flux lines due to a point charge Cq Figure 3-20 Flux lines of the electric field E due to a O centered on the charge. are normal to a sphere (n) positive charge q. In more detail the Cq charge produces flux density (outward flux crossing a unit surface) Flux density of E D

E ds D E nO jd sj

where d s includes the orientation of the surface via s and the dot product insures that only the flux normal to the surface is accounted for; nO is the outward normal to the surface, i.e., d s=jd sj 3-33

CHAPTER 3. VECTOR ANALYSIS

The total flux crossing a closed surface S (e.g., a sphere) is I Total flux D E d sO S

For a general vector field, say E.x; y; z/OxEx C yO Ey C zO Ez , we can sum the outward flux through each of the faces of a differential cube as shown in Figure3.18 E

nˆ 4 E (x, y + Δy, z)

Δx Face 4

Δz

E Face 2

Face 1

nˆ 1

nˆ 2 Δy

(x, y, z) Face 3

(x + Δx, y, z) y

(x, y, z + Δz) x

nˆ 3 z

Figure 3.19: Detailing divergence by considering the flux exiting the Figure 3-21 Flux lines of a vector field E passing six facesthrough of a differential cube (parallelpiped). a differential rectangular parallelepiped of volume ∆v = ∆x ∆y ∆z.

In the end we have I @Ex @Ey @Ez E ds D C C D divE V @x @y @z S 3-34

3.5. DIVERGENCE OF A VECTOR FIELD

Now, we take the limit as V ! 0 to obtain the formal definition of divergence r E D div E D

@Ex @Ey @Ez C C @x @y @z

If r E > 0 a source if present, while r E < 0 means a sink is present, and r E D 0 means the field is divergenceless Divergence Theorem Moving forward into Chapter 4 we will quickly bump into the divergence theorem, which states that Z I r E dV D E ds V

S

Example 3.8: Divergence in Cartesian Coordinates Consider E D xO 3x 2 C yO 2z C zO x 2z at the point P1 D .2; 2; 0/ Using the definition in Cartesian coordinates @3x 2 @2z @x 2z r ED C C @x @y @z D 6x C 0 C x 2 D x 2 C 6x Evaluating at .2; 2; 0/ we have ˇ ˇ r Eˇˇ

D 16

.2; 2;0/ 3-35

CHAPTER 3. VECTOR ANALYSIS

The positive diverge at .2; 2; 0/ can be seen in a 3D vector slice plot from Mathematica

Out[50]=

Figure 3.20: 3D vector field plot from Mathematica with a cutsphere centered at .2; 2; 0/; the positive divergence is clear.

3-36

3.5. DIVERGENCE OF A VECTOR FIELD

Example 3.9: Divergence in Spherical Coordinates Working a diverge calculation in cylindical or spherical requires the formulas inside the back cover of the text For the problem at hand we have O 3 cos =R2/ E D R.a

O 3 sin =R2/; .a

which is in spherical coordinates Find the divergence at P2 D .a=2; 0; / 1 @ 1 @ 2 R ER C E sin r ED 2 R @R R sin @ 1 @E C R sin @ ! 2 3 1 @ a sin 1 @ 3 a cos C D 2 R @R R sin @ R2 D

2a3 cos R3

At the point .a=2; 0; / we have ˇ ˇ r Eˇˇ D

16

.a=2;0;/

Since the divergence is negative at this point, we conclude that a field sink is present A 2D vector plot (Python, Mathematica, or MATLAB) can be used to review the field behavior using arrows 3-37

CHAPTER 3. VECTOR ANALYSIS

a = 10

3.0

2.5

θ

2.0

Out[64]=

1.5

1.0

0.5

0.0

4.0

4.5

5.0

5.5

6.0

R

Figure 3.21: 2D vector field plot for a D 10 in just the R and axes making the negative divergence at .5; 0; / clear.

3-38

3.5. DIVERGENCE OF A VECTOR FIELD

Example 3.10: Ulaby 3.44b

Each of the following vector fields is displayed below in the form of a vector representation. Determine r A analytically and then compare the results with your expectations on the basis of the displayed pattern. Worked using the Jupyter notebook (screen shots)

Figure 3.22: Ulaby problem 3.44b set-up in the Jupyter notebook. 3-39

CHAPTER 3. VECTOR ANALYSIS

Figure 3.23: Ulaby problem 3.44b vector (quiver) plot in Jupyter notebook to verify divegence of zero.

3.6

Curl of a Vector Field

Moving forward, the next vector operator, Curl, applies more often to magnetic fields; See https://en.wikipedia.org/ wiki/Curl_(mathematics) The Curl describes the rotation of a 3D field, in an infinitesimal sense 3-40

3.6. CURL OF A VECTOR FIELD

A field B has circulation if the line integral I Circulation D B dl ¤ 0 C

For the case of a uniform field, e.g., B D xO B0, forming a line integral around a closed rectangular contour in the x y plane yields zero, i.e., Z b Z c Circulation D xO B0 xO dx C xO B0 yO dy a b Z d Z a C xO B0 xO dx C xO B0 yO dy c

d

D B0 x

B0 x D 0

Futhermore, a small fictitious paddle wheel placed in the uniform field will not rotate, no matter the orientation of the wheel rotation axis y a

d Contour C

Δx

Δx c

b

B x (a) Uniform field Figure 3.24: A uniform field, B D xO B0 with circulation over C zero. z 3-41

CHAPTER 3. VECTOR ANALYSIS

Consider the azimuthal field of a wire carrying current I along the z-axis y y plane follows O with strength

The magnetic flux in thex a 0I =.2 r/

d

Contour C

Δx we consider Δx To compute the circulation differential length d l D O d and determine the circulation to be r c

b 2

Z Circulation D 0

0 I O r d D 0I O 2 r B

x placed in this field will rotate! Clearly a paddle wheel (a) Uniform field z Current I

ˆ φ Contour C

φ

y

r B

x

(b) Azimuthal field

O 0I =.2 r/ with circulation Figure 3.25: An azimuthal field, B D around the z-axis.3-22 Circulation is zero for the uniform field Figure in (a), but it is not zero for the azimuthal field in (b). 3-42

3.6. CURL OF A VECTOR FIELD

Finally we cab defined curl as I 1 r B D curl B D lim nO B dl s!0 s C max Note: The contour C is oriented to given the maximum circulation; position the paddle wheel so it spins the fastest O the unit normal of Since r B is a vector, its direction is n, surface s (use the right-hand rule with the fingers curling in O the direction of C and the thumb pointing along n) In rectangular coordinates we compute the curl via ˇ ˇ ˇ xO yO zO ˇ ˇ ˇ ˇ @ @ @ˇ r B D ˇ @x @y @z ˇ ˇ ˇ ˇBx By Bz ˇ For other coordinate systems consult the back page of the text Stoke’s Theorem Stoke’s theorem converts a surface integral of the curl to a line integral of a vector along a contour C bounding surface S I Z r B ds D B dl S

C

3-43

CHAPTER 3. VECTOR ANALYSIS

3.7

Laplacian Operator

The Laplacian operator shows up in a number of contexts The text mentions the divergence of the gradiant, .r .rV // as one possibility The result is known as del square @2V @2 V @2V r V D C 2 C 2 @x 2 @y @z 2

In Chapter 4 Laplace’s equation, r 2V D 0, arises when determining the electrostatic potential in 1D, 2D, and 3D problems

3-44