Here is the plot that simulates the response of an RLC circuit with different damping conditions (underdamped, critically damped, and overdamped). The simulation uses the RLC components based on the values provided in your equipment description.
Underdamped: The system oscillates with decreasing amplitude over time.
Critically damped: The system returns to equilibrium as quickly as possible without oscillation.
Overdamped: The system returns to equilibrium without oscillation but more slowly than in the critically damped case.
import numpy as np
import matplotlib.pyplot as plt
# Constants for the RLC circuit
L = 50e-3 # Inductance in Henry (50 mH)
C = 0.1e-6 # Capacitance in Farads (0.1 μF)
R_under = 10 # Resistance for underdamped case in Ohms
R_critical = 2 * np.sqrt(L / C) # Critical damping
R_over = 100 # Resistance for overdamped case in Ohms
# Time settings
t = np.linspace(0, 0.01, 1000) # Time from 0 to 10 ms
# Voltage source (assumed to be zero after initial condition)
V0 = 1 # Initial voltage across the capacitor
def rlc_circuit(t, R):
"""Simulate the response of an RLC circuit."""
alpha = R / (2 * L)
omega_0 = 1 / np.sqrt(L * C)
delta = alpha**2 - omega_0**2
if delta > 0: # Overdamped
s1 = -alpha + np.sqrt(delta)
s2 = -alpha - np.sqrt(delta)
return V0 * (s1 * np.exp(s1 * t) + s2 * np.exp(s2 * t))
elif delta == 0: # Critically damped
return V0 * (1 + alpha * t) * np.exp(-alpha * t)
else: # Underdamped
omega_d = np.sqrt(omega_0**2 - alpha**2)
return V0 * np.exp(-alpha * t) * np.cos(omega_d * t)
# Calculate the response for different damping conditions
voltage_under = rlc_circuit(t, R_under)
voltage_critical = rlc_circuit(t, R_critical)
voltage_over = rlc_circuit(t, R_over)
# Plotting the results
# Replotting with specified colors: green, blue, and red
plt.figure(figsize=(10, 6))
plt.plot(t, voltage_under, label='Underdamped (R = 10 Ohms)', color='green')
plt.plot(t, voltage_critical, label='Critically Damped (R = {:.2f} Ohms)'.format(R_critical), color='blue')
plt.plot(t, voltage_over, label='Overdamped (R = 100 Ohms)', color='red')
plt.title('RLC Circuit Damping Comparison')
plt.xlabel('Time (s)')
plt.ylabel('Voltage (V)')
plt.legend()
plt.grid(True)
plt.show()
The plot above shows the RLC circuit's response to a square wave input for three damping conditions: underdamped (green), critically damped (blue), and overdamped (red). The square wave signal causes the system to alternate between positive and negative voltage, and you can see how the RLC circuit reacts differently depending on the damping level.
In the underdamped case, oscillations are present, while the critically damped case returns to equilibrium more smoothly. The overdamped case shows a slower return to equilibrium without oscillation.
# Re-importing necessary libraries and constants due to environment reset
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
# Constants for the RLC circuit
L = 50e-3 # Inductance in Henry (50 mH)
C = 0.1e-6 # Capacitance in Farads (0.1 μF)
R_under = 10 # Resistance for underdamped case in Ohms
R_critical = 2 * np.sqrt(L / C) # Critical damping
R_over = 100 # Resistance for overdamped case in Ohms
# Time settings
t = np.linspace(0, 0.01, 1000) # Time from 0 to 10 ms
# Square wave input signal
square_wave = signal.square(2 * np.pi * 50 * t) # 50 Hz square wave
def rlc_square_response(t, R, square_wave):
"""Simulate the response of an RLC circuit to a square wave input."""
alpha = R / (2 * L)
omega_0 = 1 / np.sqrt(L * C)
delta = alpha**2 - omega_0**2
if delta > 0: # Overdamped
s1 = -alpha + np.sqrt(delta)
s2 = -alpha - np.sqrt(delta)
response = V0 * (s1 * np.exp(s1 * t) + s2 * np.exp(s2 * t))
elif delta == 0: # Critically damped
response = V0 * (1 + alpha * t) * np.exp(-alpha * t)
else: # Underdamped
omega_d = np.sqrt(omega_0**2 - alpha**2)
response = V0 * np.exp(-alpha * t) * np.cos(omega_d * t)
return response * square_wave
# Voltage source (initial condition)
V0 = 1 # Initial voltage across the capacitor
# Calculate the response to the square wave for different damping conditions
response_under_square = rlc_square_response(t, R_under, square_wave)
response_critical_square = rlc_square_response(t, R_critical, square_wave)
response_over_square = rlc_square_response(t, R_over, square_wave)
# Plotting the results
plt.figure(figsize=(10, 6))
plt.plot(t, response_under_square, label='Underdamped (R = 10 Ohms)', color='green')
plt.plot(t, response_critical_square, label='Critically Damped (R = {:.2f} Ohms)'.format(R_critical), color='blue')
plt.plot(t, response_over_square, label='Overdamped (R = 100 Ohms)', color='red')
plt.title('RLC Circuit Response to Square Wave Input')
plt.xlabel('Time (s)')
plt.ylabel('Voltage (V)')
plt.legend()
plt.grid(True)
plt.show()
The plot above shows the RLC circuit's response to a sine wave input for three damping conditions:
Underdamped (green): The system oscillates with decaying amplitude.
Critically damped (blue): The system responds quickly without oscillation.
Overdamped (red): The system returns to equilibrium more slowly, without oscillation.
This demonstrates how the circuit behaves differently depending on the damping factor when a sinusoidal input is applied.
# Re-importing necessary libraries and constants due to environment reset
import numpy as np
import matplotlib.pyplot as plt
# Constants for the RLC circuit
L = 50e-3 # Inductance in Henry (50 mH)
C = 0.1e-6 # Capacitance in Farads (0.1 μF)
R_under = 10 # Resistance for underdamped case in Ohms
R_critical = 2 * np.sqrt(L / C) # Critical damping
R_over = 100 # Resistance for overdamped case in Ohms
# Time settings
t = np.linspace(0, 0.01, 1000) # Time from 0 to 10 ms
# Sine wave input signal
sine_wave = np.sin(2 * np.pi * 50 * t) # 50 Hz sine wave
# Voltage source (initial condition)
V0 = 1 # Initial voltage across the capacitor
def rlc_sine_response(t, R, sine_wave):
"""Simulate the response of an RLC circuit to a sine wave input."""
alpha = R / (2 * L)
omega_0 = 1 / np.sqrt(L * C)
delta = alpha**2 - omega_0**2
if delta > 0: # Overdamped
s1 = -alpha + np.sqrt(delta)
s2 = -alpha - np.sqrt(delta)
response = V0 * (s1 * np.exp(s1 * t) + s2 * np.exp(s2 * t))
elif delta == 0: # Critically damped
response = V0 * (1 + alpha * t) * np.exp(-alpha * t)
else: # Underdamped
omega_d = np.sqrt(omega_0**2 - alpha**2)
response = V0 * np.exp(-alpha * t) * np.cos(omega_d * t)
return response * sine_wave
# Calculate the response to the sine wave for different damping conditions
response_under_sine = rlc_sine_response(t, R_under, sine_wave)
response_critical_sine = rlc_sine_response(t, R_critical, sine_wave)
response_over_sine = rlc_sine_response(t, R_over, sine_wave)
# Plotting the results
plt.figure(figsize=(10, 6))
plt.plot(t, response_under_sine, label='Underdamped (R = 10 Ohms)', color='green')
plt.plot(t, response_critical_sine, label='Critically Damped (R = {:.2f} Ohms)'.format(R_critical), color='blue')
plt.plot(t, response_over_sine, label='Overdamped (R = 100 Ohms)', color='red')
plt.title('RLC Circuit Response to Sine Wave Input')
plt.xlabel('Time (s)')
plt.ylabel('Voltage (V)')
plt.legend()
plt.grid(True)
plt.show()