W02 Vector Calculus
W02 Vector Calculus
. ∂f ∂f ∂f
∇f = x̂ + ŷ + ẑ
∂x ∂y ∂z
. ∂Fx ∂Fy ∂Fz
div F = + +
∂x ∂y ∂z
x̂ ŷ ẑ
∂ ∂ ∂
∂F z ∂F y ∂F x ∂F z ∂F y ∂F x
curl F = ∂x ∂y ∂z = − x̂ + − ŷ + − ẑ
Fx Fy Fz ∂y ∂z ∂z ∂x ∂x ∂y
Tasks
1.1. The gradient operator ∇ takes a scalar valued function f : R3 7→ R and maps it to a vector
in R3 . That is, ∇ f ∈ R3 . The divergence operator div operates on a vector field F ∈ R3 .
Determine whether div F is a scalar or a vector. Repeat for the curl operator curl .
1.2. In terms of coordinates in R3 , the gradient operator may be written as the vector valued
partial differential operator
∂ ∂ ∂
∇≡ , ,
∂x ∂y ∂z
Using this notation, the divergence of a vector field F may be written simply as ∇ · F.
Write down the corresponding form for the curl of vector field F.
1.3. Compute the gradient ∇ f of each of the following scalar valued functions f :
1
(a) f (x, y, z) = 3.
(b) f (x, y, z) = x.
(c) f (x, y, z) = x2 + y 2 + z 2 cos(y).
1.4. Compute the divergence div F and curl curl F of each of the following vector fields F:
1.5. Using the MATLAB command quiver3 (and any other appropriate commands), plot the
vector field F of parts (b) and (c) above. Discuss the relationship between the computed
divergence and curl with the vector field plots obtained.
1.6. Show that div curl F = 0 for all vector fields F. (State any assumptions made.)
1.7. Show that curl ∇f = 0 (∈ R3 ) for all scalar valued functions f . (State any assumptions
made.)
2 Integration
Integration arises naturally in electrical device modelling. For example, the evaluation of line
and surface integrals arise naturally in the derivation of physical models for inductance. Simi-
larly, the evaluation of surface and volume integrals are required in modelling capacitance. In
particular, line integrals are required in evaluation circulation and potential difference, whilst
surface integrals are generally required for computing flux. Volume integrals are required when
a quantity (such as charge, or resistance) is spatially distributed in a non-uniform way. Typical
integrals of these types are as follows:
Z I
V = − E · dl , C = F · dl (1)
ZZ ` `
Φ= F · dA (2)
ZZZA
q= ρ dv (3)
v
Examining the first line integral of (1), the potential difference V is obtained by integrating
along the path ` the component of the electric field E that is tangential to that path. In the
case of potential difference, this is the work done per unit charge in moving a charge along the
path ` in the presence of the electric field E. In the case of the second line integral of (1), the
circulation C is obtained from a line integration around a closed path `.
2
2.1 Tasks (line integrals)
An electric field is given by
E(x, y, z) = y x̂ + x ŷ . (4)
Two points P1,2 located in R3 are located relative to the origin O by the vectors
P1 = x̂ , P2 = ŷ .
.
Consider two paths joining P1 and P2 , namely the straight line path labelled `1 = P1 → P2 ,
.
and the radius 1 circular path labelled `2 = P1 y P2 .
2.1.1. Show that the points on `1 can be represented by the vector field
.
l1 (s) = P1 (1 − s) + P2 s = (1 − s) x̂ + s ŷ , (5)
2.1.2. Compute the incremental tangent vector dl1 (s) in terms of s and ds.
2.1.3. Explain why the first line integral of (1) evaluated along path `1 can be rewritten as
Z Z 1
V`1 = − E · dl ≡ E(s) · (x̂ − ŷ) ds (6)
`1 0
where
.
E(s) = s x̂ + (1 − s) ŷ .
2.1.5. Now consider the second path `2 , a quarter circle jointing P1 to P2 . Show that points on
`2 can be represented by the vector field
π s π s
.
l2 (s) = cos x̂ + sin ŷ .
2 2
where s ∈ [0, 1]. Compute incremental tangent vector dl2 (s) in terms of s and ds.
2.1.7. Using MATLAB, visualize the electric field and both paths via the following commands:
3
x = 0:.2:1; y = x; z = x;
[xx,yy,zz] = meshgrid(x,y,z);
Exx = yy; Eyy = xx; Ezz = 0*xx;
figure(1);
quiver3(xx,yy,zz,Exx,Eyy,Ezz);
xlabel(’x’); ylabel(’y’); zlabel(’z’);
grid on; hold on;
P1 = [1;0;0]; P2 = [0;1;0];
s = 0:.05:1;
L1 = P1*(1 - s) + P2*s;
L2 = P1*cos(pi*s/2) + P2*sin(pi*s/2);
plot3(L1(1,:),L1(2,:),L1(3,:),’g’);
plot3(L2(1,:),L2(2,:),L2(3,:),’r’);
The plot obtained should be similar to that of Figure 1. Label the path ends appropriately
as either P1 or P2 .
2.1.9. By inspection of (4) only, find a scalar valued function f : R3 7→ R such that E ≡ −∇f .
2.1.10. The existence of such a function f in Task 2.1.9 indicates that the electric field E of
(4) is conservative. In view of your answers to Tasks 2.1.4, 2.1.6, and 2.1.8, explain the
significance of a conservative field.
0.5
z
0
1.4
1.2
1
1.4
0.8 1.2
1
0.6
0.8
0.4 0.6
0.4
0.2
y 0.2
x
0 0
4
2.2 Tasks (surface integrals)
A magnetic field is given by
H(x, y, z) = −z x̂ + x ŷ + y ẑ . (7)
A half-cube A of long side 1 rests in the x-y plane with its surface lying in the half-space z ≥ 0,
as per Figure 2. The perimeter ` of the half-cube (a square of side 1) is centred at the origin
O.
ẑ
1 1
A+
xy
1
A−
2
yz
A+
yz
1
A+
xz
2
1
x̂ 2
1
2 ŷ
Perimeter
!
Figure 2: Half-cube A (Tasks 2.2).
2.2.2. The flux of curl H through the half-cube A is the surface integral
ZZ
.
Φ= curl H · dA , (8)
A
where dA is the outward pointing unit normal scaled by the incremental cross-sectional
area. As the half-cube A consists of 5 separate faces, the surface integral of (8) may be
decomposed into a sum of 5 component surface integrals. First label these faces according
to the plane they are in, along with a + or − sign to indicate the sign of the remaining
5
spatial variable.That is, define
+ . 1
Axz = x x̂ + ŷ + z ẑ x ∈ [−1/2, 1/2], z ∈ [0, 1/2]
2
− . 1
Axz = x x̂ − ŷ + z ẑ x ∈ [−1/2, 1/2], z ∈ [0, 1/2]
2
+ . 1
Ayz = x̂ + y ŷ + z ẑ y ∈ [−1/2, 1/2], z ∈ [0, 1/2]
2
− . 1
Ayz = − x̂ + y ŷ + z ẑ y ∈ [−1/2, 1/2], z ∈ [0, 1/2]
2
+ . 1
Axy = x x̂ + y ŷ + ẑ x, y ∈ [−1/2, 1/2]
2
The corresponding unit outward normal vectors from these faces are (respectively) ŷ,
−ŷ, x̂, −x̂, and ẑ, whilst the corresponding cross-sectional areas of these faces are (again
respectively) 12 , 12 , 12 , 21 and 1. Using this information, and the fact that curl H is spatially
invariant, show that
ZZ
Φ= curl H · dA = 1 . (9)
A
2.2.3. The circulation of H around the perimeter ` is given by the second line integral of (1).
As ` is a square of side 1, this perimeter (path) may be divided into 4 sub-paths. These
sub-paths are each of length 1, and the points on each may be represented by the paths
/ vector fields
. 1 1 1 1
`1 : l+x (s) = (x̂ − ŷ) (1 − s) + (x̂ + ŷ) s = x̂ + s − ŷ ,
2 2 2 2
. 1 1 1 1
`2 : l+y (s) = (x̂ + ŷ) (1 − s) + (−x̂ + ŷ) s = − s x̂ + ŷ
2 2 2 2
. 1 1 1 1
`3 : l−x (s) = (−x̂ + ŷ) (1 − s) + (−x̂ − ŷ) s = − x̂ + − s ŷ ,
2 2 2 2
. 1 1 1 1
`4 : l−y (s) = (−x̂ − ŷ) (1 − s) + (x̂ − ŷ) s = s − x̂ − ŷ ,
2 2 2 2
6
and H1 (s) is the magnetic field (7) along the path `1 . Similarly define H2,3,4 . Show that
1 1 dl+x
H1 (s) = ŷ + s − ẑ , = ŷ ,
2 2 ds
1 1 dl+y
H2 (s) = − s ŷ + ẑ , = −x̂ ,
2 2 ds
1 1 dl−x
H3 (s) = − ŷ + − s ẑ , = −ŷ . (11)
2 2 ds
Find the corresponding expression for the magnetic field H4 (s) along path `4 . Then,
show that the four line integrals in (10) are given by
Z
1
H · dl = ,
2
Z`1
H · dl = 0 ,
`2
Z
1
H · dl = ,
2
Z`3
H · dl = 0 .
`4
of H around the half-cube perimeter `. (Note that C` is the circulation of H around `.)
2.2.4. Compare the curl flux (9) with the circulation (12). What is the fundamental underlying
connection between these two quantities?
Evaluate the total charge in the cubic volume c by performing the above integration.