Jak vypočítat hodnotu rezistoru z napětí a proudu v Pythonu pomocí UliEngineering
Můžete snadno vypočítat hodnotu rezistoru vzhledem k napětí a proudu 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.
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
⚠
A
⚠
resistor_by_voltage_and_current.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Výpočet hodnoty rezistoru pro 5V při 5mA
resistor = resistor_by_voltage_and_current("5V", "5mA")
print(f"Resistor for 5V at 5mA: {format_value(resistor, 'Ω')}")
# Výpočet hodnoty rezistoru pro 3.3V při 33mA
resistor = resistor_by_voltage_and_current("3.3V", "33mA")
print(f"Resistor for 3.3V at 33mA: {format_value(resistor, 'Ω')}")Příklad výstupu
resistor_by_voltage_and_current_output.txt
Resistor for 5V at 5mA: 1.00 kΩ
Resistor for 3.3V at 33mA: 100 ΩHodnota rezistoru se počítá pomocí Ohmova zákona: $R = \frac{V}{I}$
Související příspěvky
- Jak vypočítat proud protékající rezistorem v Pythonu pomocí UliEngineering
- Jak vypočítat napětí na rezistoru v Pythonu pomocí UliEngineering
- Jak vypočítat výkon z proudu a napětí v Pythonu pomocí UliEngineering
Podívejte se na podobné články podle kategorie:
Calculators, Electronics, Python
Pokud vám tento článek pomohl, zvažte, zda mi nekoupíte kávu nebo nepřispějete přes PayPal na podporu výzkumu a publikování nových článků na TechOverflow