> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plantpredict.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Air Mass Model

export const Decomposition = () => <Tooltip tip="Separating GHI into direct (DNI) and diffuse (DHI) components using empirical models.">
    decomposition
  </Tooltip>;

export const Transposition = () => <Tooltip tip="Converting horizontal irradiance components to plane-of-array (tilted surface) irradiance.">
    transposition
  </Tooltip>;

export const SpectralEffects = () => <Tooltip tip="Changes in solar spectrum due to atmospheric path length, affecting PV module performance.">
    spectral effects
  </Tooltip>;

export const Refraction = () => <Tooltip tip="Bending of light as it passes through earth's atmosphere, making the sun appear higher than its true position.">
    refraction
  </Tooltip>;

export const ZenithAngle = () => <Tooltip tip="Angle between the local vertical and the sun (0° = overhead, 90° = horizon).">
    zenith angle
  </Tooltip>;

export const AirMassCap = () => <Tooltip tip="Ratio of atmospheric path length to path length at zenith; equals 1 when sun is overhead.">
    Air Mass
  </Tooltip>;

## Summary

The <AirMassCap /> Model calculates the relative optical path length of sunlight through earth's atmosphere based on the solar <ZenithAngle />, accounting for atmospheric <Refraction /> and curvature effects. PlantPredict implements two empirical air mass models: Bird-Hulstrom and Kasten-Sandia. Air mass is used downstream in <Transposition /> models (Perez), <Decomposition /> models (DIRINT), and <SpectralEffects /> calculations.

## Inputs

| Name                     | Symbol     | Units   | Description                                               |
| ------------------------ | ---------- | ------- | --------------------------------------------------------- |
| **Solar Zenith Angle**   | $\theta_z$ | degrees | Angle between the zenith and the line of sight to the sun |
| **Atmospheric Pressure** | $P$        | hPa     | Local atmospheric pressure                                |
| **Altitude**             | $h$        | m       | Elevation above sea level                                 |

***

## Outputs

| Name                            | Symbol | Units | Description                                                                           |
| ------------------------------- | ------ | ----- | ------------------------------------------------------------------------------------- |
| **Relative Air Mass**           | $AM$   | —     | Optical path length relative to zenith; used in Perez transposition                   |
| **Pressure-Corrected Air Mass** | $AM'$  | —     | Air mass adjusted for local pressure; used in DIRINT decomposition and spectral shift |

***

## Detailed Description

The **Air Mass Model** quantifies how much longer the path through the atmosphere is compared to the vertical path at zenith. At zenith ($\theta_z = 0°$), air mass equals 1.0. As the sun approaches the horizon, the path length increases. PlantPredict provides two empirical models that account for atmospheric curvature and refraction:

1. **Bird-Hulstrom**: Based on Bird & Hulstrom (1981)
2. **Kasten-Sandia**: Based on Kasten & Young (1989)

Both models use the same general formula but with different empirical coefficients derived from atmospheric observations:

$$
AM = \frac{1}{\cos(\theta_z) + a (b - \theta_z)^{-c}}
$$

| Model         | $a$     | $b$      | $c$    |
| ------------- | ------- | -------- | ------ |
| Bird-Hulstrom | 0.15    | 93.885   | 1.253  |
| Kasten-Sandia | 0.50572 | 96.07995 | 1.6364 |

For zenith angles at or above 89°, air mass is set to zero:

$$
AM = 0 \quad \text{for } \theta_z \geq 89°
$$

At these grazing angles the empirical formula becomes unreliable; however, incident solar radiation is also negligible, so the cutoff minimally affects energy calculations.

Typical air mass values:

* At sea level, zenith: $AM = 1.0$
* At sea level, $\theta_z = 60°$: $AM \approx 2.0$
* At sea level, $\theta_z = 80°$: $AM \approx 5.7$
* At sea level, $\theta_z = 85°$: $AM \approx 11-12$

### Pressure Correction

For spectral calculations, PlantPredict uses the **pressure-corrected air mass** $AM'$. This accounts for the fact that atmospheric scattering and absorption scale with air density—at lower pressures (e.g., higher elevations), there are fewer molecules to scatter and absorb radiation, reducing these effects:

$$
AM' = AM \times \frac{P}{P_0}
$$

where:

* $AM$ is the relative air mass from above
* $P$ is the local atmospheric pressure (hPa)
* $P_0 = 1013.25$ hPa is standard sea level pressure

### Pressure from Altitude

If pressure is not directly provided in the weather file, PlantPredict estimates it from elevation using the barometric formula:

$$
P = 1013.25 \times \left(1 - h \times 2.25577 \times 10^{-5}\right)^{5.25588}
$$

where $h$ is elevation in meters above sea level.

This formula is based on the standard atmosphere model, which assumes a temperature decrease rate of 6.5°C per kilometer of altitude.

***

## References

* Kasten, F., & Young, A. T. (1989). *Revised optical air mass tables and approximation formula.* Applied Optics, 28(22), 4735–4738. DOI: [10.1364/AO.28.004735](https://doi.org/10.1364/AO.28.004735)
* Bird, R. E., & Hulstrom, R. L. (1981). *A simplified clear sky model for direct and diffuse insolation on horizontal surfaces.* Solar Energy Research Institute Report SERI/TR-642-761. DOI: [10.2172/6510849](https://doi.org/10.2172/6510849)
