- log: documentation ( source)
- exp: documentation ( source)
<?
// alle Formeln nach http://www.wettermail.de/wetter/feuchte.html
$temperatur = 5;
$relfeuchte = 85;
//Taupunktberechnung in °C
function Taupunkt($temperatur,$relfeuchte)
{
$val = (234.67*0.434292289*log(6.1*exp((7.45*$temperatur)
/(234.67+$temperatur)*2.3025851)*$relfeuchte/100/6.1))
/(7.45-0.434292289*log(6.1*exp((7.45*$temperatur)
/(234.67+$temperatur)*2.3025851)*$relfeuchte/100/6.1) );
return $val;
}
//Sättigungsdampfdruck in hPa
function SaettigungsDampfDruck($temperatur)
{
if ($temperatur >= 0)
{
$a = 7.5;
$b = 237.3;
}
elseif ($temperatur < 0)
{
$a = 7.6;
$b = 240.7;
}
$val = (6.1078 * exp( log(10) * (($a * $temperatur) / ($b + $temperatur)) ) );
return $val;
}
//Dampfdruck in hPa
function DampfDruck($temperatur,$relfeuchte)
{
$val = $relfeuchte/100 * SaettigungsDampfDruck($temperatur);
return $val;
}
//absolute Feuchte in g/m³
function AbsoluteFeuchte($temperatur,$relfeuchte)
{
$tk = ($temperatur + 273.15);
$val = (exp(log(10) * 5) * 18.016/8314.3 * DampfDruck($temperatur,$relfeuchte)/$tk);
return $val;
}
$taupunkt = Taupunkt($temperatur,$relfeuchte);
$sattdampfdruck = SaettigungsDampfDruck($temperatur);
$dampfdruck = DampfDruck($temperatur,$relfeuchte);
$absfeuchte = AbsoluteFeuchte($temperatur,$relfeuchte);
echo $absfeuchte;
?>