Adaptive power management in energy harvesting systems