Python: Leistung aus Strom und Spannung mit UliEngineering berechnen
English
Deutsch
Du kannst leicht elektrische Leistung aus Strom und Spannung mit der UliEngineering-Python-Bibliothek berechnen:
power_by_current_and_voltage.py
from UliEngineering.Electronics.Power import *
from UliEngineering.EngineerIO import *
# Leistung für 5V bei 1A berechnen
power = power_by_current_and_voltage("5V", "1A")
print(f"Leistung für 5V bei 1A: {format_value(power, 'W')}")
# Leistung für 12V bei 0,5A berechnen
power = power_by_current_and_voltage("12V", "0.5A")
print(f"Leistung für 12V bei 0,5A: {format_value(power, 'W')}")Beispielausgabe
power_by_current_and_voltage_output.txt
Leistung für 5V bei 1A: 5.00 W
Leistung für 12V bei 0,5A: 6.00 WDie Leistung wird mit der Formel $P = V \times I$ berechnet
Verwandte Beiträge
- How to compute current through resistor in Python using UliEngineering
- How to compute voltage across resistor in Python using UliEngineering
- How to compute resistor value from voltage and current in Python using UliEngineering
Check out similar posts by category:
Electronics, Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow