Post on 26-May-2018
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Vector calculusAn introduction
Dr. David Robert Grimes1
1Old Road Campus, OX3 7DQUniversity of Oxford
Web: http://users.ox.ac.uk/~donc0074/E-mail: davidrobert.grimes@wolfson.ox.ac.uk
University of Oxford Doctoral Training Centre, 2015
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Revision - Functions of a single variable
Earlier in the lecture series we came across functions of bothsingle and multiple variables, and we learnt the basics ofpartial derivatives.
I To find partial derivative with respect to a variable,treat all other variables as constants.
For example, if f (x , y , z) = 5x3 − 9zy2 + 3zx
then ∂f∂x = 15x2 + 3z
and ∂f∂y = −18zy
and ∂f∂z = −9y2 + 3x
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Revision - Maxima and MinimaI Recall that for a function f of a single variable x ,
dfdx = 0 at a local maximum or minimum.
I To ascertain whether a given point is a local max ormin, the second derivative test can be employed
0 2 4 6 8 100
5
10
15
20
25
x
f(x)
Graph of the function f(x) = 10x − x2
I In the above example, dfdx = 10− 2x . Setting this equal
to zero, we find maximum at x = 5.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Scalar and vector fields - An introduction
Recall that a scalar has magntitude only, and a vector hasboth magnitude and direction. A similar analogy exists whenwe speak of scalar and vector fields. Let’s imagine aco-ordinate set P(x,y,z), typically positions in 3D space.Let’s also imagine that’s there a function associated withevery point in P. We call the function over all this space afield. In general, the field is one of two types.
I If the function at each point is a single value, thenU(x,y,z) is a scalar field. For example, the temperatureat every point in a room would be a scalar function.
I If the function at each point produces a vector, thenF(x,y,z) is a vector field. For example, theelectromagnetic force a charged particle experiences ata given point is a vector function.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Scalar functionI A scalar function yields a single scalar value for every
position in P. For example, each point on a 2D maphas a single-value for altitude U(x , y).
I Similarly, imagine the 2D heat distribution given by thefunction f (x , y) = 10e−(x
2+y2) is illustrated below.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Vector function
I A vector function yields a vector value for every positionin P - we might think of a particle in a river; it’smovement vector at a given position will be a functionof the river flow vector.
I A vector field is a collection of vectors at all points ofspace and time.
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5Electric field lines from a point charge at (x,y) = (0,0)
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
The Gradient
I The gradient can be thought of as the generalisation ofthe one-dimensional derivative to higher dimensions.
I If we have a scalar function U(x , y , x), then thegradient is given by
∇U = (Ux ,Uy ,Uz) (1)
I As we can see above, the gradient of a scalar function isalways a vector.
I Let’s look at how to use this, and its physicalinterpretation.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Gradient examples
I Consider scalar function U = x2 + 2y3z − 6z
Ux = 2x , Uy = 6y2z , Uz = 2y3 − 6Thus ∇U = (2x , 2y2z , 2y3 − 6)
I Consider also U = 5zx3 + 3y − 6z5
Ux = 15zx2 , Uy = 3 , Uz = 5x3 − 30z4
Thus ∇U = (15zx2, 3, 5x3 − 30z4)
I The gradient is the extention of the derivative in onedimension; notice that the output is always a vector.What does this mean?
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Gradient interpretation
I Like the derivative in one spatial dimension, thegradient yields the slope of the tangent to the function.
I The gradient points in the direction of greatest rate ofincrease, magnitude of gradient is slope of graph in thatdirection.
I Gradient always shows direction (hence vector) ofgreatest change of function. Imagine a surface abovesea level at a point (x , y) is H(x , y). Then ∇H givesyou the vector pointing in the direction of the steepestslope at that point.
I To extend our mountain analogy, the magnitude of thegradient, |∇H| would yield the steepness of the greatestslope - single number, as expected.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Gradient interpretation
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Directional Derivative
We are often interested in the rate of change of a scalarfunction U in a particular direction. If we define thisdirection vector as a unit vector ~n, then the directionalderivative is given by
∂f
∂n= ~n · ∇U (2)
This is the rate of change in the direction ~n. To illustratewith an example, if we have a function U = x2 + xy2 + yzand ~n = 1√
3(1, 1, 1), then ∇U = (2x + y2, 2xy + z , y) and
∂f
∂n=
1√3
(2x + y2 + 2xy + z + y)
As with any dot product, the output is always a scalar.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
The Divergence
I Divergence is an operator that quantifies the magnitudeof the flux of a vector field at a given point.
I First, we’ll look at how to calculate divergence and thenprobe its meaning.
I If we have a vector-field F (x , y , z) = (f , g , h) thendivergence is defined as
∇ · U =∂f
∂x+∂g
∂y+∂h
∂z(3)
I The divergence of a vector field is always a scalar - thisscalar is a magnitude.
I Let’s see some examples, and discuss what this entailsand why it’s useful.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Divergence Examples
I Consider a vector field F = (x3, zy2, z2). Then,
∇ · F = ∂x3
∂x + ∂zy2
∂y + ∂z2
∂z = 3x2 + 2z(y + 1)
I Another vector field F = (5x2, 2xz , zy3). Thus,
∇ · F = ∂5x2
∂x + ∂2xz∂y + ∂zy3
∂z = 10x2 + 0 + y3
I Notice that the output is always a scalar function. Let’stouch on what divergence means.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Divergence interpretation
I Divergence is a well-chosen name; it is a measure ofhow much a vector spreads out or ’diverges’ from agiven point.
I Imagine standing by a pond and dropping some sawduston the water at a point; if the sawdust spreads out, thenthat point has a positive divergence. If instead theyclump together, the point has a negative divergence.
I A point of positive divergence is called a source, a pointof negative divergence a sink.To use a bathtub analogy,the faucet is a source and the plughole a sink .
I Divergence is of central importance in DivergenceTheorem (Gauss’s theorem), which relates volumeintegrals to surface integrals. This is a really usefulresult, and one you may come across in future courses.For now, just knowing what divergence means and howto get it is enough.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Divergence interpretationWhile it’s beyond the limits of this course, Maxwell’s lawsstate divergence of electric field is proportional to chargedensity ρ. This is shown below for ~E = x2~i + y2~j .
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
−6 −4
−4
−2
−2
−2
0
0
0
0
2
2
2
4
4
6
Charge Density (∇ ⋅ E )
x
y
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
The Curl
I The curl of a vector-field is also well-named - it yieldsthe rotation vector experienced at a given point in avector field. Again, we’ll look at how we calculate itand what it physically means. For a vector fieldF (x , y , z) = (f , g , h), the curl in 3D is defined as
∇× F =
∣∣∣∣∣∣i j k∂∂x
∂∂y
∂∂z
f g h
∣∣∣∣∣∣ (4)
I The output of this operation will always be a vector.
I This can appear a little daunting, but a few exampleswill help us understand what is going on.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Curl Examples
I To calculate the curl of F , we need to know thecross-product identity:
∇× F =
∣∣∣∣∣∣i j k∂∂x
∂∂y
∂∂z
f g h
∣∣∣∣∣∣ =(∂h∂y −
∂g∂z
)~i +
(∂f∂z −
∂h∂x
)~j +
(∂g∂x −
∂f∂y
)~k
I Let’s do this for F = (zx3, xyz2, xyz)
∇× F = (xz − 2xy)~i + (x3 − yz)~j + (yz2)~k
I Once more F = (2xy , 3xz2, 5xy)
∇× F = (5x − 6xz)~i + (−5y)~j + (3z2 − 2x)~k
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Curl interpretation
I Curl is a measure of how much a given vector rotatesaround the point in question.
I Again, we can visualise this with a physical example: wecan imagine a cork pinwheel placed in a stream. If thepinwheel rotates, it occupies a region of non-zero curl.A whirlpool, for example, is a region of high curl.
I Curl operators appear in many branches of science tomeasure the rotation of a vector field - you mayencounter them in electromagnetism and fluiddynamics.
I Curl also appears in Stokes theorem, which allows oneto relate line and surface integrals for certain surfaces.Some of you will encounter this later on.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Curl interpretation
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
The Laplacian
I Operators can be combined. For example, thedivergence of the gradient of a scalar function U isgiven by
∇ · ∇U = ∇2U (5)
I This is a very special result, an identity known as theLaplacian or the Laplace operator.
I This occurs through much of physics and mathematicalbiology; in diffusion equations, image analysis, quantummechanics, wave theory and mechanics.
I We won’t explore this much now, but it is worth beingaware of where it comes from.
Vector calculus
Dr. David RobertGrimes
Revision
Introduction
Gradient
Directional Derivative
Divergence
Curl
Lapacian
Summary
Summary
I The Gradient of a scalar function yields a vector. Thisvector points in the direction of greatest increase. Themagnitude of this vectors gives function ’steepness’.
I The Divergence of a vector gives a scalar. This quantityis a measure of how much a function spreads out from agiven point. Positive divergence means it is source-like,negative divergence means it is sink-like.
I The Curl of a vector gives another vector. The curldescribes the rotation due to a vector field at a point.
I The ∇ operator can be thought of as a vector∇ = ( ∂
∂x ,∂∂y ,
∂∂z ). From this, all the identities we’ve
explored in this lecture can be derived.
I Also touched on...I Identities can be combined - Laplacian operator.