Como encontrar o próximo valor de resistor padrão superior em Python usando UliEngineering

Você pode encontrar facilmente o próximo valor de resistor padrão superior usando a biblioteca Python UliEngineering:

next_higher_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *

# Encontrar próximo valor de resistor E96 superior a 1.5k
resistor = next_higher_resistor("1.5k")
print(f"Next higher than 1.5k: {format_value(resistor, 'Ω')}")

# Encontrar próximo valor de resistor E24 superior a 100Ω
resistor = next_higher_resistor("100Ω", sequence=e24)
print(f"Next higher than 100Ω (E24): {format_value(resistor, 'Ω')}")

Exemplo de saída

next_higher_resistor_output.txt
Next higher than 1.5k: 1.58 kΩ
Next higher than 100Ω (E24): 110 Ω

A função next_higher_resistor() encontra o próximo valor de resistor padrão superior a partir da série E especificada (o padrão é E96).


Check out similar posts by category: Electronics, Python