this.options={ notation: 'auto', precision : 8, exponential: { lower: 1e-10, upper: 1e+10 }}; this.satvp = function(x) { // saturation vapor pressure (temperature), kPa return 0.611 * math.exp(17.502*x/(parseInt(x) + 240.97)) ; } this.dewp = function(x) { // dewpoint (vapor pressure), C return 240.97 * math.log(x/0.611) / (17.502 - math.log(x/0.611)); } this.vptovd = function(x,y) { // convert vapor pressure to vapor density, kPa to g/m3 return 2166 * x / (273.16 + y) } this.vptomr = function(x) { // Mixing ratio (vapor pressure), kg/kg return (0.622 * x / 101.3) /(1 - x / 101.3) }