降水强度计算公式
前面已经计算出了数浓度,下面我们来计算降水强度
降水强度公式如下:
#!usr/bin/env python # -*- coding:utf-8 -*- """ @author: Suyue @file: rainintensity.py @time: 2024/05/20 @desc: """ import numpy as np import pandas as pd import xlwt import math df1 = pd.read_excel('G:/lianxi/20240510五原数浓度.xls') speeds = {'速度':[0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, 1.1, 1.3, 1.5, 1.7, 1.9, 2.2, 2.6, 3, 3.4, 3.8, 4.4, 5.2, 6, 6.8, 7.6, 8.8, 10.4, 12, 13.6, 15.2, 17.6, 20.8]} df2 = pd.DataFrame(speeds) pi = math.pi a = (6*pi)/(1e4) list = [] # 要把直径、变化直径循环起来,一个个进行计算,取第一个D值时让整个v算一遍,以此类推 for i in range(0,len(df1)): N = df1.iloc[i]['数浓度'] d = df1.iloc[i]['粒径'] # 计算粒径的3次方 d_3 = pow(d,3) delta_d = df1.iloc[i]['变化直径'] # 取出速度的全部值,跟d和delta_d的第一个值计算,以此类推 v = df2.iloc[:].values.astype(float) R = v*N*d_3*delta_d df3 = pd.DataFrame(R) # 求和D1时的公式,依次类推求和D2... sum_R = df3.sum() sum_R_a = a*sum_R list.append(sum_R_a) df4 = pd.DataFrame(list) # 计算D1+D2+...+D23对应的公式 sum_R_total = df4.sum() print(sum_R_total) # sum_R_total.to_excel(r'G:/lianxi/result.xlsx',index=False)
结果