How to compute resistor current from power and resistance in Python using UliEngineering
You can easily compute the current through a resistor given its power dissipation and resistance using the UliEngineering Python library:
resistor_current_by_power.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Compute current for 1W dissipated in 1kΩ resistor
current = resistor_current_by_power("1W", "1k")
print(f"Current for 1W in 1kΩ: {format_value(current, 'A')}")
# Compute current for 0.5W dissipated in 100Ω resistor
current = resistor_current_by_power("0.5W", "100Ω")
print(f"Current for 0.5W in 100Ω: {format_value(current, 'A')}")Example output
resistor_current_by_power_output.txt
Current for 1W in 1kΩ: 31.6 mA
Current for 0.5W in 100Ω: 70.7 mAThe current is computed using the formula: $I = \sqrt{\frac{P}{R}}$
Related posts
- How to compute current from power and voltage in Python using UliEngineering
- How to compute resistor value from voltage and power in Python using UliEngineering
- How to compute power from current and voltage in Python using UliEngineering
Check out similar posts by category:
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