Sunday, May 19, 2013

HP 35S: Approximate Length of Sunlight During a Day

HP 35S: Length of Sunlight During a Day

Source: Total Daily Amount of Solar Radiation - HP 67/97 Energy Conservation Pac, December 1978, Author: Hewlett Packard

(This is a slight variation instead of a direct port)

Input

You are prompted for D and L where:
D = the number of days from March 21, a 365 day year is assumed
L = latitude (North as positive, South as negative), entered as D.MMSS (degrees-minutes-seconds) format

Output

Approximate number of hours of sunlight, in hours, minutes, seconds

Examples

Los Angeles, April 17: latitude of 34°03' N, 27 days after March 21
D = 27, L = 34.03, answer is approximately 12.573501 (12 hours, 57 minutes, 35.01 seconds)

Rome, September 1: latitude 41°51' N, 164 days after March 21
D = 164, L = 41.52, answer is approximately 12.532269 (12 hours, 53 minutes, 22.69 seconds)

Sydney, June 21: latitude 33°51'31" S, 92 days after March 21
D = 92, L = -33.5131, answer is approximately 9.443922 (9 hours, 44 minutes, 39.22 seconds)

Formulas

This version uses the estimate of sun declination:
D = 23.45 sin(d * 0.9856°)

Since 360/365.25 ≈ 0.985626283368

θ = acos(-tan L × tan D)

L = 24 * θ in radians ÷ π

Program
S001 LBL S
S002 DEG
S003 INPUT D
S004 0.9856
S005 ×
S006 SIN
S007 23.45
S008 ×
S009 INPUT L
S010 HMS→
S011 TAN
S012 x<>y
S013 TAN
S014 ×
S015 +/-
S016 ACOS
S017 ->RAD
S018 24
S019 ×
S020 π
S021 ÷
S022 ->HMS
S023 RTN



This blog is property of Edward Shore. 2013

2 comments:

  1. Cool post Eddie.

    Now I know I'll have plenty of daylight this weekend to play ham radio.

    Look for an ARRL Field Day event near you.

    http://www.arrl.org/field-day-locator

    Scott
    KD5NJR
    kd5njr@gmail.com

    ReplyDelete
  2. I will have to check it out, thanks Scott!

    Eddie

    ReplyDelete

How to Rotate Graphs

How to Rotate Graphs Introduction The key is to use parametric equations in our rotation.  Using the rotation angle θ, the rotatio...