Make a Spreadsheet for Homework: Cos & Sin Graphs

  • Thread starter Thread starter fk378
  • Start date Start date
Click For Summary

Homework Help Overview

The discussion revolves around creating a spreadsheet to model the cosine and sine functions through numerical integration. Participants are tasked with generating columns for "c" and "s" based on specific initial conditions and change equations. The goal is to visualize these functions over a defined range of "t".

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss the setup of the spreadsheet, questioning the initial conditions and the formulas used for calculating changes in "c" and "s". There is an exploration of how to correctly implement numerical integration in the spreadsheet cells.

Discussion Status

Some participants have provided guidance on how to set up the formulas, while others express confusion about the behavior of the values in the spreadsheet, particularly regarding the expected oscillation of the cosine and sine curves. There is an ongoing exploration of the implications of the results and the relationship to estimating pi.

Contextual Notes

Participants are working under the constraints of homework rules, which may limit the information they can use or the methods they can apply. There is also a focus on understanding the numerical integration process rather than deriving analytical solutions.

fk378
Messages
366
Reaction score
0

Homework Statement


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?

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:
Physics news on Phys.org
Hi fk378,

fk378 said:

Homework Statement


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)=0

Should this be 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?


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)

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?
 
alphysicist said:
Should this be c(0)=1?
Yes, thank you. I just edited it.

alphysicist said:
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?

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).
 
fk378 said:
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).

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?)
 
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) ??
 
fk378 said:
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) ??

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.
 
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.
 
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?
 
fk378 said:
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.

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:

http://img263.imageshack.us/img263/1183/spreadsheetfe9.jpg

The curves are getting larger with time because the approach here is not very careful; are you getting something very different? If so, can you upload a picture, or describe it more fully?

fk378 said:
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?

The curve you are looking at there is supposed to be similar to the cosine function. At what (first) value of t does cos(t)=0? (in radians, of course)
 
Last edited by a moderator:

Similar threads

Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
46
Views
7K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
11
Views
2K
Replies
1
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K