0% found this document useful (0 votes)
7 views2 pages

Math Function Python

This document provides a Python program for electrical engineering calculations using the math module, targeting 3rd Year Diploma Electrical Engineering students. It includes functions for calculating RMS voltage, electrical power, phase angle in AC circuits, and RL circuit transient current. The program prompts users for input values and outputs the calculated results.

Uploaded by

Ganesh Kumbhar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Math Function Python

This document provides a Python program for electrical engineering calculations using the math module, targeting 3rd Year Diploma Electrical Engineering students. It includes functions for calculating RMS voltage, electrical power, phase angle in AC circuits, and RL circuit transient current. The program prompts users for input values and outputs the calculated results.

Uploaded by

Ganesh Kumbhar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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 -----")

You might also like