Failure to calculate equation of time and declination of the sun

AI Thread Summary
The discussion centers on difficulties in calculating the equation of time and the declination of the sun. The user, Dwayne, reports unexpected values in his calculations, initially struggling with output discrepancies for both metrics. After implementing a degrees to radians converter, the declination results improved, but the equation of time became significantly inaccurate. Dwayne identified a mistake in converting the sun's mean longitude back to degrees, which led to further adjustments. Despite these corrections, he continues to face minor discrepancies in his results.
dwaynie
Messages
9
Reaction score
0
Calculating the equation of time and the declination of the sun

Hi,

I'm trying to calculate the equation of time and the declination of the sun in the prettiest way possible:

https://gist.github.com/1278755"

But right now I'm getting some unexpected values:

Code:
1) Failure:
test_suns_declination(TestSolarCalculations):
Expected -3.18, not -0.8773192601265396.

2) Failure:
test_equation_of_time(TestSolarCalculations):
Expected 2011-10-01 10:23:00 +0100, not 301.80925318673167.

Can anybody see what's wrong?

--Dwayne
 
Last edited by a moderator:
Astronomy news on Phys.org
Getting closer, still one month off though:

Code:
1) Failure:
test_equation_of_time(TestSolarCalculations):
Expected 2011-10-01 10:23:00 UTC, not 2011-10-28 17:02:35 UTC.

2) Failure:
test_suns_declination(TestSolarCalculations):
Expected -3.18, not 1.380604820284565.
 
When your computer calculates sine and cosine, is it calculating trig functions for an angle in radians or an angle in degrees?

(Excel, for example, has to have the angles converted into radians before calculating the sine or cosine.)
 
Cool! So I added a degrees to radians converter. But whereas my declination of the sun is getting really close, my equation of time has gotten way off by 10 months!

Code:
1) Failure:
test_equation_of_time(TestSolarCalculations):
Expected 2011-10-01 10:23:00 UTC, not 2011-01-06 01:08:11 UTC.

2) Failure:
test_suns_declination(TestSolarCalculations):
Expected -3.18, not -3.2087920449753007.

Any ideas? I hope my script remains readable.

https://gist.github.com/1278755"

Have you seen this by the way?

http://www.youtube.com/watch?v=y2R3FvS4xr4"

--Dwayne
 
Last edited by a moderator:
I realized I forgot to convert my sun's mean longitude back to degrees before calculating the equation of time. Now I'm back to being just a month off.

Code:
1) Failure:
test_equation_of_time(TestSolarCalculations):
Expected 2011-10-01 10:23:00 UTC, not 2011-10-28 10:59:31 UTC.

2) Failure:
test_suns_declination(TestSolarCalculations):
Expected -3.18, not -3.2087920449753007.

--Dwayne
 
Is a homemade radio telescope realistic? There seems to be a confluence of multiple technologies that makes the situation better than when I was a wee lad: software-defined radio (SDR), the easy availability of satellite dishes, surveillance drives, and fast CPUs. Let's take a step back - it is trivial to see the sun in radio. An old analog TV, a set of "rabbit ears" antenna, and you're good to go. Point the antenna at the sun (i.e. the ears are perpendicular to it) and there is...
This thread is dedicated to the beauty and awesomeness of our Universe. If you feel like it, please share video clips and photos (or nice animations) of space and objects in space in this thread. Your posts, clips and photos may by all means include scientific information; that does not make it less beautiful to me (n.b. the posts must of course comply with the PF guidelines, i.e. regarding science, only mainstream science is allowed, fringe/pseudoscience is not allowed). n.b. I start this...
Back
Top