Given a Simulink inverter model that converts DC to AC using a simple pulse-width modulation (PWM) technique, what is the expected shape of the output voltage waveform?
Think about how PWM creates an AC output from DC by switching rapidly.
The inverter uses PWM to approximate a sinusoidal AC output by switching the DC input on and off rapidly. This creates a waveform that looks like a sine wave but with high-frequency switching noise.
You have simulated an inverter output voltage signal in Simulink and exported the voltage data as a time series array. Which Python code snippet correctly calculates the RMS voltage from this data?
import numpy as np voltage_data = np.array([0, 1, 0, -1, 0, 1, 0, -1]) # example data
RMS means root mean square, so square the values, average them, then take the square root.
RMS voltage is calculated by squaring each voltage value, finding the mean of these squares, and then taking the square root of that mean.
After running an inverter simulation, you perform a Fourier transform on the output voltage to analyze harmonics. Which plot correctly shows the harmonic spectrum with a fundamental frequency peak and smaller peaks at multiples?
import numpy as np import matplotlib.pyplot as plt freqs = np.array([50, 100, 150, 200, 250]) amplitudes = np.array([1.0, 0.2, 0.1, 0.05, 0.02]) plt.stem(freqs, amplitudes) plt.xlabel('Frequency (Hz)') plt.ylabel('Amplitude') plt.title('Harmonic Spectrum') plt.show()
Harmonics appear at multiples of the fundamental frequency with decreasing amplitude.
The fundamental frequency is the largest peak, and harmonics appear at integer multiples with smaller amplitudes, shown clearly in a stem plot.
Consider this Python snippet that attempts to simulate a simple inverter output signal:
import numpy as np time = np.linspace(0, 0.02, 1000) frequency = 50 voltage = 230 * np.sin(2 * np.pi * frequency * time) output = voltage if voltage > 0 else 0
What error will this code produce?
import numpy as np time = np.linspace(0, 0.02, 1000) frequency = 50 voltage = 230 * np.sin(2 * np.pi * frequency * time) output = np.where(voltage > 0, voltage, 0)
Think about how 'if' works with arrays in Python.
The 'if' statement cannot be used directly on numpy arrays because it expects a single boolean, not an array of booleans. This causes a ValueError.
You want to reduce total harmonic distortion (THD) in your inverter simulation output. Which approach is most effective?
Higher switching frequency usually pushes harmonics to higher frequencies, easier to filter out.
Increasing the PWM switching frequency reduces low-frequency harmonics and thus lowers THD. Other options either increase distortion or remove filtering benefits.