Modeling and Control of Single-Phase Rectifiers and Inverters