Python: Strom durch Widerstand mit UliEngineering berechnen
English
Deutsch
Du kannst leicht den Strom berechnen, der durch einen Widerstand fließt, mit dem Ohmschen Gesetz und der UliEngineering-Python-Bibliothek:
current_through_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Strom durch 1kΩ-Widerstand bei 5V berechnen
current = current_through_resistor("5V", "1k")
print(f"Strom durch 1kΩ bei 5V: {format_value(current, 'A')}")
# Strom durch 100Ω-Widerstand bei 3,3V berechnen
current = current_through_resistor("3.3V", "100Ω")
print(f"Strom durch 100Ω bei 3,3V: {format_value(current, 'A')}")Beispielausgabe
current_through_resistor_output.txt
Strom durch 1kΩ bei 5V: 5.00 mA
Strom durch 100Ω bei 3,3V: 33.0 mADer Strom wird mit dem Ohmschen Gesetz berechnet: $I = \frac{V}{R}$
Verwandte Beiträge
- How to compute voltage across 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