aerosandbox.library.power_solar =============================== .. py:module:: aerosandbox.library.power_solar Attributes ---------- .. autoapisummary:: aerosandbox.library.power_solar.base_color Functions --------- .. autoapisummary:: aerosandbox.library.power_solar._prepare_for_inverse_trig aerosandbox.library.power_solar.solar_flux_outside_atmosphere_normal aerosandbox.library.power_solar.declination_angle aerosandbox.library.power_solar.solar_elevation_angle aerosandbox.library.power_solar.solar_azimuth_angle aerosandbox.library.power_solar.airmass aerosandbox.library.power_solar.solar_flux aerosandbox.library.power_solar.peak_sun_hours_per_day_on_horizontal aerosandbox.library.power_solar.length_day aerosandbox.library.power_solar.mass_MPPT Module Contents --------------- .. py:function:: _prepare_for_inverse_trig(x) Ensures that a value is within the open interval (-1, 1), so that if you call an inverse trig function on it (e.g., arcsin, arccos), you won't get an infinity or NaN. :param x: A floating-point number or an array of such. If an array, this function acts elementwise. Returns: A clipped version of the number, constrained to be in the open interval (-1, 1). .. py:function:: solar_flux_outside_atmosphere_normal(day_of_year) Computes the normal solar flux at the top of the atmosphere ("Airmass 0"). This varies due to Earth's orbital eccentricity (elliptical orbit). Source: https://www.itacanet.org/the-sun-as-a-source-of-energy/part-2-solar-energy-reaching-the-earths-surface/#2.1.-The-Solar-Constant :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) Returns: The normal solar flux [W/m^2] at the top of the atmosphere. .. py:function:: declination_angle(day_of_year) Computes the solar declination angle, in degrees, as a function of day of year. Accounts for the Earth's obliquity. Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/declination-angle :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) Returns: Solar declination angle [deg] .. py:function:: solar_elevation_angle(latitude, day_of_year, time) Elevation angle of the sun [degrees] for a local observer. Solar elevation angle is the angle between the Sun's position and the local horizon plane. (Solar elevation angle) = 90 deg - (solar zenith angle) Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/elevation-angle :param latitude: Local geographic latitude [degrees]. Positive for north, negative for south. :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :param time: Time after local solar noon [seconds] Returns: Solar elevation angle [degrees] (angle between horizon and sun). Returns negative values if the sun is below the horizon. .. py:function:: solar_azimuth_angle(latitude, day_of_year, time) Azimuth angle of the sun [degrees] for a local observer. Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/azimuth-angle :param latitude: Local geographic latitude [degrees]. Positive for north, negative for south. :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :param time: Time after local solar noon [seconds] Returns: Solar azimuth angle [degrees] (the compass direction from which the sunlight is coming). * 0 corresponds to North, 90 corresponds to East. * Output ranges from 0 to 360 degrees. .. py:function:: airmass(solar_elevation_angle, altitude = 0.0, method='Young') Computes the (relative) airmass as a function of the (true) solar elevation angle and observer altitude. Includes refractive (e.g. curving) effects due to atmospheric density gradient. Airmass is the line integral of air density along an upwards-pointed ray, extended to infinity. As a raw calculation of "absolute airmass", this would have units of kg/m^2. It varies primarily as a function of solar elevation angle and observer altitude. (Higher altitude means less optical absorption.) However, "airmass" usually refers to the "relative airmass", which is the absolute airmass of a given scenario divided by the absolute airmass of a reference scenario. This reference scenario is when the sun is directly overhead (solar elevation angle of 90 degrees) and the observer is at sea level. Therefore: * Outer space has a (relative) airmass of 0 (regardless of solar elevation angle). * Sea level with the sun directly overhead has a (relative) airmass of 1. * Sea level with the sun at the horizon has a (relative) airmass of ~31.7. (Not infinity, since the Earth is spherical, so the ray eventually reaches outer space.) Some models will say that this relative airmass at the horizon should be ~38; that is only true if one uses the *apparent* solar elevation angle, rather than the *true* (geometric) one. The discrepancy comes from the fact that light refracts (curves) as it passes through the atmosphere's density gradient, with the difference between true and apparent elevation angles reaching a maximum of 0.56 degrees at the horizon. Solar elevation angle is the angle between the Sun's position and the horizon. (Solar elevation angle) = 90 deg - (solar zenith angle) Note that for small negative values of the solar elevation angle (e.g., -0.5 degree), airmass remains finite, due to ray refraction (curving) through the atmosphere. For significantly negative values of the solar elevation angle (e.g., -10 degrees), the airmass is theoretically infinite. This function returns 1e100 in lieu of this here. Sources: Young model: Young, A. T. 1994. Air mass and refraction. Applied Optics. 33:1108–1110. doi: 10.1364/AO.33.001108. Reproduced at https://en.wikipedia.org/wiki/Air_mass_(astronomy) :param solar_elevation_angle: Solar elevation angle [degrees] (angle between horizon and sun). Note that we use the :param true solar elevation angle: :param rather than the apparent one. The discrepancy comes from the fact that light: :param refracts: :type refracts: curves :param and apparent elevation angles reaching a maximum of 0.56 degrees at the horizon.: :param altitude: Altitude of the observer [meters] above sea level. :param method: A string that determines which model to use. Returns: The relative airmass [unitless] as a function of the (true) solar elevation angle and observer altitude. * Always ranges from 0 to Infinity .. py:function:: solar_flux(latitude, day_of_year, time, altitude = 0.0, panel_azimuth_angle = 0.0, panel_tilt_angle = 0.0, air_quality = 'typical', albedo = 0.2, **deprecated_kwargs) Computes the solar power flux (power per unit area) on a flat (possibly tilted) panel. Accounts for atmospheric absorption, scattering, and re-scattering (e.g. diffuse illumination), all as a function of panel altitude. Fully vectorizable. Source for atmospheric absorption: * Planning and installing photovoltaic systems: a guide for installers, architects and engineers, 2nd Ed. (2008), Table 1.1, Earthscan with the International Institute for Environment and Development, Deutsche Gesellschaft für Sonnenenergie. ISBN 1-84407-442-0., accessed via https://en.wikipedia.org/wiki/Air_mass_(solar_energy) :param latitude: Local geographic latitude [degrees]. Positive for north, negative for south. :param day_of_year: The day of the year, represented in the Julian day format (i.e., 1 == Jan. 1, 365 == Dec. 31). This accounts for seasonal variations in the sun's position in the sky. :param time: The time of day, measured as the time elapsed after local solar noon [seconds]. Should range from 0 to 86,400 (the number of seconds in a day). Local solar noon is the time of day when the sun is at its highest point in the sky, directly above the observer's local meridian. This is the time when the sun's rays are most directly overhead and solar flux is at its peak for a given location. Solar noon does not necessarily occur at exactly 12:00 PM local standard time, as it depends on your longitude, the equation of time, and the time of year. (Also, don't forget to account for Daylight Savings Time, if that's a relevant consideration for your location and season.) Typically, local solar noon is +- 15 minutes from 12:00 PM local standard time. :param altitude: Altitude of the panel above sea level [meters]. This affects atmospheric absorption and scattering characteristics. :param panel_azimuth_angle: The azimuth angle of the panel normal [degrees] (the compass direction in which the panel normal is tilted). Irrelevant if the panel tilt angle is 0 (e.g., the panel is horizontal). * 0 corresponds to North, 90 corresponds to East. * Input ranges from 0 to 360 degrees. :param panel_tilt_angle: The angle between the panel normal and vertical (zenith) [degrees]. * Note: this angle convention is different than the solar elevation angle convention! * A horizontal panel has a tilt angle of 0, and a vertical panel has a tilt angle of 90 degrees. If the angle between the panel normal and the sun direction is ever more than 90 degrees (e.g. the panel is pointed the wrong way), we assume that the panel receives no direct irradiation. (However, it may still receive minor amounts of power due to diffuse irradiation from re-scattering.) :param air_quality: Indicates the amount of pollution in the air. A string, one of: * 'clean': Pristine atmosphere conditions. * 'typical': Corresponds to "rural aerosol loading" following ASTM G-173. * 'polluted': Urban atmosphere conditions. Note: in very weird edge cases, a polluted atmosphere can actually result in slightly higher solar flux than clean air, due to increased back-scattering. For example, imagine it's near sunset, with the sun in the west, and your panel normal vector points east. Increased pollution can, in some edge cases, result in enough increased back-scattering (multipathing) that you have a smidge more illumination. :param albedo: The fraction of light that hits the ground that is reflected. Affects illumination from re-scattering when panels are tilted. Typical values for general terrestrial surfaces are 0.2, which is the default here. * Other values, taken from the Earthscan source (citation above): * Grass (July, August): 0.25 * Lawn: 0.18 - 0.23 * Dry grass: 0.28 - 0.32 * Milled fields: 0.26 * Barren soil: 0.17 * Gravel: 0.18 * Clean concrete: 0.30 * Eroded concrete: 0.20 * Clean cement: 0.55 * Asphalt: 0.15 * Forests: 0.05 - 0.18 * Sandy areas: 0.10 - 0.25 * Water: Strongly dependent on incidence angle; 0.05 - 0.22 * Fresh snow: 0.80 - 0.90 * Old snow: 0.45 - 0.70 Returns: The solar power flux [W/m^2] on the panel. * Note: does not account for any potential reflectivity of the solar panel's coating itself. .. py:function:: peak_sun_hours_per_day_on_horizontal(latitude, day_of_year) How many hours of equivalent peak sun do you get per day? :param latitude: Latitude [degrees] :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :param time: Time since (local) solar noon [seconds] :return: .. py:function:: length_day(latitude, day_of_year) Gives the duration where the sun is above the horizon on a given day. :param latitude: Local geographic latitude [degrees]. Positive for north, negative for south. :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) Returns: The duration where the sun is above the horizon on a given day. [seconds] .. py:function:: mass_MPPT(power) Gives the estimated mass of a Maximum Power Point Tracking (MPPT) unit for solar energy collection. Based on regressions at AeroSandbox/studies/SolarMPPTMasses. :param power: Power of MPPT [watts] :returns: Estimated MPPT mass [kg] .. py:data:: base_color :value: '#4285F4'