From 3f3527f7af7fed445a356d5b37ae831484c6ade1 Mon Sep 17 00:00:00 2001 From: dmy Date: Mon, 2 Mar 2026 22:11:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AE=E4=BA=A4=E7=9B=B4?= =?UTF-8?q?=E6=B5=81=E7=B1=BB=E5=9E=8B=E8=AE=A1=E7=AE=97=E7=9B=B8=E7=94=B5?= =?UTF-8?q?=E5=8E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 2de9164..38ac496 100644 --- a/main.py +++ b/main.py @@ -140,14 +140,16 @@ def egm(): logger.debug(f"最低相防护标识{rg_type}") rated_voltage = para.rated_voltage for u_bar in range(voltage_n): # 计算不同工作电压下的跳闸率 - # TODO 需要区分交、直流 - # u_ph = ( - # math.sqrt(2) - # * rated_voltage - # * math.cos(2 * math.pi / voltage_n * u_bar) - # / 1.732 - # ) # 运行相电压 - u_ph = rated_voltage / 1.732 + if para.ac_or_dc=="AC": + # TODO 需要区分交、直流 + u_ph = ( + math.sqrt(2) + * rated_voltage + * math.cos(2 * math.pi / voltage_n * u_bar) + / 1.732 + ) # 运行相电压 + else: + u_ph = rated_voltage logger.info(f"计算第{phase_conductor_foo + 1}相,电压为{u_ph:.2f}kV") # 迭代法计算最大电流 i_max = 0