-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPHPsychrometric.php
71 lines (57 loc) · 1.87 KB
/
PHPsychrometric.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
class PHPsychrometric{
private $T;
private $UR;
private $Z;
private $X;
function __construct($T=20, $UR=65, $Z=0, $X=null){
$this->T = $T;
$this->UR = $UR;
$this->Z = $Z;
if(!is_null($X))
$this->X = $X;
}
function Pws($T){
if ($T <= 0)
$Pws = exp((((-5.6745359)*10**3)/(273.15+$T))+(((6.3925247)*10**0))+(((-9.677843)*10**(-3))*(273.15+$T))+(((6.2215701)*10**(-7))*(273.15+$T)**2)+(((2.0747825)*10**(-9))*(273.15+$T)**3)+(((-9.484024)*10**(-13))*(273.15+$T)**4)+(((4.1635019)*10**0)*log(273.15+$T)));
else
$Pws = exp((((-5.8002206)*10**3)/(273.15+$T))+(((1.3914993)*10**0))+(((-4.8640239)*10**(-2))*(273.15+$T))+(((4.1764768)*10**(-5))*(273.15+$T)**2)+(((-1.4452093)*10**(-8))*(273.15+$T)**3)+(((6.5459673)*10**0)*log(273.15+$T)));
return $Pws;
}
function Pp($UR, $Pws){
$Pp = ($UR / 100) * $Pws;
return $Pp;
}
function Tbu($T, $UR){
$Tbu = $T * atan(0.151977*(($UR)+8.313659)**(1/2))+atan($T+($UR))-atan(($UR)-1.676331)+(0.00391838*(($UR)**(3/2))*atan(0.023101*($UR)))-4.686035;
return $Tbu;
}
function Tr($T, $Pp){
if($T <= 0)
$Tr = 6.09+(12.608*(log($Pp/1000)))+0.4959*((log($Pp/1000))**2);
else
$Tr = 6.54+(14.526*(log($Pp/1000)))+(0.7389*((log($Pp/1000))**2))+(0.09486*((log($Pp/1000))**3))+(0.4569*(($Pp/1000)**0.1984));
return $Tr;
}
function V($T, $X, $Z){
$V = (0.2871*($T+273.15)*(1+(1.6078*$X/1000)))/((101325*(1-2.25577*10**(-5)*$Z)**5.2559)/1000);
return $V;
}
function H($T, $X){
$H = 1.006*$T+(($X/1000)*(2501+(1.805*$T)));
return $H;
}
function Tbs($H, $X){
$Tbs = ((200*((1000*$H)-(2501*$X)))/((361*$X)+201200));
return $Tbs;
}
function X($UR, $Pws, $Z){
$X = ($UR/100)*(0.622*($Pws/((101325*((1-2.25577*(10**(-5))*$Z)**5.2559))-$Pws)))*1000;
return $X;
}
function UR($Pws, $X, $Z){
$UR = ($X*100)/(0.622*($Pws/((101325*((1-2.25577*(10**(-5))*$Z)**5.2559))-$Pws)))/1000;
return $UR;
}
}
?>