Python: Strom aus Leistung und Spannung mit UliEngineering berechnen

English Deutsch

Du kannst leicht den Strom aus Leistung und Spannung mit der UliEngineering-Python-Bibliothek berechnen:

current_by_power.py
from UliEngineering.Electronics.Power import *
from UliEngineering.EngineerIO import *

# Strom für 5W bei 5V berechnen
current = current_by_power("5W", "5V")
print(f"Strom für 5W bei 5V: {format_value(current, 'A')}")

# Strom für 6W bei 12V berechnen
current = current_by_power("6W", "12V")
print(f"Strom für 6W bei 12V: {format_value(current, 'A')}")

Beispielausgabe

current_by_power_output.txt
Strom für 5W bei 5V: 1.00 A
Strom für 6W bei 12V: 500 mA

Der Strom wird mit der Formel $I = \frac{P}{V}$ berechnet.

Verwandte Beiträge


Check out similar posts by category: Electronics, Python