Maximizing system lifetime by battery scheduling | Synapse