摘要:AbstractDistrict Heating Networks (DHN) that include heat pumps as a heating source can offer flexibility to electrical grids. These systems are now used as part of smart city development where the electrical consumption of heat pumps can be controlled. They respond to the Demand-Side Management (DSM) programs and change their consumption to satisfy the constraints on the electrical grid while respecting the end-user heating demand. When thermal storage is included in DHN, there is an increase in the flexibility offered and a shift to using less fossil fuel energy. This paper proposes a heat pump and thermal storage system for space and water heating of twelve tertiary buildings. The proposed DHN system is modeled using Dymola, and is controlled via MATLAB to respond to flexibility demands which are given at the electrical grid level by the Distribution System Operator (DSO). A Model Predictive Controller (MPC) regulates the electrical consumption of the heat pump to perform peak shaving or valley filling for the electrical grid, or to minimize the electrical energy consumed over a 24-hour time window. This paper also presents an optimization problem that responds to different programs using only the heat pump and the thermal storage to satisfy end-user demands. Results show that thermal storage is used more often to satisfy the heating demands of the buildings when the control is activated. The system should be notified early enough before the peak shaving demand so it would be possible to turn of the heat pump.