Lemonergy · Studio block

Sampled storage

Reads a snapshot at each sample, then commits the enabled write for the next sample. Each block instance owns independent typed storage.

Implementation ID
native-data-store
Reviewed
2026-10-27

Behavior

y[k] = stored snapshot[k]. snapshot[k+1] = write[k] if enabled[k]; otherwise snapshot[k].

Interface

Sampled storage interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Sampled storageStudio blockin0in1out0
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
in0input1Write value; real 3 array.
in1input1Write enabled; bool scalar.
out0output1Stored value; real 3 array.

Parameters

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

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample period
sampleTimeS
s0.1Positive interval between sample instants. Values are held between samples.
Minimum 0
Initial value 1
params[0]
10Initial values in declared lane order, including real and imaginary lanes for complex signals.
Initial value 2
params[1]
10Initial values in declared lane order, including real and imaginary lanes for complex signals.
Initial value 3
params[2]
10Initial values in declared lane order, including real and imaginary lanes for complex signals.

Equations and rules

  • y[k] = stored snapshot[k]
  • snapshot[k+1] = write[k] if enabled[k]; otherwise snapshot[k]

Worked example

Sampled storage — worked example

Write value = [2,4,6]; Write enabled = 1. Stored value at 0 s = [0,0,0].

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Stored value
out0
0[0, 0, 0]11e-09

Explore the recorded outputs

Sampled storage recorded example

Sampled storage [1]
Sampled storage [1] against timeRecorded synthetic simulation values. Time in seconds; output in —.-0.1600.420.2510.51.580.752.161—Time (s)
Sampled storage [1]: 0 — at 0 s

11 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

Sampled storage — worked example

Reads a snapshot at each sample, then commits the enabled write for the next sample. Each block instance owns independent typed storage.

  1. Sampled storage: y[k] = stored snapshot[k]. snapshot[k+1] = write[k] if enabled[k]; otherwise snapshot[k].
    • Use the block reference for settings and connections.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • One writer per local storage declaration. Reads use the current snapshot; enabled writes become visible at the next sample.

Reference basis

This software operation is defined by its public contract and worked example; no external research result is claimed.

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)