Smart and micro grid model for renewable energy based power system