Battery knowledge · Units and electrical basics
Energy
What a battery stores and delivers: the integral of power over time, in watt-hours or joules. It is capacity times voltage, which is why two cells with equal ampere-hours can hold different energy. [1]
- Unit
- Wh
- Relationship
- E = ∫ V·I dt
Example
Integrate a changing power trace
A load that draws 40 W for 15 min and then 20 W for 30 min uses 20 Wh in total. Add the area under each part of the power-versus-time trace.
Explore the graph
Voltage connects capacity in ampere-hours to nominal energy in watt-hours.
5 Ah × 12 V = 60 Wh nominal energy.
E_nominal = Q_nominal V_nominal; actual energy = ∫ VI dt
Illustrative model. Specific energy divides energy by mass; energy density divides it by volume.
Use in Lemonergy
Lemonergy Studio blocks
Charge counter worked example
Integrates signed throughput. Changing capacity preserves fraction and reports revaluation separately.
Blocks to use
- Charge counter
Integrates signed discharge current or power over elapsed sample time. Charge efficiency applies during charging. The initial sample has zero elapsed time. Variable-capacity variants preserve the current fraction when capacity changes and report the resulting amount revaluation separately. Reset restores the initial fraction without integrating that event.
Inputs & settings
- Use the parameter values in the block reference.
- Bundled example verified on the production release of 28 October 2026.
This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.
- Review the block inputs, units and model limits.
- Open the Studio example and run its bundled model.
- Compare the output channels with the numerical checks; change one input and run again.
Example. Use the defaults below with Signed battery current = 2 A, Reset = 0 true / false. At 0 s, State of charge is 0.8 1 (fraction). Additional checks are listed below.
Observe. Inspect the outputs and numerical checks on the block reference page.
Current or power bias accumulates. Fraction clipping is reported as a boundary amount; it does not make the connected plant respect that boundary. Energy variants need capacity in joules. The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.
Open Studio example →Lemonergy Studio blocks
Energy counter worked example
Integrates signed throughput. Changing capacity preserves fraction and reports revaluation separately.
Blocks to use
- Energy counter
Integrates signed discharge current or power over elapsed sample time. Charge efficiency applies during charging. The initial sample has zero elapsed time. Variable-capacity variants preserve the current fraction when capacity changes and report the resulting amount revaluation separately. Reset restores the initial fraction without integrating that event.
Inputs & settings
- Use the parameter values in the block reference.
- Bundled example verified on the production release of 28 October 2026.
This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.
- Review the block inputs, units and model limits.
- Open the Studio example and run its bundled model.
- Compare the output channels with the numerical checks; change one input and run again.
Example. Use the defaults below with Signed battery power = 2 W, Reset = 0 true / false. At 0 s, State of energy is 0.8 1 (fraction). Additional checks are listed below.
Observe. Inspect the outputs and numerical checks on the block reference page.
Current or power bias accumulates. Fraction clipping is reported as a boundary amount; it does not make the connected plant respect that boundary. Energy variants need capacity in joules. The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.
Open Studio example →Lemonergy Studio blocks
Charge counter with capacity input worked example
Integrates signed throughput. Changing capacity preserves fraction and reports revaluation separately.
Blocks to use
- Charge counter with capacity input
Integrates signed discharge current or power over elapsed sample time. Charge efficiency applies during charging. The initial sample has zero elapsed time. Variable-capacity variants preserve the current fraction when capacity changes and report the resulting amount revaluation separately. Reset restores the initial fraction without integrating that event.
Inputs & settings
- Use the parameter values in the block reference.
- Bundled example verified on the production release of 28 October 2026.
This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.
- Review the block inputs, units and model limits.
- Open the Studio example and run its bundled model.
- Compare the output channels with the numerical checks; change one input and run again.
Example. Use the defaults below with Signed battery current = 2 A, Reset = 0 true / false, Charge capacity (Ah) = 2 Ah. At 0 s, State of charge is 0.8 1 (fraction). Additional checks are listed below.
Observe. Inspect the outputs and numerical checks on the block reference page.
Current or power bias accumulates. Fraction clipping is reported as a boundary amount; it does not make the connected plant respect that boundary. Energy variants need capacity in joules. The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.
Open Studio example →Learn it in Lesson 2 · Capacity and C-rate →
All connected Lemonergy block references
Studio interfaces connected to this concept
These components declare this quantity or operation. Their individual pages distinguish authoring metadata from numerical verification.
- Energy counter
- SOE adaptive EKF with capacity input
- SOE EKF with capacity input
- Supercapacitor cell
- Energy counter with capacity input
- Rigid body and inertia
- Charging schedule and target policy
- Edge-cooled plate
- Independent electrothermal battery
- Scheduled import / export and load policy
- Coupled inductors
- Parallel-channel plate
- Phase-change thermal mass
- Physical signal integrator
- Thermal mass
- U-channel plate
- Electromechanical variable-gap capacitor
References & further reading
Technical references
- The International System of Units (SI), 9th edition
Bureau International des Poids et Mesures · 2026
Technical reference · Definitions of SI units and coherent derived units; 2026 revision.