Jak vypočítat proud protékající rezistorem v Pythonu pomocí UliEngineering

Můžete snadno vypočítat proud protékající rezistorem pomocí Ohmova zákona s knihovnou UliEngineering v Pythonu:

TechOverflow calculators:
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button.
V
Ω
current_through_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *

# Výpočet proudu procházejícího 1kΩ rezistorem při 5V
current = current_through_resistor("5V", "1k")
print(f"Current through 1kΩ at 5V: {format_value(current, 'A')}")

# Výpočet proudu procházejícího 100Ω rezistorem při 3.3V
current = current_through_resistor("3.3V", "100Ω")
print(f"Current through 100Ω at 3.3V: {format_value(current, 'A')}")

Příklad výstupu

current_through_resistor_output.txt
Current through 1kΩ at 5V: 5.00 mA
Current through 100Ω at 3.3V: 33.0 mA

Proud se počítá pomocí Ohmova zákona: $I = \frac{V}{R}$

Související příspěvky


Podívejte se na podobné články podle kategorie: Calculators, Electronics, Python