# 8.6: Gradients - How to Find Them

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

The gradient of a variable is just the change in that variable as a function of distance. For instance, the temperature gradient is just the temperature change divided by the distance over which it is changing: ΔT/Δdistance. The gradient is a vector and thus has a direction as well as magnitude. Surface temperature map for North America on 8 September 2012. Temperatures are in oF. For a point in western Kentucky, the temperature gradient is to the southeast. Credit: Unisys

Consider the surface temperature contour plot from NOAA for 8 September 2012 in the figure above. A strong temperature variation is draped across the eastern and southern US from New York down to Texas. How do we quantify this temperature variation? First we have to specify where we want to measure the temperature gradient. Then we simply need to choose isotherms on either side of the point, take the difference between the isotherms, figure out how far apart they are in horizontal distance, and divide the temperature change between the isotherms by the distance between the isotherms. The direction for the gradient is on the normal (perpendicular to the isotherms) from the lower temperatures to the higher temperatures. It’s pretty easy to figure out where the gradient vector points just by quick examination, but it is a little harder to figure out what the gradient magnitude and actual direction are.

Now watch this video (2:12) on finding distances:

Finding Distances

We're often interested in finding distances on a map so that we can calculate quantities we are interested in, such as the temperature gradient. Note first that often the projection of the map that we have does not have east-west, parallel, and straight across. In fact, the east-west line is curved a little bit, so take that into account when you're doing your calculations. Also note the north-south lines run a little bit not parallel as well. So how do we find distances? Well, there are many different ways, but one good way is to take a known distance on the map, scale it with a ruler, and then use that ruler in other places to give us distances in other places. So for instance, we know that the height of Pennsylvania between the two parallel borders, the north and south borders is 135 nautical miles. So we can scale that with a ruler, and I have a ruler here. I put the ruler in, and I see, in this particular case, the distance between the two is just about exactly 1 centimeter or 10 millimeters. So what that means is each millimeter on my scale is equal to 13.5 nautical miles on the map. So then I can use this in other places to measure other distances. So for instance, if I want to know the height of Kansas between its parallel North and South borders, I can put my ruler on there. And if I look carefully, I get a number that's about 13 and 1/2 millimeters. So 13 and 1/2 times 13 and 1/2 is about 182. And that's what I would say this distance is. The actual distance is 180 nautical miles, so in fact, the scaling I have is actually pretty good.

Mathematically, if we know the algebraic expression for the temperature change, such that T = T(x,y), we can find the gradient by using the del operator, which is also called the gradient operator.

Recall the del operator:

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

If we are looking only at changes in x and y, then we can define a horizontal del operator:

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

At any point, we can determine the gradient of the temperature:

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

Note that this quantity has dimensions of θ/Lθ/L and a magnitude and a direction. The gradient direction is always normal to the isolines and pointing in the direction of an increase. We can define the normal vector, which is just the unit vector in the direction of the increasing temperature. We will call this normal vector n.

Credit: H.N. Shirer

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 ydirections independently and then determine the magnitude by:

$\left|\vec{\nabla}_{H} T\right|=\sqrt{\left(\frac{\partial T}{\partial x}\right)^{2}+\left(\frac{\partial T}{\partial y}\right)^{2}}=\left|\frac{\partial T}{\partial n}\right|$

and the direction by:

$\mu=\tan ^{-1}\left(\frac{\partial T / \partial y}{\partial T / \partial x}\right)$

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 ∂ is replaced by Δ in all places in these equations. We can calculate gradients by using “centered differences” as shown in the figures below. Calculating the temperature gradient in the x (top) and y (bottom) directions using the centered difference method. Credit: H.N. Shirer

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. Example of an estimation of the gradients in the x and y directions. To get an idea of the horizontal scale, you can estimate distances using the known size of a state or country, in this case, Pennsylvania, which is on average 470 km (254 nm, nautical miles, 290 miles) in the x (east–west) direction and 250 km (135 nm, 155 miles) in the y (north–south) direction for the parts where the north and south borders are parallel lines. Credit: H.N. Shirer

The magnitude and direction are:

$\left|\nabla_{H} T\right|=\sqrt{\left(\frac{\Delta T}{\Delta x}\right)^{2}+\left(\frac{\Delta T}{\Delta y}\right)^{2}}=\sqrt{\left(\frac{4^{\circ} \mathrm{F}}{45 \mathrm{nm}}\right)^{2}+\left(\frac{-4^{\circ} \mathrm{F}}{84 \mathrm{nm}}\right)^{2}}=0.1^{\circ} \mathrm{F} / \mathrm{nm}$

$$\mu=\tan ^{-1}\left(\frac{\Delta T / \Delta y}{\Delta T_{/ \Delta x}}\right)=\tan ^{-1}\left(\frac{-4 / 84}{4 / 45}\right)=-28^{\circ},$$ which points to the southeast

When you calculate the arctangent, keep in mind that the tangent function has the same values every 180o, or every π in radians. If you get an answer for the arctangent that is 45o, how do you know whether the angle is really 45o or 45o+ 180o = 225o? The gradient vector always points toward the higher temperature air, so always choose the angle so that the gradient vector points toward the warmer air.

Recap of the process for calculating the temperature gradient:

1. 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.
2. Determine the spacing between the isotherms.
3. Find the temperature change in the x and y directions using the centered difference method. These two numbers, ΔT/Δx and ΔT/ΔyΔT/Δx and ΔT/Δy ΔT/Δx and ΔT/ΔyΔT/Δx and ΔT/Δy can be either positive or negative.
4. Calculate the magnitude by finding the square root of the squares of the gradients in the x and y directions (i.e., ΔT/Δx and ΔT/ΔyΔT/Δx and ΔT/Δy
5. 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: