Understanding Gradient and Divergence

I should’ve written this a while ago, when I understood the inner workings of this stuff. But well, I believe that it’s never late to teach something. So, here goes…

I wasn’t aware of these stuff until lately…

I rote-learned vector calculus during my second semester, when I was doing nothing but complaining all the time about the crappy system we have in our college. (ehm, you can always skip my history)

I had to swallow things like curl, divergence, gradient, and theorems from Gauss and Stokes’, etc. and loss-lessly vomit in the exams. That time, I wasn’t even aware of the elegance of these operations, nor did I understood the working of vectors (things which defined symmetry, and gave an ingenious touch to the physical laws).

When I first learned Electromagnetism, I was unable to see the physical significance of Maxwell equations (I’m a geek who loves to gather knowledge, provided that I’m really able to comprehend its physical significance quite satisfactorily). Moreover, as a terrific lover of Physics, I’ve always learned things (whatever that is!) conceptually.

Sadly, this time, I can’t. From then, it started bugging inside me. I had to suffer for a few months.

Well, thank goodness, it didn’t last for long. I guess you already know that I’ve been busy with edX online courses. In my undergrad course, I have a subject called “aerodynamics”, which is the essential part (like, close to the heart) of aeronautics. But, unluckily we have a merciless teacher (sigh, we get at least two such species every semester), who mercilessly do the copy-pasta work from J.D. Anderson’s work.

So, I thought of taking the edX course for aerodynamics (having known some basics). When I joined edX, it was too late that I missed the course. The next course was Flight Vehicle Aerodynamics. The notable thing is that it’s provided by Massachusetts.

As far as I know, MIT is the hostile grader in the whole edX. No more than 2 submissions are allowed, students should get higher grades (like 70%) to pass the course and obtain a certificate, homework & exam questions will be tough like HELL!!! These often happen with their standard of MOOC (It’s not a rant! One should always appreciate such people for their job)

That’s good. I like solving problems. So, I took the challenging course. But soon, I got struck in the first lecture video, when the instructor wrote the divergence & curl operations saying, “this source distribution – we all know that…” and continued. Yeah, who am I kidding? It’s definitely not an introductory course.

With the optimist holding my back, I started learning vector calculus. I had to blow my brains a few times to grasp the concepts. I tried to understand those operations with fluid flow examples like source, sink, etc. but soon, I found myself indulged in Maxwell equations. I already have some knowledge about it, just that I couldn’t understand the differential forms. Anyways, it didn’t take long. Electromagnetism helped me in understanding those vector operations, which eventually led me into grasping fluid dynamics.

Yay! I was happy at last! That was one of the satisfactory moments I had. The problem of vector calculus took me a while to solve. But somehow, I got it. And later, Feynman helped me to reinforce the unclear, partially filled concepts.

Now that you’ve had enough patience to read my past, let’s try to interpret some of the magic operations performed using the simple upside-down delta (called “nabla”, or its official name, “Del“) operator – \nabla

Let’s begin to “understand” (the concept of fields)…

Do we really understand mathematics? It often bugs me. What my fellow students really do is, just memorize the formulas, and procedures for solving a particular problem, and they tell me that they understand the problem they’ve just “cracked”. I’ve always pictured learning as “gathering knowledge to enhance creative thinking”.

There’s an excellent quote by Paul Dirac. He says,

I consider that I understand a mathematical equation when I can predict the properties of its solutions, without actually solving it”.

Maybe we all should stop saying that we “understand” a math equation by simply solving it. So, today I’ve planned to define each and every operation (or theorem) based on its physical significance.

Okay, we always begin vector calculus with the concept of fields – which are of course, one of the most abstract concepts that has ever been defined, imagined, and used often in Physics (as far as I know). To speak truly, we still don’t know whether something as crazy as a field really exists! But, in our experience, based on the diversified experiments done so far, all we can say is that there’s some “thing” that agrees with our theoretical concept of fields. So, we carry on with the belief that it really exists!

There are two kinds of fields, one is the scalar field, and the other is a vector field.

Scalar field:

This will enable you to picture field easily. A scalar field is a region in space where each and every point is associated with a value (a scalar). For instance, the temperature in your room could be a scalar field. It could have a -25^o\ \mathrm C somewhere in the corner, a -20^o\ \mathrm C near the outlet of an air-conditioner, etc. But in reality, the thing isn’t a constant. It’s much like this simulation from htwins (enable “temperature” and try changing the disturbance to visualize the field).

In a similar manner, this can be imagined for potentials (potential is nothing but a scalar function of position, indicating the amount of work required to move something in the field against a force) in other fields like the electromagnetic or gravitational field.

Vector field:

FluidThe stuff in this field has a direction in addition to the value associated with each point. Examples include the velocity of particles (the velocity profile) in wind, a typical fluid flow, etc.

To the side, is a picture of a flow of liquid in a pipeline demonstrating viscosity, that the shear force varies with the velocity gradient perpendicular to the flow.

In simpler words, due to viscosity, the velocity of fluid particles is zero at the fluid-pipe interface, and maximum near the center of the pipe.

 

A vector field is usually shown by drawing a bunch of arrows pointing in the direction of the field, with lengths proportional to the magnitude of the field (indicating field strength). We also draw field lines to visualize fields (mostly for electric & magnetic stuff, and yeah! fluid dynamics too…) in such a way that these arrows are tangential to the field lines.

With the same field line theme, we also draw contours (which are lines of same magnitude of something, mostly isopotentials). Ah! You should’ve seen a world map. The mountains, rivers are contour lines indicating regions of same height. Contours are very elegant than field lines, because in addition to the lines, they also represent the field intensity at each point.

Here’s an example of lifting flow over a circular cylinder. The contour lines (they have a different name here, they’re called streamlines) indicate the isopotentials of velocity.

Lifting Flow

Okay, these are different ways to picture fields. But, these don’t hold very well all the time. Anyways, I’ll leave that research as an exercise for you!

Gradient means how the field changes spatially…

Now, what do we mean when we differentiate/integrate something with respect to something?

Differentiation gives the knowledge of the change of something with respect to something. And, integration gives the opposite. It extrapolates the particular change (we’ve just obtained) over the entire limit, thereby giving the average value of the function over the integrated limit.

If we wanna know how a certain function f changes with respect to say time, we take the partial derivative of the function \partial f/{\partial t}, because we only require how the function changes with time, and not to be disturbed by any other parameter involved.

What if we wanna know how a particular field changes with respect to space? The gradient does the job. It shows how the respective components of a certain field changes with respect to the space dimensions.

Let’s go with the 2D case, as it’s somewhat easy to visualize…

Gradient

f(x,y)=x^2+y^2 \implies \nabla f=2x+2y

We know that a function (like that of a field) is composed of the field components in different dimensions. For now, we’re looking only at the space dimensions.

A scalar field is shown by its field intensity. In the field shown to the side, the field density is zero at the center, and increases quadratically as we get farther away from the center.

We can make a vector field for this scalar field. Of course, we make use of the gradient function. \nabla f gives the change of f along x,y directions (i.e.) f_x and f_y.

That’s because \nabla is a magic operator. It records the change of the function along every spatial dimension.

\nabla=\big(\frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \frac{\partial}{\partial z}\big)

Say we’re at some position (x,y) in our field. What the gradient \nabla f_{(x,y)} gives, is the direction along which there’s a maximum change in the region.

So, from our position, we look around, search for the direction along which there’s a maximum change (using our gradient’s result), and we can start moving in that direction. Wow! That’s a wonderful way to plot a path along which the field intensity always increases as we move on.

Okay, now what happens when we reach the location of maximum field intensity? Simple. The gradient becomes zero. For a scalar field like the one shown above, there’s actually no maximum. The field keeps on increasing towards \infty. Never mind, that’s enough for our discussion.

By this way, the gradient is helpful in transforming a scalar field into a vector field. Well, it can also be used to analyze a vector field. But, the theme remains the same.

Divergence (going in or out?)…

 I remember explaining about flux long back, when I was writing about alternating current. Precisely, it’s just the flow of something through a surface normal to the flow. It’s usually the product of the average normal component of the “something” and the area through which it flows.

For instance, take electric flux. It’s the electric field intensity over a certain area (certainly a closed surface). In other words, the number of field lines crossing through a closed surface. Or, let’s make life simple.

Say you have a hypothetical water bag. And, let’s create this scenario with a non-conservative field (i.e.) a source of water is somehow kept inside the bag. Now, a hole pierced in the bag, in such a way that it occupies one percent (just to mention that it’s small, has nothing to do with our analysis) of the entire area of the bag.

Water is flowing out with some velocity v out of the hole. What we need is something to measure the net outward flow. We take the normal component v_n and do the math (i.e.) multiply it over the area of the hole. Now, look closely at the units. We get \mathrm{m^3/s}. In our example, this is the flux. It gives the volume of water running out of the bag every second.

Now, let’s get into divergence. Say we “pop” that water bag. Now, we wanna know how the water is flowing, that whether it’s going out or in. Well, that’s easy. It’s always gonna flow out, which is true in our simplest possible water bag example.

Once the blag is popped, all the particles (we don’t want atoms or molecules for now!) in the flow have a velocity outward like the one shown below (remember that there’s a point source inside – in the absence of any disturbance, the particles flush outward in the form of spherical wavefronts). And mind you! This is the flow of an ideal (inviscid, incompressible, etc.) fluid.

Outflow

The imaginary sphere is just to indicate the area normal to the “arrows”…

What would happen when we add a few complications? Say, there are a number of sources (that give water) and sinks (that suck away water) in this hypothetical bag. And now, we’re in a confusion. We wanna know whether the net flow of water (after adding and subtracting everything out) is out or in.

This divergence operation gives the result. It’s a measure of the flow of something out of/in to the field. The fluid flow is given by the vector field. And, the divergence does the job of adding/subtracting strengths of sources/sinks, thereby it predicts the “outgoingness” of the flow (through a certain area).

Let’s take a closer look…

We’re now getting into a theorem. For our example, let’s grab the point source we used above and place it inside a tube. This is some arbitrary part of the tube (the source is not shown here). And, I don’t think there’s another substitute for Feynman to explain this theorem. So, allow me to plagiarize his derivation.

Pipe Flow

Assume that those lines are streamlines, and the arrows are of constant magnitude (the lengthening of arrows is just due to the projection of 3D)

For our own convenience, let’s assume an infinitesimal cube of side \Delta a in the flow field. But since that may create some confusion, we shall use \Delta x\Delta y, and \Delta z as the length of the cube in the respective directions (and, we’re making use of right-handed coordinate system). Whenever we make use of area in vector analysis, we choose its direction with the help of the unit normal vector \hat n protruding out of the surface. In our case, it’s out of the cube on all the sides.

Let’s choose two surfaces along the x-direction (where the red dots are present), and assume that the field intensity vector at these two surfaces is F_x. We’re in need of the flux of the vector field through these two surfaces. Recall our definition of flux. It’s not just the product. As we’re playing with vectors, we make use of the dot product (which is associated with finding the contribution of a parameter with respect to its orientation). The cross product is associated with rotation, and we’ll discuss about it when we play with “curl” (probably next time).

The flux through the first surface would be

\vec F_{x1} \cdot (- \hat n)\ \Delta y \Delta z=-F_{x1}\ \Delta y \Delta z

and the other one would be

\vec F_{x2} \cdot (\hat n)\ \Delta y \Delta z=F_{x2}\ \Delta y \Delta z .

The direction changes, yeah. But NO! the magnitude won’t be the same! We’re doing calculus here. We should account for whether something changes the flux in between the cube.

So, both the fluxes differ by some factor

F_{x2}=F_{x1}+ \frac{\partial F_{x}}{\partial x} \Delta x

Since integral is the sum of two parts, we can add both the fluxes. Hence, the total flux along the x-direction would sum up to,

F_{x}= \big( \frac{\partial F_{x}}{\partial x} \Delta x\big)\ \Delta y \Delta z

Now, we’re getting out of the tube and looking (macroscopically) the total flux out of all the faces of the cube, which is the sum of flux contributions from all the faces. And, we get something different.

\mathrm{Total\ Flux=} \big( \frac{\partial F_{x}}{\partial x}+\frac{\partial F_{y}}{\partial y} +\frac{\partial F_{z}}{\partial z} \big)\ \Delta x \Delta y \Delta z

Look closely. It’s the dot product of our \nabla operator with the field vector. And, our total flux is the dot product of the flux intensity vector with the unit normal vector times the area of the surface chosen (that’s what we’ve defined, and written all along).

For an infinitesimal cube, we wrote \Delta x \Delta y \Delta z. For some arbitrary volume, it’s the volume integral of the function. So, the left and right sides become…

\oint \oint (\vec F\cdot \hat n)\ dS=\int\int\int (\nabla\cdot \vec F)\ dV

And, there ya go! That’s Gauss’s Divergence theorem, a very helpful theorem for differential calculus of vector fields. We just found the use of divergence. Note the surface integral. It’s circled (um, the circle should enclose both the integrals, my bad!) because the chosen surface should be closed. If it were open, we can’t evaluate the volume. I guess you know about differentiation and integration.

Advertisements

Tagged: , , ,

One thought on “Understanding Gradient and Divergence

  1. edizwt November 15, 2014 at 3:29 AM Reply

    I have recently started a website. This article has helped me greatly. Thanks for all of your time & work.

Wanna Reply?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: