An Advanced Model for MicroGrid and Energy Independence