### Install Dependencies Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Installs project dependencies. Run this before starting development. ```bash npm ci ``` -------------------------------- ### Install project dependencies Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Install all necessary dependencies for the jsthermalcomfort project before running tests or other development commands. ```bash npm install ``` -------------------------------- ### Install JSThermalComfort with npm Source: https://federicotartarini.github.io/jsthermalcomfort/installation.html Use this command to install the JSThermalComfort package locally in your project. ```bash npm install jsthermalcomfort ``` -------------------------------- ### Calculate Adaptive Thermal Comfort (IP Units) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html This example demonstrates calculating adaptive thermal comfort using the IP (Imperial Units) system. The function accepts temperature and air speed in IP units. ```javascript import { adaptive_ashrae } from "jsthermalcomfort/models"; // For users who want to use the IP system const results = adaptive_ashrae(77, 77, 68, 0.3, 'IP'); console.log(results); // {tmp_cmf: 75.2, tmp_cmf_80_low: 68.9, tmp_cmf_80_up: 81.5, // tmp_cmf_90_low: 70.7, tmp_cmf_90_up: 79.7, acceptability_80: true, // acceptability_90: true} ``` -------------------------------- ### JSDoc for New Thermal Comfort Model Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Example of JSDoc comments required for a new thermal comfort model. Ensure to use @public, @memberof models, and provide clear @param and @returns descriptions. ```javascript /** * @public * @memberof models * @name my_new_model * @description Calculates a new thermal comfort index. * * @param {number} tdb Dry bulb air temperature [°C] * @param {number} rh Relative humidity [%] * @returns {number} The calculated index value. */ export function my_new_model(tdb, rh) { // your implementation here } ``` -------------------------------- ### Import JSThermalComfort from CDN (ESM) Source: https://federicotartarini.github.io/jsthermalcomfort/installation.html Import the library directly from a CDN for use in projects without local installation. Ensure your environment supports ES Modules. ```javascript import { models, utilities, pschymetrics } from "https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/index.js" ``` -------------------------------- ### Get Clo Value for Typical Ensemble Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/clo.html Retrieves the standard Clo value for a specified typical clothing ensemble. Use this function to quickly get insulation values for common outfits. ```typescript const result = clo_typical_ensembles("Trousers, long-sleeve shirt"); // returns 0.61 ``` -------------------------------- ### Instantiate JOS3 Model Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Create an instance of the JOS3 class. Optional body parameters like height, weight, age, and sex can be provided. ```python from thermalcomfort.jos3 import JOS3 X = JOS3(height=1.7, weight=70, age=30, sex='male', bmr_equation='harris-benedict', bsa_equation='dubois') ``` -------------------------------- ### Run Tests Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Executes the project's test suite. Ensure all tests pass before submitting a Pull Request. ```bash npm test ``` -------------------------------- ### Calculate Adaptive Comfort (IP Units) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates adaptive thermal comfort using IP units. Ensure running mean temperature is within the model's applicability limits. ```javascript // for users who wants to use the IP system const results = adaptive_en(77, 77, 68, 0.3, 'IP'); console.log(results); // {tmp_cmf: 77.7, acceptability_cat_i: true, acceptability_cat_ii: true, ... } ``` -------------------------------- ### Calculate Predicted Heat Strain (PHS) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Predicted Heat Strain (PHS) index using the jsthermalcomfort library. Ensure the 'jsthermalcomfort' library is imported before use. This example demonstrates a typical usage with standing posture. ```javascript import { phs } from "jsthermalcomfort"; const results = phs(40, 40, 0.3, 33.85, 2.5, 0.5, "standing"); console.log(results); // {t_re: 37.5, d_lim_loss_50: 480, d_lim_loss_95: 480, d_lim_t_re: 480, sweat_loss_g: 5847.0, sweat_rate_watt: 252.1, ...} ``` -------------------------------- ### Update project documentation Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Generate or update project documentation, typically before committing documentation changes. ```bash npm run docs ``` -------------------------------- ### Format code with Prettier Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Run Prettier to automatically format your code according to project standards. ```bash npm run format ``` -------------------------------- ### Import JSThermalComfort in Website (Module Script) Source: https://federicotartarini.github.io/jsthermalcomfort/installation.html Include the JSThermalComfort library in your website by importing it within a script tag marked as type="module". ```html ``` -------------------------------- ### Stage all changes for commit Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Stage all modified files in the current directory for the next commit. ```bash git add . ``` -------------------------------- ### Run project tests Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Execute all project tests using Jest to ensure code quality and functionality. ```bash npm run test ``` -------------------------------- ### Push Changes and Tags Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html After bumping the version, push the commit and tags to the remote repository to trigger the release workflow. ```bash git push && git push --tags ``` -------------------------------- ### Clone the jsthermalcomfort repository Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Clone your fork of the jsthermalcomfort repository locally to begin development. ```bash git clone git@github.com:FedericoTartarini/jsthermalcomfort.git ``` -------------------------------- ### Access Model Outputs Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Access simulation results such as local and mean skin temperature, core temperature, and skin wettedness using getter methods or the dict_results() method. ```python results = X.dict_results() t_skin_mean = X.t_skin_mean t_skin_local = X.t_skin t_core_local = X.t_core ``` -------------------------------- ### Create a new local development branch Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Create a new branch for your bug fix or feature development. Follow the specified naming conventions for new branches. ```bash git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Convert Results to CSV Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Convert the model's simulation results into a CSV file using the to_csv method. ```python X.to_csv('results.csv') ``` -------------------------------- ### Set Part-Specific Environmental Conditions Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Demonstrates setting different environmental conditions for specific body parts. The input must be a 17-element list, dictionary, or numpy array corresponding to the defined body parts. ```python X.tdb = [25.0] * 17 # Example for all body parts X.tr = {'head': 23.0, 'chest': 22.0} # Example for specific parts ``` -------------------------------- ### Calculate PMV with ATHB Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the PMV value using the Adaptive Thermal Heat Balance (ATHB) framework. Ensure all required parameters are provided. ```javascript const tdb = 25; const tr = 25; const vr = 0.1; const rh = 50; const met = 1.1; const t_running_mean = 20; const athb_result = athb(tdb, tr, rh, met, t_running_mean); console.log(athb_result); // Output: {athb_pmv: 0.2} ``` -------------------------------- ### Calculate Standard Effective Temperature (SET) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Standard Effective Temperature (SET) using provided environmental and personal parameters. Ensure all required parameters are passed in the correct order. ```javascript const set = set_tmp(25, 25, 0.1, 50, 1.2, 0.5); // returns {set: 24.3} ``` -------------------------------- ### Register New Model in Index Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Import and export your new model function in `src/models/index.js` to make it available in the library. ```javascript import { my_new_model } from "./my_new_model.js"; export default { // ... existing models my_new_model, }; ``` -------------------------------- ### Set Environmental Conditions Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Set environmental conditions using setter methods. For uniform conditions, use simple variables. For part-specific conditions, provide a 17-element list, dictionary, or numpy array. ```python X.tdb = 25.0 # Air temperature X.tr = 23.0 # Mean radiant temperature X.v = 0.1 # Air velocity ``` -------------------------------- ### Push branch to GitHub Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Push your local development branch to your GitHub fork to share your changes. ```bash git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Calculate Adaptive Comfort (SI Units) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates adaptive thermal comfort using SI units. Ensure running mean temperature is within the model's applicability limits. ```javascript const results = adaptive_en(25, 25, 20, 0.1); console.log(results); // {tmp_cmf: 25.4, acceptability_cat_i: true, acceptability_cat_ii: true, ... } console.log(results.acceptability_cat_i); // true // The conditions you entered are considered to comply with Category I ``` -------------------------------- ### Calculate Saturation Vapor Pressure (p_sat) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/psychrometrics.html Calculates the vapor pressure of water at a given air temperature in Celsius. Returns pressure in Pascals. ```typescript p_sat(tdb: number): number ``` -------------------------------- ### Adaptive Comfort with Running Mean Temperature Out of Bounds Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Demonstrates the function's behavior when the running mean temperature is outside the standard applicability limits (10°C to 30°C). The function returns NaN for comfort temperature in such cases. ```javascript const results = adaptive_en(25, 25, 9, 0.1); console.log(results); // {tmp_cmf: NaN, acceptability_cat_i: true, acceptability_cat_ii: true, ... } // The adaptive thermal comfort model can only be used // if the running mean temperature is between 10 °C and 30 °C ``` -------------------------------- ### Calculate PMV and PPD with ASHRAE 55 Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Use this function to calculate PMV and PPD based on ASHRAE 55 standards. It applies a cooling effect before PMV computation, which can lower results compared to the ISO equation when elevated air speed is present. Ensure inputs are within the specified ASHRAE 55 ranges if `limit_inputs` is true. ```javascript const r = pmv_ppd_ashrae(25, 25, 0.1, 50, 1.2, 0.5); console.log(r.pmv); // 0.08 console.log(r.ppd); // 5.1 ``` -------------------------------- ### Calculate Saturation Vapor Pressure in Torr (p_sat_torr) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/psychrometrics.html Estimates the saturation vapor pressure in torr based on the dry bulb air temperature in Celsius. ```typescript p_sat_torr(tdb: number): number ``` -------------------------------- ### AT_SCHEMA Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Apparent Temperature (AT), which adjusts the dry bulb temperature based on humidity and optionally solar radiation to represent perceived temperature. ```APIDOC ## AT_SCHEMA ### Description Calculates the Apparent Temperature (AT). The AT is defined as the temperature at the reference humidity level producing the same amount of discomfort as that experienced under the current ambient temperature, humidity, and solar radiation. It includes the chilling effect of the wind at lower temperatures. ### Parameters * `tdb` (number) - dry bulb air temperature, [°C] * `rh` (number) - relative humidity, [%] * `v` (number) - wind speed 10m above ground level, [m/s] * `q` ((number | undefined)?) - Net radiation absorbed per unit area of body surface [W/m2] * `kwargs` (object?) - other parameters * `kwargs.round` (boolean, default `true`) - if True rounds output value, if False it does not round it ### Returns `AtResult` : set containing results for the model ### Example ```javascript const result = at(25, 30, 0.1); console.log(result); // {at: 24.1} ``` ``` -------------------------------- ### Bump Package Version Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Use npm to increment the package version. Choose the appropriate command for patch, minor, major, or exact version bumps. ```bash npm version patch ``` ```bash npm version minor ``` ```bash npm version major ``` ```bash npm version 1.2.3 ``` -------------------------------- ### Calculate Cooling Effect (IP Units) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Cooling Effect (CE) using IP units. The 'IP' string must be passed as the last argument to specify the unit system. ```javascript const CE_IP = cooling_effect(77, 77, 1.64, 50, 1, 0.6, "IP"); console.log(CE_IP); // Output: {ce: 3.74} ``` -------------------------------- ### clo_dynamic Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/utilities_functions.html Estimates the dynamic clothing insulation, adjusting for activity and air speed based on specified standards. ```APIDOC ## clo_dynamic(clo: number, met: number, standard: ("ASHRAE" | "ISO")) ### Description Estimates the dynamic clothing insulation of a moving occupant. The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that the clothing insulation shall be corrected [2]. The ASHRAE 55 Standard corrects for the effect of the body movement for met equal or higher than 1.2 met using the equation clo = Icl × (0.6 + 0.4/met) ### Parameters * **clo** (number) - clothing insulation, [clo] * **met** (number) - metabolic rate, [met] * **standard** (("ASHRAE" | "ISO") = "ASHRAE") - If "ASHRAE", uses Equation provided in Section 5.2.2.2 of ASHRAE 55 2020 ### Returns `number` : dunamic clothing insulation, [clo] ``` -------------------------------- ### Saturation Vapor Pressure (p_sat) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/psychrometrics.html Calculates the vapor pressure of water at a given air temperature. ```APIDOC ## p_sat(tdb: number): number ### Description Calculates vapour pressure of water at different temperatures. ### Parameters #### Path Parameters - **tdb** (number) - Required - air temperature, [°C] ### Returns `number` : vapour pressure of water, [Pa] ``` -------------------------------- ### pmv_ppd_iso Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates PMV and PPD according to ISO 7730. It delegates to the `pmv_ppd` function with a fixed standard of 'ISO'. The function includes input validation based on ISO 7730's stricter ranges when `limit_inputs` is true. ```APIDOC ## pmv_ppd_iso ### Description Calculates Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD) in accordance with ISO 7730. This function uses Fanger's original PMV formulation and applies stricter input limits. ### Parameters * **tdb** (number) - Dry-bulb air temperature [°C or °F]. * **tr** (number) - Mean radiant temperature [°C or °F]. * **vr** (number) - Relative air speed [m/s or fps]. * **rh** (number) - Relative humidity [%]. * **met** (number) - Metabolic rate [met]. * **clo** (number) - Clothing insulation [clo]. * **wme** (number, optional, default `0`) - External work [met]. * **kwargs** (Object, optional, default `{}`) * **kwargs.units** (`"SI"` | `"IP"`, optional, default `'SI'`) - Unit system. * **kwargs.limit_inputs** (boolean, optional, default `true`) - If true, returns NaN for out-of-range inputs. * **kwargs.round_output** (boolean, optional, default `true`) - If true, rounds PMV to 2 decimal places and PPD to 1. ### Returns `PmvPpdIso` - An object containing PMV and PPD values. ### Example ```javascript const r = pmv_ppd_iso(25, 25, 0.1, 50, 1.2, 0.5); console.log(r.pmv); // 0.08 console.log(r.ppd); // 5.1 ``` ``` -------------------------------- ### Calculate Normal Effective Temperature (NET) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Normal Effective Temperature (NET) using dry bulb temperature, relative humidity, and wind speed. Rounds the output by default. ```javascript const result = net(37, 100, 0.1); console.log(result); // -> {net: 37} ``` -------------------------------- ### Calculate Wet Bulb Temperature (t_wb) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/psychrometrics.html Calculates the wet-bulb temperature in Celsius using the Stull equation. Requires dry bulb air temperature and relative humidity. ```typescript t_wb(tdb: number, rh: number): number ``` -------------------------------- ### Wet Bulb Temperature (t_wb) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/psychrometrics.html Calculates the wet-bulb temperature using the Stull equation. ```APIDOC ## t_wb(tdb: number, rh: number): number ### Description Calculates the wet-bulb temperature using the Stull equation [6]. ### Parameters #### Path Parameters - **tdb** (number) - Required - air temperature, [°C] - **rh** (number) - Required - relative humidity, [%] ### Returns `number` : wet-bulb temperature, [°C] ``` -------------------------------- ### Calculate UTCI with IP units Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Universal Thermal Climate Index (UTCI) using IP units. Ensure inputs are within standard applicability limits for accurate results. ```javascript console.log(utci(77, 77, 3.28, 50, 'ip')) // will print 76.4 ``` -------------------------------- ### f_svv Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/utilities_functions.html Calculates the sky-vault view fraction. ```APIDOC ## f_svv(w: number, h: number, d: number) ### Description Calculates the sky-vault view fraction ### Parameters * **w** (number) - width of the window, [m] * **h** (number) - height of the window, [m] * **d** (number) - distance between the occupant and the window, [m] ### Returns `number` : sky-vault view faction ranges between 0 and 1 ``` -------------------------------- ### Update Model Display Name in Documentation Source: https://federicotartarini.github.io/jsthermalcomfort/contributing.html Add a mapping for your new model in `docs_theme/index.js` to set a human-readable title in the generated documentation. ```javascript const displayNameMap = { // ... existing mappings my_new_model: "My New Premium Model (MNPM)", }; ``` -------------------------------- ### Calculate Cooling Effect (SI Units) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Cooling Effect (CE) using SI units. Ensure all parameters are provided in their respective SI units. ```javascript const CE = cooling_effect(25, 25, 0.3, 50, 1.2, 0.5); console.log(CE); // Output: {ce: 1.64} ``` -------------------------------- ### PMV_SCHEMA Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Predicted Mean Vote (PMV) based on various thermal comfort parameters and standards. ```APIDOC ## PMV_SCHEMA ### Description Returns Predicted Mean Vote (PMV) calculated in accordance with main thermal comfort Standards. The PMV is an index that predicts the mean value of the thermal sensation votes of a large group of people on a sensation scale expressed from –3 to +3. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method None (This is a function/schema definition) ### Endpoint None (This is a function/schema definition) ### Parameters - **tdb** (number) - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP' - **tr** (number) - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP' - **vr** (number) - relative air speed, default in [m/s] in [fps] if `units` = 'IP'. Note: vr is the relative air speed caused by body movement and not the air speed measured by the air speed sensor. The relative air speed is the sum of the average air speed measured by the sensor plus the activity-generated air speed (Vag). - **rh** (number) - relative humidity, [%] - **met** (number) - metabolic rate. Note: The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that the clothing insulation shall be corrected. The ASHRAE 55 Standard corrects for the effect of the body movement for met equal or higher than 1.2 met using the equation clo = Icl × (0.6 + 0.4/met). - **clo** (number) - clothing insulation - **wme** (number, optional, default=0) - external work - **standard** (string, optional, default="ISO") - comfort standard used for calculation. Can be either "ISO" or "ASHRAE". - **kwargs** (PmvKwargs) - additional arguments ### Returns `{pmv: number}` : result - Object containing the Predicted Mean Vote. ### Request Example ```javascript const tdb = 25; const tr = 25; const rh = 50; const v = 0.1; const met = 1.4; const clo = 0.5; // calculate relative air speed const v_r = v_relative(v, met); // calculate dynamic clothing const clo_d = clo_dynamic(clo, met); const results = pmv(tdb, tr, v_r, rh, met, clo_d); console.log(results); // 0.06 ``` ### Response Example ```json { "pmv": 0.06 } ``` ``` -------------------------------- ### Calculate Adaptive Predicted Mean Vote (aPMV) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html This snippet demonstrates how to use the a_pmv function to calculate the Adaptive Predicted Mean Vote. Ensure all required parameters are provided with correct units. ```javascript const tdb = 24, const tr = 30, const vr = 0.22, const rh = 50, const met = 1.4, const clo = 0.5, const a_coefficient = 0.293, const wme = undefined, const result = a_pmv(tdb, tr, vr, rh, met, clo, a_coefficient, wme); console.log(result) //output { a_pmv: 0.48 } ``` -------------------------------- ### Saturation Vapor Pressure in Torr Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/psychrometrics.html Estimates the saturation vapor pressure in torr. ```APIDOC ## p_sat_torr(tdb: number): number ### Description Estimates the saturation vapour pressure in [torr]. ### Parameters #### Path Parameters - **tdb** (number) - Required - dry bulb air temperature [C] ### Returns `number` : saturation vapour pressure [torr] ``` -------------------------------- ### clo_typical_ensembles Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/clo.html Calculates the total clothing insulation (Clo) for a given set of typical clothing ensembles. ```APIDOC ## clo_typical_ensembles ### Description Calculates the total clothing insulation (Clo) for a given set of typical clothing ensembles. ### Method N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * `ensembles` ((`"Walking shorts, short-sleeve shirt"` | `"Typical summer indoor clothing"` | `"Knee-length skirt, short-sleeve shirt, sandals, underwear"` | `"Trousers, long-sleeve shirt"` | `"Knee-length skirt, long-sleeve shirt, full slip"` | `"Sweat pants, long-sleeve sweatshirt"` | `"Jacket, Trousers, long-sleeve shirt"` | `"Typical winter indoor clothing"`)) - Typical ensembles. One of: * "Walking shorts, short-sleeve shirt" * "Typical summer indoor clothing" * "Knee-length skirt, short-sleeve shirt, sandals, underwear" * "Trousers, short-sleeve shirt, socks, shoes, underwear" * "Trousers, long-sleeve shirt" * "Knee-length skirt, long-sleeve shirt, full slip" * "Sweat pants, long-sleeve sweatshirt" * "Jacket, Trousers, long-sleeve shirt" * "Typical winter indoor clothing" ### Returns `number` : Clothing insulation of the given ensembles ### Example ```javascript const result = clo_typical_ensembles("Trousers, long-sleeve shirt"); // returns 0.61 ``` ``` -------------------------------- ### Adaptive Thermal Comfort with Low Running Mean Temperature Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html When the running mean outdoor temperature is below 10°C, the adaptive thermal comfort model returns NaN values, indicating the conditions are outside its applicability limits. ```javascript import { adaptive_ashrae } from "jsthermalcomfort/models"; const results = adaptive_ashrae(25, 25, 9, 0.1); console.log(results); // {tmp_cmf: NaN, tmp_cmf_80_low: NaN, ...} // The adaptive thermal comfort model can only be used // if the running mean temperature is higher than 10°C ``` -------------------------------- ### Calculate PMV and PPD using ISO 7730 Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates PMV and PPD based on ISO 7730 standards. The function delegates to pmv_ppd with the standard fixed to 'ISO'. Input limits are enforced by default, returning NaN for out-of-range values. ```javascript const r = pmv_ppd_iso(25, 25, 0.1, 50, 1.2, 0.5); console.log(r.pmv); // 0.08 console.log(r.ppd); // 5.1 ``` -------------------------------- ### Calculate Predicted Mean Vote (PMV) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Predicted Mean Vote using thermal comfort parameters. Requires helper functions `v_relative` and `clo_dynamic` for accurate calculations, especially when dealing with air speed and clothing insulation adjustments based on metabolic rate. ```javascript const tdb = 25; const tr = 25; const rh = 50; const v = 0.1; const met = 1.4; const clo = 0.5; // calculate relative air speed const v_r = v_relative(v, met); // calculate dynamic clothing const clo_d = clo_dynamic(clo, met); const results = pmv(tdb, tr, v_r, rh, met, clo_d); console.log(results); // 0.06 ``` -------------------------------- ### PMV_PPD_SCHEMA Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD) according to ISO or ASHRAE comfort standards. ```APIDOC ## PMV_PPD_SCHEMA ### Description Returns Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD) calculated in accordance with main thermal comfort Standards. The PMV is an index that predicts the mean value of the thermal sensation votes of a large group of people on a sensation scale expressed from –3 to +3. ### Parameters * `tdb` (number) - dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP' * `tr` (number) - mean radiant temperature, default in [°C] in [°F] if `units` = 'IP' * `vr` (number) - relative air speed, default in [m/s] in [fps] if `units` = 'IP' * `rh` (number) - relative humidity, [%] * `met` (number) - metabolic rate * `clo` (number) - clothing insulation * `wme` (number, default `0`) - external work * `standard` ((`"ISO"` | `"ASHRAE"`), default `"ISO"`) - comfort standard used for calculation * `kwargs` (Pmv_ppdKwargs) - additional arguments ### Returns `Pmv_ppdReturns` : Result of pmv and ppd ### Example ```javascript const tdb = 25; const tr = 25; const rh = 50; const v = 0.1; const met = 1.4; const clo = 0.5; // Calculate relative air speed const v_r = v_relative(v, met); // Calculate dynamic clothing const clo_d = clo_dynamic(clo, met); const results = pmv_ppd(tdb, tr, v_r, rh, met, clo_d); console.log(results); // Output: { pmv: 0.06, ppd: 5.1 } console.log(results.pmv); // Output: -0.06 ``` ``` -------------------------------- ### A_PMV_SCHEMA Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Adaptive Predicted Mean Vote (aPMV) based on environmental and personal factors. This model accounts for cultural, climatic, social, psychological, and behavioral adaptations affecting thermal comfort. ```APIDOC ## A_PMV_SCHEMA ### Description Returns Adaptive Predicted Mean Vote (aPMV) [25]. This index was developed by Yao, R. et al. (2009). The model takes into account factors such as culture, climate, social, psychological and behavioral adaptations, which have an impact on the senses used to detect thermal comfort. This model uses an adaptive coefficient (λ) representing the adaptive factors that affect the sense of thermal comfort. This is a version that supports scalar arguments. ### Parameters - **tdb** (number) - Dry bulb air temperature, default in [°C] in [°F] if `units` = 'IP' - **tr** (number) - Mean radiant temperature, default in [°C] in [°F] if `units` = 'IP' - **vr** (number) - Relative air speed, default in [m/s] in [fps] if `units` = 'IP' Note: vr is the relative air speed caused by body movement and not the air speed measured by the air speed sensor. The relative air speed is the sum of the average air speed measured by the sensor plus the activity-generated air speed (Vag). Where Vag is the activity-generated air speed caused by motion of individual body parts. vr can be calculated using the function v_relative in utilities.js. - **rh** (number) - Relative humidity, [%] - **met** (number) - Metabolic rate, [met] - **clo** (number) - Clothing insulation, [clo] Note: The activity as well as the air speed modify the insulation characteristics of the clothing and the adjacent air layer. Consequently, the ISO 7730 states that the clothing insulation shall be corrected [2]. The ASHRAE 55 Standard corrects for the effect of the body movement for met equal or higher than 1.2 met using the equation clo = Icl × (0.6 + 0.4/met) The dynamic clothing insulation, clo, can be calculated using the function clo_dynamic in utilities.js. - **a_coefficient** (number) - Adaptive coefficient - **wme** (number = 0) - External work - **kwargs** (A_pmvKwargs) - additional arguments ### Returns `APmvResult` : set containing results for the model ### Example ```javascript const tdb = 24, const tr = 30, const vr = 0.22, const rh = 50, const met = 1.4, const clo = 0.5, const a_coefficient = 0.293, const wme = undefined, const result = a_pmv(tdb, tr, vr, rh, met, clo, a_coefficient, wme); console.log(result) //output { a_pmv: 0.48 } ``` ``` -------------------------------- ### Calculate Apparent Temperature (AT) Source: https://federicotartarini.github.io/jsthermalcomfort/documentation/models.html Calculates the Apparent Temperature (AT), which adjusts dry bulb temperature based on relative humidity and solar radiation. Use this for a more accurate perception of ambient temperature. ```javascript const result = at(25, 30, 0.1); console.log(result); // {at: 24.1} ```