Modelling and analyzing future energy systems and markets is challenging due to radical changes needed to tackle climate change. At the same time, global demand for energy service is increasing. However, all dimensions of sustainability need to be regarded, something that may create barriers to development. Especially challenging is the modelling and analysis of those energy systems which include large amounts of variable renewable energy generation in the system. Therefore, new models need to be created to better analyze the economics, barriers, operational issues, etc. of those systems. The focus of my doctoral thesis is the transition of the Finnish energy system towards long-term sustainability. This will involve modelling an energy system which includes large amounts of variable renewable energy generation, new energy storage options with synthetic natural gas, new energy demand patterns and demand response, etc. The effects on the power system at an operational time scale will be analyzed by integrating and further developing existing energy system and market models. A special focus will be power-to-gas technology. Moreover, renewable power methane can be stored for the mid- to long-term and reused in the energy system in several ways, with synergetic benefits to the energy system.