Lemonergy · Studio block

Bounded while iterator

Feeds each child result back as its next input, testing the condition before each call. A nonterminating loop stops without committing state.

Implementation ID
native-while-iterator-submodel
Reviewed
2026-10-27

Behavior

Feeds each child result back as its next input, testing the condition before each call. A nonterminating loop stops without committing state. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.

Interface

Bounded while iterator interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Bounded while iteratorStudio blockin0out0out1
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
in0input—Value; real scalar.
out0output—Scaled; real scalar.
out1output—Invocations this sample; u32 scalar.

Parameters

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

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample period
sampleTimeS
s1Positive interval between accepted control samples. Outputs hold between these instants.
Minimum 0
Maximum iterations
params[0]
—101–256.
Comparison
params[1]
—00 <; 1 ≤; 2 >; 3 ≥; 4 ≠; 5 =.
Comparison value
params[2]
—8Configured comparison or case value.
Reset for each invocation
params[3]
—11 reset child memory; 0 retain child memory between invocations.
Child operation
nested
—Adjustable gainOne configurable native computation operation. Its declared input/output types must match the wrapper.
Initial held outputs
tables[0]
—[1]Initial values for all child output lanes, in output order. For independent elements, supply one value per element.

Equations and rules

  • While comparison(output, threshold): output ← child(state, output)
  • Test before the first call; exceeding the iteration limit aborts the entire invocation

Worked example

Bounded while iterator worked example

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

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Scaled
out0
08—1e-08
Invocations this sample
out1
03—1e-08

Explore the recorded outputs

Bounded while iterator recorded example

Bounded while iterator / Scaled
Bounded while iterator / Scaled against timeRecorded synthetic simulation values. Time in seconds; output in —.7.507.750.5818.251.58.52—Time (s)
Bounded while iterator / Scaled: 8 — at 0 s

3 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

Bounded while iterator worked example

Feeds each child result back as its next input, testing the condition before each call. A nonterminating loop stops without committing state.

  1. Bounded while iterator: Feeds each child result back as its next input, testing the condition before each call. A nonterminating loop stops without committing state. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.
    • Use the block reference for settings and connections.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • 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.
  • The child has matching real scalar input/output. At most 256 calls are allowed; nontermination raises a run error without committing a partial result.

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. Synchronous Data Flow

    Edward A. Lee, David G. Messerschmitt · Proceedings of the IEEE, 75(9), 1235–1245 · 1987

    Technical reference · Background on actor firing and explicit dataflow. The sampled conditional semantics documented here are Lemonergy design choices, not a claim of a complete SDF implementation.

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)