Photovoltaic battery charging and discharging tutorial diagram