This document discusses the modeling and simulation of a series active power filter (SAPF) using MATLAB/Simulink software to improve power quality. SAPFs inject compensating voltages in series with the transmission line to mitigate voltage disturbances from the source, such as sags, swells, and harmonics, ensuring sinusoidal voltage at the load. The paper presents the MATLAB simulation model of a SAPF and evaluates its performance under different source voltage conditions, including interruptions and harmonic distortions. Simulation results demonstrate the SAPF is able to maintain low harmonic distortion at the load voltage below 5% even with 64% distortion in the source voltage.