EMI modeling of half-bridge inverter using a generalized terminal model