> ## 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.

# GHI Diffuse-Direct Decomposition

export const Turbidity = () => <Tooltip tip="Cloudiness or haziness of the atmosphere due to aerosols, water vapor, and particles that scatter and absorb sunlight.">
    turbidity
  </Tooltip>;

export const Transmittance = () => <Tooltip tip="Fraction of solar radiation that passes through the atmosphere to reach the surface.">
    transmittance
  </Tooltip>;

export const ClosureEquation = () => <Tooltip tip="GHI = DNI × cos(θz) + DHI; relates the three horizontal irradiance components.">
    closure equation
  </Tooltip>;

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

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

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

export const DHI = () => <Tooltip tip="Diffuse Horizontal Irradiance: solar radiation from the sky dome (excluding direct beam) on a horizontal surface.">
    DHI
  </Tooltip>;

export const DNI = () => <Tooltip tip="Direct Normal Irradiance: solar radiation received perpendicular to the sun's rays (direct beam only).">
    DNI
  </Tooltip>;

export const GHI = () => <Tooltip tip="Global Horizontal Irradiance: total solar radiation on a horizontal surface (direct + diffuse).">
    GHI
  </Tooltip>;

export const ClearnessIndex = () => <Tooltip tip="Ratio of measured GHI to extraterrestrial irradiance; quantifies atmospheric transmittance.">
    clearness index
  </Tooltip>;

## Summary

Diffuse-Direct <Decomposition /> models separate global horizontal irradiance (<GHI />) into its direct normal irradiance (<DNI />) and diffuse horizontal irradiance (<DHI />) components. PlantPredict implements three decomposition models: Erbs, Reindl, and DIRINT. These models use empirically derived relationships based on the <ClearnessIndex /> and atmospheric parameters to estimate the diffuse fraction of GHI under varying sky conditions.

## Inputs

| Name                                          | Symbol        | Units   | Description                                                                   |
| --------------------------------------------- | ------------- | ------- | ----------------------------------------------------------------------------- |
| **Global Horizontal Irradiance**              | $GHI$         | W/m²    | Total irradiance on horizontal surface from weather data                      |
| **Extraterrestrial Direct Normal Irradiance** | $DNI_{extra}$ | W/m²    | Solar irradiance at top of atmosphere                                         |
| **Solar Zenith Angle**                        | $\theta_z$    | degrees | Angle between sun and local vertical                                          |
| **Ambient Air Temperature**                   | $T_a$         | °C      | Ambient air temperature (Reindl model only)                                   |
| **Relative Humidity**                         | $RH$          | %       | Relative humidity (Reindl model only)                                         |
| **Atmospheric Pressure**                      | $P$           | hPa     | Local atmospheric pressure, used for air mass calculation (DIRINT model only) |

***

## Outputs

| Name                              | Symbol | Units | Description                                               |
| --------------------------------- | ------ | ----- | --------------------------------------------------------- |
| **Diffuse Horizontal Irradiance** | $DHI$  | W/m²  | Solar radiation from the sky dome (excluding direct beam) |
| **Direct Normal Irradiance**      | $DNI$  | W/m²  | Direct beam component perpendicular to sun's rays         |

***

## Detailed Description

All <Decomposition /> models begin by computing the clearness index, representing the fraction of extraterrestrial irradiance reaching the ground:

$$
K_t = \frac{GHI}{DNI_{extra} \cos(\theta_z)}
$$

where $\theta_z$ is the solar <ZenithAngle />. $K_t$ is set to 0 if $\theta_z \geq 87.9°$.

The clearness index characterizes sky conditions from overcast ($K_t < 0.3$) to clear ($K_t > 0.7$).

### Erbs Model

The Erbs model uses only clearness index to compute diffuse fraction $f_d$ using a piecewise polynomial function:

| $K_t$ value           | Diffuse Fraction Equation                                               |
| --------------------- | ----------------------------------------------------------------------- |
| $K_t \leq 0.22$       | $f_d = 1.0 - 0.09 K_t$                                                  |
| $0.22 < K_t \leq 0.8$ | $f_d = 0.9511 - 0.1604 K_t + 4.388 K_t^2 - 16.638 K_t^3 + 12.336 K_t^4$ |
| $K_t > 0.8$           | $f_d = 0.165$                                                           |

Once $f_d$ is determined, the DHI is calculated, then the DNI is obtained from the <ClosureEquation />:

$$
DHI = f_d \times GHI
$$

$$
DNI = \frac{GHI - DHI}{\cos(\theta_z)}
$$

### Reindl Model

The Reindl model extends the clearness index approach by incorporating solar zenith angle, air temperature, and relative humidity, accounting for sun position and atmospheric effects on scattering.

**When relative humidity is provided in the weather file** (converted from % to a fraction from 0 to 1):

| $K_t$ Value           | Diffuse Fraction Equation                                                 |
| --------------------- | ------------------------------------------------------------------------- |
| $0 \leq K_t \leq 0.3$ | $f_d = 1 - 0.232 K_t + 0.0239 \cos(\theta_z) - 0.000682 T_a + 0.0195 RH$  |
| $0.3 < K_t \leq 0.83$ | $f_d = 1.329 - 1.716 K_t + 0.267 \cos(\theta_z) - 0.00357 T_a + 0.106 RH$ |
| $K_t > 0.83$          | $f_d = 0.426 K_t - 0.256 \cos(\theta_z) + 0.00349 T_a + 0.0734 RH$        |

**When relative humidity is not provided in the weather file:**

| $K_t$ Value           | Diffuse Fraction Equation                        |
| --------------------- | ------------------------------------------------ |
| $0 \leq K_t \leq 0.3$ | $f_d = 1.02 - 0.254 K_t + 0.0123 \cos(\theta_z)$ |
| $0.3 < K_t \leq 0.83$ | $f_d = 1.4 - 1.749 K_t + 0.177 \cos(\theta_z)$   |
| $K_t > 0.83$          | $f_d = 0.486 K_t - 0.182 \cos(\theta_z)$         |

**Physical limits:** The empirical correlations can produce non-physical values at edge cases. The following bounds from Reindl et al. (1990) are applied to clamp results:

| $K_t$ Value           | Limits                    | Reason                                      |
| --------------------- | ------------------------- | ------------------------------------------- |
| $K_t \leq 0.3$        | $f_d \leq 1.0$            | Diffuse fraction cannot exceed 100%         |
| $0.3 < K_t \leq 0.83$ | $0.1 \leq f_d \leq 0.971$ | Prevents regression overshoot               |
| $K_t > 0.83$          | $f_d \geq 0.1$            | Minimum diffuse from atmospheric scattering |

PlantPredict uses 0.83 as the upper clearness index threshold (modified from 0.78 in the original published model), based on a regression against measured irradiance data from the Cimarron Solar Facility in New Mexico. These "Reindl adjusted" variants are documented in Lave et al. (2014).

Once $f_d$ is determined, the DHI is calculated, then the DNI is obtained from the <ClosureEquation />:

$$
DHI = f_d \times GHI
$$

$$
DNI = \frac{GHI - DHI}{\cos(\theta_z)}
$$

### DIRINT Model

The DIRINT (Direct Insolation Radiation INTegration) model is an enhancement of the DISC model. It first computes an initial DNI estimate using DISC, then applies a correction factor based on temporal stability and atmospheric conditions. This allows DIRINT to distinguish between steady hazy conditions and variable cloudy conditions that have similar instantaneous clearness indices. DIRINT uses pressure-corrected <AirMass /> $AM'$ as an input, calculated internally using the Bird-Hulstrom formula (see [Air Mass](../solar-geometry/air_mass) for details).

**Step 1: DISC Initial Estimate**

The DISC (Direct Insolation Simulation Code) model computes an initial DNI estimate using direct normal <Transmittance /> factors:

* $K_{nc}$ = **Clear-sky transmittance**: theoretical maximum under clear conditions, decreasing with air mass
* $\Delta K_n$ = **Transmittance reduction**: correction for clouds, aerosols, and <Turbidity /> (derived from $K_t$)
* $K_n$ = **Actual transmittance**: net transmittance after atmospheric effects

The clear-sky transmittance is a polynomial function of air mass:

$$
K_{nc} = 0.866 - 0.122 AM' + 0.0121 AM'^2 - 0.000653 AM'^3 + 0.000014 AM'^4
$$

The transmittance reduction uses coefficients $A$, $B$, $C$ that depend on $K_t$:

$$
\Delta K_n = A + B e^{C \times AM'}
$$

where each coefficient $X \in \{A, B, C\}$ is computed as:

$$
X = c_0 + c_1 K_t + c_2 K_t^2 + c_3 K_t^3
$$

<div className="coef-table">
  **For $K_t > 0.6$:**

  | Coefficient X | $c_0$  | $c_1$  | $c_2$  | $c_3$ |
  | ------------- | ------ | ------ | ------ | ----- |
  | $A$           | −5.743 | 21.77  | −27.49 | 11.56 |
  | $B$           | 41.4   | −118.5 | 66.05  | 31.9  |
  | $C$           | −47.01 | 184.2  | −222   | 73.81 |

  **For $K_t \leq 0.6$:**

  | Coefficient X | $c_0$ | $c_1$ | $c_2$  | $c_3$  |
  | ------------- | ----- | ----- | ------ | ------ |
  | $A$           | 0.512 | −1.56 | 2.286  | −2.222 |
  | $B$           | 0.37  | 0.962 | 0      | 0      |
  | $C$           | −0.28 | 0.932 | −2.048 | 0      |
</div>

The actual transmittance and DNI are then:

$$
K_n = K_{nc} - \Delta K_n
$$

$$
DNI_{DISC} = K_n \times DNI_{extra}
$$

$DNI_{DISC} = 0$ if any of the following conditions are met:

* $GHI < 1$ W/m²
* $DNI_{DISC} < 0$
* $\theta_z > 87°$ (Version 09 and earlier) or $\theta_z > 90°$ (Version 10 and later)

**Step 2: DIRINT Correction Coefficient Lookup**

DIRINT improves upon DISC by using four parameters to look up a correction coefficient $C_{DIRINT}$: modified clearness index ($K'_t$), temporal stability ($\Delta K'_t$), zenith angle ($\theta_z$), and precipitable water ($W$, not used by PlantPredict).

The modified clearness index normalizes for air mass effects, isolating the influence of clouds and excess atmospheric turbidity:

$$
K'_t = \frac{K_t}{1.031 \exp\left(-\frac{1.4}{0.9 + 9.4/AM'}\right) + 0.1}
$$

with constraint $K'_t \leq 0.82$.

Temporal stability captures cloud transients by comparing clearness across adjacent timestamps:

$$
\Delta K'_t = 0.5 \left( |K'_t - K'_{t,next}| + |K'_t - K'_{t,prev}| \right)
$$

A four-dimensional lookup table retrieves the DIRINT correction coefficient $C_{DIRINT}$ based on binned values of these four parameters. PlantPredict does not use precipitable water as an input for the model and defaults to the "precipitable water unavailable" bin.

**Step 3: Final DNI and DHI Calculation**

The final DNI is the DISC estimate scaled by the DIRINT correction coefficient:

$$
DNI = DNI_{DISC} \times C_{DIRINT}
$$

DHI is then derived using the <ClosureEquation />:

$$
DHI = GHI - DNI \cos(\theta_z)
$$

### Physical Constraints

All decomposition models apply the following physical constraints:

* If $GHI \leq 0$, then $DHI = 0$ and $DNI = 0$
* $DHI \leq GHI$
* $DNI \geq 0$
* If $\theta_z \geq 90°$, then $DNI = 0$

***

## References

* Erbs, D. G., Klein, S. A., & Duffie, J. A. (1982). *Estimation of the diffuse radiation fraction for hourly, daily and monthly-average global radiation.* Solar Energy, 28(4), 293–302. DOI: [10.1016/0038-092X(82)90302-4](https://doi.org/10.1016/0038-092X\(82\)90302-4)
* Reindl, D. T., Beckman, W. A., & Duffie, J. A. (1990). *Diffuse fraction correlations.* Solar Energy, 45(1), 1–7. DOI: [10.1016/0038-092X(90)90060-P](https://doi.org/10.1016/0038-092X\(90\)90060-P)
* Perez, R., Ineichen, P., Maxwell, E., Seals, R., & Zelenka, A. (1992). *Dynamic global-to-direct irradiance conversion models.* ASHRAE Transactions, 98(1), 354–369.
* Maxwell, E. L. (1987). *A quasi-physical model for converting hourly global horizontal to direct normal insolation.* Technical Report SERI/TR-215-3087, Solar Energy Research Institute. DOI: [10.2172/5987868](https://doi.org/10.2172/5987868)
* Lave, M., Hayes, W., Pohl, A., & Hansen, C. W. (2014). *Evaluation of global horizontal irradiance to plane-of-array irradiance models at locations across the United States.* IEEE 40th Photovoltaic Specialist Conference (PVSC). DOI: [10.1109/PVSC.2014.6925216](https://doi.org/10.1109/PVSC.2014.6925216)
