<p>The concept you need is called &quot;air mass&quot; or &quot;airmass&quot;. <a href="https://en.wikipedia.org/wiki/Air_mass_(solar_energy)" rel="nofollow noreferrer">Air mass</a> is a unitless parameter that indicates how many thicknesses of the Earth's atmosphere that sunlight has to pass through before hitting the surface. A value of zero (AM0) indicates the air mass for the top of the atmosphere, hence the zero. A value of one (AM1) indicates that sunlight has to pass through one Earth atmosphere when the Sun is directly overhead (zenith angle = 0). Higher values are indicative of the Sun being lower in the sky and hence sunlight having to pass through more than the equivalent of one thickness of the Earth's atmosphere.</p>
<p>The linked wikipedia page provides multiple approximate formulae for computing air mass as a function of zenith angle, and then provides another formula for computing intensity as a function of air mass. I have reproduced a couple of these below:</p>
<p><span class="math-container">$$ \text{AM} = \frac{2r+1}{\sqrt{(r\cos z)^2 + 2r + 1}+r\cos z}$$</span>
where</p>
<ul>
<li><span class="math-container">$r$</span> is the ratio of the Earth's radius to the effective thickness of the Earth's atmosphere (most people use <span class="math-container">$r=908$</span>),</li>
<li><span class="math-container">$z$</span> is the zenith angle of the Sun, and</li>
<li><span class="math-container">$\text{AM}$</span> is the air mass.
<span class="math-container">$$ I = 1.1\,I_0\,0.7^{(\text{AM}^{\,0.678})}$$</span>
where</li>
<li><span class="math-container">$\text{AM}$</span> is the air mass, as calculated above, or by some other equation,</li>
<li><span class="math-container">$I_0$</span> is the solar constant, <span class="math-container">$1353 \text{W}/\text{m^2}$</span>, and</li>
<li><span class="math-container">$I$</span> is the intensity at the surface, assuming no clouds, no humidity, and no pollution.</li>
</ul>

CC BY-SA 4.0
2024-09-23T12:34:39.070Z
After many researches, I found this equation for air mass `AM= 1​ / cos(Altitude - 90​°)+0.50572⋅(96.07995−Altitude - 90​°​)−1.6364`, what is the difference between it and the equation that you mentioned, and which is more accurate?
Ahmed Dyaa
CC BY-SA 4.0
2024-09-23T12:36:49.303Z
Regarding the solar constant, In [SunCalc](https://www.suncalc.org/#/27.6936,-97.5195,3/2024.09.23/13:00/1/3) the solar constant changes with the change of time or location, is there a equation for calculating it or what?
Ahmed Dyaa
CC BY-SA 4.0
2024-09-23T13:42:45.580Z
@AhmedDyaa The so-called solar constant is more or less a constant. It is the intensity of solar radiation received by a one square meter flat plate located one astronomical unit from the Sun and oriented such that the normal to the plate points toward the center of the Sun. Strictly speaking, it's not quite a constant because the Earth's orbit is somewhat elliptical and because the Sun's output is not quite constant, but everyone uses it as a constant.
David Hammen
CC BY-SA 4.0
2024-09-23T13:57:32.693Z
@Devid Hammen Thank you for the clarification, but is there an equation to calculate and what is the difference between the two equations of air mass?
Ahmed Dyaa
CC BY-SA 4.0
2024-09-23T15:24:08.203Z
@AhmedDyaa You need the air mass to calculate the second equation. You need the Sun's zenith angle to calculate air mass. You can find software for calculating the Sun's zenith angle as a function of latitude, longitude, time of day, and day of year. I strongly suggest using software (freely available on the internet) for the zenith angle calculation.
David Hammen
CC BY-SA 4.0
2024-09-23T15:35:12.307Z
I already have equation to calculate sun's altitude and azimuth, so it's easy for me to calculate zenith, what I mean with "but is there an equation to calculate" is about calculating the solar constant if there an equation for it.
Ahmed Dyaa
CC BY-SA 4.0
2024-09-23T15:37:20.560Z
But I still have not determined which air mass equation to use.
Ahmed Dyaa
CC BY-SA 4.0
2024-09-23T17:13:05.717Z
@AhmedDyaa The first equation gives air mass as a result. It says nothing directly about intensity. The second equation uses air mass as an input to compute intensity (which is what you want). Notice that air mass is on the left hand side of the equal sign in the first equation but on the right hand side in the second equation.
David Hammen
CC BY-SA 4.0
2024-09-23T18:17:34.680Z
@Devid Hammen by "second equation" you mean `AM= 1​ / cos(Altitude - 90​°)+0.50572⋅(96.07995−Altitude - 90​°​)−1.6364`?
Ahmed Dyaa
CC BY-SA 4.0
2024-09-23T18:30:41.213Z
@AhmedDyaa I have two equations in my answer. Those are the ones I suggest you use.
David Hammen
CC BY-SA 4.0
2024-09-24T04:58:30.553Z
@Devid Hammen No, I was comparing between those equations for air mass `2r+1 / (√(r cos (z))^2+2r+1) + r cos(z)` and that's the equation in your anwer, The second one that I found is `AM= 1​ / cos(Altitude - 90​°)+0.50572⋅(96.07995−Altitude - 90​°​)−1.6364`, So I was asking what's the difference between thos equations? and which one is more accurate?
Ahmed Dyaa
CC BY-SA 4.0
2024-09-24T10:02:58.863Z
@AhmedDyaa That's the Kasten and Young, which probably is more accurate (but do use the correct formula; what you wrote is not correct). There are many different formulae for air mass. They are all approximations. Reasonably good ones agree with a value of about 38 when the Sun is on the horizon.
David Hammen
CC BY-SA 4.0
2024-09-24T10:25:22.773Z
@Devid Hammen Thank you for the help....
Ahmed Dyaa
CC BY-SA 4.0
2024-11-04T13:13:09.100Z
@Devied Hammen, Is there something like this for the moon?
Ahmed Dyaa
CC BY-SA 4.0
2024-11-04T15:10:34.123Z
@AhmedDyaa The Moon? No. The concept of air mass is based on the fact that sunlight hitting the Earth's surface has to pass through one or more thicknesses of the Earth's atmosphere, depending on the Sun's altitude. The Moon's surface is essentially AM0 (air mass zero).
David Hammen
CC BY-SA 4.0
2024-09-20T11:25:53.010Z
2024-09-20T11:39:17.293Z
2024-09-20T11:39:17.293Z
David Hammen
<p>How can the intensity of sunlight throughout the day be calculated in comparison to its maximum intensity (at noon) using the solar altitude under natural conditions? By it's equations or python.</p>
<p>By &quot;under natural conditions&quot; I mean &quot;A sunny day without clouds in the desert with no other influences&quot;</p>

CC BY-SA 4.0
2024-09-19T17:16:14.030Z
Take a look at the first diagram in my answer https://astronomy.stackexchange.com/a/51898/16685
PM 2Ring
CC BY-SA 4.0
2024-09-20T04:43:39.760Z
If you are trying to model sunlight in a game, and you are trying to be "accurate", give up.  There is no way a computer monitor can even get close to the variation in intensity. You can't make a monitor that is as bright as daylight, and wouldn't want to.  Instead you want a model that "feels right" and "supports gameplay".
James K
CC BY-SA 4.0
2024-09-20T05:49:34.270Z
I know, so I explained that I want to calculate it "comparison to its maximum intensity (at noon)" so that the result is a percentage that I can control the maximum intensity I want according to my game, Note that there is a game development engine (called Unity) parameter for the intensity of sunlight in Lux. It doesn't matter to be very precise; the important thing is to simulate it similar to the way the sun actually works.
Ahmed Dyaa
<the-sun><light>
The intensity of sunlight
Ahmed Dyaa
# The intensity of sunlight

(Asked by: username_0 on 2024-09-19)

How can the intensity of sunlight throughout the day be calculated in comparison to its maximum intensity (at noon) using the solar altitude under natural conditions? By it's equations or python.

By "under natural conditions" I mean "A sunny day without clouds in the desert with no other influences"

**Tags:** the-sun, light
> **Comments:**
> **username_1**: Take a look at the first diagram in my answer https://astronomy.stackexchange.com/a/51898/16685  
> **username_2**: If you are trying to model sunlight in a game, and you are trying to be "accurate", give up.  There is no way a computer monitor can even get close to the variation in intensity. You can't make a monitor that is as bright as daylight, and wouldn't want to.  Instead you want a model that "feels right" and "supports gameplay".  
> **username_0**: I know, so I explained that I want to calculate it "comparison to its maximum intensity (at noon)" so that the result is a percentage that I can control the maximum intensity I want according to my game, Note that there is a game development engine (called Unity) parameter for the intensity of sunlight in Lux. It doesn't matter to be very precise; the important thing is to simulate it similar to the way the sun actually works.  

---

## 1 answers

### Answer by username_3 on 2024-09-20. Score: 3 | Accepted answer

The concept you need is called "air mass" or "airmass". [Air mass](https://en.wikipedia.org/wiki/Air_mass_(solar_energy)) is a unitless parameter that indicates how many thicknesses of the Earth's atmosphere that sunlight has to pass through before hitting the surface. A value of zero (AM0) indicates the air mass for the top of the atmosphere, hence the zero. A value of one (AM1) indicates that sunlight has to pass through one Earth atmosphere when the Sun is directly overhead (zenith angle = 0). Higher values are indicative of the Sun being lower in the sky and hence sunlight having to pass through more than the equivalent of one thickness of the Earth's atmosphere.

The linked wikipedia page provides multiple approximate formulae for computing air mass as a function of zenith angle, and then provides another formula for computing intensity as a function of air mass. I have reproduced a couple of these below:

$$ \text{AM} = \frac{2r+1}{\sqrt{(r\cos z)^2 + 2r + 1}+r\cos z}$$
where

* $r$ is the ratio of the Earth's radius to the effective thickness of the Earth's atmosphere (most people use $r=908$),
* $z$ is the zenith angle of the Sun, and
* $\text{AM}$ is the air mass.
  $$ I = 1.1\,I\_0\,0.7^{(\text{AM}^{\,0.678})}$$
  where
* $\text{AM}$ is the air mass, as calculated above, or by some other equation,
* $I\_0$ is the solar constant, $1353 \text{W}/\text{m^2}$, and
* $I$ is the intensity at the surface, assuming no clouds, no humidity, and no pollution.

> **Comments:**
> **username_0**: After many researches, I found this equation for air mass `AM= 1​ / cos(Altitude - 90​°)+0.50572⋅(96.07995−Altitude - 90​°​)−1.6364`, what is the difference between it and the equation that you mentioned, and which is more accurate?  
> **username_0**: Regarding the solar constant, In [SunCalc](https://www.suncalc.org/#/27.6936,-97.5195,3/2024.09.23/13:00/1/3) the solar constant changes with the change of time or location, is there a equation for calculating it or what?  
> **username_3**: @AhmedDyaa The so-called solar constant is more or less a constant. It is the intensity of solar radiation received by a one square meter flat plate located one astronomical unit from the Sun and oriented such that the normal to the plate points toward the center of the Sun. Strictly speaking, it's not quite a constant because the Earth's orbit is somewhat elliptical and because the Sun's output is not quite constant, but everyone uses it as a constant.  
> **username_0**: @Devid Hammen Thank you for the clarification, but is there an equation to calculate and what is the difference between the two equations of air mass?  
> **username_3**: @AhmedDyaa You need the air mass to calculate the second equation. You need the Sun's zenith angle to calculate air mass. You can find software for calculating the Sun's zenith angle as a function of latitude, longitude, time of day, and day of year. I strongly suggest using software (freely available on the internet) for the zenith angle calculation.  
> **username_0**: I already have equation to calculate sun's altitude and azimuth, so it's easy for me to calculate zenith, what I mean with "but is there an equation to calculate" is about calculating the solar constant if there an equation for it.  
> **username_0**: But I still have not determined which air mass equation to use.  
> **username_3**: @AhmedDyaa The first equation gives air mass as a result. It says nothing directly about intensity. The second equation uses air mass as an input to compute intensity (which is what you want). Notice that air mass is on the left hand side of the equal sign in the first equation but on the right hand side in the second equation.  
> **username_0**: @Devid Hammen by "second equation" you mean `AM= 1​ / cos(Altitude - 90​°)+0.50572⋅(96.07995−Altitude - 90​°​)−1.6364`?  
> **username_3**: @AhmedDyaa I have two equations in my answer. Those are the ones I suggest you use.  
> **username_0**: @Devid Hammen No, I was comparing between those equations for air mass `2r+1 / (√(r cos (z))^2+2r+1) + r cos(z)` and that's the equation in your anwer, The second one that I found is `AM= 1​ / cos(Altitude - 90​°)+0.50572⋅(96.07995−Altitude - 90​°​)−1.6364`, So I was asking what's the difference between thos equations? and which one is more accurate?  
> **username_3**: @AhmedDyaa That's the Kasten and Young, which probably is more accurate (but do use the correct formula; what you wrote is not correct). There are many different formulae for air mass. They are all approximations. Reasonably good ones agree with a value of about 38 when the Sun is on the horizon.  
> **username_0**: @Devid Hammen Thank you for the help....  
> **username_0**: @Devied Hammen, Is there something like this for the moon?  
> **username_3**: @AhmedDyaa The Moon? No. The concept of air mass is based on the fact that sunlight hitting the Earth's surface has to pass through one or more thicknesses of the Earth's atmosphere, depending on the Sun's altitude. The Moon's surface is essentially AM0 (air mass zero).  

---

