Eliminating harmonics in a multilevel converter in which the separate dc sources vary is considered. That is, given a desired fundamental output voltage, the problem is to find the switching times (angles) that produce the fundamental while not generating specifically chosen harmonics. Assuming that the separate dc sources can be measured, a procedure is given to find all sets of switching angles for which the fundamental is produced while lower order harmonics are eliminated. This is done by first converting the transcendental equations that specify the elimination of the harmonics into an equivalent set of polynomial equations. Then, using the mathematical theory of resultants, all solutions to this equivalent problem can be found. Experimental results are presented to validate the theory.