From 9c7e5f418a75d77579a9dabe28699653e33b1d1a Mon Sep 17 00:00:00 2001 From: MundM99 Date: Sat, 4 Jan 2025 08:48:12 +0100 Subject: [PATCH] =?UTF-8?q?Kleiner=20Prototyp=20f=C3=BCr=20Leistungssimula?= =?UTF-8?q?tion=20eingef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Leitungssimulation.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Leitungssimulation.py diff --git a/Leitungssimulation.py b/Leitungssimulation.py new file mode 100644 index 0000000..f154811 --- /dev/null +++ b/Leitungssimulation.py @@ -0,0 +1,22 @@ +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) \ No newline at end of file