Python: Spannung über einem Widerstand mit UliEngineering berechnen
English
Deutsch
Du kannst leicht den Spannungsabfall über einem Widerstand mit dem Ohmschen Gesetz und der UliEngineering-Python-Bibliothek berechnen:
voltage_across_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Spannung über 1kΩ-Widerstand bei 5mA berechnen
voltage = voltage_across_resistor("1k", "5mA")
print(f"Spannung über 1kΩ bei 5mA: {format_value(voltage, 'V')}")
# Spannung über 100Ω-Widerstand bei 33mA berechnen
voltage = voltage_across_resistor("100Ω", "33mA")
print(f"Spannung über 100Ω bei 33mA: {format_value(voltage, 'V')}")Beispielausgabe
voltage_across_resistor_output.txt
Spannung über 1kΩ bei 5mA: 5.00 V
Spannung über 100Ω bei 33mA: 3.30 VDie Spannung wird mit dem Ohmschen Gesetz berechnet: $V = I \times R$
Verwandte Beiträge
- How to compute current through resistor in Python using UliEngineering
- How to compute resistor value from voltage and current in Python using UliEngineering
- How to compute power from current and voltage 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