Calculation of solar declination in sun.c

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

Dipl.-Ing. (FH) Martin Gut
TRANSSOLAR Energietechnik GmbH
Landwehrstr. 60/62, D-80336 München
Tel +49 89 590 688 45
Fax +49 89 590 688 59
www.transsolar.com<http://www.transsolar.com/>

···

--------------------------------
Amtsgericht Stuttgart, HRB 23347, USt-IdNr.: DE152272639
Geschäftsführer: Matthias Schuler, Thomas Auer,
Stefan Holst, Erik Olsen, Helmut Meyer, Dieter Schnelle

I'm not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

···

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM
To: [email protected]
Subject: [Radiance-general] Calculation of solar declination in sun.c

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

Dipl.-Ing. (FH) Martin Gut
TRANSSOLAR Energietechnik GmbH
Landwehrstr. 60/62, D-80336 München
Tel +49 89 590 688 45
Fax +49 89 590 688 59
www.transsolar.com<http://www.transsolar.com/>
--------------------------------
Amtsgericht Stuttgart, HRB 23347, USt-IdNr.: DE152272639
Geschäftsführer: Matthias Schuler, Thomas Auer,
Stefan Holst, Erik Olsen, Helmut Meyer, Dieter Schnelle

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

···

From: Richard Mistrick <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?
With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

Hi Greg,

Thank You for the quick answer. I don't know about the history of this debate because I'm quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I'm wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for "real" calculations.

Martin

···

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 7:18:53 AM PST

I'm not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

···

From: Martin Gut <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don’t know about the history of this debate because I’m quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I’m wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for “real” calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?
With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Using a more accurate formula that is based on a respectable source like a good idea if the magnitude of the correction is as large as Martin describes. Incidentally, we are having our students do "validations" of the formula by comparing the photograph of an objects as a certain time in the year to a Radiance rendering and that analysis tends to come out pretty well: http://web.mit.edu/sustainabledesignlab/projects/DaylightingHandbook/Exercise_DirectSunlight.htm.

Best,

Christoph

···

From: Greg Ward [mailto:[email protected]]
Sent: Thursday, December 17, 2015 12:22 PM
To: Radiance general discussion <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don't know about the history of this debate because I'm quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I'm wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for "real" calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 7:18:53 AM PST

I'm not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general

I hope this contributes to the discussion: the genUtahSky program that
I presented a few workshops ago (top of
http://markjstock.org/radiance/) uses the libnova library for
astronomical calculations. It's a good place to start for all kinds of
astronomical data, though being an external library might not make it
the best choice for this application.

Mark

···

On 12/17/15, Greg Ward <[email protected]> wrote:

Given the tool construction, it would be simple enough to introduce a global
variable that switches between the de facto solar angle calculation and a
more precise version. I'd like to hear from others that this is worthwhile
before I spend too much time on it, though. Also, whether it should be
exposed as an option in all of the calling programs (i.e., IES calculation
or more accurate on).

Is there a general consensus on which solar calculation is best? I would
just end up googling it, unless you or someone else has a strong
recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don’t know about the history of this
debate because I’m quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is
ok.
  But this formula is also used for all the dynamic daylighting stuff
like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I’m wondering that so much computing effort is
investigated to render the shading and on the other side the position of
this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but
it could be avoided very easy by using a better formula for solar
declination.
Maybe there could be two functions, one for the standard calculations and
one for “real” calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in
Radiance and related tools. The main question is, do we stick with the
established standard, which provides for easy "apples to apples"
comparisons, or do we update our formulas to get a more precise answer?
In the case of the original CIE sky models, which this solar calculation
is used in primarily, the accuracy is not that great, so getting the sun
in exactly the right place is a minor quibble. If, on the other hand, you
need precise sun position for solar shading studies or the like, then it's
easy to argue for a better formula. I don't think computing power was
ever the issue with Radiance. We don't compute the sun position for every
ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard
calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format
in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days
instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into
account, that the Earth orbit is not a circle?
With today computing power, there is no more reason to use this simple
formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Greg,

I’ve found the NREL algorithms to be quite accurate:

Chris

···

On Dec 17, 2015, at 9:21 AM, Greg Ward <[email protected]> wrote:

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don’t know about the history of this debate because I’m quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I’m wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for “real” calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?
With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

I'll echo Chris's comment, and note that NREL has been nice enough to post
their c source code online (for non-commercial use only). They claim
accuracy within 0.0003 degrees for the years -2000 to 6000.
https://www.nrel.gov/midc/solpos/

Nathaniel

···

On Thu, Dec 17, 2015 at 12:48 PM, Christian Humann < [email protected]> wrote:

Hi Greg,

I’ve found the NREL algorithms to be quite accurate:
http://www.nrel.gov/docs/fy08osti/34302.pdf

Chris

On Dec 17, 2015, at 9:21 AM, Greg Ward <[email protected]> wrote:

Given the tool construction, it would be simple enough to introduce a
global variable that switches between the de facto solar angle calculation
and a more precise version. I'd like to hear from others that this is
worthwhile before I spend too much time on it, though. Also, whether it
should be exposed as an option in all of the calling programs (i.e., IES
calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would
just end up googling it, unless you or someone else has a strong
recommendation.

Cheers,
-Greg

*From: *Martin Gut <[email protected]>
*Subject: *Re: [Radiance-general] Calculation of solar declination in
sun.c
*Date: *December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don’t know about the history of this
debate because I’m quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is
ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I’m wondering that so much computing effort is
investigated to render the shading and on the other side the position of
this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but
it could be avoided very easy by using a better formula for solar
declination.
Maybe there could be two functions, one for the standard calculations and
one for “real” calculations.

Martin

*Von:* Greg Ward [mailto:[email protected] <[email protected]>]
*Gesendet:* Donnerstag, 17. Dezember 2015 17:14
*An:* Radiance general discussion
*Betreff:* Re: [Radiance-general] Calculation of solar declination in
sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in
Radiance and related tools. The main question is, do we stick with the
established standard, which provides for easy "apples to apples"
comparisons, or do we update our formulas to get a more precise answer? In
the case of the original CIE sky models, which this solar calculation is
used in primarily, the accuracy is not that great, so getting the sun in
exactly the right place is a minor quibble. If, on the other hand, you
need precise sun position for solar shading studies or the like, then it's
easy to argue for a better formula. I don't think computing power was ever
the issue with Radiance. We don't compute the sun position for every
ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard
calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

*From: *Richard Mistrick <[email protected]>

*Subject: *Re: [Radiance-general] Calculation of solar declination in
sun.c

*Date: *December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format
in the IES Lighting Handbook for many years.

Rick

*From:* Martin Gut [mailto:[email protected] <[email protected]>]
*Sent:* Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days
instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into
account, that the Earth orbit is not a circle?
With today computing power, there is no more reason to use this simple
formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

For me, the difference of the real picture and the simulation is quite visible. Maybe this discussion topic is one reason for this.

We came across this issue by doing a combined thermal and dynamic daylight analysis.
One calculation with original DAYSIM and one DAYSIM calculation with sun position calculated from TRNSYS.
There were quite visible differences, especially in Autumn.

https://drive.google.com/file/d/0B_k3K9s5QAlISGdYWFdlMHZFc00/view?usp=sharing

and

https://drive.google.com/file/d/0B_k3K9s5QAlIb0lRN3VrdXVQaFU/view?usp=sharing

TRNSYS uses the Spencer-Algorithm from 1971 for the calculation of solar declination.
Implementing this Algorithm is easy because it has just a few more sin() and cos() statements .

This graph:

https://drive.google.com/file/d/0B_k3K9s5QAlIbWVXZHhINXhYTDA/view?usp=sharing

shows the differences between this algorithm, the Cooper Algorithm and the Algorithm used in Radiance.
So my first question is answered by this. By using 368 days per year the deviation is smaller than with the original
Cooper Algorithm.

A good starting point for choosing the right algorithm could be in my opinion :
"Computing the solar vector" in Solar Energy Vol. 70, No. 5, pp. 431-441, 2001 by MANUEL BLANCO-MURIEL et al.
Here, the differences of common algorithm are described. They use only the Spencer Algorithm as an example of a simple algorithm.
Following table shows, that there are considerable differences:
https://drive.google.com/file/d/0B_k3K9s5QAlIcS1JQmZFSGttbWs/view?usp=sharing
They recommend the Michalsky-Algorithm or their own PSA-Algorithm, which is a little bit better.
The Michalsky Algorithm is also used in the program SolPos Nathaniel Jones recommended:

https://www.nrel.gov/midc/solpos/

The Source Code for the PSA-Algorithm is available under:

http://www.psa.es/sdg/sunpos.htm

It seems to be comparable to the from Christian Humann recommended NREL algorithms which is used in the program spa:

https://www.nrel.gov/midc/spa/

From my point of view as a user it would be desirable, that the main used Simulation Programs uses the same or at least quite similar algorithm for calculating the sun position.

TRNSYS uses the Spencer-Algorithm, which is due to the upper publications also not the best choice.
It would be interesting what algorithm EnergyPlus uses.

Regards

Martin

···

Von: Christoph Reinhart [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 18:29
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Using a more accurate formula that is based on a respectable source like a good idea if the magnitude of the correction is as large as Martin describes. Incidentally, we are having our students do "validations" of the formula by comparing the photograph of an objects as a certain time in the year to a Radiance rendering and that analysis tends to come out pretty well: http://web.mit.edu/sustainabledesignlab/projects/DaylightingHandbook/Exercise_DirectSunlight.htm.

Best,

Christoph

From: Greg Ward [mailto:[email protected]]
Sent: Thursday, December 17, 2015 12:22 PM
To: Radiance general discussion <[email protected]<mailto:[email protected]>>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don't know about the history of this debate because I'm quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I'm wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for "real" calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 7:18:53 AM PST

I'm not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general

This is fascinating, and in my opinion a cautionary tale for the community, given all the weight being placed on ASE as a daylight metric lately.

For me, the difference of the real picture and the simulation is quite visible. Maybe this discussion topic is one reason for this.

We came across this issue by doing a combined thermal and dynamic daylight analysis.
One calculation with original DAYSIM and one DAYSIM calculation with sun position calculated from TRNSYS.
There were quite visible differences, especially in Autumn.

https://drive.google.com/file/d/0B_k3K9s5QAlISGdYWFdlMHZFc00/view?usp=sharing

and

https://drive.google.com/file/d/0B_k3K9s5QAlIb0lRN3VrdXVQaFU/view?usp=sharing

TRNSYS uses the Spencer-Algorithm from 1971 for the calculation of solar declination.
Implementing this Algorithm is easy because it has just a few more sin() and cos() statements .

This graph:

https://drive.google.com/file/d/0B_k3K9s5QAlIbWVXZHhINXhYTDA/view?usp=sharing

shows the differences between this algorithm, the Cooper Algorithm and the Algorithm used in Radiance.
So my first question is answered by this. By using 368 days per year the deviation is smaller than with the original
Cooper Algorithm.

A good starting point for choosing the right algorithm could be in my opinion :
“Computing the solar vector” in Solar Energy Vol. 70, No. 5, pp. 431–441, 2001 by MANUEL BLANCO-MURIEL et al.
Here, the differences of common algorithm are described. They use only the Spencer Algorithm as an example of a simple algorithm.
Following table shows, that there are considerable differences:
https://drive.google.com/file/d/0B_k3K9s5QAlIcS1JQmZFSGttbWs/view?usp=sharing
They recommend the Michalsky-Algorithm or their own PSA-Algorithm, which is a little bit better.
The Michalsky Algorithm is also used in the program SolPos Nathaniel Jones recommended:

https://www.nrel.gov/midc/solpos/

The Source Code for the PSA-Algorithm is available under:

http://www.psa.es/sdg/sunpos.htm

It seems to be comparable to the from Christian Humann recommended NREL algorithms which is used in the program spa:

https://www.nrel.gov/midc/spa/

From my point of view as a user it would be desirable, that the main used Simulation Programs uses the same or at least quite similar algorithm for calculating the sun position.

TRNSYS uses the Spencer-Algorithm, which is due to the upper publications also not the best choice.
It would be interesting what algorithm EnergyPlus uses.

Regards

Martin

···

On 12/18/15, 8:40 AM, "Martin Gut" <[email protected]<mailto:[email protected]>> wrote:

Von: Christoph Reinhart [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 18:29
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Using a more accurate formula that is based on a respectable source like a good idea if the magnitude of the correction is as large as Martin describes. Incidentally, we are having our students do “validations” of the formula by comparing the photograph of an objects as a certain time in the year to a Radiance rendering and that analysis tends to come out pretty well: http://web.mit.edu/sustainabledesignlab/projects/DaylightingHandbook/Exercise_DirectSunlight.htm.

Best,

Christoph

From: Greg Ward [mailto:[email protected]]
Sent: Thursday, December 17, 2015 12:22 PM
To: Radiance general discussion <[email protected]<mailto:[email protected]>>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don’t know about the history of this debate because I’m quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
  But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I’m wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for “real” calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general

Yes, though it's worth noting that the differences also occur where there is high variance in the data already. I'm less sure what's going on with the peakiness of the second graph, and whether that was due to some other resolution difference and not just the solar position.

If I can get a clear consensus from folks about which formulas to use, I can work on an implementation at some point. Perhaps someone wants to compare the Spencer algorithm to the astronomical calculations library Mark mentioned?

-Greg

···

From: "Guglielmetti, Robert" <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c
Date: December 18, 2015 8:28:21 AM PST

This is fascinating, and in my opinion a cautionary tale for the community, given all the weight being placed on ASE as a daylight metric lately.

On 12/18/15, 8:40 AM, "Martin Gut" <[email protected]<mailto:[email protected]>> wrote:

For me, the difference of the real picture and the simulation is quite visible. Maybe this discussion topic is one reason for this.

We came across this issue by doing a combined thermal and dynamic daylight analysis.
One calculation with original DAYSIM and one DAYSIM calculation with sun position calculated from TRNSYS.
There were quite visible differences, especially in Autumn.

https://drive.google.com/file/d/0B_k3K9s5QAlISGdYWFdlMHZFc00/view?usp=sharing

and

https://drive.google.com/file/d/0B_k3K9s5QAlIb0lRN3VrdXVQaFU/view?usp=sharing

TRNSYS uses the Spencer-Algorithm from 1971 for the calculation of solar declination.
Implementing this Algorithm is easy because it has just a few more sin() and cos() statements .

This graph:

https://drive.google.com/file/d/0B_k3K9s5QAlIbWVXZHhINXhYTDA/view?usp=sharing

shows the differences between this algorithm, the Cooper Algorithm and the Algorithm used in Radiance.
So my first question is answered by this. By using 368 days per year the deviation is smaller than with the original
Cooper Algorithm.

A good starting point for choosing the right algorithm could be in my opinion :
“Computing the solar vector” in Solar Energy Vol. 70, No. 5, pp. 431–441, 2001 by MANUEL BLANCO-MURIEL et al.
Here, the differences of common algorithm are described. They use only the Spencer Algorithm as an example of a simple algorithm.
Following table shows, that there are considerable differences:
https://drive.google.com/file/d/0B_k3K9s5QAlIcS1JQmZFSGttbWs/view?usp=sharing
They recommend the Michalsky-Algorithm or their own PSA-Algorithm, which is a little bit better.
The Michalsky Algorithm is also used in the program SolPos Nathaniel Jones recommended:

https://www.nrel.gov/midc/solpos/

The Source Code for the PSA-Algorithm is available under:

http://www.psa.es/sdg/sunpos.htm

It seems to be comparable to the from Christian Humann recommended NREL algorithms which is used in the program spa:

https://www.nrel.gov/midc/spa/

From my point of view as a user it would be desirable, that the main used Simulation Programs uses the same or at least quite similar algorithm for calculating the sun position.
TRNSYS uses the Spencer-Algorithm, which is due to the upper publications also not the best choice.
It would be interesting what algorithm EnergyPlus uses.

Regards

Martin

Von: Christoph Reinhart [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 18:29
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Using a more accurate formula that is based on a respectable source like a good idea if the magnitude of the correction is as large as Martin describes. Incidentally, we are having our students do “validations” of the formula by comparing the photograph of an objects as a certain time in the year to a Radiance rendering and that analysis tends to come out pretty well: http://web.mit.edu/sustainabledesignlab/projects/DaylightingHandbook/Exercise_DirectSunlight.htm.

Best,

Christoph

From: Greg Ward [mailto:[email protected]]
Sent: Thursday, December 17, 2015 12:22 PM
To: Radiance general discussion <[email protected]<mailto:[email protected]>>
Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don’t know about the history of this debate because I’m quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
But this formula is also used for all the dynamic daylighting stuff like
Gendaymtx
Gendaylit
Daysim
etc.
also for shading studies: I’m wondering that so much computing effort is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of
a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for “real” calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in sun.c

Date: December 17, 2015 7:18:53 AM PST

I’m not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:[email protected]>
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Hi Martin,

be aware, that daysim uses interpolated sun positions (default: interpolation between the four nearby calculated sun positions). This interpolation has a much bigger impact than the small deviation of the sun position caused by the RADIANCE algorithm. This interpolation could cause a big deviation for a single timestep - especially, when you want to control your blinds with a cut-off strategy. And it shouldn't be used at all if you want to calculate the the amount of time direct radiation is falling through small gaps (e.g. fixed blinds).
you can reduce this error by invoking the shadow testing option for the sun interpolation in the header file.

Usually, I don't think that the error in sun position matters so much for the daylight calculations.
We also did it once a deviation calculation (between RADIANCE and the NREL algorithm) and it was max. 1-2 degrees - which is usually not that important for daylight calculations.
You definitely need a higher accuracy if you have a solar concentrator system and want to control your mirror - in that case the NREL calculation is reliable.

But of course it would be nice to have a more accurate sun positions implemented in gensky/gendaylit somewhere in future.

Jan

···

Am 12/18/15 um 4:40 PM schrieb Martin Gut:

For me, the difference of the real picture and the simulation is quite visible. Maybe this discussion topic is one reason for this.

We came across this issue by doing a combined thermal and dynamic daylight analysis.

One calculation with original DAYSIM and one DAYSIM calculation with sun position calculated from TRNSYS.

There were quite visible differences, especially in Autumn.

https://drive.google.com/file/d/0B_k3K9s5QAlISGdYWFdlMHZFc00/view?usp=sharing

and

https://drive.google.com/file/d/0B_k3K9s5QAlIb0lRN3VrdXVQaFU/view?usp=sharing

TRNSYS uses the Spencer-Algorithm from 1971 for the calculation of solar declination.

Implementing this Algorithm is easy because it has just a few more sin() and cos() statements .

This graph:

https://drive.google.com/file/d/0B_k3K9s5QAlIbWVXZHhINXhYTDA/view?usp=sharing

shows the differences between this algorithm, the Cooper Algorithm and the Algorithm used in Radiance.

So my first question is answered by this. By using 368 days per year the deviation is smaller than with the original

Cooper Algorithm.

A good starting point for choosing the right algorithm could be in my opinion :

�Computing the solar vector� in Solar Energy Vol. 70, No. 5, pp. 431�441, 2001 by MANUEL BLANCO-MURIEL et al.

Here, the differences of common algorithm are described. They use only the Spencer Algorithm as an example of a simple algorithm.

Following table shows, that there are considerable differences:

https://drive.google.com/file/d/0B_k3K9s5QAlIcS1JQmZFSGttbWs/view?usp=sharing

They recommend the Michalsky-Algorithm or their own PSA-Algorithm, which is a little bit better.

The Michalsky Algorithm is also used in the program SolPos Nathaniel Jones recommended:

https://www.nrel.gov/midc/solpos/

The Source Code for the PSA-Algorithm is available under:

http://www.psa.es/sdg/sunpos.htm

It seems to be comparable to the from Christian Humann recommended NREL algorithms which is used in the program spa:

https://www.nrel.gov/midc/spa/

From my point of view as a user it would be desirable, that the main used Simulation Programs uses the same or at least quite similar algorithm for calculating the sun position.

TRNSYS uses the Spencer-Algorithm, which is due to the upper publications also not the best choice.

It would be interesting what algorithm EnergyPlus uses.

Regards

Martin

*Von:*Christoph Reinhart [mailto:[email protected]]
*Gesendet:* Donnerstag, 17. Dezember 2015 18:29
*An:* Radiance general discussion
*Betreff:* Re: [Radiance-general] Calculation of solar declination in sun.c

Using a more accurate formula that is based on a respectable source like a good idea if the magnitude of the correction is as large as Martin describes. Incidentally, we are having our students do �validations� of the formula by comparing the photograph of an objects as a certain time in the year to a Radiance rendering and that analysis tends to come out pretty well: http://web.mit.edu/sustainabledesignlab/projects/DaylightingHandbook/Exercise_DirectSunlight.htm.

Best,

Christoph

*From:* Greg Ward [mailto:[email protected]]
*Sent:* Thursday, December 17, 2015 12:22 PM
*To:* Radiance general discussion <[email protected] <mailto:[email protected]>>
*Subject:* Re: [Radiance-general] Calculation of solar declination in sun.c

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,

-Greg

    *From: *Martin Gut <[email protected] <mailto:[email protected]>>

    *Subject: *Re: [Radiance-general] Calculation of solar declination
    in sun.c

    *Date: *December 17, 2015 8:55:38 AM PST

    Hi Greg,

    Thank You for the quick answer. I don�t know about the history of
    this debate because I�m quite new in this mailing list.

    I think for the CIE standard stuff, sticking on the standard
    routines is ok.

      But this formula is also used for all the dynamic daylighting
    stuff like

    Gendaymtx

    Gendaylit

    Daysim

    etc.

    also for shading studies: I�m wondering that so much computing
    effort is investigated to render the shading and on the other side
    the position of this shading is incorrect (especially in Autumn)
    because of

    a very rough calculation of the sun position. The error is not so
    big, but it could be avoided very easy by using a better formula
    for solar declination.

    Maybe there could be two functions, one for the standard
    calculations and one for �real� calculations.

    Martin

    *Von:*Greg Ward [mailto:[email protected]]
    *Gesendet:* Donnerstag, 17. Dezember 2015 17:14
    *An:* Radiance general discussion
    *Betreff:* Re: [Radiance-general] Calculation of solar declination
    in sun.c

    Hi Martin,

    This debate comes up every so often with the solar calculations
    used in Radiance and related tools. The main question is, do we
    stick with the established standard, which provides for easy
    "apples to apples" comparisons, or do we update our formulas to
    get a more precise answer? In the case of the original CIE sky
    models, which this solar calculation is used in primarily, the
    accuracy is not that great, so getting the sun in exactly the
    right place is a minor quibble. If, on the other hand, you need
    precise sun position for solar shading studies or the like, then
    it's easy to argue for a better formula. I don't think computing
    power was ever the issue with Radiance. We don't compute the sun
    position for every ray-traced or anything silly like that.

    As Rick points out, the use of 368 is part of the IES standard
    calculation, but I'm not entirely sure what anomaly it is
    correcting for.

    Cheers,

    -Greg

    *From: *Richard Mistrick <[email protected]
    <mailto:[email protected]>>

    *Subject: *Re: [Radiance-general] Calculation of solar declination
    in sun.c

    *Date: *December 17, 2015 7:18:53 AM PST

        I�m not certain why it is 368, but this equation has been in
        this format in the IES Lighting Handbook for many years.

        Rick

        *From:* Martin Gut [mailto:[email protected]]
        *Sent:* Thursday, December 17, 2015 6:05 AM

        Dear Radiance Experts,

        I have two questions regarding the calculation of solar
        declination:

        1.Why has the year in function sdec in file sun.c 368 days
        instead of 365 as in the original formula from Cooper ?

        return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

        https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

        2.Why does Radiance not use a better formula, which takes into
        account, that the Earth orbit is not a circle?

        With today computing power, there is no more reason to use
        this simple formula

        Thanks in advance

        Martin

    _______________________________________________
    Radiance-general mailing list
    [email protected]
    <mailto:[email protected]>
    http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
Dr.-Ing. Jan Wienold
Ecole Polytechnique F�d�rale de Lausanne (EPFL)
EPFL ENAC IA LIPID

http://people.epfl.ch/jan.wienold
LE 1 111 (Office)
Phone +41 21 69 30849

Hi Greg and Jan,

The second graph is just a zoom of the first graph. The peaks occur around hour: 6800 = day 283, this is also the time with the max. deviation of the solar declination calculation methods.
The in Radiance calculated elevation angle is at this time lower than the reference. Therefore direct daylight gets deeper into the room and the peaks are higher. That makes for me sense.
  The test model is quite simple as shown. Just a box with one window, no shading device, no small gaps.
The magnitude of the differences could of course have also other reasons than just the solar declination calculation, but at the end only differences in the solar position calculation leads to the two different results.
   If the error is between 1-2° as Jan Wienold wrote, than the length of a shadow of the upper part of a window differs from 9 cm to 18 cm at a location at 48°north. If the object is just 30 cm high, than the shadow length differs from 0.9 to 1.8 cm. This is the magnitude I also could see in the pictures of Christoph Reinhart's students.

As Summary:
All this examples just show, that the effect of the sun position calculation method could also be seen in the daylight calculation results. This differences could be reduced by just using a more up to date calculation method, which has no significant influence to computation time.

Martin

PS.: The whole article I mentioned in the previous e-mails could be downloaded for free under:

···

-----Ursprüngliche Nachricht-----
Von: Greg Ward [mailto:[email protected]]
Gesendet: Freitag, 18. Dezember 2015 23:17
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in sun.c

Yes, though it's worth noting that the differences also occur where there is high variance in the data already. I'm less sure what's going on with the peakiness of the second graph, and whether that was due to some other resolution difference and not just the solar position.

If I can get a clear consensus from folks about which formulas to use, I can work on an implementation at some point. Perhaps someone wants to compare the Spencer algorithm to the astronomical calculations library Mark mentioned?

-Greg

From: "Guglielmetti, Robert" <[email protected]>
Subject: Re: [Radiance-general] Calculation of solar declination in
sun.c
Date: December 18, 2015 8:28:21 AM PST

This is fascinating, and in my opinion a cautionary tale for the community, given all the weight being placed on ASE as a daylight metric lately.

On 12/18/15, 8:40 AM, "Martin Gut" <[email protected]<mailto:[email protected]>> wrote:

For me, the difference of the real picture and the simulation is quite visible. Maybe this discussion topic is one reason for this.

We came across this issue by doing a combined thermal and dynamic daylight analysis.
One calculation with original DAYSIM and one DAYSIM calculation with sun position calculated from TRNSYS.
There were quite visible differences, especially in Autumn.

https://drive.google.com/file/d/0B_k3K9s5QAlISGdYWFdlMHZFc00/view?usp=
sharing

and

https://drive.google.com/file/d/0B_k3K9s5QAlIb0lRN3VrdXVQaFU/view?usp=
sharing

TRNSYS uses the Spencer-Algorithm from 1971 for the calculation of solar declination.
Implementing this Algorithm is easy because it has just a few more sin() and cos() statements .

This graph:

https://drive.google.com/file/d/0B_k3K9s5QAlIbWVXZHhINXhYTDA/view?usp=
sharing

shows the differences between this algorithm, the Cooper Algorithm and the Algorithm used in Radiance.
So my first question is answered by this. By using 368 days per year
the deviation is smaller than with the original Cooper Algorithm.

A good starting point for choosing the right algorithm could be in my opinion :
"Computing the solar vector" in Solar Energy Vol. 70, No. 5, pp. 431-441, 2001 by MANUEL BLANCO-MURIEL et al.
Here, the differences of common algorithm are described. They use only the Spencer Algorithm as an example of a simple algorithm.
Following table shows, that there are considerable differences:
https://drive.google.com/file/d/0B_k3K9s5QAlIcS1JQmZFSGttbWs/view?usp=
sharing They recommend the Michalsky-Algorithm or their own
PSA-Algorithm, which is a little bit better.
The Michalsky Algorithm is also used in the program SolPos Nathaniel Jones recommended:

https://www.nrel.gov/midc/solpos/

The Source Code for the PSA-Algorithm is available under:

http://www.psa.es/sdg/sunpos.htm

It seems to be comparable to the from Christian Humann recommended NREL algorithms which is used in the program spa:

https://www.nrel.gov/midc/spa/

From my point of view as a user it would be desirable, that the main used Simulation Programs uses the same or at least quite similar algorithm for calculating the sun position.
TRNSYS uses the Spencer-Algorithm, which is due to the upper publications also not the best choice.
It would be interesting what algorithm EnergyPlus uses.

Regards

Martin

Von: Christoph Reinhart [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 18:29
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in
sun.c

Using a more accurate formula that is based on a respectable source like a good idea if the magnitude of the correction is as large as Martin describes. Incidentally, we are having our students do "validations" of the formula by comparing the photograph of an objects as a certain time in the year to a Radiance rendering and that analysis tends to come out pretty well: http://web.mit.edu/sustainabledesignlab/projects/DaylightingHandbook/Exercise_DirectSunlight.htm.

Best,

Christoph

From: Greg Ward [mailto:[email protected]]
Sent: Thursday, December 17, 2015 12:22 PM
To: Radiance general discussion
<[email protected]<mailto:radiance-general@radiance
-online.org>>
Subject: Re: [Radiance-general] Calculation of solar declination in
sun.c

Given the tool construction, it would be simple enough to introduce a global variable that switches between the de facto solar angle calculation and a more precise version. I'd like to hear from others that this is worthwhile before I spend too much time on it, though. Also, whether it should be exposed as an option in all of the calling programs (i.e., IES calculation or more accurate on).

Is there a general consensus on which solar calculation is best? I would just end up googling it, unless you or someone else has a strong recommendation.

Cheers,
-Greg

From: Martin Gut <[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in
sun.c

Date: December 17, 2015 8:55:38 AM PST

Hi Greg,

Thank You for the quick answer. I don't know about the history of this debate because I'm quite new in this mailing list.
I think for the CIE standard stuff, sticking on the standard routines is ok.
But this formula is also used for all the dynamic daylighting stuff
like Gendaymtx Gendaylit Daysim etc.
also for shading studies: I'm wondering that so much computing effort
is investigated to render the shading and on the other side the position of this shading is incorrect (especially in Autumn) because of a very rough calculation of the sun position. The error is not so big, but it could be avoided very easy by using a better formula for solar declination.
Maybe there could be two functions, one for the standard calculations and one for "real" calculations.

Martin

Von: Greg Ward [mailto:[email protected]]
Gesendet: Donnerstag, 17. Dezember 2015 17:14
An: Radiance general discussion
Betreff: Re: [Radiance-general] Calculation of solar declination in
sun.c

Hi Martin,

This debate comes up every so often with the solar calculations used in Radiance and related tools. The main question is, do we stick with the established standard, which provides for easy "apples to apples" comparisons, or do we update our formulas to get a more precise answer? In the case of the original CIE sky models, which this solar calculation is used in primarily, the accuracy is not that great, so getting the sun in exactly the right place is a minor quibble. If, on the other hand, you need precise sun position for solar shading studies or the like, then it's easy to argue for a better formula. I don't think computing power was ever the issue with Radiance. We don't compute the sun position for every ray-traced or anything silly like that.

As Rick points out, the use of 368 is part of the IES standard calculation, but I'm not entirely sure what anomaly it is correcting for.

Cheers,
-Greg

From: Richard Mistrick
<[email protected]<mailto:[email protected]>>

Subject: Re: [Radiance-general] Calculation of solar declination in
sun.c

Date: December 17, 2015 7:18:53 AM PST

I'm not certain why it is 368, but this equation has been in this format in the IES Lighting Handbook for many years.

Rick

From: Martin Gut [mailto:[email protected]]
Sent: Thursday, December 17, 2015 6:05 AM

Dear Radiance Experts,

I have two questions regarding the calculation of solar declination:

1. Why has the year in function sdec in file sun.c 368 days instead of 365 as in the original formula from Cooper ?

return( 0.4093 * sin( (2*PI/368) * (jd - 81) ) )

https://github.com/NREL/Radiance/blob/master/src/gen/sun.c

2. Why does Radiance not use a better formula, which takes into account, that the Earth orbit is not a circle?

With today computing power, there is no more reason to use this simple
formula

Thanks in advance

Martin

_______________________________________________
Radiance-general mailing list
[email protected]<mailto:Radiance-general@radiance-
online.org>
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Dear devs,

I appreciate this an old, stale thread. However, I was just about to send a bug report regarding the 358 divisor in sun.c, so I thought I might as well continue here.

Line 53 in sun.c should read

return( 0.4093 * sin( (2*PI/365) * (jd - 81) ) );

The following references all agree on the 365 divisor:

I understand the 368 divosor is taken from the IES lighting handbook, so this appears to be wrong.

The typo essentially means that the SD formula assumes the year is 368 days long. The resulting error in SD angle is zero at the spring equinox (JD-81), and highest at the end of December.

The link below contains 2 XLSX spreadsheets, showing the solar altitude in London at +12:00 for every day of the year.
London_solar_altitude_1200_vec.xlsx is with the current gensky (368 divisor), and London_solar_altitude_1200_sd-fix.xlsx is with a 365 divisor.

Highlighted in the first spreadsheet are three days that would, the other side of the winter solstice, fall on the 32nd, 33rd and 34th December. The fixed version does not have this discontinuity.

https://giauk.sharefile.com/d-s02fbd37383244de8

Have a good weekend, everyone

Wow, Axel – this must be one of the oldest bugs in Radiance! I wonder if our friends with access to more accurate solar angle calcs could also run a comparison? I believe the original 368 value was copied from the same source the IES handbook used, which was a short technical report by Mark Modest (if I remember right). I didn’t think too much about it at the time, as there are also the odd non-periodic divisors in the solar time adjustment calculation, but I guess those are better worked out…

Hi Greg,

I’ve uploaded another file to the same ShareFile folder: London_solar_altitude_1200_Meeus.xlsx

This one compares Jean Meeus’ algorithm against the (fixed) Radiance one. The max error of the Radiance algorithm is 3.5% or 1 degrees.

Thanks, Axel. I think you can upload files or include them in discussions directly on the Discourse server. That was one of the reasons we migrated here. (I’m having some security exception when I try to access your share point.)

Here are the files in case you have issues with accessing the ShareFile thingy. I can only upload images to this discourse group, so the links are to my server:

Solar altitude at +12:00 for London (current gensky):
http://www.jaloxa.eu/pickup/London_solar_altitude_1200_vec.xlsx
Solar altitude at +12:00 for London (365 divisor fix):
http://www.jaloxa.eu/pickup/London_solar_altitude_1200_sd-fix.xlsx
Comparison again Jean Meeus solar algorithm:
http://www.jaloxa.eu/pickup/London_solar_altitude_1200_Meeus.xlsx