Como calcular corrente através do resistor em Python usando UliEngineering

Você pode calcular facilmente a corrente fluindo através de um resistor usando a lei de Ohm com a biblioteca 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.
V
Ω
current_through_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *

# Calcular corrente através de resistor de 1kΩ a 5V
current = current_through_resistor("5V", "1k")
print(f"Current through 1kΩ at 5V: {format_value(current, 'A')}")

# Calcular corrente através de resistor de 100Ω a 3.3V
current = current_through_resistor("3.3V", "100Ω")
print(f"Current through 100Ω at 3.3V: {format_value(current, 'A')}")

Exemplo de saída

current_through_resistor_output.txt
Current through 1kΩ at 5V: 5.00 mA
Current through 100Ω at 3.3V: 33.0 mA

A corrente é calculada usando a lei de Ohm: $I = \frac{V}{R}$

Posts relacionados


Check out similar posts by category: Calculators, Electronics, Python