Sections20-01.mws

Unit 4: Vector Calculus

Chapter 20: Additional Vector Differential Operators

Sections20.1: divergence and its meaning

Copyright

Copyright * 2001 by Addison Wesley Longman, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Initializations

> restart;

> with(linalg):
with(plots):
with(student):
with(plottools):
read(`C:/Program Files/Maple 6.01/pvac.txt`):

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the name changecoords has been redefined

>

Definition 20.1

Given the vector field

F = u(x,y,z) i + v(x,y,z) j + w(x,y,z) k

the divergence of F at the point ``(x,y,z) is the scalar

f . F = div( F ) = {u[x](x,y,z)}+v[y](x,y,z)+w[z](x,y,z)

The divergence of the field F is a scalar which measures the "spread" of the field at each point. Notational clarifications, as well as xxamples and calculations designed to illuminate this claim about divergence measuring "spread" of the field at a point, follow.

Maple computes the divergence of the vector field

> F := vector([u(x,y,z), v(x,y,z), w(x,y,z)]);

F := MATRIX([[u(x,y,z)], [v(x,y,z)], [w(x,y,z)]])

>

with the command

> diverge(F, [x,y,z]);

diff(u(x,y,z),x)+diff(v(x,y,z),y)+diff(w(x,y,z),z)

>

Example 20.1

The field F given by

> F := vector([x,y]);

F := MATRIX([[x], [y]])

>

graphed in Figure 20.1 (below), appears to be "flowing" radially outward, with flow lines y = alpha*x , the solution of the differential equations

`x'`(p) = x

`y'`(p) = y

contained in

R ' ``(p) = F

Figure 20.1 is generated in Maple by executing the following commands.

> p1 := circle([0,0],1/2,color=red):
p2 := circle([0,0],3/2,color=green):
f1 := z -> arrow([.5*cos(z),.5*sin(z)],vector([.5*cos(z),.5*sin(z)]), .05,.2,.2, color=red):
f2 := z -> arrow([1.5*cos(z),1.5*sin(z)],vector([1.5*cos(z),1.5*sin(z)]), .05,.2,.2, color=green):
p3:=plot([[t,t,t=-2..2],[-t,t,t=-2..2],[t,t*tan(Pi/12),t=-2.5..2.5], [t,t*tan(5*Pi/12),t=-.7.. .7],[t,t*tan(7*Pi/12),t=-.7.. .7],[t,t*tan(11*Pi/12),t=-2.5..2.5]], color=black):
display([p||(1..3),seq(f1(Pi/6*k),k=0..11),seq(f2(Pi/6*k),k=0..11)], scaling=constrained, xtickmarks=7, ytickmarks=7, labels=[` x`,y], labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

The parameter p is eliminated from the equations

dx/dp = x(p)

dy/dp = y(p)

by writing

``(dy/dp)/``(dx/dp) = dy/dx = `y'`/`x'` = y/x

and the solution y = alpha*x is immediate.

The field arises from the scalar potential

u(x,y) = 1/2 ``(x^2+y^2)

where the minus sign has been ignored.

The level curves of u(x,y) are concentric circles orthogonal to the flow lines of the field F , as seen in Figure 20.1.

The divergence is div( F ) = 2. The constant and positive value of the divergence signals the uniform spread of the field, evidenced by the flow pointing radially outwards from the origin.

To implement these calculations in Maple, begin with R , the radius-vector form of the flow line,

> R := vector([x(p), y(p)]);

R := MATRIX([[x(p)], [y(p)]])

>

and differentiate with respect to the parameter t to form the tangent vector.

> `R'` := map(diff,R,p);

`R'` := MATRIX([[diff(x(p),p)], [diff(y(p),p)]])

>

Equating the vectors R ' and F means equating their components, accomplished in Maple with

> q := equate(`R'`,F);

q := {diff(x(p),p) = x, diff(y(p),p) = y}

>

This set of differential equations is then solved via

> q1 := dsolve(q, {x(p),y(p)});

q1 := {y(p) = _C1+y*p, x(p) = _C2+x*p}

>

Forming the ratio y/x = C[2]/C[1] eliminates the parameter p and shows analytically that the flow lines y = alpha*x are rays emanating from the origin.

Maple claims F has a scalar potential u(x,y) since the potential command returns true .

> potential(F, [x,y], 'u');

true

>

Thus, F is conservative with the potential function

> u;

1/2*x^2+1/2*y^2

>

where the physicist's minus sign has been ignored. Thus, F is

> grad(u, [x,y]);

MATRIX([[x], [y]])

>

The level curves of u(x,y) are orthogonal to the flow lines of the field F ., as suggested by the following figure.

> p4 := contourplot(u, x = -1..1, y = -1..1, contours=[.1, .3, .5], color=black, scaling=constrained):
display([p3,p4]);

[Maple Plot]

>

Finally, the divergence of this now throroughly-familiar field is given by

> diverge(F, [x,y]);

2

>

Divergence as Limiting Value of Flux per Unit Area

We next give a physical interpretation of the divergence based on the notion of flux through a closed curve C . It demonstrates that in the limit as the curve C shrinks to a point P , the ratio of the flux of the field F through C divided by the area enclosed in C , becomes the divergence of the field F evaluated at P .

To compute the flux of the arbitrary plane vector F = f(x,y) i + g(x,y) j , that is,

> F := vector([f(x,y),g(x,y)]);

F := MATRIX([[f(x,y)], [g(x,y)]])

>

through C , a circle of radius a , centered at the point P whose coordinates are ( x[0], y[0] ), write the parametric representation of this circle as

> X := x[0]+a*cos(p);
Y := y[0]+a*sin(p);

X := x[0]+a*cos(p)

Y := y[0]+a*sin(p)

>

so that on C we have F = F ``(x[0]+a*cos(p),y[0]+a*sin(p)) , that is,

> Fc := subs(x=X,y=Y, op(F));

Fc := MATRIX([[f(x[0]+a*cos(p),y[0]+a*sin(p))], [g(...

>

As the circle C shrinks to the point P , the radius a goes to zero. Hence, expand F in a Taylor series about a = 0 , obtaining

F = MATRIX([[f(x[0],y[0])+f[x](x[0],y[0])(cos(p)+f[y](x...

that is,

> map(taylor,Fc,a=0,2);

MATRIX([[series(f(x[0],y[0])+(D[1](f)(x[0],y[0])*co...

>

Rather than try to use Maple to simplify the notation, just enter the expanded, and simplified versions of f and g , writing

> fC := f[0]+(f[x]*cos(p)+f[y]*sin(p))*a;
gC := g[0]+(g[x]*cos(p)+g[y]*sin(p))*a;

fC := f[0]+(f[x]*cos(p)+f[y]*sin(p))*a

gC := g[0]+(g[x]*cos(p)+g[y]*sin(p))*a

>

The integrand for the flux integral for F is given by F . N ds = f*dy-g*dx , formed in Maple by

> `fdy - gdx` := fC*diff(Y,p) - gC*diff(X,p);

`fdy - gdx` := (f[0]+(f[x]*cos(p)+f[y]*sin(p))*a)*a...

>

The flux integral

> q := Int(`fdy - gdx`, p=0..2*Pi);

q := Int((f[0]+(f[x]*cos(p)+f[y]*sin(p))*a)*a*cos(p...

>

is then divided by Pi*a^2 , the area enclosed by the circle C , and evaluated, giving

> simplify(value(q/(Pi*a^2)));

f[x]+g[y]

>

As predicted, in the limit as a goes to zero, the limiting ratio of flux to area becomes f[x]+g[y] , the divergence of F .

>

Solenoidal Fields

Because the magnetic field set up by a solenoid (coil of wire) has zero divergence in the space surrounded by the coil, physicists use the term solenoidal for fields whose divergence is everywhere zero. For example, the field

> F := vector([x,-y]);

F := MATRIX([[x], [-y]])

>

is solenoidal since its divergence vanishes, as the following shows.

> diverge(F,[x,y]);

0

>

On the other hand, the field

> F := vector([x,y]);

F := MATRIX([[x], [y]])

>

is not solenoidal, since div( F ) = 2, as shown by

> diverge(F,[x,y]);

2

>

Connections between conservative fields and solenoidal fields are detailed in Sections21.5.

If F is the field of velocity vectors for a steady fluid flow with constant density, then its divergence must be zero, as we discuss in Sections23.3. But a steady flow with constant density is incompressible , so the analog of the solenoidal field is the incompressible flow.

>

The laplacian

The laplacian of the scalar u(x,y,z) is the scalar field

div(grad(u)) = f . ( f u ) = f ``^2 u

the divergence of the gradient field of u .

The laplacian of the scalar u(x,y,z) is given in Maple by

> u := 'u':
laplacian(u(x,y,z),[x,y,z]);

diff(u(x,y,z),`$`(x,2))+diff(u(x,y,z),`$`(y,2))+dif...

>

To obtain this same result at the divergence of the gradient, compute

> diverge(grad(u(x,y,z),[x,y,z]),[x,y,z]);

diff(u(x,y,z),`$`(x,2))+diff(u(x,y,z),`$`(y,2))+dif...

>

In cartesian coordinates, the del operator (Sections18.2) is (using an equation editor)

[Maple OLE 2.0 Object]

or (using Maple and the special font BCSYMA to create the nabla , or del, symbol)

f = i diff(``,x) + j diff(``,y) + k diff(``,z)

The gradient of the scalar u(x,y,z) is the vector

[Maple OLE 2.0 Object]

that is,

grad(u) = f u = u[x] i + u[y] j + u[z] k = MATRIX([[u[x]], [u[y]], [u[z]]])

Similarly, the divergence of F is given by

[Maple OLE 2.0 Object]

that is, div( F ) is

f . F = ( i diff(``,x) + j diff(``,y) + k diff(``,z) ) . ( f(x,y,z) i + g(x,y,z) j + h(x,y,z) k )

= f[x]+g[y]+h[z]

Consequently, the laplacian of g(x,y,z) , the divergence of the gradient, is

[Maple OLE 2.0 Object]

that is

f . ( f u ) = ( i diff(``,x) + j diff(``,y) + k diff(``,z) ) . ( i diff(``,x) + j diff(``,y) + k diff(``,z) ) u

= ( diff(``,x,x) + diff(``,y,y) + diff(``,z,z) ) u

= u[xx]+u[yy]+u[zz]

= f ``^2 u

Thus, the laplacian operator is generally called "del-squared", and in cartesian coordinates is written

[Maple OLE 2.0 Object]

that is, as

f ``^2 = diff(``,x,x) + diff(``,y,y) + diff(``,z,z)

>

Generalizations of the Directional Derivative

First Generalization

Texts on fluid dynamics or electromagnetic theory generalize D ``[U] f = grad(f) . U , the directional derivative of the scalar f(x,y,z) , by introducing the operator

[Maple OLE 2.0 Object]

that is,

V . f = ( u i + v j + w k ) . ( i diff(``,x) + j diff(``,y) + k diff(``,z) )

= u diff(``,x) + v diff(``,y) + w diff(``,z)

The directional derivative of Sections18.2 requires the vector U to be a unit vector. In this first generalization of the directional derivative, the vector V need not be a unit vector. When applied to a scalar f(x,y,z) , this operator is just the gradient dotted with V , giving for f a derivative in the direction V .

>

Example (Not in Text)

Let the vector V be given by

> V := vector([u,v,w]);

V := MATRIX([[u], [v], [w]])

>

In Maple, the action of the operator V . f acting on the scalar g(x,y,z) is captured by the syntax

> dotprod(V, grad(g(x,y,z),[x,y,z]), orthogonal);

u*diff(g(x,y,z),x)+v*diff(g(x,y,z),y)+w*diff(g(x,y,...

>

Second Generalization

Between two neighboring points P[1] and P[2] , a change in the vector field

F = f(x,y,z) i + g(x,y,z) j + h(x,y,z) k

is again a vector. If V is proportional to P ``[2]-`` P ``[1] , then at P[1] te directional derivative of F in the direction V is given by

( V . f ) F = MATRIX([[V*dot*grad(f)], [V*dot*grad(g)], [V*dot*gr... = MATRIX([[f[x], f[y], f[z]], [g[x], g[y], g[z]], [h[...

where the matrix on the right is the Jacobian matrix for F , and the operator V . f = [Maple OLE 2.0 Object] is as defined in the first generalization of the directional derivative. The formalism for the second generalization is established in Exercise B1 of Sections18.2. The idea behind the formalism is a generalization of the directional derivative.

Think of F as a force field in which

R ``(p) = P ``[1]+p V

is a line through P[1] with direction V . Evaluating F along the line gives F ``(p) , and d/dp F | ``[p = 0] is the directional derivative of the field measured at P[1] in the direction of V .

When this process was carried out in Sections18.2 for D ``[U] f = grad(f) . U , the directional derivative of the scalar field f , the gradient vector grad(f) appeared as a new object dotted with the direction vector U . The matrix which appears in the second generalization of the directional derivative is a new object, one "rank" higher that the vector field F , called the covariant derivative. Multiplication of the direction vector V by this object gives the desired rate of change.

>

Example (Not in Text)

Let the vector belonging to the operator be V , given by

> print(V);

MATRIX([[u], [v], [w]])

>

and let the operator act on the vector F , given by

> F := vector([f(x,y,z), g(x,y,z), h(x,y,z)]);

F := MATRIX([[f(x,y,z)], [g(x,y,z)], [h(x,y,z)]])

>

In Maple, the operator itself cannot be represented. However, the action of the operator on the vector F can be computed with the following syntax.

> map(dotprod,map(grad, F, [x,y,z]),V, orthogonal);

MATRIX([[diff(f(x,y,z),x)*u+diff(f(x,y,z),y)*v+diff...

>

Each of the scalar components of the vector F are subjected to the generalized directional derivative, yielding the components

> for k from 1 to 3 do
dotprod(V, grad(F[k],[x,y,z]), orthogonal);
od;

diff(f(x,y,z),x)*u+diff(f(x,y,z),y)*v+diff(f(x,y,z)...

u*diff(g(x,y,z),x)+v*diff(g(x,y,z),y)+w*diff(g(x,y,...

diff(h(x,y,z),x)*u+diff(h(x,y,z),y)*v+diff(h(x,y,z)...

>