My macbook would be running perfectly happily, both on battery & on mains, and then it would suddenly "forget" it had a battery. The indicator would say "no battery", the lights on the side of the macbook would all flash. Taking the battery out & putting it back in whilst the mac was running would f . . .