The sunpos function returns the sun position according to DIN EN 17037 from UTC (Coordinated Universal Time). The default geographical settings are set in the file “LT_location.mat”. Change the settings to your preferred location and set the file to read-only in order to prevent your settings from being overwritten with the default values in future versions.
Usage:
[az,el] = sunpos(date,utc,geolength,geowidth)
Note: For current sun position, use an empty function call and adapt the default geographic coordinates in the function file:
[az,el] = sunpos()
Where:
Parameter | Description |
az & el | Returns the solar azimuth and elevation angles. |
date | Specifies the date in 'dd.mm.yyyy' format, default: current day. |
utc | Specifies the UTC time in 'hh:mm:ss' format, default: current time. |
geolength | Specifies the geographic length, default: 13.326 (Berlin). You can change the preference in the “LT_location.mat ” file. |
geowidth | Specifies the geographic width, default: 52.514 (Berlin). You can change the preference in the “LT_location.mat ” file. |
Examples
Sun position in Berlin at ‘21.05.1987’ – ’11:03:22‘ UTC:
[az,el] = sunpos('21.05.1987','11:03:22')
Result:
az = 180.00 el = 57.527
Note: to determine noon UTC time, use the south function.
Sun position in Athens at ‘21.05.1987’ – ’11:03:22‘ UTC:
[az,el] = sunpos('21.05.1987','11:03:22',37.978,23.728)
Result:
az = 265.64 el = 66.859
Reference
Daylight in buildings. 2019.