Creating an animated spreadsheet for a travelling wave

The idea is to create an animation of the equation y = A cos(omega t - k x)

We will be installing  a scroll bar (slider)  whose 'Linked Cell' will be G1 (instructions are below)
This is the cell where the integer value of of the slider will be located
The slider will drive the animation by incrementing and increasing the time
The time itself in cell B3 will be created from delta_t and the slider integer in G1

We will need the quantities listed below.
First type the labels in cells A2..A9.
(The first one is delta_t, typed in cell A2,  then time, typed in cell A3, etc.)

Naming the cells B2 through B9
Then click on cell B2 and go to Insert/Name/Define, and click OK. [This takes the name from what is typed in A2.]
This Names the cell B2 as 'delta_t'. Then it can be referred to by other cells.
Insert the Names for the other cells B3..B9 [ Be careful not to put the Names in cells A3..A9 ! ]
This means you select cell B3 and do the same Insert/Name/Define, and click OK,
all the way down to selecting cell B9, and doing Insert/Name/Define, and click OK.

Then enter the contents of cells B2..B9 as indicated below in the righthand column.
This begins with entering 0.001 in cell B2, then entering '=G1*delta_t' in cell B3, etc.

• Typed Label          cell        Named cell for  labelled item         Contents of cell ( B2..B9)
• delta_t                     A2                B2                                                0.001
• time                         A3                B3                                                 =G1*delta_t
• A                            A4                B4                                                0.03
• freq                         A5                B5                                                15
• speed                      A6                B6                                                6
• wavelength              A7                B7                                                =speed/freq
• k                             A8                B8                                                =2*Pi()/wavelength
• omega                     A9                B9                                                =2*Pi()*freq
In cell A11, type 'distance' and in cell B11 type 'displacement'

In cells A12..A112 we want the x-values:
In cell A12 enter 0
In cell A13 enter =A12+0.01
Copy cell A13 down to A112.  [A112 should then have a value of 1]

In cells B12..B112 we want the y(x,t) values:
In cell B12 enter =A*cos(omega*time-k*A12)
Copy cell B12down to B112.

To insert the slider (scroll bar) go to View/Toolbars and click Control Toolbox.

• This will bring up a menu probably on your screen but maybe on the top bar menus which shows a blue draftsman's triangle.
• You have to click on this triangle to enter 'Design Mode'.
• Find the scroll bar icon (two triangles separated vertically by a space, not by a horizontal line).  You don't want the 'spin button' which has a horizontal line separating the triangles.
• Click on the scroll bar icon
• Go to the screen and drag over the area of cells F1..H1.
• Right-click the scroll bar. This will bring up a menu. Click on Properties.
• The Properties menu contains lots of items
•     set the Linked Cell to G1    [this is hidden underneath the scroll bar itself; we could put it someplace else]
•     set Max to 1000                  [this sets the max integer to be 1000]
•     set Large Change to 10       [changes the value by 10 when you click in the gray area right or left of the button]
• Click the blue draftsman's triangle to exit 'Design Mode', and you are almost ready to roll!
Make a graph from A12..B112 and bring it up on the screen so you can see both the graph and the slider.
For Chart type, use X-Y (Scatter) and for sub-type use one of the top two choices in the lefthand column.
When the graph comes up it will be set to automatically readjust the graph scales. This makes it jumpy for viewing; the vertical axis will change around on the fly. You can correct this by right-clicking on one of the numbers on the y-axis, then select Format Axis, go to Scale, and put Min and Max values in. When you do this, it unclicks the auto box, and the max and min will not be readjusted.

Now click on the scroll bar triangle at the right and see the time increment by delta_t each time
The graph should move a little when you do this.
Click in the gray area to the right of the scroll button and see the time increase by 10 delta_t each time
The graph should move more when you do this.
Drag the slider button and watch the graph change. Drag it back to zero to re-start.

Have Fun!