This study uses optimization modeling to study efficient ways to integrate renewable energy systems to provide electricity and heat in rural Japan. The model provides minimum cost system configuration and operation taking into account hour-by-hour energy availability and demand. Grid electricity is available to rural areas of Japan, but it is relatively expensive. Local renewable energy generation can be economic while using grid electricity to compensate for the intermittency of the renewable generation.