A receding horizon approach for the power flow management with renewable energy and energ storage systems