The installation of solar panels on building roofs is increasing and considered as a potential solution to decarbonise the current energy system. However, how to make the best use of this energy is yet to be determined. In this project, two already developed optimization algorithms are compared to analyse the synergy between thermal storage and photovoltaic power production. The energy system includes photovoltaic panels, a heat pump and electric heaters. The conducted sensitivity study shows that the simulation of the thermal and electrical fluxes depends on whether self consumption or the minimization of the operational cost is favoured and thus impacts the usage of the produced power.