Text this: Multi-sources model and control algorithm of an energy management system