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
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | 1 | Write value; real 3 array. |
in1 | input | 1 | Write enabled; bool scalar. |
out0 | output | 1 | Stored value; real 3 array. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample periodsampleTimeS | s | 0.1 | Positive interval between sample instants. Values are held between samples. Minimum 0 |
Initial value 1params[0] | 1 | 0 | Initial values in declared lane order, including real and imaginary lanes for complex signals. |
Initial value 2params[1] | 1 | 0 | Initial values in declared lane order, including real and imaginary lanes for complex signals. |
Initial value 3params[2] | 1 | 0 | Initial 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 →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Stored valueout0 | 0 | [0, 0, 0] | 1 | 1e-09 |
Explore the recorded outputs
Sampled storage recorded example
Sampled storage [1]11 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
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.
- 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.
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)