A mixed integer linear programming approach is adopted to identify the optimal size for PV area and battery capacity to minimize total costs. Total costs are intended in this code as the sum of annualized investment costs (associated to PV and battery) and yearly operational costs deriving from electricity imports from the grid. The optimization is carried out with a 1-hour resolution and 1-year time horizon. The techno-economic data used in the code are adopted from the database: https://sweet-cross.ch/data/energy-tech-parameters/2024-02-27/ The boundary conditions for the design problems are defined in the .csv file.