Comment calculer le courant traversant une résistance en Python avec UliEngineering
Vous pouvez facilement calculer le courant traversant une résistance en utilisant la loi d’Ohm avec la bibliothèque Python UliEngineering :
current_through_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Calculer le courant traversant une résistance de 1kΩ à 5V
current = current_through_resistor("5V", "1k")
print(f"Current through 1kΩ at 5V: {format_value(current, 'A')}")
# Calculer le courant traversant une résistance de 100Ω à 3.3V
current = current_through_resistor("3.3V", "100Ω")
print(f"Current through 100Ω at 3.3V: {format_value(current, 'A')}")Exemple de sortie
current_through_resistor_output.txt
Current through 1kΩ at 5V: 5.00 mA
Current through 100Ω at 3.3V: 33.0 mALe courant est calculé en utilisant la loi d’Ohm : $I = \frac{V}{R}$
Articles liés
- Comment calculer la tension aux bornes d’une résistance en Python avec UliEngineering
- Comment calculer la valeur d’une résistance à partir de la tension et du courant en Python avec UliEngineering
- Comment calculer la puissance à partir du courant et de la tension en Python avec 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