Operation of Distributed Energy Resources in Smart Distribution Networks