Design of Optimal Energy Management System in a Residential Microgrid Based on Smart Control. Issue 1 (2nd January 2022)