Soft switching inverters in electric vehicles