Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Solar calculations


lux eterna

Recommended Posts

Hi all,

My trigonometry and mathematics skills are not quite up to this task, so I would appreciate if someone can show me how to proceed.

I am trying to design a formula that can tell at what time the sun reaches a user selectable elevation (aka altitude, not to be mixed up with declination). For the specific case of alt = 0 (sunrise/sunset) I have found a formula that looks good except that I need solar altitude as an input variable. An example: At what time will the sun reach -18 degrees (under my horizon) for a specific date, at a specific location ?

I have found two very informative pages with detailed descriptions. I think I understand most of  this one but here is where I fail to follow.

What is stopping me is that I cannot see how to transform the below formula to something like :
HRA = (some mix of sin, cos etc for declination, latitude and also elevation)

sun.jpg.6f1e52b5fbaf9d4e41a267cc4762f321.jpg
If I could calculate HRA for different scenarios, it would be easy to find out what time of day that corresponds to on my location.
 
The formulas use greek letters, I suggest using abbreviations like these instead :
za    zenith angle
lat    latitude
da    declination angle (+/- 23.5 degrees) = 23.5 * cos(360 * (DoY+10)/365)
ea    elevation angle (aka "altitude angle")
hra    hour angle = 15*(lst-12)
lt    local time (hours)
lst    local solar time (hours)
tc    time correction factor
doy    Day of Year (1 = January 1)
eot    equation of time

Thank you

Ragnar

 

 

Link to comment
Share on other sites

I think that you are over complicating things here (maybe not).

If you want HRA from above formula that is straight forward:

sin(alpha) = sin(delta)*sin(phi) +cos(delta)*cos(phi)*cos(HRA)

sin(alpha) - sin(delta)*sin(phi) = cos(delta)*cos(phi)*cos(HRA)

cos(HRA) = ( sin(alpha) - sin(delta)*sin(phi) ) / ( cos(delta)*cos(phi) )

HRA = arccos( ( sin(alpha) - sin(delta)*sin(phi) ) / ( cos(delta)*cos(phi) ) )

But you only need to look up RA/DEC conversion to Alt AZ and use altitude component.

Link to comment
Share on other sites

10 minutes ago, vlaiv said:

I think that you are over complicating things here (maybe not).

If you want HRA from above formula that is straight forward:

sin(alpha) = sin(delta)*sin(phi) +cos(delta)*cos(phi)*cos(HRA)

sin(alpha) - sin(delta)*sin(phi) = cos(delta)*cos(phi)*cos(HRA)

cos(HRA) = ( sin(alpha) - sin(delta)*sin(phi) ) / ( cos(delta)*cos(phi) )

HRA = arccos( ( sin(alpha) - sin(delta)*sin(phi) ) / ( cos(delta)*cos(phi) ) )

But you only need to look up RA/DEC conversion to Alt AZ and use altitude component.

The only bits I know are what sin and cos mean from my schooldays. Here I give the only solar calculation that I am prepared to use:

sun = daytime = (get out of bed) + cup of tea...look at news + cup of tea... shower - PJs...(get dressed)... cup of tea + custard cream... lunch + cup of tea... afternoon nap...wake up + cup of tea + look at news...cup of tea ...dinner (+ cup of tea) - washing up...watch tv...sun gone = nighttime = cup of tea + bedtime.

Feel free to use it, it took me many years of dedication and self denial to get this far.

  • Like 1
  • Haha 1
Link to comment
Share on other sites

@AKB Thanks, I think the answer may be there. I just have to spend a little time with it.

@vlaiv To look up RA/DEC conversion to Alt AZ and use altitude component is not an option. I need to do the math from scratch (the reason for this is an Arduino based project).

From your post :

1) sin(alpha) = sin(delta)*sin(phi) +cos(delta)*cos(phi)*cos(HRA)
2) sin(alpha) - sin(delta)*sin(phi) = cos(delta)*cos(phi)*cos(HRA)
3) cos(HRA) = ( sin(alpha) - sin(delta)*sin(phi) ) / ( cos(delta)*cos(phi) )
4) HRA = arccos( ( sin(alpha) - sin(delta)*sin(phi) ) / ( cos(delta)*cos(phi) ) )

I think I can follow you except for #1. The original formula (see the included picture above) was : alpha = 1 / sin( sin(delta)*sin(phi) +cos(delta)*cos(phi)*cos(HRA) ). How do you go from there to #1 ?

Edit : missed one "sin" ...

 

Edited by lux eterna
Link to comment
Share on other sites

48 minutes ago, lux eterna said:

alpha = 1 / sin( sin(delta)*sin(phi) +cos(delta)*cos(phi)*cos(HRA) ). How do you go from there to #1 ?

My bad, I interpreted sin to the power of -1 to be "inverse" of sin function not reciprocal value (as would be if you actually raise it to the power of -1).

Often in literature - inverse function is denoted as fn to the power of -1.

image.png.e291ba086c41c6b23a121ecd7a8560a7.png

For this reason I interpreted original formula to read sin to the -1 or arc sin.

Are you sure that they meant 1/sin instead? It does stand to reason that sin of alpha is equal to combination of sine and cosine functions on the other side and sin to the -1 would be indeed arc sin in that case.

Link to comment
Share on other sites

13 minutes ago, lux eterna said:

No, I am not sure how to interpret this. I was just thinking like 10 to the power -1 equals 1 / 10. But not sure if that is applicable here.

 

According to the rest of the page - notation used is one that I assumed

Function to the -1 means inverse function. You can see that from other calculations that follow, namely this one:

image.png.aba74fcbf637d372ec82cd75ed3a4b66.png

This is expression for time of the Sunrise which is derived by finding HRA for which elevation above horizon is 0.

If we take original formula and do that:

sun.jpg

sin ( 0 ) = sin(delta) * sin(phi) + cos(delta)*cos(phi) * cos(HRA)

0 = sin(delta) * sin(phi) + cos(delta)*cos(phi) * cos(HRA)   // since sin(0) is of course 0

- sin(delta) * sin(phi) = cos(delta)*cos(phi) * cos(HRA)

cos(HRA) =

HRA = arccos(- sin(delta) * sin(phi) / ( cos(delta)*cos(phi) ) )

Now look at the Sunrise formula and you'll see that it actually reads:

Sunrise = 12 - 1/15° * HRA - TC/60

where HRA is arc cosine of of expression - sin(delta) * sin(phi) / ( cos(delta)*cos(phi)  ).

  • Like 1
Link to comment
Share on other sites

Interestingly, the -1 notation for inverse functions was introduced by John Herschel 🙂.

The sine and cosine give the ratio between two sides of a right-angled triangle, the inverses (arcsin and arccos) are used to calculate the angle that result from that ratio. They are used a lot in astronomical calculations, because these calculations often result in angles.

Be careful, it's addictive 😉.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.