Text this: A Mathematical Model for the Optimization of Renewable Energy Systems