The document describes modeling and simulation of a dynamic voltage restorer (DVR) for mitigating voltage sags and swells. A DVR is proposed as a cost-effective solution to protect sensitive loads from voltage fluctuations. The operation and equivalent circuit of a DVR are presented. Simulation results show that the DVR can satisfactorily compensate for both balanced and unbalanced voltage sags and swells, maintaining the load voltage at its nominal value.