Real tIme simulation of a microgrid system with distributed energy resources