Comment calculer la puissance à partir du courant et de la tension en Python avec UliEngineering
Vous pouvez facilement calculer la puissance électrique à partir du courant et de la tension à l’aide de la bibliothèque Python UliEngineering :
power_by_current_and_voltage.py
from UliEngineering.Electronics.Power import *
from UliEngineering.EngineerIO import *
# Calculer la puissance pour 5V à 1A
power = power_by_current_and_voltage("5V", "1A")
print(f"Puissance pour 5V à 1A : {format_value(power, 'W')}")
# Calculer la puissance pour 12V à 0.5A
power = power_by_current_and_voltage("12V", "0.5A")
print(f"Puissance pour 12V à 0.5A : {format_value(power, 'W')}")Exemple de sortie
power_by_current_and_voltage_output.txt
Puissance pour 5V à 1A : 5.00 W
Puissance pour 12V à 0.5A : 6.00 WLa puissance est calculée à l’aide de la formule : $P = V \times I$
Articles liés
- Comment calculer le courant traversant une résistance en Python avec UliEngineering
- 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
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