Jak vypočítat výkon z proudu a napětí v Pythonu pomocí UliEngineering
Můžete snadno vypočítat elektrický výkon z proudu a napětí pomocí knihovny 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
⚠
power_by_current_and_voltage.py
from UliEngineering.Electronics.Power import *
from UliEngineering.EngineerIO import *
# Výpočet výkonu pro 5V při 1A
power = power_by_current_and_voltage("5V", "1A")
print(f"Power for 5V at 1A: {format_value(power, 'W')}")
# Výpočet výkonu pro 12V při 0.5A
power = power_by_current_and_voltage("12V", "0.5A")
print(f"Power for 12V at 0.5A: {format_value(power, 'W')}")Příklad výstupu
power_by_current_and_voltage_output.txt
Power for 5V at 1A: 5.00 W
Power for 12V at 0.5A: 6.00 WVýkon se počítá pomocí vzorce: $P = V \times 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 hodnotu rezistoru z napětí a proudu 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