District heating (DH) systems, which can integrate various available heat sources, have proven to be an energy-efficient and environment-friendly way to satisfy buildings’ heating demands. However, with the transition from current energy systems to future sustainable energy solutions, the DH system, as an essential part of the energy systems, must undergo a generational transition to maintain its competitiveness compared with alternative heating technologies. As a result, the current DH systems are transitioning to the 4th and 5th generation DH systems. Developing intelligent control strategies to optimally operate the DH system is one of the crucial measures to realize the transition. Numerous studies have reported that intelligent control strategies can notably reduce energy use, mitigate greenhouse gas emissions and improve economic performance for heating systems. However, most of the existing DH systems still use rule-based control (RBC) strategies with limited energy-saving and cost-saving potential. This thesis, therefore, aimed to explore the intelligent control strategies for the existing DH by utilizing model predictive control (MPC) strategies. With a focus on the DH systems dedicated to Nordic climate conditions, this thesis investigated the implementation of MPC on both the demand and supply side of the DH system to improve the energy and economic performance of the system. To achieve this goal, a step-by-step simulation-based study, was conducted, driven by four research questions. Question 1: What is the economic boundary when using MPC to improve the economic performance of a DH system? Literature reviews and energy contract investigations revealed that generalized heating and electricity price models can be used as the basis for the economic boundary for the MPC schemes. The generalized heating price model included the load demand component (LDC) and the energy demand component (EDC), and the generalized electricity price model was made up of the power price and the grid rent. This economic boundary was incorporated into the objective functions of the MPC schemes based on their specific needs. Question 2: What is the system energy and economic performance when using MPC on the demand side of the DH systems? The research on the MPC application in a building space heating (SH) system was conducted to answer this question. The modelling method for a building SH system was proposed, and then an MPC scheme was formulated by defining an economic-related objective function and system constraints, as well as incorporating the developed SH system model and an optimization framework. Finally, this MPC scheme was evaluated by comparing its performance to that of a conventional RBC strategy. A case study on the SH system in a university building showed that the MPC scheme with perfect future weather information could cut the weekly heating cost by 4.1% and decrease the violation numbers of indoor temperature by 65% compared to an RBC strategy. However, these benefits may be impaired when the MPC scheme directly used weather forecast information. Since any prediction has some uncertainties and hence the MPC controller may receive inaccurate weather information, leading to incorrect control actions that may deteriorate the system performance. Therefore, the third research question was proposed as follows. Question 3: What is the impact of weather forecast uncertainty on MPC performance, and how to handle it? To answer the impact of weather forecast uncertainty on MPC performance, another MPC scenario that directly used weather forecast information was proposed. The simulation results showed that the MPC scheme directly using weather forecast information cut the heating cost by only 0.7% and even increased the violation numbers of indoor temperature by 20% compared to the RBC strategy. To tackle the weather forecast uncertainty, an error model was proposed to improve the quality of weather forecast information. Meanwhile, one more MPC scenario that incorporated weather forecast information and the error model was proposed. Results showed that introducing the error model for the MPC scheme was able to address the weather forecast uncertainty and hence achieve almost the full theoretical potential of the MPC in terms of heating cost-saving and indoor temperature control. The MPC scheme with weather forecast information and the error model cut the weekly heating cost by 3.4% and decreased the violation numbers of indoor temperature by 73% compared to the RBC strategy. Question 4: What is the system energy and economic performance when using MPC on the supply side of the DH systems with distributed sources? The research on the MPC application for a heat prosumer with data centre (DC) waste heat recovery and thermal energy storage (TES) was conducted to answer this question. The modelling method for a typical heat prosumer with DC waste heat and TES was proposed firstly, and then an MPC scheme was formulated by defining an economic-related objective function and system constraints, as well as incorporating the developed DH system model and an optimization framework. A case study on a campus DH system showed that the MPC scheme optimized the heat supply allocation between the multiple heat sources and the TES so that the economic performance of the DH system was improved. The MPC scheme was more stable and robust expressed as the smaller fluctuating ranges of the outlet temperature at the heat pump (HP) evaporator, which is crucial for the DC cooling system's safe operation. In addition, the MPC scheme made an optimized trade-off between the heat and electricity use to achieve the best economic performance of the heat prosumer, and the resulting monthly energy cost saving was up to 3.2%. In conclusion, this thesis provided a systematic research method on the implementation of MPC in DH systems with distributed sources from both the demand and supply sides. Meanwhile, the investigation of weather forecast uncertainty may facilitate the real application of the MPC in building energy systems. Lastly, this study may enrich the research on the intelligent control strategies for the DH system.