nitrox-lab-core
Usage
npm i nitrox-lab-core
import { NitroxLabCore } from 'nitrox-lab-core';
const nx = new NitroxLabCore();
const mod = nx.calcMOD(0.32, 1.4); // 33.75
Settings
- settings (optional)
- units (optional) - depth and pressure units (METRIC | IMPERIAL), default: METRIC
- defaultPpO2Max (optional) - default maximum
$O_{2}$ fraction, default: 1.4
import { NitroxLabCore, Units } from 'nitrox-lab-core';
const settings = {
units: Units.METRIC, // optional, METRIC | IMPERIAL
defaultPpO2Max: 1.4 // optional
};
const nx = new NitroxLabCore(settings);
MOD
calcMOD(fO2, ppO2Max);
- fO2 -
$O_{2}$ fraction - ppO2Max - maximum
$O_{2}$ partial pressure
const mod = nx.calcMOD(0.32, 1.4); // 33.75
Best mix
calcBestMix(depth, ppO2Max);
- depth
- ppO2Max - maximum
$O_{2}$ partial pressure
const bestMix = nx.calcBestMix(30, 1.4); // 0.35
Top off
calcTopOff(options);
- options
- currentMix
- fO2 - current mix
$O_{2}$ fraction - p - pressure
- fO2 - current mix
- topOffMix
- fO2 - top off mix
$O_{2}$ fraction
- fO2 - top off mix
- currentMix
- targetPressure - end pressure
const options = {
currentMix: {
fO2: 0.32,
p: 100
},
topOffMix: {
fO2: 0.21
},
targetPressure: 220
};
const topOffResult = nx.calcTopOff(options); // 0.26