Как вычислить сопротивление параллельно соединённых резисторов на Python с помощью UliEngineering
Можно легко вычислить общее сопротивление параллельно соединённых резисторов с помощью библиотеки Python UliEngineering:
Σ
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.
Ω
⚠
Ω
⚠
parallel_resistors.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Вычислить общее сопротивление двух параллельно соединённых резисторов
total = parallel_resistors("1k", "2k")
print(f"Total resistance: {format_value(total, 'Ω')}")
# Вычислить общее сопротивление трёх параллельно соединённых резисторов
total = parallel_resistors("1k", "2k", "3k")
print(f"Total resistance: {format_value(total, 'Ω')}")Пример вывода
parallel_resistors_output.txt
Total resistance: 666.7 mΩ
Total resistance: 545.5 mΩФункция parallel_resistors() принимает любое количество значений резисторов в качестве аргументов и вычисляет общее сопротивление по формуле параллельного соединения:
Check out similar posts by category:
Calculators, 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