Initial work on web based voltage calculator

This commit is contained in:
2023-05-13 16:04:36 +01:00
parent 889da444bd
commit 8b7fb4bc4d
2 changed files with 69 additions and 0 deletions

39
powerweb/power_calcs.py Normal file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/python
voltage_limit = 11.5
def calculate(cabletype, assumed_load, length):
cable_size = {
"13": 1.5,
"16": 2.5,
"32": 6.0,
"63": 16,
"125": 35,
}
single_phase = {
1.5: 31,
2.5: 19,
6.0: 7.9,
16: 2.9,
}
three_phase = {
1.5: 27,
2.5: 16,
6.0: 6.8,
16: 2.5,
35: 1.1,
}
drop = 0
if "/3" in cabletype:
drop = three_phase[cable_size[cabletype[:-2]]]
else:
drop = single_phase[cable_size[cabletype]]
total_drop = drop * assumed_load * length / 1000
max_length = (voltage_limit * 1000) / (drop * assumed_load)
r = total_drop / assumed_load
pfc = 230 / r
#print(f"Estimated PFC is {pfc:.1f}A")
return drop, total_drop, max_length, pfc