The Design and Dynamic Control of a Unified Power Flow Controller with a Novel Algorithm for Obtaining the Least Harmonic Distortion | Synapse