Extraterrestrial radiation ($E_a$) is the intensity (power) of the sun at the top of the Earth’s atmosphere. It is usually expressed in irradiance units (Watts per square meter) on a plane normal to the sun. It varies throughout the year because of the Earth’s elliptical orbit, which results in the Earth-Sun distance varying during the year in a predictable way. This effect can be represented empirically with the following equations:
$$E_a=E_s{_c}\times\left(\frac{R_a{_v}}{R}\right)^2$$, where $$E_s{_c}$$ is the solar constant ($$1367W/m^2$$). $$R_a{_v}$$ is the mean sun-earth distance and (R) is the actual sun-earth distance depending on the day of the year.
$$\left(\frac{R_a{_v}}{R}\right)^2=1.00011+0.034221cos({b})+0.00128/sin({b})+\dots$$
$$0.000719cos(2b)+0.000077sin(2b)$$, where $$b=2\pi\frac{DOY}{365}{radians}$$, where $$DOY$$ is the day of the year (integer).