22 lines
519 B
Python
22 lines
519 B
Python
import numpy as np
|
|
import math
|
|
import matplotlib as plt
|
|
|
|
#Units are SI-Units except for cable cross-section
|
|
|
|
def distance(x1,y1,x2,y2):
|
|
distance = math.sqrt(((x2-x1)^2)*((y2-y1)^2))
|
|
return distance
|
|
|
|
def resistance(l,a,rho):
|
|
#Calculate the resistance between 2 coordinates
|
|
#Add 10% of length for various factors such as transitions and hanging lines
|
|
r = l*a*rho
|
|
return r
|
|
|
|
def power_loss(resitance,voltage,power):
|
|
loss = (voltage^2)/resistance
|
|
return loss
|
|
|
|
def run():
|
|
distance(1,2,3,4) |