DOC - islcs

advertisement
1
Let’s Make Waves: Building a Wave Function in
Microsoft Excel
Author:
Laura Hickman
Software Required:


Microsoft Excel 2007 (can also be done in Microsoft Excel 2003)
Web browser (to view links)
Other materials (recommended):



Microsoft Excel Tutorial (especially the section on creating and using slider bars)
Microsoft Excel Template called “Waves_SINE_template” (to have students create their
own formulas)
Note: If you do not want your students to have to create the entire worksheet, you may
use the already created version called “Waves_SINE” and let them experiment with
slider bars and values that have already been entered.
Objectives


Students will review the wave nature of light and be able to calculate wavelength and
frequency.
Students will become acquainted with how to use slider bars to view properties of
waves in Microsoft Excel.
Review of Waves
I.
The wave nature of light
Light can be considered a wave. A wave is a change that repeats itself (an
oscillation) in matter or in a physical field. For example, if you skip a rock across
the surface of a pond, the water begins to move up and down repeatedly,
generating what we commonly recognize as a series of waves. Electromagnetic
waves are simply oscillations of electric and magnetic fields. These electric and
©2011 University of Illinois Board of Trustees • http://islcs.ncsa.illinois.edu/copyright
2
magnetic fields oscillate perpendicular to one another and are called
electromagnetic radiation.
a. Frequency and Wavelength
Electromagnetic radiation can be categorized into many different types,
depending on the frequency or wavelength of the wave. Frequency can be
defined as the number of wavelengths of the wave that pass a fixed point in
one unit of time (the unit of time is usually one second). Let’s go back to our
earlier example of skipping rocks across the surface of a pond and imagine that
there is a dock close to where the rock hit the pond and you are watching the
waves as they pass the dock. The number of wavelengths that pass the dock in
one second would be the frequency of that wave. Frequency is typically denoted
by the Greek letter v (nu, pronounced “new”). The unit we typically measure
frequency in is per second ( /s), also called the hertz (Hz). A high frequency wave
would pass the dock many times per second, whereas a wave with a relatively
low frequency would not pass the dock as often. For practice adjusting the
frequency of a wave using a slider bar and seeing how fast or slow a wave
moves, click here.
Electromagnetic radiation can also be categorized by wavelength. Wavelength
is the distance between any two adjacent points on a wave (e.g., the distance
between two neighboring peaks or valleys of a wave). Wavelength is denoted
by the Greek letter λ (lambda) and is often measured in meters (m), millimeters
(mm), or nanometers (nm). A wave with a long wavelength would have a lot of
space between two neighboring peaks or troughs, whereas a wave with a short
wavelength would have a narrow space between the peaks or troughs.
3
Wavelength and frequency are related to each other. For two waves traveling at
a given speed, wavelength and frequency have an inverse relationship. This
means that the greater the wavelength of a wave, the lower the frequency of
the same wave. Similarly, the smaller the wavelength of a wave, the higher the
frequency of that wave. Though the speed of a wave depends on what medium
it is passing through, we will assume that the light waves we are concerned with
travel in a vacuum with a speed of 3.00 x 108 m/s (the actual speed of light in air
is actually only slightly less than this). Using the letter c to represent the speed
of light, we can now use the following formula to calculate frequency or
wavelength (one must be given to us and we can calculate the other).
c=vλ
Where c = speed of light, v = frequency, λ = wavelength
b. Important Properties of Waves
The main properties of waves are summarized below:





Amplitude: the height of the wave, measured in meters.
Wavelength: the distance between adjacent crests, measured in meters.
Period: the time it takes for one complete wave to pass a given point,
measured in time (usually seconds).
Frequency: the number of complete waves that pass a point in one second,
measured in inverse seconds, or Hertz (Hz).
Speed: the horizontal speed of a point on a wave as it propagates, measured
in meters / second.
4
Not all of these properties are independent; some have relationships with one
another.


Period = 1 / frequency
Speed = wavelength / period = wavelength x frequency
Source: http://theory.uwinnipeg.ca/mod_tech/node120.html
Practice calculating frequency, wavelength, and period
Before we build our own wave function and practice changing the amplitude and period of the
wave, let’s first do some practice problems to help solidify our knowledge of how the different
properties of waves are related.
Note: Unless otherwise told, assume that the light waves below travel in a vacuum with a speed (c) of
3.00 x 108 m/s.
I.
Practice Problems1
1. Wavelengths are often written in nanometers (nm), where 1nm = 10 -9m. What is
the wavelength (in nm) of light with a wavelength of 4.57 x 10-7 m?
Answer: 457 nm
2. What is the wavelength of a wave that has a frequency of 7.82 x 10 14 /s?
Answer: λ = c / v = (3.00 x 108 m/s) / (7.82 x 1014/s) = 7.82 x 10-7 m = 782 nm
3. What is the frequency of a wave that has a wavelength of 302 nm?
Answer: v = c / λ = (3.00 x 108 m/s) / (302 x 10-9m) = 9.90 x 1014/s
1
Based off of Ebbing 5th ed. General Chemistry textbook.
5
4. What is the period of a wave with a frequency of 9.90 x 1014/s?
Answer: Period (T) = 1/v = 1 / 9.9 x 1014/s = 1.01 x 10-15 s
Building a Wave Function in Microsoft Excel
Note: It may be helpful to read the Excel Tutorial before beginning this section of the module.
The section of the tutorial that refers specifically to using slider bars in Microsoft Excel begins on
page 5 of the tutorial (http://kermit.beckman.uiuc.edu/ICLCS_lessons/2-Excel_Tutorial.pdf).
This following section will detail how to build a wave function in Microsoft Excel 2007.
1. Open the Microsoft Excel document called “Waves_SINE_template.”
2. We will plot a wave using the mathematical function called the SINE function. If you’ve
taken algebra with trigonometry, you know that the SINE of an angle is the ratio of the
length of the opposite side of a triangle to the length of the hypotenuse (SINE = opposite side /
hypotenuse). If we look at infinite numbers of triangles by varying the lengths of their legs, but
keeping the lengths of their hypotenuses equal to 1, we are able to visualize the SINE function.
For a visualization of the SINE function, click here. Note that for angles greater than 2π or less
than −2π, (remember π is approximately equal to 3.14159), the function simply continues to
rotate around the circle. In this way, sine becomes a periodic function with a period of 2π. A
periodic function is a function that repeats itself in regular intervals. As we learned above,
waves can be depicted by periodic functions. We will use the following formula with variables
A,B,C, and D (a definition of what each variable stands for is given in the table below):
Y=A*sin(B*x+C)+D
Variable
Definition
A
Scaling factor for amplitude
B
Period (T) = (the reciprocal
6
of frequency)
C
Phase shift (shift along the X
axis)
D
Shift along the Y axis
(vertical shift)
3. Type the formula above under the heading “Equation” in your Microsoft Excel
spreadsheet.
7
4. Now we need to come up with a range of values for X. We will make the values of X go
from zero to 2π (the period of a SINE function). Let’s choose to use increments of .05
for X. For example, our first X value would be 0, our second X value would be .05, our
third would be .1, and so on. To do this, we can type 0 in our first cell (A14) and then type the
following formula into the next cell (A15):
A15 should now read “.05.”
=A14+0.05. Press “enter.” The value in cell
8
5. Move your cursor to the very bottom of the A15 cell until it forms a thin cross. Click and
drag the cursor down the column until the values reach approximately 6.3 (close to the
value of 2π). When you release the cursor the values should be filled in increments of
.05. The bottom of your screen (the last values for X) should look like the image below:
9
6. We will now use the equation in Step 2 {Y = A*sin(B*x+C) + D} to help us calculate what
the Y values will be for each value of X. Since the formula for calculating Y also depends
on the variables A,B,C and D, let’s first fill in values for these variables. Fill in the values
for A,B,C, and D using the table below (Note: these are just arbitrary starting values for
A,B,C, and D and we will be able to play with them and change them later).
Variable
Value
A
330
B
250
C
75
D
10
10
7. We now need to focus our attention on the “Values of Y” label and type in the formula
we want to use to calculate Y. To get this to work, we will need to multiply each
variable value (A,B,C, and D) by a scaling factor of .01. This means that our new
equation looks a lot like our old equation (from Step 2), except it also has four .01’s
inserted in (one by A, one by B, one by C, and one by D). Thus, the formula looks
something like this (don’t type this into Microsoft Excel yet):
= .01 *(Value of A) * SIN {.01*(Value of B) * X + .01 * (Value of C)} + .01*(Value of D)
We want to tell Microsoft Excel where in the worksheet to find the values of A,B,C, and
D. You should have already typed the values of A,B,C and D into cells B8, B9, B10, and
B11 (respectively). We did this previously in Step 6. We also want to tell Microsoft
Excel where in the worksheet to find the values of X, starting with the value 0 for X (cell
A14). We do this by typing the following equation into cell B14 (the first value for Y):
=0.01*$B$8*SIN(0.01*$B$9*A14+0.01*$B$10)+0.01*$B$11
Note: The $ tells Microsoft Excel to use an absolute (fixed) address so that we can “fix” a cell address
and then copy it into other cells. The only cell that is NOT fixed in this formula is the cell where we have
our values of X (since we have many different values of X). For a review of absolute (fixed) addressing,
please see the Microsoft Excel Tutorial p.3.
11
12
8. Once the formula has been correctly entered into cell B14, hit enter. You should see the first
value of Y appear (Y = 2.35). Now put the cursor in the bottom right hand corner of cell B14,
click, and drag the formula down the column so that it “fills” a value of Y for every value of X you
have. This means you should stop dragging around cell B140. The last few values you get for Y
should look something like the screen below:
13
9. We are finally ready to use the slider bar (scroll bar) function in Microsoft Excel! We will insert
one slider bar for each of the four variables A,B,C, and D. The slider bars will enable us to scroll
along to change the values of A,B,C, and D and see what happens to our wave function as a
result. If you try the steps below and still need help inserting slider bars in Microsoft Excel 2007,
please see the following link: Add a scroll bar or spin button to a worksheet”. Note that in
Microsoft Excel 2007 slider bars are called “scroll bars.”
10. First you will need to enable the “Developer Tab” in Microsoft Excel 2007 (if the tab is not
already showing at the top of your spreadsheet). To do this:
a. Click on the Microsoft Office Button (circled in red below).
b. Click “Excel Options.”
c. Check “Show Developer tab in the ribbon.”
11. Once you have the “Developer Tab” showing in your Excel spreadsheet:
a. Left-click on “Insert.”
b. Under “Form Controls,” click on “Scroll Bar.”
c. Now click on cell D8 (near the value of A) to put the scroll bar in this cell (Note: the
scrollbar may appear too big, in the wrong spot, and in the wrong direction, but can be
easily adjusted.)
14
12. Once you have the scrollbar in cell D8, your screen should look like the screen below:
15
16
13. Repeat steps 10 and 11 above until you have slider bars next to the values of A,B,C, and D.
When you are finished, your screen should look something like the screen below:
17
14. Now we need to link the slider bars to their corresponding values. For example, we need to link
the slider bar next to the value of A to the value of A. To do this, right-click on the slider bar by
the value of A and then click on “Format Control.”
18
15. This should bring you to the “Control” tab of the Format Control box. Here, we need to enter a
minimum value, maximum value, incremental change value, and cell link for our wave function.
Please enter the values as shown below and link the slider bar (“cell link”) to cell B8 (for variable
A). When you are finished, click “OK” to close the Format Control box.
Current value
Leave as is
Minimum value
0
Maximum value
640
Incremental Change
.01
Page Change
Leave as is
Cell Link
B8
Note: The Format Control box only accepts whole numbers. To get around this we are adding
scaling factor (incremental change) of .01. For example, we want our maximum value to be 2π
(the period of a SINE function, which is about 6.3. We can’t enter 6.3 into the Format Control
box since we can’t enter decimals for maximum and minimum values. We can, however, enter
640 and enter an incremental change value of .01 (640 x .01 = 6.4, which is close to the value we
are looking for).
19
16. Repeat step 14 to enter Format Control box values for B,C, and D. The only thing that will vary
this time when you are filling in the values is the cell link. For B, the cell link will be B9. For C,
the cell link will be B10. Finally, for D, the cell link will be B11. When you are finished, click “OK”
to close the Format Control box.
17. Notice that you can now move the slider bars with your mouse and that the values of Y will
change. The value of the variable linked to whichever slider bar you are moving will also
change.
20
18. Now we want to graph our wave function. To do this, highlight all the values of X & Y. Then
click on the “Insert” tab at the top of your screen (next to the “Home” tab). Once you have
clicked on the “Insert” tab, click on the “Scatter Plot” icon (circled in red below).
21
19. Once the scatter plot icon is highlighted, click on the “smooth lines” graph (circled in red below).
This kind of plot will most closely resemble a wave function.
22
20. After you have clicked on the “smooth lines” graph, your screen should look similar to the
screen below:
21. Now you can move the slider bars around and watch the effects on the graph. Practice moving
each slider bar up and down and observing what happens to your wave function. Use the wave
function and graph you have created to answer the thought questions below.
23
Thought Questions:
1. Set all the slider bars to the middle. Observe what your wave looks like. Now, set the slider bar
linked to variable B almost all the way to the right (about 3/4th of the way to the right). Keep the
other slider bars in the middle. What happens to the frequency of the wave? What happens to
the wavelength?
Answer: The frequency increases. The wavelength decreases. Sample pictures are shown
below.
24
2. Set all the slider bars to the middle. Observe what your wave looks like. Now, set the slider bar
linked to variable A almost all the way to the right (about 3/4th of the way to the right). Keep the
other slider bars in the middle. What happens to the values on the Y axis? What changes when
the height of the wave changes?
Answer: The values on the Y axis increase. This means that the amplitude of the wave is
increasing. The amplitude is the height of the wave. Sample pictures are shown below.
25
26
References:
1. Ebbing, D.D. (1996) General Chemistry, 5th ed. Houghton Mifflin Company.
2. Wikipedia wave link:
http://en.wikipedia.org/wiki/Wave
3. Wikipedia electromagnetic radiation link:
http://en.wikipedia.org/wiki/Electromagnetic_radiation#Electromagnetic_spectrum
4. Wikipedia frequency link:
http://en.wikipedia.org/wiki/Frequency
27
5. Wikipedia Wavelength link:
http://en.wikipedia.org/wiki/Wavelength
6. Practice adjusting the frequency of a wave:
http://id.mind.net/~zona/mstm/physics/waves/partsOfAWave/waveParts.htm#frequen
cy
7. Properties of waves:
http://theory.uwinnipeg.ca/mod_tech/node120.html
8. About the Sine function:
http://en.wikipedia.org/wiki/Trigonometric_functions#Sine
9. Sine function animation
http://en.wikipedia.org/wiki/File:ComplexSinInATimeAxe.gif
10. Wikipedia Pi link:
http://en.wikipedia.org/wiki/Pi
11. Wikipedia periodic function link:
http://en.wikipedia.org/wiki/Periodic_function
12. Wikipedia phase shift link:
http://en.wikipedia.org/wiki/Phase_(waves)#Phase_shift
Download