An improved algorithm for the analysis of partially saturated ferrite inductors in switching power supplies