Technical Reference
Scientific Methods & References
Equation set, numerical methods, assumptions, and annotated bibliography for the VPD Studio application.
1. Definitions & Symbols
| Symbol | Meaning | Units |
|---|---|---|
| \(T\) | Air temperature | °C |
| \(T_\ell\) | Leaf temperature \(= T + \Delta T\) | °C |
| \(\Delta T\) | Leaf–air temperature difference | °C |
| \(RH\) | Relative humidity | % |
| \(e_s(T)\) | Saturation vapor pressure over water at \(T\) | kPa |
| \(e(T,RH)\) | Ambient water vapor partial pressure | kPa |
| \(VPD\) | Vapor Pressure Deficit | kPa |
| \(P\) | Station (ambient) pressure | kPa |
| \(h\) | Geopotential height (altitude) | m |
2. Saturation Vapor Pressure Models
The app uses a Magnus–Tetens–type expression (FAO-56 form) for saturation vapor pressure over liquid water:
This parameterization (Allen et al., 1998, FAO-56) is standard in agronomy and evapotranspiration modeling. Alternative high-accuracy formulations include Buck (1981, 1996) and Sonntag (1990). For horticultural VPD ranges \(T \in [0, 40]^\circ\mathrm{C}\), the FAO-56 expression tracks these within ~0.1–0.3 %, well below sensor and environmental variability in grow environments.
2.1 Alternative formulations (cross-check)
- Buck (1981, 1996): Piecewise empirical equations for \(e_s\) over water and ice; widely cited in meteorology.
- Sonntag (1990): Revision of Magnus equation coefficients, accurate across 0–50 °C.
- Alduchov & Eskridge (1996): Improved constants for the August–Roche–Magnus dew-point relationship; also used here for dew point (Section 4).
3. Vapor Pressure Deficit (Air & Leaf)
Ambient water vapor partial pressure is \( e(T,RH) = \frac{RH}{100}\,e_s(T) \). Following standard definitions (FAO-56; Jones, Plants and Microclimate), VPD is the difference between saturation at a reference surface and the ambient vapor pressure.
3.1 Air VPD
3.2 Leaf VPD (with leaf–air ΔT)
When a leaf is warmer than the surrounding air by \(\Delta T\), the evaporative demand at the leaf surface is modeled as:
This assumes (i) the leaf surface is near saturation at \(T_\ell\), and (ii) ambient vapor pressure is governed by air \(T\) and \(RH\). It captures the first-order effect described in plant microclimate literature (Monteith & Unsworth; Jones). In high-advection or boundary-layer-limited regimes, canopy models add aerodynamic resistances; the app intentionally uses the simpler diagnostic definition for speed and clarity in grow-room use.
4. Dew Point & Absolute Humidity
4.1 Dew point (August–Roche–Magnus form)
With \( a = 17.27 \) and \( b = 237.3^\circ\mathrm{C} \) (Alduchov & Eskridge, 1996 / FAO-style), define \( \gamma(T,RH) = \ln(RH/100) + \dfrac{aT}{b+T} \).
4.2 Absolute humidity
Using ideal-gas relationships with \(R_d/R_v \approx 0.622\) yields a convenient engineering form for absolute humidity (mass concentration of water vapor):
Here \(e\) is vapor pressure in hPa (1 kPa = 10 hPa) and \(T\) is absolute temperature in Kelvin. The constant 216.7 follows from the universal gas constant and molecular weights (WMO/ASHRAE tables).
5. Station Pressure & Altitude
For reference, the app computes an approximate station pressure from altitude using the US Standard Atmosphere barometric formula:
vpd_kPa function accepts an altitude parameter for API compatibility but does not use it. The barometric formula is retained for psychrometric display and informational purposes only.
Earlier versions (pre-1.4.2) multiplied \(e_s\) by \(P(h)/101.325\) as a heuristic scaling factor. This was removed after review confirmed it is not required by the standard VPD definition and introduced a small, unnecessary bias at higher elevations.
6. Analytic Solvers & Numerics
6.1 Solve RH for a target VPD (fixed T)
From \( VPD = e_s(T)\,(1 - RH/100) \) it follows directly that \( RH = 100\,\bigl(1 - VPD/e_s(T)\bigr) \).
6.2 Solve T for a target VPD (fixed RH)
There is no closed form for \(T\) in the Magnus expression. The app uses a stable bounded search on \(T\in[5,45]^\circ\mathrm{C}\) with a small step for widget responsiveness. A Newton–Raphson variant was profiled but the bounded sweep is more robust on-device and avoids rare divergence at extreme RH.
6.3 Numerics & stability
- Precision. All exponentials are evaluated in double precision; results are clamped to physically meaningful ranges (e.g., \(RH\in[0,100]\)).
- Guarding. To avoid division by zero, \(b+T\) and color-scale denominators use a small \(\varepsilon\) floor (e.g., \(10^{-6}\)).
- Widget lifecycle. Timeline updates are debounced and snapshots are written to an App Group store to minimize energy and prevent black widgets during rapid interactions.
7. Visualization & Color Mapping
Heatmaps use the perceptually uniform Viridis palette with green near the active stage's ideal band midpoint. The app computes a band-relative signed distance:
and maps \(s\) into Viridis parameter \(t\) such that \(t\approx 0.72\) (green) at \(s=0\), shifting toward indigo (\(s\ll0\), too humid) and yellow (\(s\gg0\), too dry).
vpdLeafCalc(T, RH, deltaT) at each cell rather than Air VPD. This ensures the color map reflects the plant's actual transpiration environment, including the configured leaf–air temperature offset. Air VPD heatmaps were used in versions prior to 1.4.
The heatmap image is pre-rendered to an off-screen RGBA buffer once per size/stage/ΔT combination (not every frame). Isolines (every 0.2 kPa) and the cursor halo are vector overlays drawn cheaply on top.
Why Viridis? Unlike rainbow maps, Viridis is near-perceptually-uniform in lightness and color, improves readability for color-vision-deficient users, and preserves ordinal structure (van der Walt & Smith, 2015).
8. Validation Strategy
- Unit tests compare \(e_s(T)\) against Buck (1996) values at 0–40 °C; max relative error < 0.3 %.
- Spot checks of \(T_d\) vs Alduchov–Eskridge yield < 0.2 °C absolute differences across RH 10–90 %.
- VPD isolines at integer tenths (0.6, 0.8, 1.0 … kPa) match analytic \(RH\) inversion within ±0.2 % RH over the plotted domain.
9. Limits & Uncertainties
- Sensor error dominates. Typical low-cost RH sensors have ±2–3 % RH and temp ±0.2–0.5 °C; this maps to ~±0.03–0.08 kPa VPD around 1 kPa.
- Leaf energy balance. The simple \(T_\ell=T+\Delta T\) approach is diagnostic. Detailed canopy models would add stomatal, boundary-layer, and radiative terms (Monteith & Unsworth).
- Pressure independence. VPD is computed without scaling \(e_s\) by station pressure, consistent with the standard thermodynamic definition. The barometric formula is retained in the codebase for psychrometric context only.
- Domain. Plots are limited to \(T\in[10,35]^\circ\mathrm{C}\), \(RH\in[30,95]\%\), covering typical controlled-environment horticulture.
10. Code Mapping
Traceability from equation to implementation. Function names refer to the shared helpers in the widget and app targets.
| Concept | Equation | Code |
|---|---|---|
| Saturation vapor pressure | \(e_s(T)=0.6108\exp\!\bigl(\frac{17.27\,T}{T+237.3}\bigr)\) | es_kPa(T) |
| Station pressure from altitude | \(P(h)=101.325(1-2.256\!\times\!10^{-5}h)^{5.256}\) | pressureFromAltitude_kPa(h) |
| Air VPD | \(e_s(T)(1-RH/100)\) | vpd_kPa(T, RH, alt) |
| Leaf VPD | \(e_s(T\!+\!\Delta T) - (RH/100)\,e_s(T)\) | vpd_leaf_kPa(Tair, RH, Tleaf, alt) |
| Leaf VPD (widget heatmap) | Same as above | vpdLeafCalc(T, RH, deltaT) |
| Dew point | \(T_d=\frac{b\,\gamma}{a-\gamma}\) | VPDCalc.dewPointC(T, RH) |
| Absolute humidity | \(\rho_v=216.7\,e[\mathrm{hPa}]/(T[\mathrm{K}])\) | VPDCalc.absoluteHumidity_gm3(T, RH) |
| Solve RH for target VPD | \(RH=100(1-VPD/e_s(T))\) | VPDCalc.solveRH_for(...) |
| Solve T for target VPD | Bounded search on \(T\) | VPDCalc.solveTemp_for(...) |
| Isoline plotting | \(RH(T)\) inversion per target VPD | VPDChart.drawIsolines(...) |
| Viridis mapping | Band-relative \(s\mapsto t\) | viridisCentered(s) |
vpd_kPa and vpd_leaf_kPa are now separate implementations. vpd_kPa no longer applies pressure correction (altitude parameter retained for signature compatibility). vpd_leaf_kPa takes (Tair, RH, Tleaf, alt) with distinct air and leaf temperature arguments. The altitude override was removed from the widget configuration intent in v1.4.4.
11. References
- Allen, R.G., Pereira, L.S., Raes, D., Smith, M. (1998). FAO Irrigation and Drainage Paper 56: Crop Evapotranspiration (FAO-56). UN-FAO. — Provides the 0.6108–17.27–237.3 Magnus-Tetens form used here for \(e_s(T)\) and standard VPD/ET conventions.
- ASHRAE (2017/2021). Handbook — Fundamentals. American Society of Heating, Refrigerating and Air-Conditioning Engineers. — Psychrometric relations, absolute humidity conversions, and standard properties.
- Alduchov, O.A., Eskridge, R.E. (1996). "Improved Magnus form approximation of saturation vapor pressure." J. Appl. Meteor. 35:601–609. — Coefficients often used for dew point; consistent with the implementation above.
- Buck, A.L. (1981, updated 1996). "New equations for computing vapor pressure and enhancement factor." J. Appl. Meteor. 20:1527–1532. — High-accuracy empirical \(e_s(T)\) formulas over water/ice; used for cross-validation.
- Sonntag, D. (1990). "Important new values of the physical constants of 1986, vapor pressure formulations based on the ITS-90, and psychrometric formulae." Z. Meteorologie 70:340–344.
- WMO (2008/2018). Guide to Meteorological Instruments and Methods of Observation (WMO-No. 8). World Meteorological Organization. — Definitions and recommended practice for humidity measurements and conversions.
- Jones, H.G. (2013). Plants and Microclimate (3rd ed.). Cambridge Univ. Press. — Leaf energy balance, stomatal control, and the interpretation of leaf-air VPD.
- Monteith, J.L., Unsworth, M.H. (2013). Principles of Environmental Physics (4th ed.). Academic Press. — Canonical text for surface energy balance and psychrometrics in plant environments.
- U.S. Standard Atmosphere (1976). NOAA/NASA/USAF. — Basis for the barometric \(P(h)\) approximation used for station pressure.
- van der Walt, S., Smith, N. (2015). "A better default colormap for Matplotlib." (SciPy 2015). — Rationale for the Viridis palette (perceptually uniform, CVD-friendly).