# Version 1.1 released by David Romps on August 25, 2022. # (Added the bloodflow routine) # Version 1.0 released by David Romps on May 12, 2022. # (Initial release) # # When using this code, please cite: # # @article{20heatindex, # Title = {Extending the Heat Index}, # Author = {Yi-Chuan Lu and David M. Romps}, # Journal = {Journal of Applied Meteorology and Climatology}, # Year = {2022}, # Volume = {61}, # Number = {10}, # Pages = {1367--1383}, # Year = {2022}, # } # # This headindex function returns the Heat Index in Kelvin. The inputs are: # - T, the temperature in Kelvin # - rh, the relative humidity, which is a value from 0 to 1 # - verbose is an optional logical flag. If true, the function returns the physiological state. # - debug is an optional logical flag. If true, code checks its answer. source('heatindex.R') if ( all(abs(heatindex(200,c(0,.5,1))/c(199.9994020652,199.9997010342,200.0000000021)-1) < 1e-8) & all(abs(heatindex(210,c(0,.5,1))/c(209.9975943902,209.9987971085,209.9999998068)-1) < 1e-8) & all(abs(heatindex(220,c(0,.5,1))/c(219.9915822029,219.9957912306,219.9999999912)-1) < 1e-8) & all(abs(heatindex(230,c(0,.5,1))/c(229.9739691979,229.9869861009,230.0000001850)-1) < 1e-8) & all(abs(heatindex(240,c(0,.5,1))/c(239.9253828022,239.9626700074,240.0000000003)-1) < 1e-8) & all(abs(heatindex(250,c(0,.5,1))/c(249.7676757244,249.8837049107,250.0000000037)-1) < 1e-8) & all(abs(heatindex(260,c(0,.5,1))/c(259.3735990024,259.6864068902,259.9999999944)-1) < 1e-8) & all(abs(heatindex(270,c(0,.5,1))/c(268.5453870455,269.2745889562,270.0000002224)-1) < 1e-8) & all(abs(heatindex(280,c(0,.5,1))/c(277.2234200026,278.6369451963,280.0000000091)-1) < 1e-8) & all(abs(heatindex(290,c(0,.5,1))/c(285.7510545370,288.2813660100,290.7860610129)-1) < 1e-8) & all(abs(heatindex(300,c(0,.5,1))/c(297.5737503539,300.2922595865,305.3947127590)-1) < 1e-8) & all(abs(heatindex(310,c(0,.5,1))/c(305.5549530893,318.6225524695,359.9063248191)-1) < 1e-8) & all(abs(heatindex(320,c(0,.5,1))/c(313.0298872791,359.0538750602,407.5345212438)-1) < 1e-8) & all(abs(heatindex(330,c(0,.5,1))/c(320.5088548469,398.5759733823,464.9949352940)-1) < 1e-8) & all(abs(heatindex(340,c(0,.5,1))/c(328.0358006469,445.8599463105,530.5524786708)-1) < 1e-8) & all(abs(heatindex(350,c(0,.5,1))/c(333.2806160592,500.0421800191,601.9518435268)-1) < 1e-8) & all(abs(heatindex(360,c(0,.5,1))/c(343.6312984164,559.6640227151,677.2462089759)-1) < 1e-8) & all(abs(heatindex(370,c(0,.5,1))/c(354.1825692377,623.1960299857,755.0832658147)-1) < 1e-8) ) { cat('Success\n') } else { cat('Failure\n') }