Numerical Tools For College and University Students

Students attending college or university in apoints. For situations like this, a systematic
discipline heavy in the physical sciences, formethod is required to produce an approximating
example, science or engineering, frequently makefunction that describes the relationship defined by
use of several specific numerical routines. Five ofthe data. The approximating function can then be
the most popular numerical routines are examinedused to interpolate data between the known data
below. These types of routines probably coverpoints (or to extrapolate outside the range of the
90% of the routines a student will use during aknown points). Linear least-squares data fitting is
typical undergraduate degree. In addition to theirone tool available for such situations.
popularity among science and engineeringApplications for this class of numerical task arise in
programs, these numerical routines are alsoalmost any field: economics, physics, politics,
encountered in many other curriculum. Forengineering, chemistry, environmental studies, and
example, students in first year university whomany more. For example, say a researcher has
take an Algebra course to satisfy a breadthcollected population data for a country over the
requirement might need a Simultaneous Equationspast fifty years and would like to define an
Solver occasionally - while they are taking theequation that effectively describes the population
course. Another student might need to apply agrowth so that future growth can be
Linear Least Squares fit - once, for a specificextrapolated. Instead of simply looking at the
assignment - when taking an Accounting class. Ifdata, and creating a "guesstimate" for an
the students then continue on in their plannedequation--a technique that would vary from one
majors, say, Political Science or English, they doresearcher to the next--a systematic and
not use such tools again.effective way of examining the data is offered
The five routines examined below are presentedby Linear Least- Squares Data Fitting; it offers a
in response to the following hypothetical question:systematic approach for determining trends.
Which five numerical routines fill most - if not all -4) Interpolation
of the needs of undergraduate universityInterpolation is often used when drawing smooth
students? The answer given below presents thecurves through data, usually data that does not
most common types of numerical tasks andinclude errors, and provides a systematic
some of their applications. In addition, severaltechnique for computing data values between the
good-quality free tools are named that offerknown data points (or outside the range of the
solutions to these types of problems; theyknown data points). For example, a researcher
provide most of the functionality required bymight have (x, y) data points for the following
undergraduate students, allowing them to avoid -x-values: 1, 2, 3, 4, 5. However, the researcher
or at least delay - the expense of purchasingmight need a y-value that corresponds to an
commercial software.x-value of 2.5 or 6.4. The researcher would have
1) Root-findingto interpolate for the y-value at x = 2.5 (which is
Root-finding covers the class of problem in whichwithin the range of known data values) and
the zero(s) of an equation cannot be foundextrapolate for the y-value at x = 6.4 (which is
explicitly.outside the range of known data values).
Consider the Quadratic Equation:a x^2 + b x + cFurthermore, the acquisition of the data may
= 0a, b, and c are constants, and values of x thatrequire sophisticated equipment that is hard to
satisfy the equation, called the roots or zeros,access, or the data may be very expensive to
must be found.compute. In these sorts of situations, a
The Quadratic Equation is one example of thesystematic method of computing these
class of the problem of finding the roots ofinterpolating data points is required.
polynomial equations which is, in turn, part of theSeveral algorithms exist for this purpose; one
larger class of problem of root-finding. In fact,such algorithm is a Cubic Spline Interpolation. A
because the Quadratic Equation is so well-knownCubic Spline Interpolation creates a smooth curve
(students are often introduced to the Quadraticthrough known data values by using piecewise
Equation and its solution in Grade 10), root-findingthird-degree polynomials that pass through all the
is probably the best-known class of numericaldata values. However, it should be noted that
routine.different versions of this algorithm exist, for
The van der Waals Equation is another exampleexample, a natural cubic spline interpolation has the
of a polynomial equation for which roots are oftensecond derivatives of the spline polynomial set to
sought:pV^3 - n(RT + bp)V^2 + n^2 aV - n^3zero at the endpoints of the interpolation interval.
ab = 0This means that a graph of the spline outside the
In this case, values of V that satisfy the equationknown data range is a straight line. Another
are sought, and the polynomial is a cubic (theversion of the algorithm forces a "not-a-knot"
highest power of V is 3). van der Waals Equationcondition: the second and second-last points are
is often encountered in chemistry,treated as interpolation points rather than knots
thermodynamics, and gasdynamics applications.(i.e. - the interpolating cubics on the first and
Kepler's Equation of Elliptical Motion is anothersecond sub-intervals are identical, and so are the
equation to which root-finding techniques areones for the last and second last sub-intervals).
applied:Applications for spline interpolation include
E - e sin(E) = Mpopulation data gathered over many years,
In this example, the equation is not a polynomial,cyclical sales information, and the contour of the
but it involves a transcendental function. e and Mshape of an automobile body.
are known quantities, but there is no way to5) Eigenvalues and Eigenvectorslambda is an
isolate E on one side of the equation and solveeigenvalue (a scalar) of the Matrix [A] if there is a
for it explicitly. Consequently, numerical techniquesnon-zero vector (v) such that the following
have to be employed. Rearranging the equation asrelationship is satisfied:
follows turns the problem into one of finding the[A](v) = lambda (v)
roots of the equation:Every vector (v) satisfying this equation is called
E - e sin(E) - M = 0an eigenvector of [A] belonging to the eigenvalue
These examples are just three equations whoselambda.
solution requires root-finding; many moreEigenproblems arise in almost all fields of science:
equations arise whose solutions can be found onlystructural analysis, computing the modes of
by employing root-finding techniques. Fortunately,vibration of a beam, aeroelasticity and flutter,
the problem of root-finding is a well-developedsystem stability (structure, aircraft, satellites, etc.),
field of mathematics and computer science.heat transfer, biological systems, population
Almost all root-finding algorithms take an iterativegrowth, sociology, economics, and statistics.
approach to computing a solution to a desiredEigenvalues and eigenvectors are also often used
degree of accuracy: first, an initial guess is madein conjunction with the solution of differential
and checked, then a closer solution is estimatedequations. Furthermore, the algorithm behind the
and checked, and this process is repeated untilGoogle search engine is also said to treat indexing
the user-specified level of accuracy is obtained.as an eigenproblem.
For example, a user might require four decimalSummary
places of accuracy in the solution, so theRoot-finding, solving Simultaneous Equations, Linear
computer program would stop iterating for aLeast-Squares Data-fitting, Interpolation, and the
solution once an approximation has been found tocomputation of Eigenvalues and Eigenvectors are
four decimal places.the most common types of problems faced by
2) Simultaneous Equationsstudents in college and university. Not only are
This class of numerical task deals with solving Nthese types of numerical tasks faced by science
Equations in N Unknowns. For example, a situationand engineering students, they also show up
may arise in which it can be mathematicallythroughout a variety of other programs. In
described as a linear (the highest power of xaddition, two more factors attest to the
present is 1) system of Three Equations in Threeprevalence of these numerical problems: (i)
Unknowns:a11 x1 + a12 x2 + a13 x3 = b1a21 x1routines for handling these types of tasks are
+ a22 x2 + a23 x3 = b2a31 x1 + a32 x2 + a33almost always covered in texts and courses on
x3 = b3numerical mathematics, and (ii) algorithms for
The aii and bi values are known but the values ofthese mathematical tasks are well-developed and
xi that satisfy this system of equations must besource code for computer programs has been
computed. This task could be accomplished with aavailable for decades.
pencil, paper, and hand calculator, but it would beConsidering their popularity, readily-available tools
tedious. And as systems get larger, the numberthat provide solutions to these most common
of computations involved grows fast, introducingnumerical tasks would appeal to a broad range of
the risk of typos or other errors. A system of,users. On one hand, some users might need a
say, 10 Equations in 10 Unknowns would keep afew routines for one-time or very infrequent use
person busy for quite a while!whereas, on the other hand, other users might
Fortunately, computer programs have beenuse a program often, but only one specific routine.
developed that can compute solutions to theseIn either case, the purchase of a commercial
systems quickly and accurately. They are usuallysoftware package is not justified and having free
put in matrix notation:software available is a convenient alternative. In
[A](x) = (b)where [A] is a square matrix and (x)fact, these types of numerical math routines are
and (b) are column vectors.widely available for free, in a variety of formats,
These sorts of systems can arise from almostoffering a variety of capabilities. Several software
any field of study. In a course on Linear Algebrapackages have been developed for installation on
such systems will be faced all the time. Thesea user's computer, for example, Octave and
systems also arise in electric circuit analysis (i.e. -Scilab, to name two. Others are available as Java
Mesh Current Analysis), industrial chemistryapplets. And yet more are available as
projects, structural analysis, economics studies,immediate-for-use Javascript web pages; for
and more. In addition to solving the system forexample, AKiTi.ca offers routines for solving
the x values, quantities of the [A] matrix itself aremany of these types of problems. The availability
often computed to reveal informative propertiesof these various numerical routines provides
(for example, its determinant, eigenvalues, and LUpeople more options when selecting a tool that
Decomposition).best fits their unique needs, especially if these
3) Linear Least-Squares Data Fittingtools include solutions for the most common
Linear Least-Squares data fitting is often appliednumerical tasks. The availability of good-quality
to describe data which includes errors. Forsoftware tools for working with the most
example, a curve might be sought for data, butcommon numerical tasks offers the greatest
the data may be such that the expected curveutility to the greatest number of people.
does not satisfactorily pass through all the data