Adaptive Power Management in Energy Harvesting Systems