system
June 20, 2012, 3:59pm
1
Hi,
In the old forum, I found this topic:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1267245927
Indicating how to convert the values ??in% RH, dewpoint and humidex.
But the function to convert dewpoint, I get an error, which is a value added and multiplied, what is the correct formula to get it?
dewpoint = (237,7*(17.271*((temp-32)*5/9))/(237.7+*((temp-32)*5/9)+log(RH/100))/(17.271-(17.271*((temp-32)*5/9))/(237.7+*((temp-32)*5/9)+(log(RH/100)));
// the numbers are constants, RH =relative humidity, temperature must be in C
Thanks,
pylon
June 20, 2012, 4:26pm
2
This code is syntactically incorrect. I simplified it a little and added the necessary braces at the end, although I don't know if this calculates the correct value (I haven't studied the wikipedia article).
float tempC = 25.7;
float temp = (tempC -32) * 5 / 9;
float RH = 35.9;
float dewpoint = (237.7*(17.271*temp)/(237.7*temp+log(RH/100))/(17.271-(17.271*temp)/(237.7*temp+(log(RH/100)))));
This at least compiles. I took out the recurring calculation of the temperature in Fahrenheit and made it before the dewpoint calculation.
system
June 20, 2012, 7:11pm
3
You may also want to try:
const float
tempC = 25.7,
temp = (tempC - 32) * 5/9,
logRH = -1.024433, // ln(35.9/100)
a = 17.271,
b = 237.7,
y = a*temp/(b + temp) + logRH,
Td = b*y/(a - y);
system
June 21, 2012, 2:42pm
4
pylon:
This code is syntactically incorrect. I simplified it a little and added the necessary braces at the end, although I don't know if this calculates the correct value (I haven't studied the wikipedia article).
float tempC = 25.7;
float temp = (tempC -32) * 5 / 9;
float RH = 35.9;
float dewpoint = (237.7*(17.271temp)/(237.7 temp+log(RH/100))/(17.271-(17.271temp)/(237.7 temp+(log(RH/100)))));
This at least compiles. I took out the recurring calculation of the temperature in Fahrenheit and made it before the dewpoint calculation.
For this formula, the result I get is 0.00.
I used this formula, but I can not confirm if the values ??are correct.
float aux = (log(RH / 100) + ((17.27 * temperatureC) / (237.3 + temperatureC))) / 17.27;
float dewpoint = (237.3 * aux) / (1 - aux);
The values ??that I'm getting are:
24.22 *C 75.59 *F 43.69 %RH 11.09 dew point *C 18.66 Humidex
Can you confirm if I'm right?
Reinderien:
You may also want to try:
const float
tempC = 25.7,
temp = (tempC - 32) * 5/9,
logRH = -1.024433, // ln(35.9/100)
a = 17.271,
b = 237.7,
y = a*temp/(b + temp) + logRH,
Td = b*y/(a - y);
In this calculation, it seems to me you were to ignore the value of the logarithm of %RH.
But I'm not sure.
thanks for your help,
system
June 21, 2012, 2:59pm
5
In this calculation, it seems to me you were to ignore the value of the logarithm of %RH.
In your code, %RH was a constant, so log(RH/100) is also a constant. Since log is an expensive operation, it might as well be pre-computed.
from - Arduino Playground - DHT11Lib - the NOAA reference algorithm and the fast variation
// dewPoint function NOAA
// reference: http://wahiduddin.net/calc/density_algorithms.htm
double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078); // temp var
return (241.88 * T) / (17.558-T);
}
// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}
system
June 28, 2012, 1:17am
7
I took out the recurring calculation of the temperature in Fahrenheit and made it before the dewpoint calculation.
nice to meet you guys here to share the beautiful life with so many people.
Rc Helicopter |
Mini Rc Helicopter Reviews |
Rc Hobby Stores