An optimal purchase and sale power model considering microgrids. (10th December 2013)