ARCHITECTURE OF A MICROGRID AND OPTIMAL ENERGY MANAGEMENT SYSTEM