NREL's Solar Position Algorithm (SPA)

Solar Position Algorithm for Solar Radiation Applications
3.4K Downloads
Updated 19 Mar 2017

View License

There have been many published articles describing solar position algorithms for solar radiation applications. The best uncertainty achieved in most of these articles is greater than ±0.01 (deg) in calculating the solar zenith and azimuth angles. For some, the algorithm is valid for a limited number of years varying from 15 years to a hundred years. This program is a step by step procedure for implementing an algorithm to calculate the solar zenith and azimuth angles in the period from the year -2000 to 6000, with uncertainties of ±0.0003 (deg). The algorithm is described by Jean Meeus [1]. This program is written in a step by step format to simplify the complicated steps described in the book, with a focus on the sun instead of the planets and stars in general. It also introduces some changes to accommodate for solar radiation applications. The changes include changing the direction of measuring azimuth angles to be measured from north and eastward instead of being measured from south and eastward, and the direction of measuring the observer’s geographical longitude to be measured as positive eastward from Greenwich meridian instead of negative. This program also includes the calculation of incidence angle for a surface that is tilted to any horizontal and vertical angle, as described by Iqbal [2].
References:
1. Meeus, J. “Astronomical Algorithms”. Second edition 1998, Willmann-Bell, Inc.,Richmond, Virginia, USA.
2. Iqbal, M. “An Introduction to Solar Radiation”. New York: 1983; pp. 23-25.
3. https://www.nrel.gov/midc/spa/

Cite As

Meysam Mahooti (2025). NREL's Solar Position Algorithm (SPA) (https://au.mathworks.com/matlabcentral/fileexchange/59903-nrel-s-solar-position-algorithm-spa), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

Revised on 2017-03-19.