  The global drive towards carbon neutrality has led to a significant increase
in the number of power plants based on renewable energy sources (RES).
Concurrently, numerous households are adopting RES to generate their own
energy, aiming to decrease both electricity costs and carbon footprints. To
support these users, many papers have been devoted to developing optimal
investment strategies for residential energy systems. However, there is still a
significant gap as these studies often neglect important aspects like carbon
neutrality. For this reason, in this paper, we explore the concept of net-zero
energy houses (ZEHs) -- houses designed to have an annual net energy
consumption around zero -- by presenting a constrained optimization problem to
find the optimal number of photovoltaic panels and the optimal size of the
battery system for home integration. Solving this constrained optimization
problem is difficult due to its nonconvex constraints. Nevertheless, by
applying a series of transformations, we reveal that it is possible to find an
equivalent linear programming (LP) problem which is computationally tractable.
The attainment of ZEH can be tackled by introducing a single constraint in the
optimization problem. Additionally, we propose a sharing economy approach to
the investment problem, offering a strategy that could potentially reduce
investment costs and facilitate the attainment of ZEH more efficiently.
Finally, we apply the proposed frameworks to a neighborhood in Japan as a case
study, demonstrating the potential for long-term ZEH attainment. The results
show that, under the right incentive, users can achieve ZEH, reduce their
electricity costs and have a minimal impact on the main grid.
