On the optimal design and management of grid-connected residential PV-systems