Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda AC Circuit Analysis and Phasors | Modeling and Simulation in Electrical Engineering
Python for Electrical Engineers

bookAC Circuit Analysis and Phasors

Alternating current (AC) circuits are fundamental in electrical engineering, powering most modern electrical systems. Unlike direct current (DC), AC voltages and currents vary sinusoidally with time, leading to more complex analysis. To make these calculations manageable, engineers use phasors—a mathematical tool that represents sinusoidal signals as complex numbers. A phasor captures both the amplitude and phase of a sinusoidal waveform, allowing you to analyze steady-state AC circuits using algebraic methods rather than differential equations. In Python, you can use complex numbers to represent phasors directly, simplifying calculations involving voltages, currents, and impedance for resistors, inductors, and capacitors.

12345678910111213141516171819202122232425
# Representing phasors and calculating impedance in Python import numpy as np # Example: Voltage phasor with amplitude 120V and phase 30 degrees V_amp = 120 V_phase_deg = 30 V_phase_rad = np.deg2rad(V_phase_deg) V_phasor = V_amp * np.exp(1j * V_phase_rad) # Impedance calculations R = 10 # Ohms L = 0.05 # Henry C = 100e-6 # Farads f = 60 # Hz omega = 2 * np.pi * f Z_R = R # Resistor impedance (real) Z_L = 1j * omega * L # Inductor impedance (imaginary) Z_C = 1 / (1j * omega * C) # Capacitor impedance (imaginary) print(f"Voltage phasor: {V_phasor}") print(f"Resistor impedance: {Z_R} Ω") print(f"Inductor impedance: {Z_L:.2f} Ω") print(f"Capacitor impedance: {Z_C:.2f} Ω")
copy

By converting sinusoidal signals to phasors, you turn time-varying differential equations into simple algebraic equations using complex numbers. This approach is highly efficient for steady-state AC analysis. Phasor arithmetic allows you to add, subtract, and multiply voltages and currents as complex numbers, and apply Ohm's Law using impedance (which generalizes resistance for all AC elements). The impedance of resistors is real, while inductors and capacitors introduce imaginary components, reflecting their phase-shifting properties. Using Python's complex number support, you can perform these calculations easily, making it straightforward to analyze even complicated AC circuits.

123456789101112131415161718192021222324252627282930313233
# Calculating total impedance and current in a series RLC circuit using phasors import numpy as np # Circuit parameters R = 10 # Ohms L = 0.05 # Henry C = 100e-6 # Farads f = 60 # Hz V_amp = 120 # Voltage amplitude V_phase_deg = 0 # Reference phase omega = 2 * np.pi * f # Impedances Z_R = R Z_L = 1j * omega * L Z_C = 1 / (1j * omega * C) # Total impedance (series connection) Z_total = Z_R + Z_L + Z_C # Source voltage phasor V_phase_rad = np.deg2rad(V_phase_deg) V_phasor = V_amp * np.exp(1j * V_phase_rad) # Current phasor using Ohm's Law: I = V / Z I_phasor = V_phasor / Z_total print(f"Total impedance: {Z_total:.2f} a9") print(f"Current phasor: {I_phasor:.2f} A") print(f"Current magnitude: {np.abs(I_phasor):.2f} A") print(f"Current phase (degrees): {np.angle(I_phasor, deg=True):.2f}")
copy

1. What is a phasor and how is it represented in Python?

2. How does impedance differ for resistors, capacitors, and inductors?

3. Why are complex numbers useful in AC circuit analysis?

question mark

What is a phasor and how is it represented in Python?

Select the correct answer

question mark

How does impedance differ for resistors, capacitors, and inductors?

Select the correct answer

question mark

Why are complex numbers useful in AC circuit analysis?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 4

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

bookAC Circuit Analysis and Phasors

Deslize para mostrar o menu

Alternating current (AC) circuits are fundamental in electrical engineering, powering most modern electrical systems. Unlike direct current (DC), AC voltages and currents vary sinusoidally with time, leading to more complex analysis. To make these calculations manageable, engineers use phasors—a mathematical tool that represents sinusoidal signals as complex numbers. A phasor captures both the amplitude and phase of a sinusoidal waveform, allowing you to analyze steady-state AC circuits using algebraic methods rather than differential equations. In Python, you can use complex numbers to represent phasors directly, simplifying calculations involving voltages, currents, and impedance for resistors, inductors, and capacitors.

12345678910111213141516171819202122232425
# Representing phasors and calculating impedance in Python import numpy as np # Example: Voltage phasor with amplitude 120V and phase 30 degrees V_amp = 120 V_phase_deg = 30 V_phase_rad = np.deg2rad(V_phase_deg) V_phasor = V_amp * np.exp(1j * V_phase_rad) # Impedance calculations R = 10 # Ohms L = 0.05 # Henry C = 100e-6 # Farads f = 60 # Hz omega = 2 * np.pi * f Z_R = R # Resistor impedance (real) Z_L = 1j * omega * L # Inductor impedance (imaginary) Z_C = 1 / (1j * omega * C) # Capacitor impedance (imaginary) print(f"Voltage phasor: {V_phasor}") print(f"Resistor impedance: {Z_R} Ω") print(f"Inductor impedance: {Z_L:.2f} Ω") print(f"Capacitor impedance: {Z_C:.2f} Ω")
copy

By converting sinusoidal signals to phasors, you turn time-varying differential equations into simple algebraic equations using complex numbers. This approach is highly efficient for steady-state AC analysis. Phasor arithmetic allows you to add, subtract, and multiply voltages and currents as complex numbers, and apply Ohm's Law using impedance (which generalizes resistance for all AC elements). The impedance of resistors is real, while inductors and capacitors introduce imaginary components, reflecting their phase-shifting properties. Using Python's complex number support, you can perform these calculations easily, making it straightforward to analyze even complicated AC circuits.

123456789101112131415161718192021222324252627282930313233
# Calculating total impedance and current in a series RLC circuit using phasors import numpy as np # Circuit parameters R = 10 # Ohms L = 0.05 # Henry C = 100e-6 # Farads f = 60 # Hz V_amp = 120 # Voltage amplitude V_phase_deg = 0 # Reference phase omega = 2 * np.pi * f # Impedances Z_R = R Z_L = 1j * omega * L Z_C = 1 / (1j * omega * C) # Total impedance (series connection) Z_total = Z_R + Z_L + Z_C # Source voltage phasor V_phase_rad = np.deg2rad(V_phase_deg) V_phasor = V_amp * np.exp(1j * V_phase_rad) # Current phasor using Ohm's Law: I = V / Z I_phasor = V_phasor / Z_total print(f"Total impedance: {Z_total:.2f} a9") print(f"Current phasor: {I_phasor:.2f} A") print(f"Current magnitude: {np.abs(I_phasor):.2f} A") print(f"Current phase (degrees): {np.angle(I_phasor, deg=True):.2f}")
copy

1. What is a phasor and how is it represented in Python?

2. How does impedance differ for resistors, capacitors, and inductors?

3. Why are complex numbers useful in AC circuit analysis?

question mark

What is a phasor and how is it represented in Python?

Select the correct answer

question mark

How does impedance differ for resistors, capacitors, and inductors?

Select the correct answer

question mark

Why are complex numbers useful in AC circuit analysis?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 4
some-alt