error handling

Frequently Made Errors in Equation Handling

Estimated Read Time: 6 minute(s)
Common Topics: errors, made, mechanics, php, spring

 

1. Algebra versus Arithmetic

When numerical values are provided as inputs in a question, it is tempting to plug these into the equations straight away.  Resist!  Create variable names for these constants and work wholly symbolically until the final step.  There are many advantages:

  • If you make a mistake, it takes less time to correct.
  • It is easier to check correctness.
  • It is much easier for others to follow your reasoning.
  • Sometimes terms cancel; working symbolically eliminates redundant calculation.
  • It minimizes the propagation of rounding errors.
  • It allows sanity checks to be performed on the answer by substituting extreme numerical values instead of the ones provided.  (E.g., does it make sense that the answer becomes infinite if a certain two values happen to be equal?)
  • Dimensional analysis may be a way to check the algebraic expression (see below)

2. Loss of Precision

As noted above, rounding errors can accumulate.

In a multipart question, the answer to one part might be an input to the next.  In stating the answer to the first part, it may be appropriate to round it so, say, 3 significant figures, but the unrounded value should be used in the continuing calculation.

A particular danger arises in taking the difference between two large numbers of similar magnitude.

Example: “Ignoring the atmosphere, how high above the surface would a satellite orbiting Earth at the equator need to be in order to have a period 10 seconds longer than at the surface?”

##G = 6.673\times 10^{-11} m^3kg^{-1}s^{-2}##

##M_E=5.973\times 10^{24} kg##

##R_E = 6.378\times 10^6 m##

Since the inputs above are all to four significant digits, we’ll work to that many digits throughout:

##T_{R_E} = 2\pi\sqrt{\frac{{R_E}^3}{GM_E}} = 5069 s##

##T_r = T_{R_E}+10 = 5079 s = 2\pi\sqrt{\frac{{R_E}^3}{GM_E}}##

##{\frac{T_r}{2\pi}}^2 = 653400 s^2##

##r = 6.386\times 10^6 m##

##h = r – R_E = 8000 m##

Now let’s try it algebraically:

##r^{\frac 32} – {R_E}^{\frac 32} = \frac{\sqrt{GM_E}}{2\pi}\Delta T##

##(1+\frac h{R_E})^{\frac 32} -1  = \frac {\Delta T}{2\pi}\sqrt{\frac{GM_E}{{R_E}^3}}##

Using a binomial approximation:

##\frac 32\frac h{R_E}  = \frac {\Delta T}{2\pi}\sqrt{\frac{GM_E}{{R_E}^3}}##

##h  = \frac {\Delta T}{3\pi}\sqrt{\frac{GM_E}{R_E}} = 8388 m##

This is much closer to the correct answer 8385 m.

3. Division by potential zero

When dividing through by an algebraic expression one must recognise explicitly that the operation is only valid if that term is nonzero

An old chestnut:

Let ##a=b##

$$a^2 = ab$$

$$a^2-b^2 = ab-b^2$$

$$(a-b)(a+b) = (a-b)b$$

X Cancelling the (a-b) factors

$$a+b=b$$

$$2b=b$$

$$2=1$$

Starting again at: $$(a-b)(a+b) = (a-b)b$$

Either a=b,  or we can cancel the (a-b) factors:

##a=b## or ##a+b=b##

4. Unique variable names

Using the same symbol for two different quantities in the same question (such as m for each for two different masses) will confuse you and everyone else.  Use subscripts.

5. Dimensions

An equation associated with physical entities must be dimensionally consistent.  Dimensional analysis is a powerful technique for checking algebra.  Typically, standard symbols are substituted for each ‘dimension’, e.g.:

SymbolDimension
MMass
LDistance
TTime
##\Theta##Temperature
QCharge

Example: The frequency of a spring oscillation is ##\sqrt{\frac km}##

ExpressionDimensional expression
spring force##MLT^{-2}##
k##MLT^{-2}/L=MT^{-2}##
m##M##
##\frac km####T^{-2}##
##\sqrt{\frac km}####T^{-1}##

That’s all very well for physics problems, but what about pure math?  Say you have an equation involving abstract variables x, y, … It may be possible to assign dimensions to these variables in a consistent manner.

Example: ##ax^2+bx+c=0##.  If we assign dimension X to x, the equation can be made consistent by assigning ##X^0## (i.e. no dimension) to a, ##X^1## to b, and ##X^2## to c.  You can check for yourself that ##x=\frac{-b+\sqrt{b^2-4ac}}{2a}## is dimensionally consistent under those assignments.

6. Units

Symbolic variables have dimension (even if the dimension is null, such as for the constant ##\pi##), but they do not usually* presume specific units.  G can represent the universal constant of gravitation independently of the units being used.  The numerical value to be substituted for it will supply its own units.

X ##G = \frac{F_Gr^2}{m_1m_2}## ##m^3kg^{-1}s^{-2}##
##G = \frac{F_Gr^2}{m_1m_2}##
X ##G = 6.673\times 10^{-11} ##
##G = 6.673\times 10^{-11} m^3kg^{-1}s^{-2}##

Conversely, when working numerically, units should, in principle, always be included:

Average speed = 120 km / 3 h = 40 km/h

Done carefully, this allows units to be mixed by treating them as symbolic variables:

How many km will be covered averaging 5 m/s for 3 hours?

Distance = 5 m/s * 3 h = 15 mh/s = 15 km (m/km) (h/s) = 15* 0.001*3600 km = 54 km

*One does sometimes come across questions like “A block has mass m kg…”.  In this case, the variable m is a dimensionless number.  This isn’t actually wrong, but it is poor style and not to be emulated.

7. Memorised Formulae

It’s one thing to memorize a formula, but it’s important to remember how the variables in it are defined and in what circumstances the formula is applicable.

Example: Period of a Pendulum

X##T = 2\pi \sqrt{\frac lg}##
##T = 2\pi \sqrt{\frac lg}##where :

##l##is the length of the pendulum
##g##is the value of acceleration due to gravity

and provided:

  • the pendulum consists of a point mass suspended from a frictionless pivot by a light rod or string, and
  • oscillations are small

 

Example: Spring extension

“A mass m hangs at equilibrium from a spring with spring constant k.  The mass is then pulled down a distance x.  What work has been done in pulling the mass down?”

Taking down as positive:

Change in gravitational PE = ##-mgx##

X Change in spring PE = ##\frac 12 kx^2##

In the equation ‘spring energy = ##\frac 12 kx^2##’, x is the extension from the relaxed length.  Before the mass was pulled down, the spring was already extended by ##x_0 = \frac{mg}k##.  Therefore

Change in spring PE = ##\frac 12 k(x+x_0)^2-\frac 12 k{x_0}^2 = \frac 12 kx^2 +kxx_0 = \frac 12 kx^2+mgx##.

Total work done = ##\frac 12 kx^2##

Plugging in values just because they are of the right dimension can be observed in worrying places.  The following example is committed by the Australian Federal Minister for the Environment.

The previous Government had levied a carbon tax of $23/tCO2e.  This produced $6bn in revenue while cutting emissions by around 12mtCO2e.  The Minister attacks this as having cost $6bn/12mtCO2e = $500/tCO2e of abatement.  (Actually, he gets it to $1200 by other sleights of hand.)

It is easily seen to be nonsense by noting that if the industries had spent more on cutting emissions then the abatement would have gone up but the tax revenue down.  Pinpointing the fallacy is left as an exercise for the reader.

8. Checking your algebra

As mentioned above, if you work algebraically you may be able to sanity-check your work by

  • Dimensional analysis of equations and expressions
  • Plugging in extreme values for variables.
  • Considering whether it makes physical sense that increasing a certain variable tends to increase or decrease the expression as a whole.

A simple example of the second is checking whether you have correctly selected the sine or cosine function of an angle when resolving into components.

“A mass m slides down a plane at angle theta to the horizontal.  What is the normal force from the plane?”

Is it ##mg\sin(\theta)## or ##mg\cos(\theta)##?  Consider the case theta=0.  It is level ground now, so the normal force is mg.  Which expression gives that answer when we plug in ##\theta = 0##?

For tracking down the erroneous step in the manipulation of an equation, a useful technique is a binary chop.  If everything looks good at the first equation but one of the checks fails for the ninth equation in the sequence, check the fifth one; if that’s ok, try the 7th, etc.

But the single commonest cause of algebraic errors, in my experience, is bungled signs.  Did you forget to change a sign when expanding parentheses or when shifting terms across the equals?  My best advice here is just to be extra careful in those steps.

If you find you make a lot of mistakes, don’t try to do too much in one step.  It may be tedious to write the equation out again for each little operation,  but it may save you time in the end.

 

15 replies
  1. anorlunda says:

    [QUOTE=”mfb, post: 5114330, member: 405866″]Great post, haruspex! A large number of homework problems could be solved without help if everyone would follow those points.

    Writing let[FONT=Courier]t[/FONT]ers in a dif[FONT=Verdana]f[/FONT]erent font total[FONT=Arial]l[/FONT]y makes them dif[FONT=Times]f[/FONT]erent.[/QUOTE]

    Completely true, but problematic in the digital world where rendering of text might mangle the formatting (such as losing the distinction between D and Δ.) Obviously, science and math written traditions originate in the eras of handwriting. Rendering in the digital age is a problem we created, but have not yet adequately solved.

  2. Orodruin says:

    [QUOTE=”mfb, post: 5114330, member: 405866″]Writing let[FONT=Courier]t[/FONT]ers in a dif[FONT=Verdana]f[/FONT]erent font total[FONT=Arial]l[/FONT]y makes them dif[FONT=Times]f[/FONT]erent.[/QUOTE]
    This is so true! Obviously ##mathcal L## is different from ##L##. One is a Lagrangian and one is a fixed length.

  3. mfb says:

    Great post, haruspex! A large number of homework problems could be solved without help if everyone would follow those points.

    [QUOTE=”Vanadium 50, post: 5112025, member: 110252″]I have a textbook that uses h for two different things. h is a quantum number (h, j, and k) and also Plack’s constant.[/QUOTE]
    Writing let[font=”Courier”]t[/font]ers in a dif[font=”Verdana”]f[/font]erent font total[font=”Arial”]l[/font]y makes them dif[font=”Times”]f[/font]erent.

  4. Orodruin says:

    [QUOTE=”rude man, post: 5109812, member: 350494″]If m and R are left as m and R rather than giving them numbers, I don’t see how that makes m and R dimensionless. Did you mean m adn R to be numbers?[/QUOTE]

    Since they explicitly say ##m## kg, ##m## has to be a dimensionless. If ##m## has dimension mass, e.g., ##m = 1## kg, then the mass would have dimension mass squared, which is nonsense as replacing ##m## in the statement with 1 kg would imply “has the mass 1 kg kg”.

  5. rude man says:

    This post is of [I]great[/I] importance to anyone not already cognizant of its importance.
    Dimensions get even more important when uncommon functions are concerned.
    For example: in Laplace transforms we correctly have δ(t) ↔ 1, but then if we’re dealing in voltages we say a 1 volt-sec. delta function = 1δ(t). But this is wrong. A 1 V-sec. input voltage should be written as kδ(t), k = 1 V-sec.
    Similar observation applies in mechanical dynamics, etc. of course.

  6. rude man says:

    [QUOTE=”Orodruin, post: 5107779, member: 510075″]Regarding 5 and 6, dimensions and units, early physics education may have to take a lot of blame, at least from what I remember from my high-school textbooks. Several problems were formulated using text such as “Let the wheel mass be ##m## kg and its radius ##R## m” (but in Swedish), in this case making ##m## and ##R## dimensionless quantities. Later, students have problems with dimensional analysis as well as units … No wonder.[/QUOTE]
    If m and R are left as m and R rather than giving them numbers, I don’t see how that makes m and R dimensionless. Did you mean m adn R to be numbers?

  7. Vanadium 50 says:

    I give partial credit only until the numbers go in, and encourage my colleagues to do the same. If someone writes a+sqrt(b/2) when they mean a+sqrt(b)/2, there is a good chance I can figure this out. If they write 9.54317265 when they mean 4.5112121, I’ll never figure it out.

    And also be annoyed by the likely extraneous precision.

  8. haruspex says:

    [QUOTE=”Orodruin, post: 5107779, member: 510075″]Regarding 5 and 6, dimensions and units, early physics education may have to take a lot of blame, at least from what I remember from my high-school textbooks. Several problems were formulated using text such as “Let the wheel mass be ##m## kg and its radius ##R## m” (but in Swedish), in this case making ##m## and ##R## dimensionless quantities. Later, students have problems with dimensional analysis as well as units … No wonder.[/QUOTE]
    Yes, I had the same thought. I’ll add a comment on that, thanks.

  9. Orodruin says:

    Regarding 5 and 6, dimensions and units, early physics education may have to take a lot of blame, at least from what I remember from my high-school textbooks. Several problems were formulated using text such as “Let the wheel mass be ##m## kg and its radius ##R## m” (but in Swedish), in this case making ##m## and ##R## dimensionless quantities. Later, students have problems with dimensional analysis as well as units … No wonder.

  10. Philip Wood says:

    "One does sometimes come across questions like “A block has mass m kg…”.  In this case, the variable m is a dimensionless number.  This isn’t actually wrong, but it is poor style and not to be emulated."I entirely agree. One problem we're up against, in the UK at least, is that in mathematics students are taught to represent quantities as pure numbers. So "A block has mass m kg" is just the sort of wording they meet in mathematics classes, textbooks and exams. Students have to use one convention in Maths and another in Physics; I'm surprised they cope as well as they do.I'm so keen on the convention of representing a physical quantity as the product of a number and a unit, that I urge students to put in the number with its unit as soon as they replace an algebraic symbol by a given value, just as haruspex recommends in 6 (above)…"Conversely, when working numerically, units should, in principle, always be included:Average speed = 120 km / 3 h = 40 km/h"In more complicated cases, simplifying the units to get a unit for the final answer is an excellent exercise in itself, as well as often providing useful check on preceding algebra.

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply