Flexible operation of thermal plants with integrated energy storage technologies