/* Wind chill formula in Picat. From http://www.lenntech.com/calculators/wind/wind-chill.htm """ To calculate the wind chill temperature, we use the Siple formula: Tapparent(°C) = 33 + (Tair- 33)*(0.474 + 0.454√(v)-0.0454.v) However, mainly at low temperatures and high wind speed, this formula does not give very reliable results. For wind speed, the relative speed must be filled in. Example: the wind blows 2 m/s and you run by 1 m/s in the opposite direction, the total speed is 3 m/s. When you run in the same direction as the wind, the total speed is 1 m/s. """ http://en.wikipedia.org/wiki/Wind_chill """ Wind Chill (Celcius, km/h) Tchill = 13.12 + 0.6215*T - 11.37*V^0.16 + 0.3965*T*V^0.16 """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ % import util. % import cp. main => go. go => foreach(T in 0..40, V in 0..30) println([T,V,wind_chill(T,V),wind_chill2(T,V)]) end, nl. wind_chill(T, V) = 13.12 + 0.6215*T - 11.37*(V**0.16) + 0.3965*T*(V**0.16). wind_chill2(T, V) = 33 + (T-33)*(0.474 + 0.454*sqrt(V)-0.0454*V).