Generation of Optimal Constrained Switching Pattern for Single-Phase Intervers