Lemonergy · Studio block
Weighted capacity fit
Fits charge capacity through the origin from aligned SOC-change and integrated-charge windows.
- Implementation ID
battery-weighted-capacity-fit- Reviewed
- 2026-10-27
Behavior
Fits a positive ampere-hour capacity through the origin from aligned SOC-decrease and removed-charge windows. The weighted version accepts nonnegative window weights; zero excludes a window. A validity flag reports sufficient identifying information.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
socChange | input | 1 (fraction) | SOC decrease per window; 3 channels at the default configuration. |
charge | input | Ah | Removed charge per window (Ah); 3 channels at the default configuration. |
weight | input | 1 | Window weights; 3 channels at the default configuration. |
capacity | output | Ah | Fitted capacity (Ah); scalar. |
information | output | 1 | Weighted SOC information; scalar. |
residual | output | Ah² | Weighted squared residual (Ah²); scalar. |
count | output | 1 | Included windows; scalar. |
valid | output | true / false | Positive identifiable capacity; scalar. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Number of measured windowswindows | 1 | 3 | Number of measured windows. This is an editable model input; the default belongs to the synthetic worked example. |
Minimum identifying informationminimumInformation | 1 | 1e-12 | Minimum identifying information. This is an editable model input; the default belongs to the synthetic worked example. |
Equations and rules
QAh = sum(weight * deltaSOC * removedAh) / sum(weight * deltaSOC^2)
Worked example
Weighted capacity fit worked example
Use the defaults below with SOC decrease per window = [0.1, 0.2, 0.3] 1 (fraction), Removed charge per window (Ah) = [0.2, 0.4, 0.9] Ah, Window weights = [1, 1, 0] 1. At 0 s, Fitted capacity (Ah) is 2 Ah. Additional checks are listed below.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Fitted capacity (Ah)capacity | 0 | 2 | Ah | 1e-08 |
Positive identifiable capacityvalid | 0 | true | true / false | 1e-08 |
Explore the recorded outputs
Weighted capacity fit recorded example
Weighted capacity fit / Fitted 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
Weighted capacity fit worked example
Fits charge capacity through the origin from aligned SOC-change and integrated-charge windows.
- Weighted capacity fit: Fits a positive ampere-hour capacity through the origin from aligned SOC-decrease and removed-charge windows. The weighted version accepts nonnegative window weights; zero excludes a window. A validity flag reports sufficient identifying information.
- Use the parameter values in the block reference.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- SOC and integrated charge must describe the same windows. Biased SOC or current measurements bias the fit; this operation does not collect or qualify those measurements.
- 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)