Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeatIndex for lower values of temperature and humidity #153

Open
frankielc opened this issue Apr 2, 2020 · 1 comment
Open

HeatIndex for lower values of temperature and humidity #153

frankielc opened this issue Apr 2, 2020 · 1 comment

Comments

@frankielc
Copy link

frankielc commented Apr 2, 2020

The current algorithm used for calculating heat index takes into account Rothfusz equation to achieve the values that Robert G. Steadman came up by experimentation. It then has some refinements done by the NWS but doesn't consider the other refinements that NWS did for lower values of temperature and humidity.

That's the reason why heat index for common house-hold values, like 74.84F and 68.5H give a heat index of 66.38F when in reality it should be somewhere in the range of 75.23F - which makes more sense.

NWS full algo is very well detailed in this paper:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3801457/

I also submited a pull request:
#154

@Daryavahus
Copy link

I changed used library DHT11 Asair using that diagram shown above:
And my code looks like this:

float DHT::computeHeatIndex(float temperature, float percentHumidity,
bool isFahrenheit) {
float hi;

if (!isFahrenheit)
temperature = convertCtoF(temperature);

if (temperature <= 40){
hi = temperature;
}
else{
float var_A = -10.3 + (1.1 * temperature) + (0.047 * percentHumidity);
if(var_A < 80){
hi = var_A;
}

else{
hi = -42.379 + 2.04901523 * temperature + 10.14333127 * percentHumidity +
-0.22475541 * temperature * percentHumidity +
-0.00683783 * pow(temperature, 2) +
-0.05481717 * pow(percentHumidity, 2) +
0.00122874 * pow(temperature, 2) * percentHumidity +
0.00085282 * temperature * pow(percentHumidity, 2) +
-0.00000199 * pow(temperature, 2) * pow(percentHumidity, 2);

if ((percentHumidity < 13) && (temperature >= 80.0) &&
    (temperature <= 112.0)){
  hi -= ((13.0 - percentHumidity) * 0.25) *
        sqrt((17.0 - abs(temperature - 95.0)) * 0.05882353);
	}
	
if ((percentHumidity > 85.0) && (temperature >= 80.0) &&
         (temperature <= 87.0)){
  hi += ((percentHumidity - 85.0) * 0.1) * ((87.0 - temperature) * 0.2);

}
}
}
return isFahrenheit ? hi : convertFtoC(hi);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants