-
Notifications
You must be signed in to change notification settings - Fork 0
/
myscript.php
46 lines (40 loc) · 1.56 KB
/
myscript.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
<?php
require_once "PHPsychrometric.php";
isset($_GET['F']) ? $F = $_GET['F'] : $F = "all";
isset($_GET['T']) ? $T = $_GET['T'] : $T = "20";
isset($_GET['UR']) ? $UR = $_GET['UR'] : $UR = "65";
isset($_GET['Z']) ? $Z = $_GET['Z'] : $Z = "0";
$PHPsychrometric = new PHPsychrometric($T, $UR, $Z);
switch($F){
case "Tbu":
$print = "Wet bulb temperature: ".$PHPsychrometric->Tbu($T, $UR);
break;
case "Tr":
$print = "Dew point temperature: ".$PHPsychrometric->Tr($T, $PHPsychrometric->Pp($UR, $PHPsychrometric->Pws($T)));
break;
case "V":
$print = "Specific volume: ".$PHPsychrometric->V($T, $PHPsychrometric->X($UR, $PHPsychrometric->Pws($T), $Z), $Z);
break;
case "H":
$print = "Specific enthalpy: ".$PHPsychrometric->H($T, $PHPsychrometric->X($UR, $PHPsychrometric->Pws($T), $Z));
break;
case "X":
$print = "Absolute humidity: ".$PHPsychrometric->X($UR, $PHPsychrometric->Pws($T), $Z);
break;
case "all":
default:
$print = "Wet bulb temperature: ".$PHPsychrometric->Tbu($T, $UR);
$print .= "</br>";
$print .= "Dew point temperature: ".$PHPsychrometric->Tr($T, $PHPsychrometric->Pp($UR, $PHPsychrometric->Pws($T)));
$print .= "</br>";
$print .= "Specific volume: ".$PHPsychrometric->V($T, $PHPsychrometric->X($UR, $PHPsychrometric->Pws($T), $Z), $Z);
$print .= "</br>";
$print .= "Specific enthalpy: ".$PHPsychrometric->H($T, $PHPsychrometric->X($UR, $PHPsychrometric->Pws($T), $Z));
$print .= "</br>";
$print .= "Absolute humidity: ".$PHPsychrometric->X($UR, $PHPsychrometric->Pws($T), $Z);
break;
}
print "<pre>";
print $print;
print "</pre>";
?>