anacv / HeatStress

Calculation of heat stress indices
GNU General Public License v3.0
14 stars 10 forks source link

Globe Temperature Inaccurate in Cases of Default/Low Wind Values #3

Open kaytlin-m opened 4 years ago

kaytlin-m commented 4 years ago

Within fTg Function: Upper bound of range indicated on line 68 is not large enough for cases where there is a wind value lower than 4 m/s. Function is unable to find value of true minimal error as the upper bound is too restrictive. opt <- stats::optimize(fr, range(Tair-2, Tair+10),Tair,Pair, tol=tolerance)

Function call used for testing/discovery: HeatStress::fTg(31.111111111111111, 63.388810371390171, 1010, 0.1, 0.10000000000000001, 852.49419750000004, 0.80000000000000004, 0.44949817750115978, tolerance=0.0001)

With upper bound = Tair + 10: 0.1 m/s: Tg = 41.111 1 m/s: Tg = 41.111 3 m/s: Tg = 41.111 4 m/s: Tg = 41.111

With upper bound = Tair + 35: 0.1 m/s: Tg = 62.4938 1 m/s: Tg = 48.82955 3 m/s: Tg = 43.07874 4 m/s: Tg = 41.79968

acgvar commented 3 years ago

Thank you for this! I agree. Took me two hours to figure it out what went wrong until this post.