如何使用 UliEngineering 在 Python 中计算流过电阻的电流
你可以使用 UliEngineering Python 库,通过欧姆定律轻松计算流过电阻的电流:
current_through_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# 计算 5V 电压下 1kΩ 电阻的电流
current = current_through_resistor("5V", "1k")
print(f"Current through 1kΩ at 5V: {format_value(current, 'A')}")
# 计算 3.3V 电压下 100Ω 电阻的电流
current = current_through_resistor("3.3V", "100Ω")
print(f"Current through 100Ω at 3.3V: {format_value(current, 'A')}")示例输出
current_through_resistor_output.txt
Current through 1kΩ at 5V: 5.00 mA
Current through 100Ω at 3.3V: 33.0 mA电流通过欧姆定律计算:$I = \frac{V}{R}$
相关文章
- 如何使用 UliEngineering 在 Python 中计算电阻两端的电压
- 如何使用 UliEngineering 在 Python 中根据电压和电流计算电阻值
- 如何使用 UliEngineering 在 Python 中根据电流和电压计算功率
按类别查看类似文章:
Electronics, Python
如果这篇文章对您有帮助,请考虑请我喝杯咖啡或通过 PayPal 捐款,以支持 TechOverflow 上新文章的研究与发布