Firstly why would you do this? The simple answer is when calibrating your battery, the last thing you want to do is sit around waiting for your battery to drain normally. This procedures accelerates the process.
There are a number of ways to drain your Macs battery such as playing a game, or watching a DVD. But I have found a quicker way to do it which doesn’t require you to be at your computer.
Just open up one terminal per processor core and run this in it:
yes > /dev/null
Don’t run it without the /dev/null otherwise it will consume lots of memory and eventually lock up your system. Now if you open another Terminal an run “top”, you should see 0% idle. Let it run this way for a while and your battery will drain very quickly. Once it reaches around 5%, I would suggest stopping all the yes processes and let it drain by itself. Otherwise when you powerup your system these processes will start running again.