Showing posts with label sun. Show all posts
Showing posts with label sun. Show all posts

Sunday, October 21, 2018

HP 11C (and Emulators): Sun's Approximate Declination, Altitude, and Azimuth

HP 11C (and Emulators):  Sun's Approximate Declination, Altitude, and Azimuth

Introduction

The following program calculates three positions for our Sun in our Solar System:

1.  Declination of the Sun (δ = 0° at the Equinoxes)
2.  Altitude of the Sun (height of the sun)
3.  Azimuth of the Sun (degree from latitude ground-wise north)
 
Formulas Used:

Inputs:
D = days after the vernal equinox (usually March 20 or March 21)
L = latitude given in D.MMSS format (avoid ±90°)
T = time before solar noon (12 PM).  Example: 9 AM, T= 3.  3 PM, T = -3.

Declination:
δ = 23.45 * sin(D * 0.9856)

Altitude:
H = asin(cos L * cos D * cos(15 * T)) + sin L * sin D)

Azimuth:
A = acos((sin H * sin L - sin D) / (cos L * cos H))

Before running the program, store D in R1, L in R2, and T in R3.

HP 11C Program: Sun Declination, Altitude, Azimuth

001 42, 21, 13 LBL C
002 43, 7 DEG
003 45, 1 RCL 1
004 48 .
005 9 9
006 8 8
007 5 5
008 6 6
009 20 ×
010 23 SIN
011 2 2
012 3 3
013 48 .
014 4 4
015 5 5
016 20 ×
017 44, 4 STO 4
018 31 R/S
019 24 COS
020 45, 2 RCL 2
021 43, 2 →H
022 24 COS
023 20 ×
024 45, 3 RCL 3
025 1 1
026 5 5
027 20 ×
028 24 COS
029 20 ×
030 45, 2 RCL 2
031 43, 2 →H
032 23 SIN
033 45, 4 RCL 4
034 23 SIN
035 20 ×
036 40 +
037 43, 23 ASIN
038 44, 5 STO 5
039 31 R/S
040 23 SIN
041 45, 2 RCL 2
042 43, 2 →H
043 23 SIN
044 20 ×
045 45, 4 RCL 4
046 23 SIN
047 30 -
048 45, 2 RCL 2
049 43, 2 →H
050 24 COS
051 45, 5 RCL 5
052 24 COS
053 20 ×
054 10 ÷
055 43, 24 ACOS
056 44, 6 STO 6
057 43,32 RTN


Example 1:
Stored Data: 
R0 = 184 (approximately September 21),
R1 = -14° 50' 12" (entered as -14.5012)
R2 = 0 (noon)

Output:
δ ≈ 13.1576°
H ≈ 62.0058°
A = 180.0000°

Example 2:
Stored Data: 
R0 = 68 
R1 = 46°
R2 = 4 (8 AM)

Output:
δ ≈ 21.5892°
H ≈ 35.9899°
A ≈ 84.4083°

Sources:

Hewlett Packard.  "Sun Altitude, Azimuth, Solar Pond Absorption", HP 67/97 Energy Conservation December 1978.
Shore, Edward.  "HP 35S: Sun Altitude, Azimuth, Solar Pond Absorption"  Eddie's Math and Calculator Blog:  http://edspi31415.blogspot.com/2013/06/hp-35s-sun-altitude-azimuth-solar-pond.html  June 7, 2013

Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Sunday, June 5, 2016

Quick Approximation Formulas: Position of the Sun, Phase of the Moon

Quick Approximation Formulas: Position of the Sun, Phase of the Moon

 Caution:  The formulas for the position for the Sun and Moon are quick but approximate!  This is good for a fast, ballpark answer.  If you want precise data, make sure to use precise calculations or visit Wolfram Alpha or an astronomy website.  The formulas presented in today’s blog only measure longitude (right ascension), latitude (declination) is not included.

Quick Sun Formula

To approximate where the sun is:

S ≈ 360/365.25 * n ≈ 0.985626283 * n

Where n is the number of days from the last vernal equinox.  This date varies between March 19 to March 21 year to year.  It also depends on your location on Earth, so for most accurate results, check when is the last (or next) vernal equinox in your area.

For us living on the Pacific Time Zone, the vernal equinox occurred on March 19, 2016, 9:30 PM. [*]  At the time, we were in daylight savings time, hence the difference between the Pacific Time Zone and Universal time is 7 hours.  In terms of Universal Time, the vernal equinox occurred on March 20, 2016, 4:30 AM. 

To check which constellation the sun is in front of, first we have to take the rate of precession into account. 

Rate of Precession

The rate of precession of the equinoxes is estimated.  One estimated equation of longitude (right ascension) is:

(I)
P = 5028.79695*t  + 1.1054348*t^2 – 0.00007964*t^3 + 0.000170663*t^4 – (5.6 * 10^-8)*t^5
[Captiatne et al, Eqn 39]

The equation is a basic IAU (International Astronomical Union) expression for precession, after adjustments for obliquity of the equator on the moving elliptic and other linear corrections, The coefficients are in terms of arcseconds.  1 degree had 3600 arcseconds   The term t is in terms of Julian Century, which consist of 36,525 days. 

If we want to express P in terms of years (Y), we need to make the substitution Y = t/100 and (I) becomes:

(II)
P = 50.2879695*Y  + 0.000110543*Y^2 – (7.964*10^-11)*Y^3 + (1.70663*10^-12)*Y^4 – (5.6 * 10^-18)*Y^5

Note that the P is still expressed in arcseconds.  To express dP/dY in terms of degrees, divide each coefficient by 3600.  As a result, (II) is now:

(III)
Pd = 0.01396888*Y + (3.070638889*10^-7)*Y^2 – (2.212222222*10^-14)*Y^3 + (4.740638889 * 10^-16)*Y^4 – (1.555555556*10^-21)*Y^5

I’ll label (III) this as Pd to distinguish this from P which are represented in degrees and arcseconds, respectively.  This the amount of longitude (right ascension) that occurs in degrees in terms of Julian years (365.25 years).

If we want an approximate year or do a year accounting, we can approximate the rate as:

(IV)
Rate of Precession ≈ 0.0139691871 degrees/year 

Using this approximation, it takes about 71.586 years (around 71 years, 7 months, 2 days) for the vernal equinox to move a full degree.  Pretty much a single human lifetime.

It doesn’t seem much, but taking centuries and millennia into account, this can have an effect on where the zodiac constellations are. 

Determine the Zodiac Constellation where the Sun appears

The following are the range of constellations where the sun appears for 2016, 2017, and 2018.  2016 is from EarthSky and the 2017 and 2018 entries are calculated.  All results are rounded to 3 decimal places (degrees). 

Note: This is for constellations in astronomy (not astrology).  The amounts in degrees. 

Constellation
2016
2017
2018
Sagittarius
266.55-299.67
266.564-299.693
266.578-299.707
Capricornus
299.68-327.84
299.694-327.863
299.708-327.877
Aquarius
327.85-351.53
327.864-351.553
327.878-351.567
Pisces
351.54-360.00;
0.00-29.04
351.554-360.000;
0.000-29.063
351.568-360.000;
0.000-29.077
Aries
29.05 – 53.42
29.064- 53.443
29.078-53.457
Taurus
53.43 – 90.39
53.444-90.413
53.458-90.427
Gemini
90.40 – 118.21
90.414-118.233
90.428-118.247
Cancer
118.22 – 138.14
118.234-138.163
118.248-138.177
Leo
138.15 – 174.11
138.164-174.133
138.178-174.147
Virgo
174.12 – 217.76
174.134-217.783
174.148-217.797
Libra
217.77 – 241.10
217.784-241.123
217.798-241.137
Scorpius
241.11 – 247.99
241.124-248.013
241.138-248.027
Ophiuchus*
248.00 – 266.563
248.014-266.577
248.028-266.592

Currently, the sun is the constellation Sagittarius on New Year’s Day (January 1).  The sun is about 279° to 281° longitude around New Year.


FYI: Western (tropical) astrology uses the calendar that dates back to the Age of Aries. Where S = 0° is designated as the sign of Aries.  Each sign is 30° apart.  The examples in this blog entry work with the astronomical constellations, not astrological signs. 

The following table shows the constellations as they are positioned in 2016 versus the western astrological zodiac.  Notice how far off astrology is! 

Astronomy in 2016 vs. Western Astrology (amounts are in degrees)
Constellation
2016
Western Astrology
Sagittarius
266.55-299.67
26.55-30.00 Sagittarius
0.00-29.67 Capricorn (270°)
Capricornus
299.68-327.84
29.68 – 30.00 Capricorn
0.00 – 27.84 Aquarius (300°)
Aquarius
327.85-351.53
27.85 – 30.00 Aquarius
0.00 – 21.53 Pisces (330°)
Pisces
351.54-360.00;
0.00-29.04
21.54 – 30.00 Pisces
0.00 – 29.04  Aries  (0°)
Aries
29.05 – 53.42
29.05 – 30.00 Aries
0.00 – 23.42 Taurus (30°)
Taurus
53.43 – 90.39
23.43 – 30.00 Taurus
0.00 – 30.00 Gemini (60°)
0.00 – 0.39 Cancer (90°)
Gemini
90.40 – 118.21
0.40 – 28.21 Cancer
Cancer
118.22 – 138.14
28.22 – 30.00 Cancer
0.00 – 18.14 Leo (120°)
Leo
138.15 – 174.11
18.15 – 30.00 Leo
0.00 – 24.11 Virgo (150°)
Virgo
174.12 – 217.76
24.12 – 30.00 Virgo
0.00 – 30.00 Libra (180°)
0.00 – 7.76 Scorpio (210°)
Libra
217.77 – 241.10
7.77 – 30.00 Scorpio
0.00 – 1.10 Sagittarius (240°)
Scorpius
241.11 – 247.99
1.11 – 7.99 Sagittarius
Ophiuchus
248.00 – 266.54
8.00 – 26.54 Sagittarius



Examples

Example 1:
June 6, 2016 and I live in the Pacific Time Zone.  For us, the Vernal Equinox occurred on March 19.  Hence n = 79. 

S ≈ 360/365.25 * 79 ≈ 77.86447°.  Hence, the sun is in the constellation Taurus. 


Example 2: 
It is 2017 and the sun about 276° longitude.  The vernal equinox occurs on March 20.  About what day is it?  Hence S = 276.

276 = 360/365.25 * n  leads to n ≈ 280.025 (280 days from the vernal equinox)

We would be 280 days from the vernal equinox.  This would be December 25, 2017.  The sun would be in front of the constellation Sagittarius.

Remember that this is an approximation. 

Quick Phase of the Moon

The following formula describes the approximate elongation of the moon:

M ≈ (360/29.5 * d) ≈ (12.20338983 * d)

M is given a range of 0° to 360°.  Should M exceed 360°, subtract successive multiples of 360° until M is in the 0° to 360° range.  In other words, M = (360/29.5 * d) MOD 360

Where d = number of days from the last New Moon.

Elongation is the longitudinal “distance” between the sun and the moon. 

Elongation
Comments
M is about 0°.  (or 360°)
New Moon.  The moon is about in the same constellation the sun is.
M is about 90°.
1st Quarter.  The moon is approximately 90° away from the sun.
M is about 180°.
Full Moon.  The moon is approximately 180° away from the sun.
M is about 270°.
3rd Quarter.  The moon is approximately 270° from the sun.

For 0° < M < 180°, the Moon is waxing.  For 180° < M < 360°, the Moon is waning.


Example:

It is June 5, 2016 in the Pacific Time Zone, 79 days from the last Vernal Equinox.  (n = 79)  The New Moon is on June 5, 2016.  Approximately, when are the next 1st Quarter, Full Moon, and 3rd Quarter moons?

1st Quarter:
90 = 360/29.5 * d
7.375 = d 

About 7 days – hence the 1st quarter occurs approximately on June 12, 2016. 

Full Moon:
180 = 360/29.5 * d
14.75 = d

About 15 days – the Full Moon is on June 20.

3rd Quarter:
270 = 360/29.5 * d
22.125 = d

About 22 days – the 3rd Quarter Moon would be on June 27.

Next New Moon

About 29.5 days or 30 days – the next New Moon would be on July 4. 

Summary

Approximate Longitude of the Sun:  S = 360/365.25*n, n is the number of days from the Vernal Equinox

Approximate Phase of the Moon:  M = 360/29.5*d, d is the number of days from the last known New Moon


Eddie

Sources:

Quick Sun Formula:

“Solstices & Equinoxes for Los Angeles (Surrounding 10 Years)” timeandate.com  http://www.timeanddate.com/calendar/seasons.html  (my laptop was located in Azusa, CA)  Retrieved June 5, 2016

Rate of Precession Section:

N. Capitaine, P.T. Wallace, and J. Chapront.   “Expressions for IAU 2000 precession quantities” Astronomy & Astrophysics.  September 19, 2003.   PDF file: http://syrte.obspm.fr/iau2006/aa03_412_P03.pdf

“Axial Precession” Wikipedia  https://en.wikipedia.org/wiki/Axial_precession  Retrieved June 5, 2016

Zodiac Section:

McClure, Bruce  “Dates of sun’s entry into each constellation of the zodiac” (2016) EarthSky http://earthsky.org/space/dates-of-suns-entry-into-each-constellation-of-the-zodiac
Retrieved June 5, 2016


This blog is property of Edward Shore, 2016.

Friday, June 7, 2013

HP 35S: Sun Altitude, Azimuth, Solar Pond Absorption

HP 35S: Sun Altitude, Azimuth, Solar Pond Absorption

Source: Sun Altitude, Azimuth, Solar Pond Absorption, HP 67/97 Energy Conservation December 1978, Author: HP

Input:

This program asks for:

D = days after March 21 (later will be sun's declination : 23.45 sin (D * .9856°) )
L = latitude given in D.MMSS (degrees minutes seconds) format (avoid ±90°)
T = time before solar noon (12:00 PM), if the time is after noon, enter hours as a negative (example: 3:00 PM → -3)
N = index of refraction of surface/fluid (see below)


Index of Refraction for Common Objects:

Water: 1.33
Ice: 1.309
Glass: 1.52
Diamond: 2.42



Formulas: (Degrees Mode)

Sun Declination
D = 23.45 * sin( days after March 21 * .9856°)

Altitude of the Sun (H):
H = asin (cos L * cos D * cos (15 * T) + sin L * sin D)

Azimuth of the Sun (A): (degree from latitude ground wise north)
A = acos ( (sin H * sin L - sin D) ÷ (cos L * cos H) )

Fraction of the surface penetrated by the sun that hour (T):
T = 2 * n * (x^2 + y^2) * sin H * cos R
Where
R = asin (cos H ÷ n)
x = (cos R + n * sin H)^-1
y = (sin H + n * cos R)^-1

Example 1:

Input:
D = 68 (May 28), L = 46°, T = 4 (8:00 AM), N = 1.33 (water)

Output:
H (altitude) = 35.98991°
A (azimuth) = 84.40835°
F (fraction of coverage) = 0.95943

Example 2:

Input:
D = 90 (June 19), L = 23°, T = -3 (3:00 PM), N = 2.42 (diamond)

Output:
H = 48.81756°
A = 99.85903°
F = 0.82156



Program:

U001 LBL U
U002 INPUT D \\ declination
U003 DEG
U004 0.9856
U005 *
U006 SIN
U007 23.45
U008 *
U009 STO D \\ altitude
U010 COS
U011 INPUT L
U012 HMS→ \\ or → H
U013 STO L
U014 COS
U015 *
U016 INPUT T
U017 15
U018 *
U019 COS
U020 *
U021 RCL L
U022 SIN
U023 RCL D
U024 SIN
U025 *
U026 +
U027 ASIN
U028 STO H
U029 VIEW H \\ azimuth
U030 SIN
U031 RCL L
U032 SIN
U033 *
U034 RCL D
U035 SIN
U036 -
U037 RCL L
U038 COS
U039 RCL H
U040 COS
U041 *
U042 ÷
U043 ACOS
U044 STO A
U045 VIEW A

U046 RCL H \\ fraction
U047 COS
U048 INPUT N
U049 ÷
U050 ASIN
U051 STO R
U052 COS
U053 RCL H
U054 SIN
U055 RCL* N
U056 +
U057 1/x
U058 x^2
U059 RCL H
U060 SIN
U061 RCL R
U062 COS
U063 RCL* N
U064 +
U065 1/x
U066 x^2
U067 +
U068 RCL* N
U069 2
U070 *
U071 RCL H
U072 SIN
U073 *
U074 RCL R
U075 COS
U076 *
U077 STO F
U078 VIEW F
U079 RTN




This blog is property of Edward Shore. 2013

Python in Numworks: Duplicating and Grayscale

Python in Numworks: Duplicating and Grayscale All three scripts presented today use the math, random, and the Numworks specific ...