Lemonergy · Studio block
Scoped state reader
Executes one declared discrete state-space child and records its actual internal state before and after each update.
- Implementation ID
native-state-reader- Reviewed
- 2026-10-27
Behavior
Executes one declared discrete state-space child and records its actual internal state before and after each update. Trial evaluations read the held output without mutating state.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | — | Input; real scalar. |
out0 | output | — | Output; real scalar. |
out1 | output | — | State before update; real vector [1]. |
out2 | output | — | State after update; real vector [1]. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample periodsampleTimeS | s | 1 | Positive period between accepted updates; outputs hold between updates. |
Initial held outputtables[0] | — | [0] | Output held before the first accepted update, with one value per output lane. |
Declared child operationnested | — | Discrete state space | The locally owned target operation. Its parameters, initial state, and typed ports are configured explicitly. |
State transition matrixnested.parameters.config.tables[0] | — | [0.5] | Matrix A in x_next = A x + B u. |
Input matrixnested.parameters.config.tables[1] | — | [1] | Matrix B in x_next = A x + B u. |
Output matrixnested.parameters.config.tables[2] | — | [2] | Matrix C in y = C x + D u. |
Direct input matrixnested.parameters.config.tables[3] | — | [3] | Matrix D in y = C x + D u. |
Initial statenested.parameters.config.tables[4] | — | [4] | Initial internal coordinates before an optional enabled replacement. |
Equations and rules
Observe x_before = internal child statey = C x_before + D ux_after = A x_before + B u
Worked example
Scoped state reader worked example
For A=0.5, B=1, C=2, D=3, initial state 4 and input 1, the model output is 11 and the internal state advances from 4 to 3.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Outputout0 | 0 | 11 | — | 1e-08 |
State before updateout1 | 0 | [4] | — | 1e-08 |
State after updateout2 | 0 | [3] | — | 1e-08 |
Explore the recorded outputs
Scoped state reader recorded example
Scoped state reader / Output3 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
Scoped state reader worked example
Executes one declared discrete state-space child and records its actual internal state before and after each update.
- Scoped state reader: Executes one declared discrete state-space child and records its actual internal state before and after each update. Trial evaluations read the held output without mutating state.
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- One declared discrete linear state-space child, with 1–128 real state coordinates. The reader owns and executes that child; it cannot inspect arbitrary foreign blocks.
- State outputs are explicit numeric coordinates, distinct from the model output. Continuous states, opaque kernel memory, and history buffers are not exposed.
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.
- Feedback Systems: System Modeling, Section 2.1, discrete-time systems
Karl Johan Åström, Richard M. Murray · Princeton University Press; author-hosted chapter, California Institute of Technology
Technical reference · Discrete state-space equations and the distinction between internal state and output. Scoped write ordering is a separate Lemonergy contract.
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)