Skip to main content

# 8.6: Gradients - How to Find Them

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\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]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\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]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\avec}{\mathbf a}$$ $$\newcommand{\bvec}{\mathbf b}$$ $$\newcommand{\cvec}{\mathbf c}$$ $$\newcommand{\dvec}{\mathbf d}$$ $$\newcommand{\dtil}{\widetilde{\mathbf d}}$$ $$\newcommand{\evec}{\mathbf e}$$ $$\newcommand{\fvec}{\mathbf f}$$ $$\newcommand{\nvec}{\mathbf n}$$ $$\newcommand{\pvec}{\mathbf p}$$ $$\newcommand{\qvec}{\mathbf q}$$ $$\newcommand{\svec}{\mathbf s}$$ $$\newcommand{\tvec}{\mathbf t}$$ $$\newcommand{\uvec}{\mathbf u}$$ $$\newcommand{\vvec}{\mathbf v}$$ $$\newcommand{\wvec}{\mathbf w}$$ $$\newcommand{\xvec}{\mathbf x}$$ $$\newcommand{\yvec}{\mathbf y}$$ $$\newcommand{\zvec}{\mathbf z}$$ $$\newcommand{\rvec}{\mathbf r}$$ $$\newcommand{\mvec}{\mathbf m}$$ $$\newcommand{\zerovec}{\mathbf 0}$$ $$\newcommand{\onevec}{\mathbf 1}$$ $$\newcommand{\real}{\mathbb R}$$ $$\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}$$ $$\newcommand{\laspan}[1]{\text{Span}\{#1\}}$$ $$\newcommand{\bcal}{\cal B}$$ $$\newcommand{\ccal}{\cal C}$$ $$\newcommand{\scal}{\cal S}$$ $$\newcommand{\wcal}{\cal W}$$ $$\newcommand{\ecal}{\cal E}$$ $$\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}$$ $$\newcommand{\gray}[1]{\color{gray}{#1}}$$ $$\newcommand{\lgray}[1]{\color{lightgray}{#1}}$$ $$\newcommand{\rank}{\operatorname{rank}}$$ $$\newcommand{\row}{\text{Row}}$$ $$\newcommand{\col}{\text{Col}}$$ $$\renewcommand{\row}{\text{Row}}$$ $$\newcommand{\nul}{\text{Nul}}$$ $$\newcommand{\var}{\text{Var}}$$ $$\newcommand{\corr}{\text{corr}}$$ $$\newcommand{\len}[1]{\left|#1\right|}$$ $$\newcommand{\bbar}{\overline{\bvec}}$$ $$\newcommand{\bhat}{\widehat{\bvec}}$$ $$\newcommand{\bperp}{\bvec^\perp}$$ $$\newcommand{\xhat}{\widehat{\xvec}}$$ $$\newcommand{\vhat}{\widehat{\vvec}}$$ $$\newcommand{\uhat}{\widehat{\uvec}}$$ $$\newcommand{\what}{\widehat{\wvec}}$$ $$\newcommand{\Sighat}{\widehat{\Sigma}}$$ $$\newcommand{\lt}{<}$$ $$\newcommand{\gt}{>}$$ $$\newcommand{\amp}{&}$$ $$\definecolor{fillinmathshade}{gray}{0.9}$$

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.

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

Click here for transcript of the Finding Distances video.

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.

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:

Finding Gradients

Click here for transcript of the Finding Gradients video.

We can calculate the gradient by using the method that's described in the lesson. Let's pick a point in Pennsylvania about here, and then we'll calculate the gradient for that point. We will first look at the gradient in the x direction which goes along, and it's parallel with the North and South boundaries of Pennsylvania. We'll use the method of center differences that's described. We'll look at this contour here, this isotherm, and this one over here on the other side. And we note that this distance here is very, very similar to the distance of Pennsylvania between the parallel borders, which is 135 nautical miles. And so each one of these contours is four degrees Fahrenheit. So we have two of them, so 8 divided by 135 nautical miles gives us a gradient in the x direction of 0.059 degrees Fahrenheit per nautical miles. Now we can do the y direction, so we pick two points here. One here and one about here to be on the gradients. And we note that this is a little bit more than half the height of Pennsylvania. It's actually about 80 nautical miles. But also note that as y goes more positive, the temperature becomes more negative and therefore, we have to use minus 8 over 80. And we get, for the gradient in the y direction, minus 0.1 degrees Fahrenheit per nautical miles. When we put these in to get the magnitude-- it's the square root of the squares-- we see that we end up with 0.12 degrees Fahrenheit per nautical mile with a magnitude of the gradient. To find the direction of the gradient we see that mu, the angle with respect to the x-axis-- so this is a math angle. It's equal to the arctangent of the gradient in y divided by the gradient in x. And so that would be the arctangent of minus 0.1 over 0.059, which is minus 59 degrees. And that is, of course, measured from the x-axis here. So that is measured from this direction here like this, and so that's minus 59. And it's the same as if we went all the way around and we would get 301 for alpha if we were looking at the math angle. Now, we can look and get an idea about gradients and other places really quickly, so let's just take this point in Central Oregon. So now x is going like this over here, and so we see that the gradient in the East West direction, or x direction is-- to go to another country you have to go very, very far, and so that would be 8 degrees. It's so far the really the gradient is essentially 0. Whereas if we go in the North South direction-- that is in the y direction here-- we see that there's quite a substantial distance here. And so, since this is 8 degrees, just like this is 8 degrees over here, then what that means is the gradient is going to be quite a bit smaller in this direction than it is in Pennsylvania here where the isotherms are much, much closer together. So we would expect a gradient that's a fourth or a fifth of the gradient that we got for Pennsylvania, and so it'll be very weak. Nonetheless, it'll point toward the hotter air, and it'll look something like this.

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 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 160 degrees when your eyeball check says about 220 degrees, check your math again.

This page titled 8.6: Gradients - How to Find Them is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by William Brune (John A. Dutton: e-Education Institute) via source content that was edited to the style and standards of the LibreTexts platform.

• Was this article helpful?