This paper advocates the use of a dynamic scheduling model to perform battery-aware optimal task scheduling for LEO satellites, and reports on its effective application in the GOMX-3 mission. GOMX-3, a 3U CubeSat designed and built by GomSpace in less than a year, is the first European Space Agency In-Orbit Demonstration Cubesat. It was deployed from the International Space Station on October 5th 2015. GOMX-3 contains many power-hungry components, including payloads for tracking ADS-B signals from airplanes, a software-defined L-Band receiver for monitoring of geostationary satellites, and an experimental high data rate X-Band transmitter, as well as an advanced attitude control system. The operation is challenging due to capacity limits of onboard batteries as well as irregular patterns of input power and relative object attitude in space. This makes manual scheduling ineffective and error-prone, and instead suggests the need for dynamic and battery-aware scheduling of tasks. This method does not risk depletion of the onboard batteries while maximizing the amount of data delivered to the ground station. To master this challenge, the SENSATION project has developed a two-step procedure to perform optimal task scheduling for LEO satellites. The first step is a cost-optimal reachability analysis (CORA) on networks of linear priced timed automata (LPTA) modeling the satellite components and their powerrelevant behaviour. This analysis yields an optimal task schedule for the satellite relative to a linear battery model, valid up to a time horizon set by uncertainty in the satellite position due to the chaotic nature of earth's outer atmosphere. In the second step, we validate the computed schedule in a noisy setting and evaluate it along a more realistic non-linear kinetic battery model (KiBaM) having a stochastic initial state of charge, extended by battery capacity limits to bound the cumulative risk of premature battery depletion. This two-step procedure ensures that the schedules are guaranteed to exploit the available battery power most effectively, with quantifiable error bounds. We have automated and tightly integrated this procedure in the daily management of GOMX-3. Our in-orbit experiments have shown an improvement over manual scheduling as well as a clear reduction of scheduling workload. With the rising demand for larger nano-satellite constellations and more efficient payload operations, there is an obvious demand for flexible and effective resource utilization and scheduling support, working with precise battery models.