Rank: 5451 based on 1 downloads (last 30 days) and 1 file submitted
Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Jeff
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Aug 2010 why Command Output A list of the unique statements generated by a call to the "why" function Author: Jeff Gullett why, unique cell, unique why 1 0
Comments and Ratings by Jeff View all
Updated File Comments Rating
06 Jan 2009 sun_position.m Sun position given observer time/location. Author: Vincent Roy

I have found a few other discrepancies in the algorithm. In the 2005 version of the document, the algorithm to compute the topocentric sun declination (eqn #39, line #825) contains the variable 'y' in the denominator, but the code presented later in the pdf document has the variable 'x' in its place. In the 2008 version of the algorithm document, this difference is resolved and the variable should be 'x' (as in the C-code, so it needs to be changed in the m-code presented on this page). Also, when computing the mean obliquity of the ecliptic (eqn #24, line #733), the documented steps have one of the terms as "-4680.93", but again, the C-code from the appendix used the term "-4680.96". Unfortunately, this discrepancy still exists in the 2008 document, so I don't know which term is correct. Using the wrong one will result in an error greater than the maximum error claimed by the algorithm designers.

24 Oct 2008 sun_position.m Sun position given observer time/location. Author: Vincent Roy

The algorithm has a flaw... The atmospheric refraction correction has a number of vertical asymptotes below -5 degrees true elevation to the sun. For elevation angles that hit these asymptotes, I was getting points that resulted in positive elevations, when the neighboring points would come out with the expected result of "sun well below the horizon". You need to add a conditional prior to applying the atmospheric correction to only add this in if the true elevation is greater than -5 degrees.

As for the code itself, it is somewhat disorganized and difficult to read, but it does work. I had a specific application where I needed to improved the efficiency/readability of the code, so I ended up rewriting the thing from scratch based on the paper, except I store everything in radians instead of degrees. This is still a nice application, though.

Top Tags Applied by Jeff
unique cell, unique why, why
Files Tagged by Jeff
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Aug 2010 why Command Output A list of the unique statements generated by a call to the "why" function Author: Jeff Gullett why, unique cell, unique why 1 0

Contact us at files@mathworks.com