Text this: Algorithm for optimal pairing of res and hydrogen energy storage systems