The BioCro C++ Library
solar_position_michalsky Class Reference

Calculates the solar position using the model described in Michalsky, J. J. "The Astronomical Almanac's algorithm for approximate solar position (1950–2050)" Solar Energy 40, 227–235 (1988) More...

#include <solar_position_michalsky.h>

+ Inheritance diagram for solar_position_michalsky:
+ Collaboration diagram for solar_position_michalsky:

Public Member Functions

 solar_position_michalsky (state_map const &input_quantities, state_map *output_quantities)
 

Static Public Member Functions

static string_vector get_inputs ()
 
static string_vector get_outputs ()
 
static std::string get_name ()
 

Detailed Description

Calculates the solar position using the model described in Michalsky, J. J. "The Astronomical Almanac's algorithm for approximate solar position (1950–2050)" Solar Energy 40, 227–235 (1988)

As the paper's title indicates, this method is only recommended for years between 1950 - 2050.

In this module, we neglect the refraction correction from the Michalsky paper. The correction is small and was not found to have a significant effect on the output of a BioCro simulation; furthermore, it is discontinuous, which can cause problems for differential equation solvers.

The cosine of the solar zenith angle is provided as a convenience since several other BioCro modules only use the zenith angle via its cosine.

Model details

The calculations in the model follow this general structure:

  • First, the time is converted from the more familiar format of year, day, hour, etc into a Julian date, which uniquely specifies a time using one number representing the continuous count of days since the beginning of the Julian period. An additional operation converts the Julian date into an "n" date representing the difference in Julian date between the current time and 1 January 2000 (UTC). Although this format is less common than the Julian date, the "n" date is the basis for the calculations used by the Astronomical Almanac. These "date conversion" operations follow Section 2.1 of the Michalsky paper.
  • Second, the time (expressed as an "n" date) is used to calculate the ecliptic coordinates of the sun: the mean longitude, the mean anomaly, the ecliptic anomaly, and the obliquity of the ecliptic. These four numbers represent the location of the Sun relative to the Earth; see https://en.wikipedia.org/wiki/Ecliptic_coordinate_system#Spherical_coordinates for more information about this coordinate system. These operations follow Section 2.2 of the Michalsky paper.
  • Third, the ecliptic coordinates are used to determine the Sun's position in celestial coordinates; here the conversion is accomplished using purely geometric factors with no explicit reference to the time. In this system, the Sun's position is specified using right ascension (analogous to longitude) and declination (analogous to latitude). See https://en.wikipedia.org/wiki/Astronomical_coordinate_systems#Equatorial_system for more information about this coordinate system. These operations follow Section 2.3 of the Michalsky paper.
  • Fourth, two additional expressions of time are determined: Greenwich mean sidereal time and local mean sidereal time. See https://en.wikipedia.org/wiki/Sidereal_time for more information about sidereal time. These operations follow the first two equations in Section 2.4 of the Michalsky paper.
  • Fifth, the coordinates of the Sun's position in the local sky (the local hour, azimuthal, and zenith angles) can finally be determined from the celestial coordinates and the local mean sidereal time. See https://en.wikipedia.org/wiki/Solar_zenith_angle for more information about this coordinate system. These operations follow Equations 3 - 5 in the Michalsky paper.

Symbols and quantity names used in this module

Name Variable in code BioCro quantity
Julian date jd 'julian_date'
"n" date n NA
mean longitude L 'solar_L'
mean anomaly g 'solar_g'
ecliptic anomaly ell 'solar_ell'
obliquity of the ecliptic ep 'solar_ep'
right ascension ra 'solar_ra'
declination dec 'solar_dec'
Greenwich mean sidereal time gmst 'gmst'
local mean sidereal time lmst 'lmst'
local hour angle lha 'lha'
zenith angle zen 'solar_zenith_angle'
azimuthal angle az 'solar_azimuth_angle'
cosine of the zenith angle cos_zen 'cosine_zenith_angle'

Definition at line 96 of file solar_position_michalsky.h.

Constructor & Destructor Documentation

◆ solar_position_michalsky()

solar_position_michalsky ( state_map const &  input_quantities,
state_map *  output_quantities 
)
inline

Definition at line 99 of file solar_position_michalsky.h.

Member Function Documentation

◆ get_inputs()

string_vector get_inputs ( )
static

Definition at line 158 of file solar_position_michalsky.h.

◆ get_name()

static std::string get_name ( )
inlinestatic

Definition at line 129 of file solar_position_michalsky.h.

◆ get_outputs()

string_vector get_outputs ( )
static

Definition at line 169 of file solar_position_michalsky.h.


The documentation for this class was generated from the following file: