Design of a Power Electronics Based Diesel Engine Generator Emulator for Study of Microgrid Related Applications