Improving the efficiency of renewable energy assets by optimizing the matching of supply and demand using a smart battery scheduling algorithm