### 8.5 Gradients: How to Find Them

The **gradient** of a variable quantifies the magnitude and direction of the maximum change of the variable as a function of distance in space. For instance, the temperature gradient gives the maximum amount of temperature change in space and the direction of that maximum temperature change. Thus, a gradient is a vector.

We can find the gradient in Cartesian coordinates by using the **del operator**, which is also called the **nabla **or **gradient operator**, which is a vector that finds the partial derivative of a variable (please review 8.1) in each direction.

$$ \vec{\nabla}_{H}=\vec{i} \frac{\partial}{\partial x}+\vec{j} \frac{\partial}{\partial y}+\vec{k} \frac{\partial}{\partial z} $$

[8.10]

$$ \vec{\nabla}_{H}=\vec{i} \frac{\partial}{\partial x}+\vec{j} \frac{\partial}{\partial y} $$

**n**in the direction of the temperature gradient, and call it the normal vector for temperature gradient because

**n**is normal to the isotherms.

To see how we can calculate gradients, lets start with the commonly used gradient: the horizontal temperature gradient. Look at the surface temperature map for the United States on 8 September 2012.

With the temperature data that was used to generate the map above, a computer can easily calculate the gradients for every location. However, you can get a better understanding of gradients by using a map, ruler, and the following mathemantical equations to estimate gradients. First, we show you how to find distances on a map using a ruler. Watch this video (2:12) on finding distances:

We can calculate a gradient for every point on the map, but to do this we need to know the change in the temperature over a distance that is centered on our chosen point. One approach is to calculate the gradients in the *x* and *y* directions independently and then determine the magnitude by:

and the direction by:

The partial derivatives are approximately equal to changes over small distances. Let's assume that the temperature gradient is approximately constant around a location. Then, integrating the equation 8.11, which is the definition of a horizontal gradient, yields

We can program a computer to do these calculations. However, often we just want to *estimate* the gradient. The gradient can be determined by looking at the contours on either side of the point and computing the change in temperature over the distance. These partial derivatives can be approximated by small finite changes in temperatures and distances, so that $\partial $ is replaced by $\Delta $ in all places in these equations. We can calculate gradients by using “centered differences” as shown in the figures below.

We then calculate the magnitude with Equation [8.12] and the direction with Equation [8.13], where we replace the partial derivatives with the small finite differences in all places in these equations.

The magnitude and direction are:

When you calculate the arctangent, keep in mind that the tangent function has the same values every 180^{o} or every π radians. If you get an answer for the arctangent that is 45^{o}, how do you know whether the angle is really 45^{o} or 45^{o} + 180^{o} = 225^{o}? The gradient vector always points towards higher values, so always choose the angle so that the gradient vector points toward the warmer air. Alternatively, if *∂T*/*∂x* is greater than 0, choose the value of the arctangent between –90^{o} and 90^{o}, whereas if *∂T*/*∂x* is less than 0, add 180^{o}.

Recap of the process for calculating the temperature gradient:

- Determine the distance scale by any means that you can. Sometimes it is given to you; sometimes you can scale off a ruler; sometimes you just estimate it using the size of known boundaries.
- Determine the spacing between the isotherms.
- Find the temperature change in the
*x*and*y*directions using the centered difference method. These two numbers, $\Delta T/\Delta x\text{}and\text{}\Delta T/\Delta y$, are needed to calculate both the gradient magnitude and the gradient direction. Note that $\Delta T/\Delta x\text{}and\text{}\Delta T/\Delta y$ can be either positive or negative. - Calculate the magnitude by finding the square root of the squares of the gradients in the
*x*and*y*directions (i.e., $\Delta T/\Delta x\text{}and\text{}\Delta T/\Delta y$). - Calculate the direction of the gradient vector by finding the arctangent of the
*y*-gradient divided by the*x*-gradient. Pay attention to the direction—make sure that it points toward the warmer air.

Now watch this video (3:52) on finding gradients:

A word about finding gradients in the real world. Sometimes the centered differences method is difficult to apply because the gradient is too much east–west or north–south. For instance, in the temperature map at the beginning of this section, the *x*-gradient is hard to determine by the centered difference method in the Oklahoma panhandle and the *y*-gradient is hard to determine in central Pennsylvania because in both cases, the temperature hardly changes in those directions. In these cases, you could say that the gradient in that direction equals 0, but then your computer program might have a hard time finding the arctangent. One way around this problem is to put in a very small number for the gradient in that direction, say 1 millionth of your typical gradient numbers, to do the calculation.

A second word about finding gradients in the real world. When you are finding temperature gradients from a temperature map, it is sometimes hard to determine the temperature gradient at some locations because the isotherms are not evenly spaced and can be curvy. Don't despair! Use your best judgment as to what the gradients are. Check your answers for the magnitude and direction of the temperature gradient vector by estimating the magnitude and direction by eyeballing the normal to the isotherms at that location and pointing the gradient vector to the warmer air. If your calculated direction is very different from your eyeballed value by more than, say, 45^{o}, check your math.

#### Quiz 8-3: Grading your gradients.

- Find
**Practice Quiz 8-3**. You may complete this practice quiz as many times as you want. It is not graded, but it allows you to check your level of preparedness before taking the graded quiz. - When you feel you are ready, take
**Quiz 8-3**. You will be allowed to take this quiz only**once**. Good luck!