65 lines
1.2 KiB
Markdown
65 lines
1.2 KiB
Markdown
---
|
|
id: 2026-03-05T10:26:48-05:00
|
|
aliases: []
|
|
title: 2026-03-05 10:26:48
|
|
tags:
|
|
- authorship/original
|
|
- destiny/permanent
|
|
- status/draft
|
|
- type/periodic/timestamped
|
|
dg-publish: true
|
|
date-created: 2026-03-05T10:26:48-05:00
|
|
daily: "[[2026-03-05]]"
|
|
weekly: "[[2026-W10]]"
|
|
monthly: "[[2026-03]]"
|
|
quarterly: "[[2026-Q1]]"
|
|
yearly: "[[2026]]"
|
|
---
|
|
# 2026-03-05 10:26:48
|
|
|
|
## Python SQLite Voltage Drop Calculator
|
|
|
|
Python script to account for voltage drop
|
|
based on various factors given in various forms
|
|
|
|
Python to handle calculation, defaults.
|
|
SQLite to store conductor properties
|
|
(resistance, reactance)
|
|
|
|
Allowable voltage drop given by
|
|
* percent overall
|
|
* percent per n feet
|
|
* volts overall
|
|
* volts per n feet
|
|
|
|
```python
|
|
import math
|
|
|
|
"""
|
|
current
|
|
apparent_power
|
|
voltage
|
|
phases
|
|
wire_size
|
|
parallel_runs
|
|
wire_material
|
|
conduit_material
|
|
"""
|
|
|
|
if (!current) {
|
|
current = apparent_power / voltage
|
|
}
|
|
|
|
if (phases = 3) {
|
|
max_resistance = voltage_drop_volts / math.sqrt(3) * current
|
|
}
|
|
else {
|
|
max_resistance = voltage_drop_volts * current * 2
|
|
}
|
|
|
|
power_factor_angle = math.acos(power_factor)
|
|
|
|
effective_z = ac_resistance * math.cos(power_factor_angle)
|
|
+ reactance * math.sin(power_factor_angle)
|
|
```
|