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

Weighted capacity fit interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Weighted capacity fitStudio blocksocChangechargeweightcapacityinformationresidualcountvalid
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
socChangeinput1 (fraction)SOC decrease per window; 3 channels at the default configuration.
chargeinputAhRemoved charge per window (Ah); 3 channels at the default configuration.
weightinput1Window weights; 3 channels at the default configuration.
capacityoutputAhFitted capacity (Ah); scalar.
informationoutput1Weighted SOC information; scalar.
residualoutputAh²Weighted squared residual (Ah²); scalar.
countoutput1Included windows; scalar.
validoutputtrue / falsePositive identifiable capacity; scalar.

Parameters

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

Configuration fields
ParameterUnitDefaultMeaning and limits
Number of measured windows
windows
13Number of measured windows. This is an editable model input; the default belongs to the synthetic worked example.
Minimum identifying information
minimumInformation
11e-12Minimum 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 →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Fitted capacity (Ah)
capacity
02Ah1e-08
Positive identifiable capacity
valid
0truetrue / false1e-08

Explore the recorded outputs

Weighted capacity fit recorded example

Weighted capacity fit / Fitted capacity (Ah)
Weighted capacity fit / Fitted capacity (Ah) against timeRecorded synthetic simulation values. Time in seconds; output in —.1.501.750.2520.52.250.752.51—Time (s)
Weighted capacity fit / Fitted capacity (Ah): 2 — 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

Weighted capacity fit worked example

Fits charge capacity through the origin from aligned SOC-change and integrated-charge windows.

  1. 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.
Open Studio example after release

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.

  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)