Charging and discharging principle of solar panels