Lemonergy · Studio block

SOE EKF with capacity input

One-state extended Kalman observer with a calibrated fraction-to-OCV table, Joseph covariance update and explicit measurement validity.

Implementation ID
battery-soe-ekf-variable-capacity
Reviewed
2026-10-27

Behavior

Predicts a charge or energy fraction from signed throughput and corrects it using terminal voltage and a calibrated fraction-to-OCV table. Scalar Joseph covariance updates preserve nonnegative variance. Invalid voltage measurements skip correction; flat OCV regions report limited observability. Adaptive variants bound an innovation-based voltage-noise estimate.

Interface

SOE EKF with capacity input interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.SOE EKF with capacity inputStudio blockpowercurrentvoltagevalidresetcapacityfractionvarianceinnovationgainnoisestatus
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
powerinputWSigned battery power; scalar.
currentinputASigned battery current; scalar.
voltageinputVMeasured voltage; scalar.
validinputtrue / falseVoltage measurement valid; scalar.
resetinputtrue / falseReset; scalar.
capacityinputJEnergy capacity (J); scalar.
fractionoutput1 (fraction)State of energy; scalar.
varianceoutput1Posterior fraction variance; scalar.
innovationoutputVVoltage innovation; scalar.
gainoutput1Correction gain; scalar.
noiseoutput1Voltage-noise variance; scalar.
statusoutput1Status (0 prediction, 1 correction, 2 unobservable, 3 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.
Energy capacity (J)
capacity
J7200Energy capacity (J). This is an editable model input; the default belongs to the synthetic worked example.
Initial SOE (0–1)
initialFraction
0–10.6Initial SOE (0–1). This is an editable model input; the default belongs to the synthetic worked example.
Initial fraction variance
initialVariance
10.04Initial fraction variance. This is an editable model input; the default belongs to the synthetic worked example.
Process variance rate (fraction²/s)
processNoise
fraction²/s0Process variance rate (fraction²/s). This is an editable model input; the default belongs to the synthetic worked example.
Voltage measurement variance (V²)
measurementNoise
V²0.01Voltage measurement variance (V²). This is an editable model input; the default belongs to the synthetic worked example.
Series resistance (Ω)
resistanceOhm
Ω0.05Series resistance (Ω). This is an editable model input; the default belongs to the synthetic worked example.
Noise adaptation weight (0–1)
adaptationRate
0–10Noise adaptation weight (0–1). This is an editable model input; the default belongs to the synthetic worked example.
Minimum voltage variance (V²)
minimumNoise
V²1e-06Minimum voltage variance (V²). This is an editable model input; the default belongs to the synthetic worked example.
Maximum voltage variance (V²)
maximumNoise
V²1Maximum voltage variance (V²). This is an editable model input; the default belongs to the synthetic worked example.
OCV table [energy fraction, V]
ocvTable
See field order[[0, 3], [1, 4]]OCV table [energy fraction, V]. Rows are ordered coordinate/value pairs; the first column must be strictly increasing.

Equations and rules

  • innovation = Vmeasured - Vpredicted
  • K = Ppredicted*H / (H^2*Ppredicted + R)
  • fraction = predictedFraction + K*innovation
  • P = (1-K*H)^2*Ppredicted + K^2*R

Worked example

SOE EKF with capacity input worked example

Use the defaults below with Signed battery power = 0 W, Signed battery current = 0 A, Measured voltage = 3.8 V, Voltage measurement valid = 1 true / false, Reset = 0 true / false, Energy capacity (J) = 7200 J. At 0 s, State of energy is 0.76 1 (fraction). Additional checks are listed below.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
State of energy
fraction
00.761 (fraction)1e-08
Posterior fraction variance
variance
00.00811e-08
Voltage innovation
innovation
00.2V1e-08
Correction gain
gain
00.811e-08

Explore the recorded outputs

SOE EKF with capacity input recorded example

SOE EKF with capacity input / State of energy
SOE EKF with capacity input / State of energy against timeRecorded synthetic simulation values. Time in seconds; output in 1 (fraction).0.758577800.76373330.250.76888890.50.77404440.750.779211 (fraction)Time (s)
SOE EKF with capacity input / State of energy: 0.76 1 (fraction) 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

SOE EKF with capacity input worked example

One-state extended Kalman observer with a calibrated fraction-to-OCV table, Joseph covariance update and explicit measurement validity.

  1. SOE EKF with capacity input: Predicts a charge or energy fraction from signed throughput and corrects it using terminal voltage and a calibrated fraction-to-OCV table. Scalar Joseph covariance updates preserve nonnegative variance. Invalid voltage measurements skip correction; flat OCV regions report limited observability. Adaptive variants bound an innovation-based voltage-noise estimate.
    • Use the parameter values in the block reference.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • One-state extended Kalman observers, without an unscented transform, RC polarization states or automatic cell identification. SOE requires its own energy-fraction-to-OCV calibration. Synthetic filter settings are not accuracy guarantees.
  • 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.

  2. Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs: Part 2. Modeling and identification

    Gregory L. Plett · Journal of Power Sources · 2004

    Technical reference · Battery charge balance, open-circuit voltage, ohmic loss, polarization dynamics and model identification; parameters require cell-specific data.

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)