Text this: An Optimal Algorithm for Renewable Energy Generation Based on Neural Network