Lemonergy · Studio block

Conditional action kernel

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

Implementation ID
native-action-submodel
Reviewed
2026-10-27

Behavior

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.

Interface

Conditional action kernel interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Conditional action kernelStudio blockin0in1out0out1
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
in0input—Value; real scalar.
in1input—Action; bool scalar.
out0output—Biased value; 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
Child operation
nested
—BiasOne configurable native computation operation. Its declared input/output types must match the wrapper.
Initial held outputs
tables[0]
—[0]Initial values for all child output lanes, in output order. For independent elements, supply one value per element.

Equations and rules

  • action = true: (state, output) ← child(state, input)
  • action = false: retain state and output

Worked example

Conditional action kernel worked 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.

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

Explore the recorded outputs

Conditional action kernel recorded example

Conditional action kernel / Biased value
Conditional action kernel / Biased value against timeRecorded synthetic simulation values. Time in seconds; output in —.2.502.750.5313.251.53.52—Time (s)
Conditional action kernel / Biased value: 3 — 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

Conditional action kernel worked example

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

  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.
    • 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.
  • A Boolean action flag controls one child. This is not an arbitrary multi-block action subsystem.

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. Statecharts: A visual formalism for complex systems

    David Harel · Science of Computer Programming, 8(3), 231–274 · 1987

    Technical reference · Background on explicit states and events. Lemonergy bounded control blocks are not a complete Statecharts 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)