一些小细节的修改。

This commit is contained in:
2021-09-23 00:15:30 +08:00
parent 257d5bb23b
commit 476c8de80f
2 changed files with 54 additions and 34 deletions

47
main.py
View File

@@ -7,7 +7,7 @@ import timeit
def egm():
h_g_avr_sag = 11.67 * 2 / 3
h_c_avr_sag = 14.43 * 2 / 3
h_whole = 260 # 杆塔全高
h_whole = 40 # 杆塔全高
voltage_n = 3 # 工作电压分成多少份来计算
td = 20 # 雷暴日
insulator_c_len = 6.8 # 串子绝缘长度
@@ -36,33 +36,38 @@ def egm():
rg_x = None
rg_y = None
cad = Draw()
# 跳闸率 利用QGDW 11452-2015 架空输电线路防雷导则的公式 Ng=0.023*Td^(1.3) 20天雷暴日地闪密度为1.13
ng = func_ng(td)
n_sf_phases = np.zeros((phase_n, voltage_n)) # 计算每一相的跳闸率
for phase_conductor in range(phase_n):
rs_x = gc_x[phase_conductor]
rs_y = gc_y[phase_conductor]
rc_x = gc_x[phase_conductor + 1]
rc_y = gc_y[phase_conductor + 1]
if np.any(np.array(gc_y) < 0):
print("导线可能掉地面了,程序退出。")
return 0
for phase_conductor_foo in range(phase_n):
exposed_curve_shielded = False
rs_x = gc_x[phase_conductor_foo]
rs_y = gc_y[phase_conductor_foo]
rc_x = gc_x[phase_conductor_foo + 1]
rc_y = gc_y[phase_conductor_foo + 1]
if phase_n == 1:
rg_type = "g"
if phase_n > 1: # 多回路
if phase_conductor < 2:
if phase_conductor_foo < 2:
rg_type = "c"
rg_x = gc_x[phase_conductor + 2]
rg_y = gc_y[phase_conductor + 2]
rg_x = gc_x[phase_conductor_foo + 2]
rg_y = gc_y[phase_conductor_foo + 2]
else:
rg_type = "g"
# TODO 保护角公式可能有问题,后面改
shield_angle = (
math.atan(rc_x / ((rc_y - rs_y) + string_c_len)) * 180 / math.pi
math.atan((rc_x - rs_x) / ((rs_y - rc_y) + string_c_len)) * 180 / math.pi
) # 保护角
print(f"保护角{shield_angle:.3f}°")
print(f"最低相防护标识{rg_type}")
ng = func_ng(td)
for u_bar in range(voltage_n):
u_ph = (
math.sqrt(2) * 750 * math.cos(2 * math.pi / voltage_n * u_bar) / 1.732
) # 运行相电压
print(f"计算第{phase_conductor + 1}相,电压为{u_ph:.2f}kV")
print(f"计算第{phase_conductor_foo + 1}相,电压为{u_ph:.2f}kV")
# 迭代法计算最大电流
i_max = 0
i_min = min_i(insulator_c_len, u_ph / 1.732)
@@ -151,17 +156,21 @@ def egm():
)
if distance > rc:
print("暴露弧已经完全被屏蔽")
exposed_curve_shielded = True
break
if phase_conductor == 2:
cad.draw(i_min, u_ph, rs_x, rs_y, rc_x, rc_y, rg_x, rg_y, rg_type, 2)
cad.draw(i_max, u_ph, rs_x, rs_y, rc_x, rc_y, rg_x, rg_y, rg_type, 6)
cad.save()
# if phase_conductor_foo == 2:
cad.draw(i_min, u_ph, rs_x, rs_y, rc_x, rc_y, rg_x, rg_y, rg_type, 2)
cad.draw(i_max, u_ph, rs_x, rs_y, rc_x, rc_y, rg_x, rg_y, rg_type, 6)
cad.saveas(f"egm{phase_conductor_foo+1}.dxf")
# 判断是否导线已经被完全保护
if abs(i_max - _max_i) < 1e-5:
print("无法找到最大电流,可能是杆塔较高。")
print(f"最大电流设置为自然界最大电流{i_max}kA")
print(f"最大电流为{i_max:.2f}")
print(f"最小电流为{i_min:.2f}")
if exposed_curve_shielded:
print("暴露弧已经完全被屏蔽,不会跳闸。")
continue
curt_fineness = 0.1 # 电流积分细度
if i_min > i_max or abs(i_min - i_max) < curt_fineness:
print("最大电流小于最小电流,没有暴露弧。")
@@ -204,11 +213,9 @@ def egm():
# if abs(calculus-0.05812740052770032)<1e-5:
# abc=123
# pass
n_sf = (
2 * ng / 10 * calculus
) # 跳闸率 利用QGDW 11452-2015 架空输电线路防雷导则的公式 Ng=0.023*Td^(1.3) 20天雷暴日地闪密度为1.13
n_sf = (2 * ng / 10 * calculus) * arc_possibility(750, insulator_c_len)
avr_n_sf += n_sf / voltage_n
n_sf_phases[phase_conductor][u_bar] = n_sf
n_sf_phases[phase_conductor_foo][u_bar] = n_sf
print(f"工作电压为{u_ph:.2f}kV时,跳闸率是{n_sf:.6}")
print(f"跳闸率是{avr_n_sf:.6f}")
print(f"不同相跳闸率是{np.mean(n_sf_phases,axis=1)}")