Text this: Optimal Scheduling of Combined Heat and Power Generation Considering Heating Grid Dynamics