Define the function solar_elevation(latitude, day_num, solar_hour) that returns the angle of the sun to the ground for a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Define the function solar_elevation(latitude, day_num, solar_hour) that returns the angle of the sun to the ground for a

Post by answerhappygod »

Define the function solar_elevation(latitude, day_num,
solar_hour) that returns the angle of the sun to the ground
for an observer at the given latitude, for the given day number and
solar hour.
The formula for calculating this is:
π‘’π‘™π‘’π‘£π‘Žπ‘‘π‘–π‘œπ‘›=π‘Žπ‘ π‘–π‘›_𝑑(𝑠𝑖𝑛_𝑑(π‘™π‘Žπ‘‘)×𝑠𝑖𝑛_𝑑(π‘‘π‘’π‘π‘™π‘–π‘›π‘Žπ‘‘π‘–π‘œπ‘›)+π‘π‘œπ‘ _𝑑(π‘™π‘Žπ‘‘)Γ—π‘π‘œπ‘ _𝑑(β„Žπ‘œπ‘’π‘Ÿ_π‘Žπ‘›π‘”π‘™π‘’)Γ—π‘π‘œπ‘ _𝑑(π‘‘π‘’π‘π‘™π‘–π‘›π‘Žπ‘‘π‘–π‘œπ‘›))elevation=asin_d(sin_d(lat)Γ—sin_d(declination)+cos_d(lat)Γ—cos_d(hour_angle)Γ—cos_d(declination))
Where:
Define The Function Solar Elevation Latitude Day Num Solar Hour That Returns The Angle Of The Sun To The Ground For A 1
Define The Function Solar Elevation Latitude Day Num Solar Hour That Returns The Angle Of The Sun To The Ground For A 1 (193.91 KiB) Viewed 29 times
IT ITT HNMON 1 def sin_d(degrees): 2 To save us converting to radians all the time 3 return math.sin(math.radians(degrees)) 4 = def asin_d(n): Returns the degrees such that sin(degrees) The standard asin function returns the value in re This function converts the result to degrees 6 7 8 9 10 11 12 13 14 # We force the cos_value between -1 and 1 so that # This removes rounding errors from values such as # be careful not to use values outside the -1 to if n < -1: n = -1 elif n > 1: n = 1 return math.degrees(math.asin(n)) 16 45919 17 18 20 21 def solar_hour_angle(solar_hour): 22 "" The earth makes a full 360 degree rotation 23 every 24 hours, or 15 degrees per hour. 24 This function returns the angle implied by a 25 given hourly time, relative to the solar noon. For example: 27 An hour of 11 should give -15 28 An hour of 15 (3 hours after midday) should give 29 An hour of 15.5 should give 52.5 30 31 return 15 * (solar_hour 12) 32 def solar_elevation(latitude, day_num, solar_hour) 26 Scratchpad
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply