European Parliament and Council Directive 2009/28/EC regulates the promotion of the use of energy from renewable recourses in the European Union. According to the 4 th attachment of this Directive, Latvia is legally resolved to increase its renewable energy share in gross final energy consumption from 32,6 % in 2005 to 40% in 2020.This objective cannot be achieved with a single solution or mechanism; it requires a complex strategy that includes energy efficiency and renewable resource use issues in all sectors of the economy including: industry, transport, public, residential, and agricultural. The residential sector is the main thermal energy consumer in Latvia and has huge potential for renewable energy use and an increase of energy efficiency. In this work, a combined solar and pellet system for the heating of an apartment building has been developed, installed and optimized. This solution for the apartment building heat supply is entirely based on local and renewable energy resources and suitable for Latvian climatic conditions. The combined solar and pellet systems deterministic mathematical model was developed using dynamic simulation software TRNSYS. The model was validated using the monitoring results of a real system and were used in this work for finding economical optimization, system performance analysis and the optimization of different technological solutions. A series of combustion experiments were carried out usinga low power pellet boiler in laboratory conditions withthe objective to determinate the effects of the quantity of combustion air on performance parameters of the boiler. The results of the experiments were used for the optimization of a wood pellet boiler installed in the combined system. Within this work, a methodology for the optimization of the system operational parameters was developed. The methodology allows for a complex analysis of the parameter impact on the system performance and determining the optimal combination of performance parameters. The method is based on TRNSYS dynamic simulation, multi-parameter nonlinear regression analysis and the use of steep rise method for the optimization of regression equations.The developed method is sufficiently universal, and can be used for the analysis and optimization of similar systems. This study has a number of target groups, among them apartment building residents, equipment installers and distributors, wood pellet heating equipment and modular boiler manufacturers, municipalities, parliamentary representatives, and investors.