Text this: Improved Gradient-Based Optimizer for Modelling Thermal and Hydropower Plants