{"id":606,"date":"2023-10-20T10:03:49","date_gmt":"2023-10-20T10:03:49","guid":{"rendered":"https:\/\/uneedtalk.com\/config\/tredword\/?page_id=606"},"modified":"2023-12-01T13:07:59","modified_gmt":"2023-12-01T13:07:59","slug":"solar-position-algorithm","status":"publish","type":"page","link":"https:\/\/radi-cal.org\/method\/solar-position-algorithm\/","title":{"rendered":"Solar position algorithm"},"content":{"rendered":"<div class=\"row\"  id=\"row-1849777204\">\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner\"  >\n<h1>Solar position algorithm<\/h1>\n<h2>4.5.1. Theoretic background and model<\/h2>\n<p>Numerous algorithms are available for the purpose of calculating the solar position. The accuracy and computation time of the available algorithms vary greatly, however. In the present work, the SG2 algorithm of Ph. Blanc and L. Wald (2012) has been implemented. The SG2 algorithm is a numerically significantly optimised version of the SPA algorithm provided by NREL (Reda and Afshin, 2005). The SPA algorithm, in turn, is based on the astronomical algorithms provided by Jean Meeus (1998) in his book first published in 1991. The SPA algorithm, based on Meeus work, has long been the gold standard as Reda and Afshin specify a maximum uncertainty of \u00b10.0003\u00b0 for the years ranging from 2000 b.c. to 6000 a.d.<br \/>\nBased on Blanc and Wald\u2019s numerical optimisations, the SG2 algorithm is several orders of magnitude faster than the original SPA algorithm and provides a maximum uncertainty of the solar vector of less than \u00b10.0025\u00b0. This value still exceeds by far the accuracy required for most practical applications, whereas computational performance is crucial for many practical purposes. For this reason, the SG2 algorithm has been implemented here.<\/p>\n<h2>4.5.2. Implementation<\/h2>\n<p>For the actual implementation in Pascal, the original publication (Blanc and Wald, 2012) and a validated implementation in C and Python provided by PSL university (O.I.E. Mines-ParisTech, 2022) have been used.<br \/>\nThe code has been implemented in the library rc_sunpos_sg2. It encapsulates the class TSunposIrradiance containing the following methods:<\/p>\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner text-center\"  >\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_2014403906\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"854\" height=\"800\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a14-1-854x800.jpg\" class=\"attachment-large size-large\" alt=\"\" srcset=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a14-1-854x800.jpg 854w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a14-1-427x400.jpg 427w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a14-1-768x720.jpg 768w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a14-1.jpg 923w\" sizes=\"(max-width: 854px) 100vw, 854px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_2014403906 {\n  width: 86%;\n}\n<\/style>\n\t<\/div>\n\t\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner\"  >\n<p>The key method is the calcSunPos function, which returns the solar angles for a specified date. The  function JulianD allows converting standard date and time values into a single numeric Julian-date  value (of type double). Apart from the SG2 code, the class also contains functions for irradiance  evaluation. These are covered in section 6.2.5.<\/p>\n<h2>4.5.3. Testing and validation<\/h2>\n<p>The validation has been done with multiple comparisons against free online tools using the SG2 algorithm. In particular, however, the validation example provided in the appendix of the SPA paper (Reda and Afshin, 2005) is used here to demonstrate the validity of the implementation.<\/p>\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner text-center\"  >\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_591232248\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" style=\"margin:0 0px 0px 0px;\">\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"205\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a15.jpg\" class=\"attachment-large size-large\" alt=\"\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_591232248 {\n  width: 65%;\n}\n<\/style>\n\t<\/div>\n\t\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner\"  >\n<p>The code used to perform the solar position calculation for the given validation parameters in the present implementation is:<\/p>\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner text-center\"  >\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_511176346\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"925\" height=\"462\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a16-1.jpg\" class=\"attachment-large size-large\" alt=\"\" srcset=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a16-1.jpg 925w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a16-1-800x400.jpg 800w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a16-1-768x384.jpg 768w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_511176346 {\n  width: 75%;\n}\n<\/style>\n\t<\/div>\n\t\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner\"  >\n<p>Table 4 shows the calculation result of the RadiCal implementation compared to the solar position<br \/>\nstated in the SPA paper. As can be seen, the deviation ranges well below the specified uncertainty.<\/p>\n<\/div><\/div>\n<div class=\"col small-12 large-12\"  ><div class=\"col-inner text-center\"  >\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_2004422154\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"869\" height=\"205\" src=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a17-1.jpg\" class=\"attachment-large size-large\" alt=\"\" srcset=\"https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a17-1.jpg 869w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a17-1-800x189.jpg 800w, https:\/\/radi-cal.org\/method\/wp-content\/uploads\/2023\/10\/a17-1-768x181.jpg 768w\" sizes=\"(max-width: 869px) 100vw, 869px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style scope=\"scope\">\n\n#image_2004422154 {\n  width: 76%;\n}\n<\/style>\n\t<\/div>\n\t\n<\/div><\/div>\n<\/div>\n<style>\n#menu-main li:nth-child(4) .sub-menu{display:block !important;}\n<\/style>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-right-sidebar.php","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages\/606"}],"collection":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/comments?post=606"}],"version-history":[{"count":11,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages\/606\/revisions"}],"predecessor-version":[{"id":1959,"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/pages\/606\/revisions\/1959"}],"wp:attachment":[{"href":"https:\/\/radi-cal.org\/method\/wp-json\/wp\/v2\/media?parent=606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}