You are on page 1of 13

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/268052556

Workshop in Excel

Article · November 2007


DOI: 10.1090/cbmath/014/23

CITATIONS READS

0 1,020

3 authors, including:

Deane Arganbright Erich Neuwirth

16 PUBLICATIONS 94 CITATIONS
University of Vienna
86 PUBLICATIONS 666 CITATIONS
SEE PROFILE
SEE PROFILE

Some of the authors of this publication are also working on these related projects:

statconn View project

All content following this page was uploaded by Erich Neuwirth on 27 April 2015.

The user has requested enhancement of the downloaded file.


Proceedings of KAIST International Symposium
on Enhancing University Mathematics Teaching
May 12–16, 2005 Daejeon, Korea

WORKSHOP IN EXCEL

DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

Abstract. This hands-on computer workshop illustrates how spreadsheets can


be use creatively in teaching mathematics to study a surprising range of significant
mathematical concepts and models via Microsoft Excel, the principal mathemati-
cal tool of the workplace. Participants learn how to use Excel to create dynamic
graphic displays that include animation.

1. Introduction
The electronic spreadsheet, of which Microsoft Excel is the leading version, is an
excellent tool for the study of mathematics, mathematical modeling, and mathemat-
ical visualization. It can fit naturally into the university mathematics classroom for
a wide variety of courses, providing both students and teachers with new conceptual
insights, and giving students valuable experience in using the primary mathematical
tool of the workplace. This workshop is a very brief introduction to some of the
tools, techniques, and ideas that are particularly useful in the use of Excel in teach-
ing mathematical topics. Because of time constraints we are only able to illustrate
a few of these. Two Web sites that provide additional illustrations and discussions
of educational uses of spreadsheets are [3] and [4].

2. Euler’s Method
Our first example illustrates Euler’s method for approximating the solution to an
initial value problem of the form y 0 = f (x, y), y(x0 ) = y0 . As an illustration we use
the initial value problem: y 0 = x + y, y(0) = 1.
In Euler’s method we start from an initial point (x0 , y0 ) and repeatedly increase
the x-value by a chosen step size, dx. We approximate the resulting change in y by
traveling along the tangent line whose slope is given by f (xn , yn ), so that the change
in y is given by dy = y 0 dx. Thus, at step n the new approximation is obtained from
the old one as yn+1 = yn + yn0 dx, or “new y” = “old y” + “change in y”. We first
enter headings for our output, the step size dx, and initial values of x and y (Fig.
1).

A B C
1 dx 0.1
2
3 x y y'
4 0 1
5

Figure 1
Received by the editors on June 6, 2005.
183
184 DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

Figure 2 Figure 3 Figure 4

Figure 5 Figure 6 Figure 7

Next, in the third column we compute the slope at the initial point as the sum
of the x- and y-values. We do this by producing the formula =A4+B4 in Cell C4.
However, we want to emphasize that the best approach is not to type in formulas
via cell locations. Rather, we create the formula by a “gesturing” method.
Thus, we first type in an = sign to indicate that we are entering a formula. We
then use the mouse to click on the cell containing the value for x (Fig. 2). We do
not need to refer to the cell location. Excel does this for us. We then type the +
sign and click on the y-value (Fig. 3). Finally, we press the Enter key to complete
the process for us.
Excel computes the value of our formula using the value of the cells that are
referenced. This value appears in the cell (Fig. 4). The underlying formula for the
current cell can be seen in the formula bar. We have created the formula as the sum
“two cells to the left” + “cell to the left”.
We now enter formulas to compute the next iteration of our process. We begin
by using the gesturing process to compute the new value of x by adding dx to the
previous value of x (Fig. 5). However, in doing this we should think ahead. We will
want to repeat this step in future replications, but while the previous value of x will
change each time, the step size remains fixed. To ensure this will happen when we
copy a formula, after we click in the cell for dx (Fig. 6) as we create the formula,
we press the F4 key. This supplies $ signs to the column and row components of
the cell reference (Fig. 7) that will serve to make the cell reference absolute. It will
not be changed when we copy the formula.
Next, in the y -column we compute the new value of y as the sum of the previous
value of y (cell above, relative) and the product of the step-size (absolute) and the
previous value of y 0 (cell to the right and above, relative). This is shown in Figure
8.
WORKSHOP IN EXCEL 185

Figure 8

Figure 9 Figure 10

We have generated the approximation(x1 , y1 ). We now want to evaluate y 0 at this


point. We could enter the formula as we did above. Instead, since it is really the
same expression as before, we will copy the previous formula for y 0 . We first click
on the cell to be copied. There we see a small box, called a fill handle, in the lower
right corner of the cell (Fig. 9). To copy the formula, we use the mouse to place the
pointer on the fill handle, where we see the large white cross turn into a thin black
cross. We hold down on the left mouse button and drag it down into the next cell.
The copy command treats the locations for x and y as relative locations, or as “two
cell to the left” + “cell to the left”, that are updated as we copy.
Now that we have completed a second row, it expresses that way that all follow-
ing rows are generated. We can just copy these expressions down their respective
columns. To do this we use the mouse to click in the center of the left cell in the
second row of output, hold down on the left mouse button and move to the right.
This highlights, or selects, the cells in that row. We now release the mouse button,
place the pointer on the fill handle in the lower right corner of the highlighted block,
and drag it down as far as we wish to go (Fig 10).
186 DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

A B C
1 dx 0.1 A B C
2 1 dx 0.1
3 x y y' 2
4 0 1 1 3 x y y'
5 0.1 1.1 1.2 4 0 1 =A4+B4
6 0.2 1.22 1.42 5 =A4+$B$1 =B4+$B$1*C4 =A5+B5
7 0.3 1.362 1.662 6 =A5+$B$1 =B5+$B$1*C5 =A6+B6
8 0.4 1.5282 1.9282 7 =A6+$B$1 =B6+$B$1*C6 =A7+B7
8 =A7+$B$1 =B7+$B$1*C7 =A8+B8
9 0.5 1.72102 2.22102
9 =A8+$B$1 =B8+$B$1*C8 =A9+B9
10 0.6 1.943122 2.543122 10 =A9+$B$1 =B9+$B$1*C9 =A10+B10
11 0.7 2.197434 2.897434 11 =A10+$B$1 =B10+$B$1*C10 =A11+B11
12 0.8 2.487178 3.287178 12 =A11+$B$1 =B11+$B$1*C11 =A12+B12
13 0.9 2.815895 3.715895 13 =A12+$B$1 =B12+$B$1*C12 =A13+B13
14 1 3.187485 4.187485 14 =A13+$B$1 =B13+$B$1*C13 =A14+B14

Figure 11 Figure 12

A B C
1 dx 0.1
2
dx 0.1 dx 0.1
3 x y y'
4 0 1 1
x y y' x y y' 5 0.1 1.1
0 1 1 0 1 1 6
+ 0.1 + * 7

Figure 13 Figure 14 Figure 15

We obtain the numerical output shown in Figure 11. The display of the underly-
ing formulas in Figure 12 shows how the copy process treats relative and absolute
references.
While we create spreadsheet formulas for algorithms and models in a very natural
way, a display of formulas provides a rather inadequate way to describe the cre-
ation process. In [2] Neuwirth and Arganbright have developed an alternate way of
describing formulas that corresponds to our gesturing approach to model creation.
Thus, the new x (Fig. 13) is the sum of the previous x (cell above, relative) and the
value of dx (absolute). The new y (Fig. 14) is the sum of previous y (cell above,
relative) and the product of dx (absolute) and the previous y 0 (cell above and to
the right, relative). A similar diagram can be created to show the computation for
the derivative as the sum of the two cells to the left (not shown). We indicate the
copy process (Fig. 15) by using heavy shading for the cells that are copied and light
shading for the cells into which they are copied. These arrow diagrams are not part
of Excel.
Once our spreadsheet model is created, we can vary the value of initial condition
or step size cells and see the ensuing results as the spreadsheet is immediately
recomputed. We can change the differential equation by entering a new formula
into the initial cell of the y 0 column and copying it.
We now illustrate the algorithm by creating an interactive graphic display within
the worksheet. To show the steps of the algorithm we use the mouse to highlight
the block of (x, y)-values (Fig. 16) and then click on the chart wizard button (Fig.
17). In Excel graphs are called charts. This produces a series of four dialog boxes.
In the first we choose the xy (scatter) chart (Fig. 18). It plots the (x, y) Cartesian
coordinates and connects consecutively listed points by straight line segments. We
WORKSHOP IN EXCEL 187

Figure 16 Figure 17 Figure 18

Figure 19 Figure 20

choose the option in the lower left corner that will show both the markers and the
connecting line segments.
After we finish with the first dialog box we click on the Next button to go to Step
2 (not shown). When we are finished there, we again click the Next button and go
to Step 3. There we can adjust gridlines (Fig. 19), legends (Fig. 20), and other
features
After completing the process, we click on the Finish button of Step 4 and obtain
a graph like the one in Figure 21. Our chart will be updated as we change any of the
parameters or other aspects of our model. In teaching, this allows us to demonstrate
aspects of an algorithm by varying parameters and seeing the results visually. The
graph can be resized and reformatted to adjust many features to make it look as
shown in Figure 22, but we will not do that in this workshop.
To show how Euler’s approximation relates to the actual solution, it is helpful to
display the true solution in the same chart. To do this we first obtain the analytical
solution, y = 2ex − x − 1. To graph this we generate x-values in steps of size 0.01 in
one column, use our gesturing technique to ender a formula for y at the top of the
column to the right (Fig. 23), and copy it down the right column.
188 DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

3.5

3.5 3.0
3 2.5
2.5 2.0
2
1.5
1.5
1.0
1
0.5
0.5
0.0
0
0 0.2 0.4 0.6 0.8 1 1.2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Figure 21 Figure 22

Figure 23 Figure 24 Figure 25

Next we use the mouse to click in the center of the first cell in the x-column, hold
down on the left mouse button, and drag the mouse to select the entire block of
the (x, y) values. Then we position the mouse pointer on an edge of the selected
block, hold down on the left mouse button, drag the block into the chart (Fig. 24),
and release the mouse button. When the Paste Special dialog box appears, we click
in the New Series and the Y values in Columns circles, and tick the Categories (X
values) in First Column box (Fig. 25).
This produces the chart below. Since we are plotting both (x, y) point markers
and connecting line segments, the resulting display is not ideal. To adjust this
aspect, we right click on the new curve in the chart. In the resulting option box, we
click on the option: Format Data Series.
In the resulting dialog box (Fig. 28) we click on the Patterns tab, change the
Line color to red and increase its thickness. We also click on the option, None, for
Marker. The resulting display is shown in Figure 29.
Now we can see what is happening. The approximation diverges further and
further from the true solution in each step. Using this model in teaching, we can
study the effect of changing the step size, dx. In Figures 30-31 we show the result
for dx = 0.2. We will get a better approximation with dx = 0.02, but to do this we
need five times as many points to obtain the approximate solution over the same
interval. At this stage in the classroom we can discuss the strengths and weakness
WORKSHOP IN EXCEL 189

4
3.5
3
2.5
2
1.5
1
0.5
0
0 0.2 0.4 0.6 0.8 1 1.2

Figure 26 Figure 27

0
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Figure 28 Figure 29
A B C
1 dx 0.2 4
2
3 x y y'
3
4 0 1 1
5 0.2 1.2 1.4
6 0.4 1.48 1.88 2
7 0.6 1.856 2.456
8 0.8 2.3472 3.1472
9 1 2.97664 3.97664 1
10 1.2 3.771968 4.971968
11 1.4 4.766362 6.166362
12 1.6 5.999634 7.599634 0
13 1.8 7.519561 9.319561 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
14 2 9.383473 11.38347

Figure 30 Figure 31

of this approach and consider more sophisticated algorithms, which we then can
implement in Excel.
Our model will be even more effective in our teaching if we can change the value
of dx continuously. Surprisingly Excel gives us ways to do essentially this. We will
190 DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

Figure 32 Figure 33

Figure 34 Figure 35

Figure 36 Figure 37

connect the value of dx to a scroll bar or slider. In Excel these can only take on
non-negative integer values. So in Cell C1 we enter an integer (here 10) and obtain
the value of dx by dividing this value by 100 (Fig. 32). Then as the value of C1
varies from 0 to 50 in steps of size 1, dx varies from 0 to 0.5 in steps of 0.01. To
create the toolbar, we click on the command menu View and tick Control Toolbox
(Fig. 33).
In the toolbar that is produced (Fig. 34) we first ensure that the Design Mode
button (upper left) is selected. Then we click on the scroll bar button. We move
the mouse to where we want the scroll bar located, hold down on the left mouse
button, drag out the outline of a scroll bar (Fig. 35), and release the button.
To create a link between the scroll bar and our model, we right click inside the
scroll bar that is generated and choose the option Properties (Fig. 36). There we
click in the box to the right of Linked Cell and type in C1. We also set the maximum
size for the linked cell to 50 (Fig. 37). We then click on the upper left button of the
Control Toolbox toolbar to exit the design mode.
WORKSHOP IN EXCEL 191

Figure 38
A B C D E F
1 n 2
2
3 deg t r x y Y
4 0
5 1
6 2
7 3

Figure 39

Now the scroll bar is linked to the value of dx. When we move the slider on
the scroll bar we see the effect of continuous changes in dx. Figure 38 provides a
reformatted view of our model.

3. Graphs of Polar and Parametric Equations


For a second example we will create an animated graph of a polar equation.
Both the process and the resulting model closely follow the traditional classroom
approach to the study of these equations, but provide much more versatility in what
teachers and students can do in graphing. We create the graph by computing polar
coordinates (r, t) and converting them to Cartesian coordinates by the equations x
= rcos(t) and y = rsin(t). Here we produce a graph for r = cos(nt), where n is a
parameter of our spreadsheet model.
We begin in Figure 39 by generating degrees in steps of size 1 down the first
column. In adjacent columns we will generate values of t (in radians), r, x, and y.
We discuss the use of an additional column, Y , later.
To convert from degrees to radians, we type =radians(, click on the cell to the
left, type ), and press the Enter key (Fig. 40). Another way is to use the Insert,
Functions commands. This keeps us from needing to memorize function names and
leads us through the steps required to create the function. We generate the value of
r as cos(nt) in a similar way, pressing the F4 key when we click on the cell containing
n to ensure that it becomes an absolute reference (Fig. 41-42).
In the next two columns we compute r cos(t) and r sin(t) with all references rela-
tive (Fig. 43-44).
192 DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

Figure 40 Figure 41 Figure 42

Figure 43 Figure 44

Figure 45

1.5

1.0

0.5

0.0
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
-0.5

-1.0

-1.5

Figure 46 Figure 47

All that remains is to copy the formulas down through 360 rows. We do this using
the drag technique. However, since we have already generated values of n through
360, we can highlight the cells in the top row and double-click on the fill button
(Fig. 45) and all of the values will be generated.
Next, we highlight the columns of x- and y-values and create an xy-chart just
as before, except this time we choose only to plot the connecting lines and not the
point markers (Fig. 46). In Figure 47 we see the resulting curve, and experiment
with changes in the value of n.
We conclude this example by demonstrating one more effective use of a scroll bar.
Before doing this we first use Excel’s built-in IFTHENELSE function to generate
y-values only for those points whose degree measure is less than a value N that
WORKSHOP IN EXCEL 193

Figure 48

1.5

1.0

0.5

0.0
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
-0.5

-1.0

-1.5

Figure 49 Figure 50

Figure 51 Figure 52

we enter in Cell F1 (Fig. 48). The formula shown is interpreted as “IF degrees
is less than N , THEN reproduce the y-value, ELSE generate the “not available”,
NA(), value. After copying we see the output below. We then drag the new column
into the chart as another y-series (Fig. 49). The curve in Figure 50 uses N = 40.
Notice that only the points for degrees less than the value of N are plotted, and in
a different color.
We now create a scroll bar linked to the cell containing N and set its largest value
to 360 (Fig. 51). As the scroll bar is moved (Fig. 52) we see the curve traced out
continuously. The display can be even more effective if we remove the original curve
View publication stats

194 DEANE ARGANBRIGHT, ERICH NEUWIRTH, AND ROBERT S. SMITH

n 2 n 2 N

deg t r deg t r x y
0 RADIANS( ) COS( * ) 0 0 1 *COS( ) *SIN( )
1 1

Figure 53 Figure 54
n 2 N 5

deg t r x y Y
0 0 1 1 0 =IF( < , ,NA())
1

Figure 55

to see only the heavy red one that is being produced. The use of the scroll bar
enables students to examine the process of drawing the curve, in addition to seeing
the completed drawing.
We also can explain the steps in our construction via arrow diagrams (Fig. 53-55).

The two examples in this workshop where chosen to provide workshop partici-
pants with some fundamental skills for using spreadsheets in teaching mathematics.
Further discussions of the wide range of other possibilities and applications may be
found in the references.
References
[1] Arganbright, Deane. Practical Handbook of Spreadsheet Curves and Geometric Constructions,
CRC Press, 1993.
[2] Neuwirth, Erich and Arganbright, Deane. The Active Modeler: Mathematical Modeling with
Microsoft Excel, Brooks-Cole, 2004.
[3] Neuwirth, Erich. Web site on educational applications of spreadsheets:
http://sunsite.univie.ac.at/Spreadsite/.
[4] Sugden, Steve, ed. Spreadsheets in Education. Bond University (Australia) Web site on edu-
cational uses of spreadsheets: http://www.sie.bond.edu.au/.

Department of Mathematics, Korea Advanced Institute of Science and Technol-


ogy, Daejeon 305-701, Korea
E-mail address: arganbright@math.kaist.ac.kr

Faculty of Computer Science, University of Vienna, Vienna, A-1010, Austria


E-mail address: erich.neuwirth@univie.ac.at

Department of Mathematics and Statistics, Miami University, Oxford, OH 45056-


3414, USA
E-mail address: smithrs@muohio.edu

You might also like