Calculate the capacity of a battery for a given discarge time with a constant load.
batteryCapacityForDischargeTime( 10 hours, 100 mA )
|dischargeTime||the desired discharge time.|
|k||Peukerts constant. It depends on battery type. If not given 1.3 is assumed.|
|dischargeRate||the discarge rate of the battery. If not given 20 hour rate is assumed (good for 99% of specifications).|
|return value||the capacity of the battery.|
NOTE: This version of battery capacity specification is used in most of the cases. If you are looking for Peukert's capacity (rarely used), check out batteryCapacityForDischargeTime1H.
For more details, see https://en.wikipedia.org/wiki/Peukert's_law, http://www.smartgauge.co.uk/peukert2.html.