0% found this document useful (0 votes)
115 views8 pages

Power-Law Fitting and Log-Log Graphs: 5.1 Dealing With Power Laws

The document discusses using log-log graphs to determine power law relationships between variables when the exponent and constant are unknown. It explains that taking the logarithm of both sides of a power law equation converts it to a linear relationship, where the slope is the exponent and the intercept is the log of the constant. An example analyzing the relationship between oscillation period and mass using a log-log graph is provided. The procedure is to make a log-log plot of the data, draw the best fit line, and estimate the exponent from the slope and constant from the intercept.

Uploaded by

unionew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views8 pages

Power-Law Fitting and Log-Log Graphs: 5.1 Dealing With Power Laws

The document discusses using log-log graphs to determine power law relationships between variables when the exponent and constant are unknown. It explains that taking the logarithm of both sides of a power law equation converts it to a linear relationship, where the slope is the exponent and the intercept is the log of the constant. An example analyzing the relationship between oscillation period and mass using a log-log graph is provided. The procedure is to make a log-log plot of the data, draw the best fit line, and estimate the exponent from the slope and constant from the intercept.

Uploaded by

unionew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

5

POWER-LAW FITTING AND LOG-LOG GRAPHS


She had taken up the idea, she supposed, and made everything bend to it.
--- Emma
5.1 DEALING WITH POWER LAWS
Although many relationships in nature are linear, some of the most interesting relationships
are nonlinear. Power-law dependences, of the form
y x kx
n
( ) = (5.1)
are particularly common. In many cases, we might suspect that two experimental variables are re-
lated by a power-law relationship, but are unsure of what k or n are. For example, we might sus-
pect that the period T of a simple harmonic oscillator might depend on the mass m of the oscillating
object in some kind of power-law relationship, but we might be unsure of exactly what the values
of either n or k . If we knew n, then we could plot y vs. x
n
to get a straight line; the slope of that
line would then be k. But if we dont know n, it would seem at first glance that the best we could
do would be simply try different possible values of n to see what works. This could get old fast.
We can, however, take advantage of the properties of logarithms to convert any relationship
of the type given by equation 5.1 into a linear relationship, even if we do not know either k or n!
The most basic property of logarithms (for any base, but lets assume base-ten logs) is that:
log( ) log log ab a b = + (5.2a)
From this it follows that
log( ) log( ) log log log log a a a a a a a n a
n
= = + ++ = (5.2b)
(this is actually true even for non-integer n). Also, in the case of base-ten logarithms, this means
log( ) log( ) 10 10 1
b
b b b = = = (5.2c)
which shows that raising 10 to a power is the inverse operation to taking the (base-ten) log.
With this in mind, let us take the (base-ten) logarithm of both sides of equation 5.1 and use
the properties described by equation 5.2. If we do this we get
log log( ) log log log log y kx k x k n x
n n
= = + = + (5.3)
Now define log log . x u y and v Substituting these into 5.3 and rearranging, we get

v = + nu k log (5.4)
Now, this is the equation of a straight line. This means that if we graph v vs. u (that is, log y vs.
log x), we should end up with a straight line, even if we do not know what n and k are.
Furthermore,the slope of this line is the unknown exponent n in equation 5.1. We can there-
fore find the value of n by calculating the slope in the usual way. That is,
n
u
y y
x x
=
D
D
= =
v v v
u u
2 1
2 1
2 1
2 1

log log
log log
(5.5)
n times n times
The value of the intercept (which is the value of

v = log y when u x = log = 0) is logk , so if we
can find the intercept and its uncertainty, we can find k and its uncertainty.
In summary, we can take any relationship of the form given in equation 5.1, take the loga-
rithm of both sides, and convert it to a linear relationship whose slope and intercept are related to
the unknown values of n and k. This is, therefore, a very powerful way of learning about un-
known power-law relationships (and displaying them). A graph that plots log y versus log x in
order to linearize a power-law relationship is called a log-log graph.
5.2 AN EXAMPLE OF A LOG-LOG GRAPH
As an example, consider a hypothetical experiment testing how the period of an object oscil-
lating at the end of a spring depends on the objects mass. Table 5.1 gives a set of measurements
taken during this experiment, Figure 5.1 shows a graph of period vs. the mass. Table 5.2 shows
the base-10 logs of the measurement data, while Figure 5.2 shows a graph of logT vs. logM.
0.2 0.4 0.6 0.8
mass (kg)
P
e
r
i
o
d

(
s
e
c
o
n
d
s
)
2
4
6
log(mass)
l
o
g
(
p
e
r
i
o
d
)
0
0.2
0.4
0.6
0.8
1.0 0.8 0.6 0.4 0.2 0
mass (M) period (T)
0.125 kg
0.325 kg
0.525 kg
0.725 kg
0.825 kg
2.42 s
3.76 s
4.75 s
5.52 s
5.87 s
log M log T
0.903
0.488
0.280
0.140
0.084
0.384
0.575
0.677
0.742
0.769
Figure 5.1: Graph of the oscillation period as a
function of mass.
Figure 5.2: Graph of the log of the oscillation
period as a function of the log of the mass.
Table 5.1 Table 5.2
0
0
We can see that the graph of the period vs. the mass does not yield a very good straight line:
(if the uncertainties are smaller than the dots representing the data points, we would have to say
that a straight line is inconsistent with the data). On the other hand the plot of logT vs. logM is a
very nice straight line, suggesting that the period T and the mass M have a power-law relationship.
What are n and k according to this experiment? We can easily get a quick estimate from the
graph. For the sake of round numbers, consider the points marked with s on the graph above.
The slope of this graph (rise over run) is thus
5. Power-Law Fitting and Log-Log Graphs 3 6
n
T T
M M
= = =
log log
log log
. .
. .
.
2 1
2 1
0 72 0 43
0 80 0 20
0 48 (5.6)
(The two points that you choose to compute the slope need not correspond to actual data points:
simply choose convenient points on your drawn line near the ends of the line. I chose the points so
that the denominator of the expression above would be simple.) Since exponents in physical situa-
tions are most often integers or simple fractions, we might guess that the actual value of n is 1/2
(this turns out to be the theoretical value as well as we will see chapter N11 in the class text).
The intercept is the place where the line crosses the logM = 0 grid line. According to the
graph, this is roughly where logT = 0.82 (note that the logM = 0 line is the right edge of the graph
here, not the left!). So the intercept is 0.82 = log k, which means that k = 10
0 82 .
= 6.6 s/kg
1/2
.
5.3 A COMMENT ABOUT LOGARITHMS AND UNITS
You may also have noticed that units seem to spring in and out of these calculations rather
haphazardly. This behavior conflicts with a general rule about special functions: the log function,
like sine, cosine, and the exponential function, is supposed to have a dimensionless arguments.
That is, the number you take the logarithm of is supposed to be a pure number, with no units or di-
mensions (like seconds or centimeters), attached to it. What's going on?
One can think of a number with units as the product of the number part and the units part; that
is, 10 cm is 10 (a pure number) multiplied by the unit of centimeters. When you take the logarithm
of a number with units, then, you are taking the logarithm of this product, which behaves like the
logarithm of all products: the result is the sum of the logarithms of the two numbers making up the
product. The logarithm of 10 cm is therefore log (10) + log cm = 1 + log cm. You can't give a nu-
merical result for log cm, which may seem rather disturbing.
Fortunately, this all works out fine anyway, because you typically find the logarithm of a
quantity with units only when you in the process of finding the difference between two logarithms
of quantities with the same units. Consider, for example, the situation where we compute the slope
using equation 5.6. If we attach to each logarithm in the numerator the appropriate term of log s
(where s is the unit of seconds here), we see that two log s terms cancel out when we subtract,
leaving a unitless number in the numerator. The same thing happens in the denominator. There-
fore, the slope ends up being a unitless number, as it should be.
To find the units of k, note that equation 5.4 in this situation really ought to read
log log log log log t m + = + + s kg n n k (5.7)
(where in this expression we are considering t and to be the unitless parts of T and M respec-
tively). The intercept is where the line crosses the vertical grid line corresponding to logm = 0: we
see from the graph that logt has the value logt
0
= 0.82 there. Therefore equation 5.7 implies that
log log log log log log log log t t
0 0
+ = + = + s kg s kg n k k n (5.8)
When we take the antilog of (that is, 10 to the power of) both sides of this, all the items in logs get
multiplied together, so we get (assuming that n is really 1/2):
k
n
=

=

=
10 10
6 6
0
0 82 log .
.
t
s
kg
s
kg
s
kg
1/2 1/2
(5.9)
Keeping track of these unit terms when working with logarithms involves a lot of work,
however, and less often pays off the way that keeping track of units in normal equations does.
5. Power-Law Fitting and Log-Log Graphs 3 7
Therefore, people generally ignore the units associated with logarithmic quantities, and fill in the
units of quantities after taking the antilog (as I did with k in the last section) to make them consist-
ent across the master equation 5.1. But if you ever get confused about units and want to make sure
that things work out correctly, this is how to do it.
5.4 A PROCEDURE FOR EXPLORING POWER-LAW RELATIONSHIPS
Log-log graphs are most useful when you suspect your data has a power-law dependence
and you want to test your suspicion. Sometimes your suspicion is based on a theoretical predic-
tion, sometimes a previous low-level Cartesian plot. Figures 5.3 through 5.5 are typical Cartesian
graphs that could be power laws. Whatever the source of your suspicion, your next step is to plot
the logarithms of your data as a low-level graph. If this graph looks like a pretty good straight line
(within your experimental uncertainties) you can proceed to the next steps.
Once you have plotted the points, you should use a ruler to draw the straight line that you
think best fits your data. You can then use this line to estimate the slope n using equation 5.6. You
can also estimate the value of the constant k in equation 5.1 by extrapolating your straight line back
to the vertical grid line where the value of the independent variable (lets call it x) is equal to 1 (and
thus log x = 0): the value of log k is the vertical scale reading where your best fit line crosses this
vertical grid line where log x = 0. Note that this vertical line may not correspond to the left edge of
your graph! In Figure 5.2, for example, it happens to be at the right edge of the graph, and on a
general log-log graph, it could be almost anywhere. (If the line log x = 0 is off the edge of your
graph, you can often bring it onto the graph by changing the units of x. For example if x is a dis-
tance ranging from 20 cm to 200 cm, the place where log x = 0 is when x = 1 cm, which will
probably be off the left side of your graph. But if we change the units of x to meters, then the place
where log x = 0 is where x = 1 m, which is right in the middle of your data.)
To estimate the uncertainties of these quantities, draw a new line with the largest slope that
you think might be consistent with your data, and another line with the smallest slope consistent
with your data, and find the slope and intercept for each of these lines. The greatest and least slope
will then bracket the uncertainty range of n and you can use the greatest and least values of logk
determine the greatest and least values of k, which bracket the uncertainty range of k.
To go further than crude estimates, one needs the help of a computer. The program LinReg,
which is discussed in Chapter 10 of this manual, makes it very easy to plot log-log graphs and find
the best-fit slope (with its uncertainty) and the best-fit intercept (and its uncertainty).
40
30
20
10
0
2 4 6 8 10
x
y
Figure 5.3: y = x
a
, a >1.
40
30
20
10
0
2 4 6 8 10
x
y
Figure 5.4:
40
30
20
10
0
2 4 6 8 10
x
y
Figure 5.5: y = x
a
, a <1. y = x
a
, a < 0.
5. Power-Law Fitting and Log-Log Graphs 3 8
EXERCI SES
Exercise 5.1
The table to below gives the orbital periods T (in years) of the planets known to Newton as a
function of their mean distance R from the sun in AUs (where 1 AU = the earths mean orbital
radius). Plot plot a log-log graph of the period versus the distance on the graph paper provided
as Figure 5.6 on the next page.
Planet Distance (AU) Period (y)
Mercury
Mars
Jupiter
Saturn
1.00
1.52
5.20
9.54
1.00
1.88
11.86
29.46
Table 5.3 Planetary Periods
vs. Mean Orbital Distances
Venus
Earth
0.72
0.39
0.62
0.24
Exercise 5.2
Assuming that the period and distance are related by a power-law of the form T kR
n
= , where
n is an integer or simple fraction, what does your graph suggest is the likely value of n?
Exercise 5.3
Find the value of k (with appropriate units) for the data of Table 5.3 from the intercept of your
log-log graph. Combine this with the result of exercise 5.1 to find the power-law equation (of
the type given in equation 5.1) that seems to fit this data.
5. Power-Law Fitting and Log-Log Graphs 3 9
Figure 5.6
5. Power-Law Fitting and Log-Log Graphs 4 0
5.5 (OPTIONAL) USING LOG-LOG PAPER
If you have more than five or ten data points, calculating the logarithms quickly gets tedious
even with a calculator. To reduce this tedium (which would have been particularly gruesome in the
era before computers and calculators), someone invented a special kind of graph paper called log-
log paper. In effect, this kind of graph paper calculates the logarithms for you.
Imagine that you have data for an independent variable x that ranges from, say, 0.01 m to
about 10 m. The values of log x would then range from about 2.0 to 1.0, and a useful horizontal
scale might look something like this:

2.0
log x
1.5 1.0 0.5 0.0 0.5 1.0

Now, imagine that we were to also draw a scale immediately above this scale that showed the cor-
responding values of x. The two scales together would look like this:

2.0
log x
1.5 1.0 0.5 0.0 0.5 1.0
0.01
0.02 0.03
0.05 0.1
0.2 0.3
0.5 1.0
2.0 3.0
5.0 10
x
(Note how the pattern of the spacing between marks on the upper scale is identical for each power
of 10.) Now, note that if we had graph paper that had its axes pre-labeled as shown in the upper
scale, then we could locate points on the plot directly according to their value of x rather than hav-
ing to compute the value of log x for each data point.
The way that the pattern repeats for each power of 10 makes it possible to create general and
flexible graph paper with essentially pre-labeled scales. Figure 5.7 on the next page is an example
of log-log paper which has 3 cycles of the pattern horizontally and vertically, making it possible to
display data points whose x and/or y values span up to three powers of 10 (or three decades). If
you compare this graph paper to the double-axis shown above, you will see that only the equival-
ent of x scale is displayed on this paper: the log x scale has been suppressed for the sake of clarity,
but should be considered implicit. Also you will note that the publishers of the graph paper do not
commit you to particular powers of 10: each decade is labeled as if it spans from 1 to 10. You can
cross out the numbers shown to adapt the graph paper to the particular ranges of your data points
(this is conventionally done for just the numbers labeled 1 or 10 on the graph paper). Figure 5.7
shows how you would do this for the planetary orbit data given in Table 5.3.
The point is that with just a little relabeling you can use graph paper like this to construct
quickly a log-log graph without having to do any actual calculations of logarithms. This is great for
doing low-level, quickie graphs of a set of data that you think might reflect a power-law relation.
y kx
n
= . You can even read the value of k directly from the graph by finding the point where your
best-fit line crosses the vertical line corresponding to x = 1 unit and reading the vertical coordinate
of this point according to the vertical axis.
But how can you compute the slope n of data drawn on such graph? Remember each axis has
an implicit linear scale that reflects the log of the value displayed. Linear means that the change
in the value of log log x y or is proportional to the physical distance on the sheet of paper. So to
find the slope, all that you have to do is measure the rise of your line (in cm on the sheet of paper!)
and divide by the run (in cm).
Using log-log paper is optional in this course. But you can purchase sheets of log-log paper
from Connie (the department secretary) for 10 per page if you would like to use it for quick low-
level graphing.
5. Power-Law Fitting and Log-Log Graphs 4 1
(OPTIONAL) Exercise 5.4
Plot the planetary orbit data in Table 5.3 on the log-log paper shown below, and use the meth-
ods described in the previous section to find k and n assuming that T kR
n
= . Check that these
agree with the values you found before.
Figure 5.7: An example of 3-cycle 3-cycle log-log paper.
5. Power-Law Fitting and Log-Log Graphs 4 2

You might also like