UliEngineering kullanarak Python'da orana göre gerilim bölücü dirençlerini hesaplama

UliEngineering Python kütüphanesini kullanarak alt direnç değeri ve bölme oranı verildiğinde bir gerilim bölücünün üst direncini kolayca hesaplayabilirsiniz:

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.
Ω ⚠
⚠
top_resistor_by_ratio.py
from UliEngineering.Electronics.VoltageDivider import *
from UliEngineering.EngineerIO import *

# 10k alt dirençli 1:2 gerilim bölücü için üst direnci hesapla
rtop = top_resistor_by_ratio("10k", 0.5)
print(f"Top resistor (ratio 0.5, bottom 10k): {format_value(rtop, 'Ω')}")

# 1k alt dirençli 1:10 gerilim bölücü için üst direnci hesapla
rtop = top_resistor_by_ratio("1k", 0.1)
print(f"Top resistor (ratio 0.1, bottom 1k): {format_value(rtop, 'Ω')}")

Örnek çıktı

top_resistor_by_ratio_output.txt
Top resistor (ratio 0.5, bottom 10k): 10.0 kΩ
Top resistor (ratio 0.1, bottom 1k): 9.00 kΩ

Üst direnç şu formülle hesaplanır: $R_{top} = R_{bottom} \times (\frac{1}{ratio} - 1)$; burada oran $V_{out}/V_{in}$‘dir.


Check out similar posts by category: Hesaplayıcılar Elektronik Python