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
| Name | Direction | Unit | Meaning |
|---|---|---|---|
socChange | input | 1 (fraction) | Independent SOC decrease; scalar. |
charge | input | Ah | Removed charge (Ah); scalar. |
valid | input | true / false | Window valid; scalar. |
reset | input | true / false | Reset; scalar. |
capacity | output | Ah | Estimated capacity (Ah); scalar. |
variance | output | Ah² | Capacity variance (Ah²); scalar. |
innovation | output | Ah | Charge innovation (Ah); scalar. |
gain | output | 1 | Correction gain; scalar. |
status | output | 1 | Status (0 prediction, 1 correction, 2 clipped); scalar. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample interval (s)sampleTimeS | s | 1 | Positive sample interval. Initialization has zero elapsed time; subsequent accepted samples update memory. |
Initial capacity estimate (Ah)initialCapacityAh | Ah | 1.8 | Initial capacity estimate (Ah). This is an editable model input; the default belongs to the synthetic worked example. |
Initial capacity variance (Ah²)initialVariance | Ah² | 0.04 | Initial 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²/s | 0 | Capacity 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.0004 | Charge measurement variance (Ah²). This is an editable model input; the default belongs to the synthetic worked example. |
Minimum capacity estimate (Ah)minCapacityAh | Ah | 0.1 | Minimum capacity estimate (Ah). This is an editable model input; the default belongs to the synthetic worked example. |
Maximum capacity estimate (Ah)maxCapacityAh | Ah | 10 | Maximum capacity estimate (Ah). This is an editable model input; the default belongs to the synthetic worked example. |
Equations and rules
predicted removedAh = capacityAh * deltaSOCinnovation = 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 →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Estimated capacity (Ah)capacity | 0 | 1.96 | Ah | 1e-08 |
Capacity variance (Ah²)variance | 0 | 0.008 | Ah² | 1e-08 |
Charge innovation (Ah)innovation | 0 | 0.04 | Ah | 1e-08 |
Correction gaingain | 0 | 4 | 1 | 1e-08 |
Explore the recorded outputs
Capacity observer recorded example
Capacity observer / Estimated capacity (Ah)2 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.
Read the selected signal as a table
| Time (s) | Value |
|---|
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.
- 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.
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.
- 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)