Python: Widerstandswert aus Spannung und Leistung mit UliEngineering berechnen

English Deutsch

Du kannst leicht den erforderlichen Widerstandswert bei gegebener Spannung und Verlustleistung mit der UliEngineering-Python-Bibliothek berechnen:

resistor_value_by_voltage_and_power.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *

# Widerstand für 5V bei 1W berechnen
resistor = resistor_value_by_voltage_and_power("5V", "1W")
print(f"Widerstand für 5V bei 1W: {format_value(resistor, 'Ω')}")

# Widerstand für 12V bei 0,5W berechnen
resistor = resistor_value_by_voltage_and_power("12V", "0.5W")
print(f"Widerstand für 12V bei 0,5W: {format_value(resistor, 'Ω')}")

Beispielausgabe

resistor_value_by_voltage_and_power_output.txt
Widerstand für 5V bei 1W: 25.0 Ω
Widerstand für 12V bei 0,5W: 288 Ω

Der Widerstandswert wird mit der Formel $R = \frac{V^2}{P}$ berechnet

Verwandte Beiträge


Check out similar posts by category: Electronics, Python