Examination Of Power Quality Control Within A Cost-Based Microgrid Architecture