Photovoltaic system for standalone/grid-connected applications