如何使用 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 中根据电流和电压计算功率
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