Calculation of sun position: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Restored page from Google Cache, uploaded by John Pye
 
No edit summary
Line 1: Line 1:
The ASCEND [[ModelLibrary|model library]] contains a file {{src|models/johnpye/sunpos.a4c}} that can be loaded in ASCEND and used to calculate the position of the sun at any location on earth and at any time of day or day of the year. It uses the method of Duffie and Beckman<sup id="_ref-0" class="reference"><a href="#_note-0" title="">[1]</a></sup>, which is accurate to the extent required for solar thermal energy calculations, but probably unsuitable for use in astronomy.
The ASCEND [[ModelLibrary|model library]] contains a file {{src|models/johnpye/sunpos.a4c}} that can be loaded in ASCEND and used to calculate the position of the sun at any location on earth and at any time of day or day of the year. It uses the method of Duffie and Beckman<ref>Duffie & Beckman, (2006) ''Solar Engineering of Thermal Processes'', Wiley.</ref>, which is accurate to the extent required for solar thermal energy calculations, but probably unsuitable for use in astronomy.
 


The following is a code snippet, taken from the {{src|models/johnpye/sunpos.a4c}} file, that solves Example 1.6.1 from that book. It can be run and solved using [[Main_Page|ASCEND]] with the command <tt>ascend johnpye/sunpos.a4c</tt>.
The following is a code snippet, taken from the {{src|models/johnpye/sunpos.a4c}} file, that solves Example 1.6.1 from that book. It can be run and solved using [[Main_Page|ASCEND]] with the command <tt>ascend johnpye/sunpos.a4c</tt>.
Line 33: Line 32:
END values;
END values;
METHOD self_test;
METHOD self_test;
     ASSERT abs(theta-35.0{deg}) &lt; 0.15{deg};
     ASSERT abs(theta-35.0{deg}) < 0.15{deg};


     ASSERT abs(delta-(-13.80{deg})) &lt; 0.02{deg};
     ASSERT abs(delta-(-13.80{deg})) < 0.02{deg};
END self_test;
END self_test;


Line 41: Line 40:


It is intended that this sun position calculation would be linked together with the experimental [[Data reader]] component to allow solar energy engineering problems to be solved over the course of days, weeks or years, along the lines of the [[Other_modelling_tools|TRNSYS]] simulation tool.
It is intended that this sun position calculation would be linked together with the experimental [[Data reader]] component to allow solar energy engineering problems to be solved over the course of days, weeks or years, along the lines of the [[Other_modelling_tools|TRNSYS]] simulation tool.


== References ==
== References ==
 
<references/>
<br />
 


== See also ==
== See also ==
Line 54: Line 50:
* [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_ashighlight] (syntax highlighter used on this page)
* [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_ashighlight] (syntax highlighter used on this page)


 
[[Category:Examples]]
 
[[Category:Examples]]
[[Category:Documentation]]
[[Category:Documentation]]

Revision as of 00:40, 30 July 2010

The ASCEND model library contains a file models/johnpye/sunpos.a4c that can be loaded in ASCEND and used to calculate the position of the sun at any location on earth and at any time of day or day of the year. It uses the method of Duffie and Beckman[1], which is accurate to the extent required for solar thermal energy calculations, but probably unsuitable for use in astronomy.

The following is a code snippet, taken from the models/johnpye/sunpos.a4c file, that solves Example 1.6.1 from that book. It can be run and solved using ASCEND with the command ascend johnpye/sunpos.a4c.

(*
    For Madison (Wisconsin), calculate the angle of incidence of beam radiation

    on a surface at 10:30 AM solar time on February 13, if the surface is
    tilted 45 from the horizontal and pointed 15 degrees west of south.
*)
MODEL example_1_6_1 REFINES sunpos;
METHODS

METHOD specify;
    RUN sunpos::specify;
    FREE t;

    FIX t_solar;
END specify;
METHOD values;
    RUN sunpos::values;

    t_solar := 43{d} + 10{h} + 30{min};

    beta := 45 {deg};
    gamma := 15 {deg};

    L_st := -90{deg}; (* USA Central time*)
    L_loc := -89.4{deg};
    phi := +43{deg};

END values;
METHOD self_test;
    ASSERT abs(theta-35.0{deg}) < 0.15{deg};

    ASSERT abs(delta-(-13.80{deg})) < 0.02{deg};
END self_test;

END example_1_6_1;

It is intended that this sun position calculation would be linked together with the experimental Data reader component to allow solar energy engineering problems to be solved over the course of days, weeks or years, along the lines of the TRNSYS simulation tool.

References

  1. Duffie & Beckman, (2006) Solar Engineering of Thermal Processes, Wiley.

See also