露點溫度計算算法

算法1

輸入爲室內溫溼度,輸出結露溫度

static float cal_dew_temp(float temp,float rh)
{
    float es,e,Td;
    es = 6.112*exp((17.67*temp)/(temp+243.5));
    e = (es * rh)/100;
    Td = (243.5*log(e/6.112))/(17.67-log(e/6.112));
    return(Td);
}

算法2

static double cal_dew_point_temp(double temperature, double humidity)
{
    double a = 17.27, b = 237.7;
    double r_value;

    r_value = a * temperature / (b + temperature) + log(humidity / 100);

    if((b * r_value / (a - r_value)) < 0)
        return (0);
    return (b * r_value / (a - r_value));
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章