Function Purpose Electrical Application
[Link]() Square root RMS voltage calculation
[Link]() Power calculation Electrical power formula
[Link]() Inverse tangent Phase angle in AC circuits
[Link]() Radians → Degrees Angle conversion
[Link]() Exponential function RL transient current
# Demonstration of Python math built-in functions
# For 3rd Year Diploma Electrical Engineering Students
import math
print("----- Electrical Engineering Calculations using math module -----")
# 1. RMS Voltage Calculation
Vm = float(input("Enter Peak Voltage (Vm): "))
Vrms = Vm / [Link](2)
print("RMS Voltage (Vrms) =", round(Vrms, 2), "V")
# 2. Power Calculation using P = V^2 / R
V = float(input("\nEnter Voltage (V): "))
R = float(input("Enter Resistance (R): "))
Power = [Link](V, 2) / R
print("Power =", round(Power, 2), "Watts")
# 3. AC Circuit Phase Angle Calculation
XL = float(input("\nEnter Inductive Reactance (XL): "))
R_ac = float(input("Enter Resistance (R): "))
phi = [Link](XL / R_ac) # Phase angle in radians
phi_degree = [Link](phi) # Convert to degrees
print("Phase Angle =", round(phi_degree, 2), "degrees")
# 4. RL Circuit Current (Transient Response)
Vdc = float(input("\nEnter DC Voltage (V): "))
R_rl = float(input("Enter Resistance (R): "))
L = float(input("Enter Inductance (L in Henry): "))
t = float(input("Enter Time (t in seconds): "))
I = (Vdc / R_rl) * (1 - [Link](-R_rl * t / L))
print("Current at time", t, "seconds =", round(I, 4), "Amperes")
print("\n----- Program Completed -----")