This Notebook is Best Viewed at 150% Magnification.  (Menu: Format / Magnification / 150%)

Sinusoidal Functions as Mathematical Models of Periodic Events
by Henry Brink

There are many natural and man-made phenomena that are periodic and can be represented by sinusoidal functions. A few classic examples are shown above. 

	◼ The sun rises and sets every day at different times. Using sinusoids we can predict times for sunrises and 	sunsets well into the future. 
	◼ We can pinpoint the exact height of a particular car of a Ferris wheel, given the speed and length of time. 
	◼ The path of a pendulum has an amplitude and period allowing us to model its motion with sinusoids.
	◼ When a spacecraft is launched into orbit from a place north of the equator, like Cape Canaveral, Florida, it 	goes into an orbit that traces a sinusoid north and south of the equator over time.
	
There are many other potential applications for this lesson as you will see. Can you think of a few right now?

◼ This three-part lesson will illustrate:

	1. how to change the graph of a sinusoidal function by changing its equation
	2. how to write a sinusoidal equation and plot its graph to represent real-world periodic events
	and give you opportunities to
	3. solve problems related to events such as sunrises, wheels, pendulums, orbits and tides

◼ This lesson provides you the advantage of both seeing the graphs and finding the solutions mathematically.
◼ At the end of the lesson you should have a clear understanding and be able to use sinusoidal functions to model real-world situations. 
◼ A basic understanding of the graphing of trigonometric functions from our previous lessons is necessary before proceeding with this lesson.

Before you go any further, save this notebook using File/Save As and insert your initials before the existing file name. As you progress you should save your work. You can turn in your final saved version for me to check.

Click in the following cell and, while holding down the SHIFT key, hit the ENTER key. 
This simply installs the Colors package for our use. 
We will use this same SHIFT & ENTER keystroke many times to evaluate cells in this lesson.

<< "Graphics`Colors`"

Part 1
General Sinusoidal Graphs

Consider what the graph of sunrise time might look like over the course of a year. Does the sun rise earlier or later in the winter than it does in the summer? Take a look at my graph of sunrise time and see if you agree.

pl1=Plot[Sin[x],{x, 0, 2  π}, Axes -> {True, True},Ticks -> {{{π/
                        2, "WINTER"}, {3  π/2, "SUMMER"}}, 
                  None},PlotStyle -> {Blue,  Thickness[0.015]},AxesLabel -> SUNRISE TIME];

OK. Now which has an earlier sunrise, Winter or Summer? Evaluate the following cell. Do you agree?

pt1 = 
      Graphics[Text["Later in the morning", {2.1, 1}, {-1, 0}]]; 
    pt2 = Graphics[Text["Earlier in the morning", {2.5, - .9}]]; 
    Show[pl1, pt1, pt2]

To use sinusoidal functions as mathematical models for periodic phenomena, you need to be able to graph sinusoids of various Periods (not just 2π or 360°) and Amplitudes (not just 1). You also need to be able to position the graph away from the horizontal axis.

The general equation for sinusoidal functions is y = C + A cos[ B (x - D) ], where A, B, C and D are constants with the following definitions:

|A| is the Amplitude. Amplitude is a positive number, but can be measured in a negative direction. 
|B| is the number of cycles the sinusoid makes in 2π units of x. 
	So the Period, p is ((2  π)/(|B|)). For trig functions, the Period is ((360°)/(|B|)).
C is the Vertical Shift and may be positive or negative.
D is the Phase Displacement and may be positive or negative.

Let's experiment with changes in these constants to see for ourselves how the graphs change. Then we can draw some conclusions that will help us in our abilty to not only graph these functions, but to also define equations to model real-world situations in order to draw conclusions and make predictions.

OK, let's begin by manipulating Amplitude. First, evaluate the cell below which will graph the equation 
y = cos(x). Here, A = 1, B = 1, C = 0 and D = 0. It should look familiar, you've seen this graph many times before. (Also pay attention to the code changes. You will be writing some code later, in which case you may be able to simply cut and paste the pieces you need to make the desired changes.)

pl2=Plot[Cos[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Blue,  Thickness[0.005]}];

Now, let's change A and see what happens. Shall we try 3? y = 3cos(x). Can you guess what will happen?

pl3=Plot[3  Cos[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Red,  Thickness[0.005]}];

Whoops! It looks exactly the same because the scale automatically changed. Let's put them on the same axes.

Show[pl2, pl3]

Now we can see that the Amplitude increased from 1 to 3. Amplitude is the distance from the horizontal axis to either a high point or a low point. Remember, it is the absolute value of the distance.

Next, adjust the code in the following cell to define pl4 such that the amplitude remains 3, but the Period is π instead of 2π. (You can enter the symbol π by typing esc p esc). Also, make the color of the plot green. Then show all three plots on the same axes. Remember, we change the value of B to adjust the period and the formula for period is p = ((2  π)/(|B|)).

pl4=Plot[3  Cos[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Red,  Thickness[0.005]},DisplayFunction -> Identity];Show[pl2, pl3, pl4, 
        DisplayFunction -> $DisplayFunction]

Did your's look like mine? Open this group of cells, evaluate my equation, then compare our work. If your graph was different go back and double check the changes to the code and the value you used for B.

pl4=Plot[3  Cos[2  x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Green,  Thickness[0.005]},DisplayFunction -> Identity];Show[pl2, pl3, pl4, 
        DisplayFunction -> $DisplayFunction]

Now that we know how to control both Amplitude and Period, let's a take a closer look at Vertical Shift and Phase Displacement.  Do you recall the general equation of a sinusoid? Try entering it in the cell below without looking back.

To check your answer, select the remainder of the contents of this cell (after the brown text) by clicking and dragging the cursor to the end of the cell. Then use the Format menu at the top of the screen. Choose Format/Text Color/Black (or any color of your choice that will display against this background). 

The general equation for sinusoidal functions is y = C + A cos[B (x - D)], where A, B, C and D are constants with the following definitions:

|A| is the Amplitude. Amplitude is a positive number, but can be measured in a negative direction. 
|B| is the number of cycles the sinusoid makes in 2π units of x. So the Period, p is 2π / |B|. For trig functions, the Period is 360° / |B|.
C is the Vertical Shift and may be positive or negative.
D is the Phase Displacement and may be positive or negative.

OK, on to Vertical Shift.  

Consider for a moment how you might shift the graph of y = Cos (x) up by 3 units. In other words, each point must move up by 3 units. 

You probably have already figured out that you simply have to add 3 to each value. We would write this equation as: y = 3 + Cos (x).  

◼ Adjust the code in the following cell to plot y = 3 + cos x  from  x = -π/2  to  2π.  
◼ Change the color of the plot to YellowOchre. 
◼ Finally, on the same axes, display plots of  y = cos x,  y = 3 cos x  and y = 3 + cos x.

pl5=Plot[3  Cos[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Red,  Thickness[0.005]}];

Do you think you did it correctly? Check your work against mine. Open this group of cells, evaluate my equation, then compare our work.

pl5=Plot[3 + Cos[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {YellowOchre,  Thickness[0.005]},DisplayFunction -> Identity];
Show[pl2, pl3, pl5, DisplayFunction -> $DisplayFunction]

What do you conclude about Vertical Shift ?

Finally, Phase Displacement. Given what you now know about sinusoidal functions and working in Mathematica, create a plot that shows three curves with different colors representing
◼ y = sin x
◼ a sine curve with an amplitude of 2, a period of π and a vertical shift of 1.
◼ a sine curve with an amplitude of 1, a period of 2π , vertical shift of 0 and a phase displacement of π/3
◼ all three curves should span the same distance on the horizontal axis 
(Remember, you can use cut & paste to save time & reduce errors.)

Do you think you did it correctly? Check your work against mine. Open this group of cells, evaluate my equation, then compare our work.

pl6=Plot[Sin[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Black,  Thickness[0.005]}];
pl7=Plot[1 + 2  Sin[2  x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Red,  Thickness[0.005]}];
pl8=Plot[Sin[x - π/3],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Green,  Thickness[0.005]}];
Show[pl6, pl7, pl8]

How would you adjust the formula y = sin x so that the graph would be identical to y = 2 + 2 cos ( x-π/2)? (You must use sine not cosine.) 

◼ Write the equation here 

◼ Start a cell below by moving the cursor below this cell until the cursor shifts from a vertical line to a horizontal line, then click. Just start typing to create the input cell.
◼ Write the code for both plots in the new input cell and display them separately.

Answer...

pl10=Plot[2 + 2  Cos[x - π/2],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Red,  Thickness[0.005]},DisplayFunction -> Identity];
pl11=Plot[2 + 2  Sin[x],{x, -π/2, 2  π}, Axes  ->  {True, True},Ticks -> {{-π/2, 
                    0, (π/2), π, ((3 π)/2), 2 π}, 
                  Automatic},PlotStyle -> {Green,  Thickness[0.005]},DisplayFunction -> Identity];
Show[GraphicsArray[{pl10,pl11}]]

Did you pick up on the GraphicsArray command? Try using it. You can also resize the plots by dragging a corner like you would in PowerPoint.

Part 2 
Writing Sinusoidal Equations to Represent Periodic Events

Now we are ready to progress to the next step -- writing equations to describe real-world situations in which a dependent variable repeats its value at regular intervals as the independent variable changes.

Full of Hot Air?

Imagine an old fashioned bellows. (see below) These were often used to fan the flames in an oven or fireplace.  The volume of air in the bellows would vary periodically over time as one would pump it. Assuming that one was pretty consistent in their pumping rate, you could use a sine curve to represent the volume over time. As you pull the bellows open it fills with air. As you press the bellows closed, the air is forced out.

pla=Plot[Sin[x - π/2],{x, 0, 2  π}, Axes  ->  {True, True},Ticks -> None,PlotStyle->{Blue,  Thickness[0.015]},AxesLabel -> {TIME, "VOLUME OF AIR"},DisplayFunction -> Identity];pta = 
          Graphics[Text["Bellows Fully Open", {2.1, 1.1}, {-1, 0}]];
ptb = 
          Graphics[
            Text["Bellows Fully Closed", {π, -1}, {0, 0}]];
points = 
          ListPlot[{{0, -1}, {π, 1}, {2  π, -1}}, 
            PlotStyle -> {PointSize[ .02], Red}, 
            DisplayFunction -> Identity];Show[pla, pta, ptb, points, 
          DisplayFunction -> $DisplayFunction]

Around and Around and Around we go...

Let's take a look at a problem involving a Ferris wheel.

As you ride a Ferris wheel, your distance from the ground varies with time. We could assume that it would be fairly represented sinusoidally. You were almost the last to be seated. When the Ferris wheel was fully loaded and the ride started (t = 0) your seat was at some height h above the ground (which, by the way was higher than the lowest position where you got into your seat). See below.

This Ferris wheel takes 20 seconds to make one revolution. The top is 155 feet above the ground and the diameter of the wheel is 150 feet. From your starting position it takes you 8 seconds to reach the top. What is your height at the beginning ( t = 0 )? Predict your height from the ground at t = 10 seconds, 15 seconds, 18 seconds and 40 seconds. Plot a graph of this sinusoid for 0 ≤ t ≤ 40.

First we have to determine the equation for the sinusoid. The constants would be determined as follows:

A -- The amplitudeis 150/2 =  75 ft. (One-half the distance from the high point to the low point.)
B -- The period p is 20 seconds (the time for one complete revolution). |B| = 2π/p, so B = 2π/20, or π/10
C-- The vertical shift is the radius of the wheel plus it is five feet off the ground, so it is 75 + 5 =  80 ft.
D-- The phase displacement is 8 seconds for cosine 
(We are given the time it takes to reach the highest point, so we use the cosine function. Since a high point for cosine is at 0, we can simply displace the curve by 8 seconds.)
Therefore, our equation for this sinusoid is:  y = 80 + 75 cos [(π/10) (t-8) ]

f[t_] := 80 + 75 Cos[(π/10) (t - 8)]
N[Table[f[t], {t, 0, 10}]]

f[t_] := 80 + 75 Cos[(π/10) (t - 8)]
N[Table[f[t], {t, 15, 18}]]

f[t_] := 80 + 75 Cos[(π/10) (t - 8)]
N[Table[f[t], {t, 18, 40}]]

The heights from the ground at t = 0 seconds, 10 seconds, 15 seconds, 18 seconds and 40 seconds would be: 19.3237 feet, 140.676 feet, 35.9161 feet, 5 feet (lowest point) and 19.3237 feet (back to the starting height after two complete revolutions).

wpa=Plot[80 + 75  Cos[π/10 (t - 8)],{t, 0, 40},Axes  ->  {True, True},AxesLabel -> {"TIME(seconds)", "HEIGHT ABOVE \
GROUND(feet)"},AxesOrigin -> {0, 80},PlotStyle->{Blue,  Thickness[0.0075]},DisplayFunction -> Identity];
wta = 
          Graphics[Text["Starting Point", {0.5, 20},  {-1, 0}]];
wtb = Graphics[Text["Highest Point", {14, 155}, {0, 0}]]; 
      wtc = Graphics[
          Text["One Complete Period", {20.5, 20}, {-1, 0}]];
points = 
        ListPlot[{{0, 19.3}, {8, 155}, {20, 19.3}}, 
          PlotStyle -> {PointSize[ .02], Red}, 
          DisplayFunction -> Identity]
Show[wpa, wta, wtb, wtc, points, 
          DisplayFunction -> $DisplayFunction];

Dirt Cheap!

Combining our Mathematica skills with our new knowledge of sinusoidal functions, we can now write programs that will help us solve some real-world problems with ease.

Consider this situation for example:

Suppose you work for a mining company that has found a rock formation that looks promising for mining gold. The claim is a strip of land one mile in length from West to East and 1/4 mile wide from North to South. The surface of the claim area is essentially flat since it is a dried seabed. The diagram below shows some typical rock and soil formations that might exist below the surface.

Your job is to determine the shape and depth of the gold ore formation so you can estimate the amount of overburden* that must be removed to gain access to the ore. Then, you need to make a recommendation to management on whether or not to develop the mine. The company relies on your estimate of overburden removal costs and your recommendation on the economic sensibility of mining the deposit. 
(*overburden is the undesireable soils and rocks lying on top of the ore of interest)

The exploration team provides you raw data on depth readings from the surface to the gold ore. They took readings on a specified grid moving west to east ascross the claim. This data was obtained from sonic readings to save money and time. The sonic readings are taken from the surface without any drilling, so the work can be completed faster and at lower cost. The downside is that the readings are not as accurate as drilling cores. However, you have learned from experience that your ability to map the shape of the deposit and the amount of overburden is improved by the greater number of readings that you get by the sonic method versus the fewer but more accurate drilling cores. 

The exploration team follows company procedures, and has already simplified the data to two coordinates instead of three because they have determined that the formation is essentially the same in the north-south direction. This often holds true due to the massive size of these rock formations. The data is reported in units of feet, as {distance from west border, depth}.

Step 1. You are to:
◼ Plot the data points and determine the shape of the deposit. (Flat, sloped, ridged, sinusoidal, random, etc.) 
◼ Does the data appear to conform to a sinusoidal function?
◼ If so, estimate the coefficients: A, B, C and D from the data plot, and
◼ Write an equation to model the shape of the deposit.
◼ Overlay your plot on the data plot. Is it a reasonable fit?
◼ Is it obvious where you would begin mining? Where is the overburden the greatest?

minedata contained in this cell- no need to open unless you're just curious!

f[n_] := -5 Random[Real, {0, 2}] - 
          10 (3 + 
                2 Cos[((π n)/2640)]);
minedata = Table[{n, N[f[n]]}, {n, 0, 5280, 10}]

ANSWERS in Blue Background Cells

minedataplot = 
      ListPlot[minedata,  AxesOrigin -> {0, -10}]

A = Amplitude = 40/2 = 20
B = 2π/Period = 2π/5280 =π/2640
C = Vertical Shift = -35
D= Phase Displacement = 2640
general equation for a sinusoid  y = C + A cos[ B (x - D) ],
y=-35+20Cos[(π/2640 )(x-2640)]

estplot = 
      Plot[-35 + 20  Cos[(π/2640 ) (x - 2640)], {x, 0, 
          5280},  PlotStyle -> {Red, Thickness[0.0075]},  
        AxesOrigin -> {0, -35} ]

Show[minedataplot, estplot, 
      AxesOrigin -> {0, -35} ]

A Great Fit!

Step 2.

Now you need to make a recommendation to management on whether to invest in uncovering the ore, but you need more information.

A. The engineers have told you that the cost of removal for overburden is $100,000 per 1,000,000 cubic feet, or $0.10/cubic foot.
B. You know the area of the claim and you now have a function to predict the depth of the ore based on the east-west position in the claim area. 
C. Your site manager just informed you that based on the quality of the ore, the company must be able to access all of the ore for a cost of $5 million or less in order to make the operation a financial success.
D. Based on the massive size of the strip-mining equipment, the initial cut must be at least 100 feet wide to allow room to maneuver the machinery. The equipment itself makes 20 foot wide cuts.

◼ Look at the plot again. It is pretty obvious the you should start stripping overburden in the N-S orientation (across the 1/4 mile width of the claim of land) at the half-way point relative to the E-W orientation. You could reasonably plan to start in the middle and work outward, gaining the lowest cost access to the ore first. Then you have to estimate the volume of overburden that would have to be removed and the cost to do so.

To assist you in making this estimate the mining engineers have helped you make another assumption:

◼ Looking at the curve of the deposit as you move away from the center, it seems reasonable for estimation purposes to assume that over each 20 foot increment, that you have essentially a flat, level line (since compared to a mile, 20 feet is pretty small). Take a look at the data they developed with the "depths" function below. Counting out 1000 feet from center you'll see that the depth changes only about 6 inches over a 20 foot wide cut at the steepest part of the curve. 
Another way of looking at it would be to take the difference in depth from the deepest to the shallowest (55-15=40ft) and divide by the distance covered (2640ft). You'll see that the drop averages 3.6 inches for every 20 feet of distance.

So, doesn't the mining engineers' assumption seem reasonable?

depths = 
      Abs[N[Table[-35 + 20  Cos[(π/2640 ) (x - 2640)], {x, 
              2640, 3640, 20}]]]

Write a program that will:
◼ estimate the total volume of overburden 
◼ estimate the total cost of overburden removal
◼ make a recommendation on whether or not to develop the mine.

ANSWERS in Blue Background Cells

Program to Determine Economic Viability of Prospective Gold Mine 
 deposit shape approximates sinusoid, with even distribution of ore. 
Units = feet and $

Amplitude = a
2π/Period =  b
Vertical shift = c
Phase displacement = d
Excavation cost ($/cubic foot) = e
Estimated value of ore deposit = v
Length of area = l
Width of area = w
Maximum economical excavation cost = m, written as percentage of v

Clear[a, b, c, d, e, f, g,  l, m, n, v, w, 
        x];

inputs follow  -  
        change values as needed;

a = 20;
b =  π/2640;
c = -35;
d = 2640;
e = 0.1;
l = 5280;
w = 1320;
v = 600000000;
m = 5.0;

f[x_] := 
        N[Abs[c + a*Cos[(b )*(x - d)]]]* (20*
              w);
"basically this  gives us a depth reading times the width of a cut \
times the width of the claim - in other words the volume of a cut of unknown \
depth";

"Total Overburden Volume, cubic feet"  
obv = Sum[f[n], {n, 1, l, 20}] 
"This function takes a depth every 20 feet, calculates the volume, \
and adds them all up giving us the total volume";

"Total Overburden Removal Cost, $"  
obc = obv*e
\(\("this calculates the volume times the cost per unit volume";\)
\)
"Overburden Percentage"
op = 100*obc/v  
"this reports the overburden removal cost as a percentage of the \
value of the ore";

"RECOMMENDATION"
If[op  ≤  m,  
      StyleForm["PROCEED TO DEVELOP MINE", 
        FontFamily -> "Ariel", FontSize -> 14, 
        FontWeight -> "Bold", FontColor -> ForestGreen],  
      StyleForm["STOP - Do Not Develop Mine", 
        FontFamily -> "Ariel", FontSize -> 14, 
        FontWeight -> "Bold", 
        FontColor -> Red]]

Now you should be ready to solve some problems on your own !

Part 3
Problems

A Stone in Your Tire!

As you stop at a traffic light, a stone becomes wedged in your tire tread. As you drive, the height of the stone varies as the wheel turns. Assume that your tires are over-inflated and that they do not flatten out at all against the road surface. The diameter of the tire is 24 inches.

1. Could this situation be represented by a sinusoidal function?
2. How high is the high point?
3. Should you use sine or cosine?
4. What is the period?
5. What are the values of each of the constants: A, B, C, D?
6. Write the equation for this function.
7. Plot it and dress up the plot with labels and color.

Now, let's say you get really tired of hearing that incessant clicking sound with every tire revolution. So, you decide to stop the car and dig out the stone with your key. You step out and look for the stone, but can't find it. !@#$%!! It must be on the very bottom of the tire. You're on your way to a job interview and you have on nice clothes so you don't want to have to kneel down. You'll have to get back in and move the car to get at the stone. You determine that the stone needs to be 15 inches off the pavement for you to be able to get at it without getting dirty. How far will you have to move the car?

ANSWERS in Blue Background Cells

ANSWERS
1. Could this situation be represented by a sinusoidal function? Yes
2. How high is the high point? 24 inches
3. Should you use sine or cosine? Cosine
4. What is the period? the circumference, which = π D, or 24π
5. What are the names and values of each of the constants: A, B, C, D?
A = Amplitude = 24/2 = 12
B = 2π/Period = 2π/24π = 1/12
C = Vertical Shift = 24/2 = 12
D= Phase Displacement = π
6. Write the equation for this function. We could write the equation as:
y = 12 + 12 Cos[(1/12)(x-12π)] = 12 + 12 Cos[(x/12) - π] , but this can be simplified further to 
y = 12 - 12 Cos[x/12] , because Cos[(x/12) - π] = (Cos[x/12] )(Cos[-π]) = (Cos[x/12] )(-1) = -Cos[x/12] 
It is simply cleaner to write the function without displacement if possible.
7. Plot it, dress up the plot with labels and color and resize it appropriately. See below
8. How far will you have to move the car to get the stone 15 inches off the ground? 
Set y = 15 and solve for x. You could move forward or backward by about 22 inches. See below.

stonepl=Plot[12 + 12  Cos[(1/12) (x - 12  π)],{x, 0, 24  π},Axes  ->  {True, True},AxesLabel -> {"Distance(inches)", "HEIGHT ABOVE \
GROUND(inches)"},AxesOrigin -> {0, 12},PlotStyle->{Blue,  Thickness[0.0075]},DisplayFunction -> Identity];
sta = 
          Graphics[
            Text["Stone Caught in Tread", {5, 0},  {-1, 0}]];
stb = 
        Graphics[Text["Highest Point", {12  π, 25}, {0, 0}]]; 
      stc = Graphics[
          Text["One Complete Revolution", {18  π, 0}, {0, 0}]];
points = 
        ListPlot[{{0, 0}, {12  π, 24}, {24  π, 0}}, 
          PlotStyle -> {PointSize[ .02], Red}, 
          DisplayFunction -> Identity]
Show[stonepl, sta, stb, stc, points, 
          DisplayFunction -> $DisplayFunction];

NSolve[12 - 12  Cos[x/12] - 15 == 0, x]

Spaceship in Orbit

When a spaceship is launched into obit from Cape Canaveral, Florida it goes into an orbit alternating north and south of the equator. The distance from the equator over time can be approximated by a sinusoidal curve.

Assumptions:
◼ Ten minutes after lift-off the spaceship reaches its northernmost point at 4000 kilometers north of the equator.
◼ Half a cycle later (halfway around the world) it reaches its southernmost point at 4000 kilometers south of the equator.
◼ The spaceship completes an orbit in 90 minutes
◼ Let y = the number of kilometers north of the equator that the spaceship is.
◼ Let t = the number of minutes since lift-off

1. Write the equation for a sinusoidal function approximating the spaceship's route.
2. Plot the function showing one complete cycle.
3. Predict how far from the equator the spaceship would be when t = 25, 41, 163 minutes
4. What is the approximate distance from Cape Canaveral to the equator?
5. When does the spaceship cross the equator for the first time?

ANSWERS in Blue Background Cells

ANSWERS:
1. Write the equation for a sinusoidal function approximating the spaceship's route.
A = 4000 kilometers
B = 2π/p = π/45
C = 0
D = 10
y = 4000 Cos[ (π/45) (t-10) ]
2. Plot the function showing one complete cycle. See Below
3. Predict about how far from the equator the spaceship would be when t = 25, 41, 163 minutes 
t=25, y= 2000 son, 2000 kilometers above
t=41, y= -2237 so, 2237 kilometers below
t=163, y= -1236 so, 1236 kilometers below
See Calcs Below
4. What is the approximate distance from Cape Canaveral to the equator?
Set t=0. y= 3064 kilometers. See Calcs Below
5. When does the spaceship cross the equator for the first time?
Set y=0. t = about 32.5 minutes. See Calcs Below

sspl=Plot[4000  Cos[(π/45) (t - 10)],{t, 0, 90},Axes  ->  {True, True},AxesLabel -> {"TIME (minutes)", "DISTANCE FROM \
EQUATOR(kilometers)"},AxesOrigin -> {0, 0},PlotStyle->{Blue,  Thickness[0.0075]},DisplayFunction -> Identity];
ssa = 
          Graphics[Text["Liftoff", {1, 3000},  {-1, 0}]];
ssb = 
        Graphics[Text["Northernmost Point", {15, 4000}, {-1, 0}]]; 
      ssc = Graphics[
          Text["Southernmost Point", {60, -4000}, {-1, 0}]];
ssd = 
        Graphics[
          Text["Cross Equator", {32, 200}, {-1, 
              0}]];
points = 
        ListPlot[{{0, 3064}, {10, 4000}, {55, -4000}, {32.5, 0}}, 
          PlotStyle -> {PointSize[ .02], Red}, 
          DisplayFunction -> Identity]
Show[sspl, ssa, ssb, ssc, ssd, points, 
          DisplayFunction -> $DisplayFunction];

N[Table[
        4000  Cos[(π/45) (t - 10)], {t, 25,  41}]]

N[Table[
        4000  Cos[(π/45) (t - 10)], {t, 160,  163}]]

NSolve[4000  Cos[(π/45) (t - 10)] == 0, t]

Mine Your Own Business!

Let's take another look at the mining problem. We came up with a handy dandy computer model to help us determine whether or not to develop a mine. Of course, the model only works if the distribution of ore fits a sinusoidal function. Furthermore, all of our inputs were estimates. Even when we take measurements there is some degree of error involved.

For this exercise, through trial and error, you will: 
◼ Evaluate the sensitivity of the recommendation to changes in e and v , leaving the sinusoid and the area of the claim intact.
1. how much can each of the factors change, ALL ELSE CONSTANT, without getting a different recommendation?
2. which factor is the recommendation most sensitive to?

◼ How sensitive is the recommendation to changes in the sinusoid, keeping the other factors intact?
1. how much each of the factors can change without getting a different recommendation?
2. which factor is the recommendation most sensitive to?

Program to Determine Economic Viability of Prospective Gold Mine 
 deposit shape approximates sinusoid, with even distribution of ore. 
Units = feet and $

Amplitude = a
2π/Period =  b
Vertical shift = c
Phase displacement = d
Excavation cost ($/cubic foot) = e
Estimated value of ore deposit = v
Length of area = l
Width of area = w
Maximum economical excavation cost = m, written as percentage of v

Clear[a, b, c, d, e, f, g,  l, m, n, v, w, 
        x];
inputs follow  -  
        change values as needed;
a = 20;
b =  π/2640;
c = -35;
d = 2640;
e = 0.1;
l = 5280;
w = 1320;
v = 600000000;
m = 5.0;
f[x_] := 
        N[Abs[c + a*Cos[(b )*(x - d)]]]* (20*
              w);
"Total Overburden Volume, cubic feet"  
obv = Sum[f[n], {n, 1, l, 20}] 
"Total Overburden Removal Cost, $"  
obc = obv*e
"Overburden Percentage"
op = 100*obc/v  
"RECOMMENDATION"
If[op  ≤  m,  
      StyleForm["PROCEED TO DEVELOP MINE", 
        FontFamily -> "Ariel", FontSize -> 14, 
        FontWeight -> "Bold", FontColor -> ForestGreen],  
      StyleForm["STOP - Do Not Develop Mine", 
        FontFamily -> "Ariel", FontSize -> 14, 
        FontWeight -> "Bold", 
        FontColor -> Red]]

Amplitude=a  from 20 to 56.35 a 182% increase
2π/Period=b  can't seem to make recommendation change to Stop by changing b ... Hmmmm! More on that next semester.
Vertical shift=c   from -35 to -43. It seems pretty sensitive to this
Phase displacement=d    can't seem to make recommendation change to Stop by changing b ... Hmmmm! More on that next semester.
Excavation cost ($/cubic foot)=e    from 0.1 to 0.123 a 23% change
Estimated value of ore deposit=v    from 600,000,000 to 488,000,000 a 18.7% change
Length of area=l   Constant
Width of area=w   Constant
Maximum economical excavation cost=m, written as percentage of v

Use this to play around visually...

estplot = 
      Plot[-35 + 20  Cos[(π/2640 ) (x - 2640)], {x, 0, 
          5280},  PlotStyle -> {Red, Thickness[0.0075]},  
        AxesOrigin -> {0, -35} ]

Conclusions - 
The really critical factors are:
◼ the Vertical Shift (c), 
◼ the estimated value of the ore and 
◼ the estimated excavation costs. 
Errors in estimating these factors could easily make or break the project. Interestingly, we could make a lot of errors on the shape of the sinusoid , especially its period and phase displacement without affecting the profitability.

CONGRATULATIONS !!
You have just completed the unit on Sinusoids