Lemonergy · Studio block

Capacity observer

Scalar capacity Kalman update from independent SOC change and removed charge.

Implementation ID
battery-capacity-observer
Reviewed
2026-10-27

Behavior

Updates a scalar capacity estimate using an independently obtained SOC decrease and measured removed charge. Invalid windows retain prediction. The capacity estimate is bounded and reports clipping status.

Interface

Capacity observer interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Capacity observerStudio blocksocChangechargevalidresetcapacityvarianceinnovationgainstatus
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
socChangeinput1 (fraction)Independent SOC decrease; scalar.
chargeinputAhRemoved charge (Ah); scalar.
validinputtrue / falseWindow valid; scalar.
resetinputtrue / falseReset; scalar.
capacityoutputAhEstimated capacity (Ah); scalar.
varianceoutputAh²Capacity variance (Ah²); scalar.
innovationoutputAhCharge innovation (Ah); scalar.
gainoutput1Correction gain; scalar.
statusoutput1Status (0 prediction, 1 correction, 2 clipped); scalar.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample interval (s)
sampleTimeS
s1Positive sample interval. Initialization has zero elapsed time; subsequent accepted samples update memory.
Initial capacity estimate (Ah)
initialCapacityAh
Ah1.8Initial capacity estimate (Ah). This is an editable model input; the default belongs to the synthetic worked example.
Initial capacity variance (Ah²)
initialVariance
Ah²0.04Initial capacity variance (Ah²). This is an editable model input; the default belongs to the synthetic worked example.
Capacity process variance rate (Ah²/s)
processNoise
Ah²/s0Capacity process variance rate (Ah²/s). This is an editable model input; the default belongs to the synthetic worked example.
Charge measurement variance (Ah²)
measurementNoise
Ah²0.0004Charge measurement variance (Ah²). This is an editable model input; the default belongs to the synthetic worked example.
Minimum capacity estimate (Ah)
minCapacityAh
Ah0.1Minimum capacity estimate (Ah). This is an editable model input; the default belongs to the synthetic worked example.
Maximum capacity estimate (Ah)
maxCapacityAh
Ah10Maximum capacity estimate (Ah). This is an editable model input; the default belongs to the synthetic worked example.

Equations and rules

  • predicted removedAh = capacityAh * deltaSOC
  • innovation = measured removedAh - predicted removedAh

Worked example

Capacity observer worked example

Use the defaults below with Independent SOC decrease = 0.2 1 (fraction), Removed charge (Ah) = 0.4 Ah, Window valid = 1 true / false, Reset = 0 true / false. At 0 s, Estimated capacity (Ah) is 1.96 Ah. Additional checks are listed below.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Estimated capacity (Ah)
capacity
01.96Ah1e-08
Capacity variance (Ah²)
variance
00.008Ah²1e-08
Charge innovation (Ah)
innovation
00.04Ah1e-08
Correction gain
gain
0411e-08

Explore the recorded outputs

Capacity observer recorded example

Capacity observer / Estimated capacity (Ah)
Capacity observer / Estimated capacity (Ah) against timeRecorded synthetic simulation values. Time in seconds; output in —.1.95857801.9637330.251.9688890.51.9740440.751.97921—Time (s)
Capacity observer / Estimated capacity (Ah): 1.96 — at 0 s

2 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.

Download the recorded samples (JSON) · Open this Studio example after release

Use in a workflow

Capacity observer worked example

Scalar capacity Kalman update from independent SOC change and removed charge.

  1. Capacity observer: Updates a scalar capacity estimate using an independently obtained SOC decrease and measured removed charge. Invalid windows retain prediction. The capacity estimate is bounded and reports clipping status.
    • Use the parameter values in the block reference.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • Capacity is observable only with informative SOC changes. Feeding the same capacity-dependent SOC calculation back into the observer can create circular evidence.
  • The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.

Scientific and mathematical references

These sources explain the scientific and mathematical background. The behavior, interface and limits above define the Lemonergy implementation; a citation does not imply every model option in the source is implemented.

  1. Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs: Part 3. State and parameter estimation

    Gregory L. Plett · Journal of Power Sources · 2004

    Technical reference · Model-based battery state-of-charge and parameter estimation with extended Kalman filtering, including uncertainty and model dependence.

Implementation sources

This reference follows the public interface and locally verified numerical checks for an upcoming release.

Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27

  • docs/glossary/native-block-verification.json

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)