# Homework Help: Making a spreadsheet

1. Oct 25, 2008

### fk378

1. The problem statement, all variables and given/known data
Make a spreadsheet with a dimensionless column marked "t" that goes from 0 to 20 in units of 0.05. Now make columns marked "c" and "s". Integrate the functions c(t) and s(t) with the properties that:

1) c(0)=1
2) s(0)=0
3) Change in c= -s*(change in t)
4) Change in s= c*(change in t)

Make a graph of c vs t and s vs t. Remind you of anything?

3. The attempt at a solution
I know it's supposed to look like cos and sin curves, but what is the formula I'm supposed to input into the cells? I tried to integrate the equations and for 3) I got c= -s*(t2-t1)
and for 4) I got s=c*(t2-t1)

But my values get more and more negative and the graphs don't look like the cos and sin curves.

Last edited: Oct 25, 2008
2. Oct 25, 2008

### alphysicist

Hi fk378,

Should this be c(0)=1?

What is the exact formula you are typing in the cells? (For example, if c and s are in columns B and C, what is the formula entered in B2 and C2?)

Is it updating correctly over all 401 rows?

3. Oct 25, 2008

### fk378

Yes, thank you. I just edited it.

It is updating, I believe. Well B2 and C2 are just the initial conditions so I have c=1, s=0 in those. In B3 I have (-C2)*(A3-A2) where time is in the A column. In C2 I have (B2)*(A3-A2).

4. Oct 25, 2008

### alphysicist

I believe that is not correct. Those values -s*(change in t) and c*(change in t) from the original problem are the changes, not the values themselves.

So for example, you have B2=1 and C2=0. What is B3? The quantity (-C2)*(A3-A2) tells you how much that the B-column function changes in going from B2 to B3 (not the value of B3 itself). So what would the formula for B3 be?

(After you finish this step, are you supposed to find ways to make it closer to a sine and cosine function?)

5. Oct 25, 2008

### fk378

Well, I mean what I did was "integrate" the original equations we were given. So for equation (3), after integrating the change in c, I just get c. Then integrating the right hand side of the equation, I get integral of (-s)*(change in t) which just yields (-s)*(t2-t1).

If that is not correct, am I just supposed to rearrange the equation and then for example for equation (3) get:
-s=(change in c)*(change in t) ??

6. Oct 25, 2008

### alphysicist

The way I read the problem, is that you use the (3) and (4) directly to give the change from one cell to the next one--you would not alter them at all, just use them as they are as part of your cell formula.

The process of adding these cells one at a time would be a type of numerical integration to get the values at t=20 (not a very accurate one, but enough to see the similarities to a sine and cosine curve). So when they talk about integrating, they mean numerical integration and are just referring to the process of adding up all of these small changes.

7. Oct 25, 2008

### fk378

Okay, I did do that now...but I still get the same problem---the values toward the end of the graph are just zero because the values keep getting more negative throughout the spreadsheet.

8. Oct 25, 2008

### fk378

Maybe it is supposed to be this way though because the second part of the question asks:

(b) Make an extended graph in the region 1.5<t<1.6 and look where the curve crosses zero. Multiply your answer by 2 and you have an estimate of pi. Why does that work?

If i do this for the cosine curve, I get 1.55. Then 1.55*2=3.1 which is approx pi. Any idea on why this would work?

9. Oct 25, 2008

### alphysicist

I'm not sure what you mean; do you mean the curves are heading downwards and never oscillate back upwards?

If you can, let me know what formulas you are using for B3,B4,C3,C4, because I am getting this: