在Python中计算风寒系数(WCF)或风寒指数(WCI)
W ind-chill 或W indchill 是由于空气流动,身体在暴露的皮肤上感觉到的空气温度的感知下降。风寒的作用是增加热量损失的速度,并使任何较热的物体更快地降低到环境温度。
以下是加拿大、英国和美国在 2001 年采用的标准公式来计算和分析风寒指数:
Twc(WCI) = 13.12 + 0.6215Ta – 11.37v+0.16 + 0.3965Tav+0.16
where
Twc = Wind Chill Index (Based on Celsius temperature scale)
Ta = Air Temperature (in degree Celsius)
v = Wind Speed (in miles per hour)
例子:
Input:
Air Temperature = 28
Wind Speed = 80
Output: 30
Calculation done using the above formula:
WCI = 13.12 + 0.6215 * (28) -
11.37 * (80)**0.16 +
0.3965 * 28 * 80**0.16
Input:
Air Temperature = 42
Wind Speed = 150
Output: 51
Calculation done using the above formula:
WCI = 13.12 + 0.6215 * (42) -
11.37 * (150)**0.16 +
0.3965 * 42 * 150**0.16
# Python program to calculate WCI
import math
# funtion to calculate WCI
def WC(temp, wi_sp):
# Calculating Wind Chill Index (Twc)
wci = 13.12+0.6215*temp- 11.37*math.pow(wi_sp, 0.16) + \
0.3965*temp*math.pow(wi_sp, 0.16)
return wci
# Taking the Air Temperature (Ta)
temp = 42
# Taking the Wind Speed (v)
wi_sp = 150
print("The Wind Chill Index is", int(round(WC(temp, wi_sp))))
输出:
The Wind Chill Index is 51