Date: Thu, 22 Nov 2007 19:49:34 -0500 Subject: Re: EoT on Fred's Calendar (fwd) Walter, Regarding the spreadsheet: I just repeated the formula lines enough times for you to get the idea. You can make what's there work for any date you like by simply changing the starting date up at the top of the sheet (that's the starting date, not the epoch date). You can also copy/paste the body of the spreadsheet if you'd like to have a larger expanse of data available at the same time. The information he supplied really differed only in how d (the number of days' offset from the epoch) was calculated. In one, he had a giant case statement that added days for each month based on the number of days in the month. The generic version simply relied on you to calculate d before starting. I went with the latter approach, since Excel makes it so easy to do math on dates. In this case, I calculate d by simply subtracting the date in question from the epoch date and then adding 1 (since in his calculation the epoch date takes the value of 1 and not 0). Once we have a value for d, the remaining columns in the spreadsheet are designed to follow the step-by-step formula that he provided exactly; you can highlight one, look at the formula line, and get a picture of what's going on. If all else fails, you might send him the Excel sheet and ask him if he sees a reason why the calculation isn't returning the exact expected values for the EoT. The only area where I've been able to spot any difference is that we used a different approximation for pi. The one I'm using is built in to Excel and is a little bit more precise. But even substituting his version won't result in a significant change in the calculated EoT values. My guess is that the trig functions he referred to in another message are the hyperbolic (sinh, cosh, ...) functions that aren't available in every programming environment. The only functions used here, though, are the basic sine and cosine functions. Phil On Nov 22, 2007, at 2:53 PM, Walter Sanford wrote: > On Mon, 19 Nov 2007, Phil Wherry wrote: > > > Here's an Excel spreadsheet that I set up using this calculation. It > > produces results close to - but not exactly the same as - the example he > > gives. I've double-checked the formulas and don't see any obvious error. > > I'm using an approximation of pi with more precision, but even > > substituting the less-precise version included in the code won't yield > > 3.514 minutes for the example (11-Sep-04) that he gives; I'm > > consistently getting about 3.314 minutes. > > Phil > > I just had an opportunity to look at the spreadsheet you prepared for me. > A couple of follow-up questions and a comment: > > 1. I expected the spreadsheet to feature EoT data for the entire year; it > doesn't. (It shows data from 11 Sep 2004 to 23 Oct 2004.) Do you know how > I could tweak the input to get output for an entire year, e.g., 2008? > > 2. Bob mentioned two formulas... > > "I have both a "to date" accurate EoT equation and a generic 'for any > year' EoT." > > Did he in fact provide both formulas? > > Comment: In one of Bob's messages, I noticed the following comment... > > "And here are trig functions that might be missing from your normal > set" > > I'm wondering whether you used those functions in your spreadheet. If not, > then would that explain the discrepency between Bob's example output and > the output of your spreadheet? > > ================================================================= > Walter Sanford, Director Carl Sandburg Middle School > Center for Sky Awareness 8428 Fort Hunt Road > Sandburg Planetarium Alexandria, VA 22308 > Fairfax County Public Schools Work: 703-799-6169 -6197 (fax) > E-mail: wsanford@wsanford.com Home: 703-765-9392 > AMS Project ATMOSPHERE Atmospheric Education Resource Agent & > Water in the Earth System (WES) Resource Teacher > SCSA, Geosystems, & Camp T-Equity - URL: http://www.wsanford.com/ > =================================================================