Unified and non-ideal switch model for analysis of switching circuits