Analysis and optimisation of a flyback converter with a nondissipative snubber