October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Model Battery Runtime More Accurately in TypeScript

A more credible battery runtime model accounts for discharge-rate-dependent capacity, inverter idle consumption, and a chemistry-appropriate discharge limit.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A runtime estimate based only on amp-hours divided by load current can be badly wrong because battery capacity changes with discharge rate, an inverter draws power even when its AC output is lightly loaded, and not all rated capacity may be usable. A useful TypeScript model should make those factors explicit inputs rather than treating a battery as a fixed bucket of amp-hours.

Why amp-hours divided by current can mislead

The simple calculation hours = amp-hours ÷ amps assumes the battery will deliver its full rated capacity at the current draw and that the current stays constant. A battery’s amp-hour rating is tied to a stated discharge rate, however; a capacity quoted at C20 is not guaranteed at a much faster discharge. For power loads, first establish the battery’s nominal voltage and convert watts to current consistently: at a given voltage, current ≈ watts ÷ volts. Real voltage varies during discharge, so this is a modeling approximation, not a complete battery model.

As an Amazon Associate I earn from qualifying purchases.

Victron explains that faster discharge reduces available capacity and that lead-acid batteries are more affected by this effect than lithium batteries. Its illustrative example says a lead-acid battery rated at 100 Ah at C20 may deliver 56 Ah when discharged completely in two hours. That is an example, not a general derating factor for other batteries. Victron’s explanation of battery capacity and Peukert’s law and its Energy Unlimited guide discuss the rate effect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How Peukert’s law adjusts for discharge rate

Peukert’s law is an empirical way to represent the loss of available capacity as discharge current rises. One common form is:

#1 Best Overall
MakerHawk Battery Load Tester - 180W 200V 20A USB Load Tester 4-Wire System Adjustable Constant Current Voltage Discharge Lithium Battery Capacity Tester Electronic Load Tester
  • 2.4" Large Screen Battery Load Tester: Featuring a high-definition color screen, this electronic load tester provides clear and precise readings. It offers comprehensive parameter, settings and operations, including voltage, current, power, capacity, electricity, temperature, discharge resistance, time-limited discharge and stop voltage, etc., to ensure accurate and reliable results.
  • Multi-Device Compatibility & Safety Features: This battery capacity tester supports discharge aging tests for a wide range of devices, including chargers, cables, power banks, batteries, and power adapters. It has intelligent safety protection such as overload, overcurrent and high temperature protection, real-time monitoring of status makes it safe and reliable.
  • Four Discharge Modes & App Compatibility: The USB load tester supports constant current, constant power, constant resistance, and constant voltage modes. It is compatible with Android and iOS apps, as well as PC BT and wired connections, providing versatile testing options.
  • High Precision & Upgraded Four-Wire System: Utilizing a four-wire connection, this voltage tester ensures accurate voltage measurements unaffected by wire resistance and its measurement accuracy is comparable to that of large professional instruments. It is also compatible with two-wire connection.
  • Powerful Performance & Intelligent Cooling: This lithium battery tester has a high voltage of 200V, a high current of 20A, and a high power of 180W. Equipped with an intelligent temperature-controlled colored light fan, strong airflow and low noise, it can extend the service life and support continuous operation of long-term discharge or aging tests.

Cp = In × t

Here, Cp is a constant for the chosen battery and reference convention, I is discharge current, n is the Peukert exponent, and t is discharge time. With a consistent reference rating and units, the relationship can be rearranged to estimate time at a different current. The exponent is battery-specific; do not infer it from nominal amp-hours alone.

Estimate the exponent from two battery ratings

When the supplier does not specify an exponent, Victron describes calculating one from two capacity ratings at different discharge rates, often C20 and C5. The discharge currents should be substantially different to make the estimate useful. In effect, the ratings give two observations of how time and current relate for that battery. Use the battery supplier’s stated values and discharge conditions; ratings drawn from different products or incompatible test conditions do not define a sound exponent.

Victron’s cited battery-monitor documentation describes an exponent range of 1.00–1.50 and a default of 1.25 for that monitor. Its configuration guidance gives typical fallback values of 1.25 for lead-acid and 1.05 for lithium when a supplier value is unavailable. Those are manufacturer settings and fallback guidance, not universal constants; defer to the battery maker’s data. See Victron’s battery-monitor configuration guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
ANCEL BA101 Car Battery Tester, 12V Digital Automotive Alternator Meter Diagnostic Tool,100-2000 CCA Load Capacity, Charging & Cranking Analyzer for Truck, Boat, RV, Marine Vehicle, and More
  • Catch Battery Problems Early: Featured in two videos by Project Farm, a popular YouTube channel with millions of subscribers, the ANCEL BA101 helps you quickly spot battery issues before they leave you stranded. It provides easy-to-understand readings for State of Health (SOH), State of Charge (SOC), voltage, current, CCA, plus cranking and charging system tests, so you can better understand your battery and help avoid unexpected breakdowns
  • Know the Real Condition: Don’t let inaccurate readings lead to costly surprises. Built with high-quality copper crocodile clips and a precision smart chip, this battery tester is designed to deliver dependable results. For the most accurate test, enter the correct battery type, rating value (such as CCA/Ah), and temperature exactly as shown on your battery label, so you get a clearer picture of your battery’s true condition
  • Fast, Clear, Hassle-Free Testing: The classic black-and-white screen, adjustable contrast, and white backlight make results easy to read in bright sunlight or low-light conditions. One-handed operation keeps testing simple, while direct power from your vehicle’s battery means no charging and no internal batteries to deal with. Multi-language support makes it easier for more users to test with confidence
  • Protection When Mistakes Happen: Built-in 4-in-1 protection helps guard against reverse polarity, short circuits, overcurrent, and overvoltage for safer testing, especially in tight spaces where clamp slips or wiring mistakes can happen. The 3x reinforced ABS housing adds extra durability and helps protect both the tester and your battery during everyday use
  • Built for More 12V Batteries: Supporting global standards including JIS, EN, DIN, SAE, BCI, GB, CA, MCA, and IEC, this tester works with 12V batteries used in cars, trucks, boats, RVs, ATVs, lawnmowers, golf carts, and motorbikes over 30Ah. Compatible with Flooded, AGM, GEL, and EFB batteries. Not for lithium batteries, non-12V batteries (6V/8V/24V), or motorcycles below 30Ah. For 6V testing, choose BA101 Plus. For 24V testing, choose BA101 PRO

Know where the approximation weakens

A fixed exponent is a useful correction, not a complete electrochemical simulation. Victron cautions that at very high currents a battery can yield less capacity than the fixed-exponent law predicts. Temperature, battery age, load variation, voltage limits, wiring losses, and battery-management-system cutoffs can also change actual runtime. The manufacturer sources support the model inputs described here, but do not establish one equation as accurate for every battery and operating condition.

Include inverter tare draw, including at low AC load

An inverter’s DC input is not necessarily zero when little or nothing is connected to its AC output. Its own operating electronics consume power while it remains on; that standby or zero-load consumption is commonly called tare loss. Model it as an additional DC-side load for every interval the inverter is on, using the specification for the actual inverter and operating mode.

For example, Victron’s SUN Inverter specification table lists these zero-load figures for two specific models. Its ECO values are the default ECO-mode figures, not the continuous-operation figures:

Rank #3
KooingTech Battery Load Tester 150W 200V 20A Battery Capacity Tester
  • Product Parameters: Battery load tester Maximum power: 150W; Maximum voltage: 200V; Maximum current: 20A; Refresh time: >500mS/time; Measurement rate: about 0.5 times/second; Working pressure: 80~106kPa
  • Display Design: The battery capacity tester uses the micro power LCD module LCM green backlight to display both Chinese and English, and switches different interfaces through multi function buttons
  • Alarm Design: Load tester overcurrent setting alarm mode, display alarm interface, remind users, overvoltage reminder setting range: 1~200V; Overflow alert setting range: 0.2 to 100A
  • Fan Design: USB load tester adopts cooling fan design, built in discharge tube, reliable power, quiet heat dissipation(Tip: please turn the knob counterclockwise to the end before use, and then slowly open)
  • Widely Used: Electronic load tester to test various batteries, DC power supply, charging data line; Can measure voltage, current, power, battery capacity, impedance, temperature, energy, time and other data
Victron SUN Inverter model Zero-load power Default ECO-mode zero-load power
12/250 4.2 W 0.8 W
24/250 5.2 W 1.3 W

These are model-specific manufacturer specifications, not values to apply to other inverters. ECO operation is not interchangeable with leaving an inverter continuously on. Consult the SUN Inverter specifications for the relevant model and mode.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a specification gives idle power in watts, multiply it by the hours the inverter is on to get idle energy in watt-hours: Wh = W × hours. Relate that energy to the battery model using the system voltage and a consistent energy or current calculation. Do not add the inverter’s AC output load and its idle draw as though they were the same measurement point: account for the inverter’s DC-side consumption, including its conversion losses under load, using suitable device data if available. The cited zero-load specifications alone do not provide a general efficiency curve for loaded operation.

Set a battery-appropriate discharge floor

A runtime estimate should stop when the modeled state of charge reaches the configured minimum, rather than assuming every rated amp-hour can be used. Make the discharge floor an explicit, configurable assumption tied to the chemistry and supplier guidance. It may be represented as a minimum state of charge or as a maximum permitted depth of discharge; be clear which convention the code uses.

Rank #4
Sale
Vastarry 180W DC Electronic Load Tester, USB Load Tester, Lithium Battery Capacity Tester, Color Screen Data Monitoring, Constant Current and Constant Voltage, etc. 4 Working Modes
  • 4 operating modes: CC-constant current operation; CV-constant voltage operation; CW-constant power operation; CR-constant resistance operation. There are three intelligent safety protections in the discharge detection process, which can monitor the discharge tube status in real time, which is safe and reliable. An external wired NTC thermometer can realize dual temperature measurement inside and outside.
  • 2.4-inch high-definition large color screen blue digital curve version of high-power electronic tube digital load meter. Intelligent temperature control color glare fan, high power, long life, durable cooling fan; 180W high power / 200V wide voltage / 20A high current, strong performance.
  • Support testing Android, Type-C cable, Mini and other wires, and display a variety of test data on one screen. By checking and killing, by testing various data cable/charger test/discharge aging/DC power adapter current, voltage, power and other parameters, the operation is simple and the test is convenient and fast.
  • 180W load discharge aging test, using intelligent temperature control light effect fan design, built-in large discharge tube, the temperature is maintained at about 50~80 degrees; easily test the voltage, current, capacity and other data of various power sources such as lithium batteries/USB chargers; Powerful, safe and reliable.
  • If there is any abnormality in the product, whether it is return or exchange, you can contact us first, we will reply you within 6 hours, we will be happy to solve it for you, thank you.

Victron’s cited battery-monitor manual uses a 50% discharge floor as a default for lead-acid and says lithium batteries can often be discharged deeper, with a 10–20% setting range unless the battery supplier advises otherwise. These are settings and guidance in that manufacturer’s manual, not universal safety limits for all batteries. Check the battery specification and system requirements before choosing a value. The BMV-710H Smart and SmartShunt manual explains these monitor settings.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the model inputs explicit in TypeScript

Keep physical assumptions separate from the calculation so a different battery, operating mode, or discharge policy does not require changing hidden constants. A practical input set includes:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Battery chemistry and nominal/system voltage.
  • Rated capacity in amp-hours together with its discharge-rate basis, such as C20.
  • The supplier’s Peukert exponent, or two compatible capacity ratings and their discharge currents from which to estimate one.
  • Discharge current or a time-varying load profile, with units stated.
  • The allowed minimum state of charge or maximum depth of discharge.
  • Inverter model, operating mode, zero-load draw, and the time it remains on.
  • Charge efficiency and temperature assumptions if the model accounts for them.

Preserve units in names or types—for example, capacity in Ah, current in A, voltage in V, power in W, and elapsed time in hours. Establish whether your Peukert calculation expects current or a normalized C-rate, then keep that reference convention consistent when deriving the constant and estimating runtime. The model should not silently mix watts, amps, and amp-hours.

Best Value
Eyes.sys Electronic Load Tester, USB Load Tester, 180W 200V 20A Battery Capacity Tester Constant Current & Constant Voltage, 4 Modes, Intelligent Discharge Resistance Power Tester
  • 4 operating modes - constant current / constant voltage / constant power / constant resistance, plus auto generation of data report & 2.4” HD color large screen
  • 3 intelligent safety protections to monitor the discharge status in real time
  • External wired NTC thermometer to realize dual temperature measurement inside and outside
  • Can test the charging speed and quality of a variety of charging cable and data cables
  • Flexible input wiring interface design to support more DIY connections and extend the functions

Use a transparent calculation sequence

  1. Load source data. Record the battery’s capacity rating and its C-rate, chemistry, supplier-provided Peukert data, voltage, and recommended discharge limit.
  2. Estimate battery-specific rate behavior. Use the supplier exponent where available; otherwise derive an estimate from two substantially different discharge ratings that share compatible test conditions.
  3. Build the DC-side load. Convert loads to consistent units and add the inverter’s idle consumption during each interval it is on. Use the actual operating-mode specification.
  4. Estimate delivered capacity or runtime. Apply the Peukert relationship using the same reference convention as the capacity data. For a changing load, calculate interval by interval rather than pretending the current is constant.
  5. Enforce the discharge floor. End the estimate when modeled state of charge reaches the configured minimum; do not count capacity below that threshold as usable.
  6. Report assumptions with the result. Include the battery rating basis, exponent source, load profile, inverter mode and idle draw, discharge floor, and any temperature or efficiency assumptions.

This sequence is modeling guidance, not a validated TypeScript implementation or library API. A simple model can be useful for planning, but the result should not be presented with more precision than its inputs justify.

Check estimates against real battery behavior

When practical, compare predicted consumption with a shunt-based battery monitor and an observed load period. Victron describes its monitor as continuously measuring current flowing into and out of the battery and integrating that current over time to estimate state of charge. Its calculation also accounts for Peukert efficiency and charge efficiency, with temperature considered to a lesser extent. A monitor reading is still an estimate: configuration, synchronization, and battery-specific settings matter. See the manufacturer manual.

In particular, the manual warns that a deeply discharged lithium battery can be harmed by even residual current. Avoid treating a model’s remaining-capacity estimate as permission to ignore a battery’s low-voltage protection or supplier instructions. Compare scenarios only when chemistry, capacity-rating basis, discharge profile, configured floor, inverter model and mode, and relevant temperature assumptions are held constant or clearly identified.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.