Battery knowledge · Transport and modelling

State-space model

A model written as first-order equations for a set of internal states — such as state of charge and the voltages across RC pairs — plus an output equation for the measured terminal voltage. Kalman filters and other observers need this form, so equivalent circuit and reduced physics models are cast this way for a BMS. [1]

Also called
state-space representation
Relationship
ẋ = A·x + B·u; y = C·x + D·u

Example

Read a one-state thermal model

Let x be temperature rise and u heating power. With ẋ = −0.01x + 0.002u, the time constant is 100 s and a steady 10 W input gives x = 2 K. The output y = x directly reports temperature rise.

Explore the graph

A one-state linear model separates the stored state from its observed output.

First-order state-space step response
First-order state-space step responseTime (s) versus Normalized input and output. Unit input u; Output y = 1 − exp(−t/τ). Interpretation follows the graphs.000.275250.55500.825751.1100Time (s)Normalized input andoutput
Unit input uOutput y = 1 − exp(−t/τ) (dashed)

At τ = 10 s, output reaches 63.2% after 10 s and 95.0% after 30 s.

dx/dt = −x/τ + u/τ; y = x; x(0) = 0

Illustrative model. Scalar continuous-time, stable linear model with no saturation, delay or measurement noise.

Use in Lemonergy

Lemonergy Studio blocks

Conditional action kernel worked example

Executes a child on a true action flag and holds its state and output on inactive samples.

Blocks to use

  1. Conditional action kernel

    Executes a child on a true action flag and holds its state and output on inactive samples. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.

    Inputs & settings
    • Use the block reference for settings and connections.
    • Bundled example verified on the production release of 28 October 2026.

This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.

  1. Review the interface, units and model limits.
  2. Open the Studio example and run its bundled model.
  3. Compare outputs with the numerical checks; change one input and run again.

Example. Default editable example at the first accepted sample (t = 0 s). Child operation: bias. The output checks below are execution oracles for this example.

Observe. Inspect the output channels and checks on the block reference page.

Control executes on an explicit sampled clock. Continuous states, history/delay kernels, residual equations, and event-source children are not supported. The wrapper contains one original computation operation; arbitrary multi-block submodels are not supported. A sampled child advances once per invocation using its own declared period. Repeated calls share the same outer timestamp and do not advance physical time. A Boolean action flag controls one child. This is not an arbitrary multi-block action subsystem.

Open Studio example →

Lemonergy Studio blocks

Bounded continuous integrator — worked example

Integrates a rate while preventing further outward motion at configured bounds.

Blocks to use

  1. Bounded continuous integrator

    dx/dt = gain × input, except outward motion at an active bound; output = clamp(x). The worked example connects this operation to signals in Lemonergy Studio.

    Inputs & settings
    • Use the block reference for settings and connections.
    • Bundled example verified on the production release of 28 October 2026.

This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.

  1. Review the interface, units and model limits.
  2. Open the Studio example and run its bundled model.
  3. Compare outputs with the numerical checks; change one input and run again.

Example. Rate = 2. Integral at 1 s = 2.

Observe. Inspect the output channels and checks on the block reference page.

Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed.

Open Studio example →

Lemonergy Studio blocks

Invocation count fan-out worked example

Copies one accepted-sample call count to fixed typed branches. It does not impose side-effect order between independent downstream models.

Blocks to use

  1. Invocation count fan-out

    Copies one accepted-sample call count to fixed typed branches. It does not impose side-effect order between independent downstream models. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.

    Inputs & settings
    • Use the block reference for settings and connections.
    • Bundled example verified on the production release of 28 October 2026.

This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.

  1. Review the interface, units and model limits.
  2. Open the Studio example and run its bundled model.
  3. Compare outputs with the numerical checks; change one input and run again.

Example. Default editable example at the first accepted sample (t = 0 s). The output checks below are execution oracles for this example.

Observe. Inspect the output channels and checks on the block reference page.

Control executes on an explicit sampled clock. Continuous states, history/delay kernels, residual equations, and event-source children are not supported. Fan-out does not impose execution or side-effect order on independent downstream models. Counts are limited to 0–256; 1–32 branches are supported.

Open Studio example →
All connected Lemonergy block references

References & further reading

Technical references

  1. Feedback Systems: An Introduction for Scientists and Engineers, second edition

    Karl J. Åström, Richard M. Murray · Princeton University Press; author-maintained FBSwiki · 2021

    Technical reference · State-space modeling, feedback and PID control. These mathematical foundations do not establish a particular software implementation.

Further reading on this topic

These sources provide broader context; they are not presented as citations for every statement in this entry.

  1. Modeling of Galvanostatic Charge and Discharge of the Lithium/Polymer/Insertion Cell

    Marc Doyle, Thomas F. Fuller, John Newman · Journal of The Electrochemical Society · 1993

    Topic background · Porous-electrode transport and insertion-cell modeling; foundational work rather than a specification for a particular commercial cell.

  2. Quantities, Units and Symbols in Physical Chemistry, 3rd edition, 2nd printing

    IUPAC · 2011

    Topic background · Physical-chemistry notation, thermodynamics, electrochemistry and transport quantities.