{
  "node": {
    "id": "block:native-for-each-submodel",
    "type": "Block",
    "label": "Independent element kernels",
    "properties": {
      "id": "native-for-each-submodel",
      "name": "Independent element kernels",
      "kind": "studio",
      "summary": "Runs one scalar child instance per vector element, with fixed shape and isolated memory for every element.",
      "behavior": "Runs one scalar child instance per vector element, with fixed shape and isolated memory for every element. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "—",
          "description": "Iteration values; real vector [3]."
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "—",
          "description": "Element results; real vector [3]."
        },
        {
          "name": "out1",
          "direction": "output",
          "unit": "—",
          "description": "Invocations this sample; u32 scalar."
        }
      ],
      "parameters": [
        {
          "key": "sampleTimeS",
          "label": "Sample period",
          "unit": "s",
          "default": 1,
          "min": 0,
          "description": "Positive interval between accepted control samples. Outputs hold between these instants."
        },
        {
          "key": "params[0]",
          "label": "Element count",
          "unit": "—",
          "default": 3,
          "description": "1–256, fixed for the model."
        },
        {
          "key": "nested",
          "label": "Child operation",
          "unit": "—",
          "default": "Discrete integrator",
          "description": "One configurable native computation operation. Its declared input/output types must match the wrapper."
        },
        {
          "key": "tables[0]",
          "label": "Initial held outputs",
          "unit": "—",
          "default": [
            0,
            0,
            0
          ],
          "description": "Initial values for all child output lanes, in output order. For independent elements, supply one value per element."
        }
      ],
      "equations": [
        "For each element i: (state[i], output[i]) ← child(state[i], input[i])",
        "State storage is separate for every element"
      ],
      "example": {
        "title": "Independent element kernels worked example",
        "text": "Default editable example at the first accepted sample (t = 0 s). Child operation: discrete integrator. The output checks below are execution oracles for this example.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-for-each-submodel",
        "label": "Open Studio example",
        "inputs": [
          {
            "port": "in0",
            "label": "Iteration values",
            "value": [
              1,
              2,
              3
            ],
            "unit": "—"
          }
        ],
        "checks": [
          {
            "port": "out0",
            "label": "Element results",
            "atS": 0,
            "value": [
              1,
              2,
              3
            ],
            "unit": "—",
            "tolerance": 1e-08
          },
          {
            "port": "out1",
            "label": "Invocations this sample",
            "atS": 0,
            "value": 3,
            "unit": "—",
            "tolerance": 1e-08
          }
        ]
      },
      "limits": [
        "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 one scalar input and one scalar output; the outer vector length is fixed at 1–256 elements."
      ],
      "references": [
        "control-dataflow"
      ],
      "availability": {
        "status": "released",
        "label": "Available in Lemonergy Studio",
        "detail": "The bundled example is available in the production release verified on 28 October 2026. The parameters and examples here are synthetic teaching fixtures, not a characterized cell or a validated operating limit."
      },
      "evidence": [
        "docs/glossary/native-block-verification.json"
      ],
      "sourceRepository": "Lemonergy Studio public contract",
      "sourceRevision": "verification-2026-10-27",
      "caseIds": [
        "native-native-for-each-submodel"
      ],
      "exampleTraces": [
        {
          "id": "native-for-each-submodel",
          "url": "https://lemonergy.com/learn/glossary/api/traces/native-for-each-submodel.json?v=a0ddf8a1a5ca",
          "title": "Independent element kernels recorded example",
          "exampleId": "block-native-for-each-submodel",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 3,
          "channels": 4,
          "omittedChannels": 0,
          "interpolation": "step",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "no-continuous-states"
          }
        }
      ],
      "type": "native-for-each-submodel",
      "implementationId": "native-for-each-submodel",
      "url": "https://lemonergy.com/learn/glossary/blocks/native-for-each-submodel/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/native-for-each-submodel/",
      "sourceFile": "block-library.json",
      "reviewed": "2026-10-27",
      "releaseEvidence": {
        "environment": "production",
        "status": "verified",
        "revision": "e76cadfc203e15eb41f3478d8b1044a5b851953d",
        "verifiedOn": "2026-10-28",
        "exampleUrls": [
          "https://design.lemonergy.com/cosim.html?example=block-native-for-each-submodel"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-native-for-each-submodel/0",
      "type": "usesBlock",
      "source": "workflow:native-native-for-each-submodel",
      "target": "block:native-for-each-submodel",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Independent element kernels",
        "type": "native-for-each-submodel",
        "role": "Runs one scalar child instance per vector element, with fixed shape and isolated memory for every element. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.",
        "settings": [
          "Use the block reference for settings and connections.",
          "Bundled example verified on the production release of 28 October 2026."
        ]
      }
    }
  ],
  "outgoing": [
    {
      "id": "edge:cites/block:native-for-each-submodel/reference:control-dataflow",
      "type": "cites",
      "source": "block:native-for-each-submodel",
      "target": "reference:control-dataflow",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-native-for-each-submodel",
      "type": "Workflow",
      "label": "Independent element kernels worked example",
      "properties": {
        "id": "native-native-for-each-submodel",
        "title": "Independent element kernels worked example",
        "kind": "studio",
        "summary": "Runs one scalar child instance per vector element, with fixed shape and isolated memory for every element.",
        "steps": [
          "Review the interface, units and model limits.",
          "Open the Studio example and run its bundled model.",
          "Compare outputs with the numerical checks; change one input and run again."
        ],
        "example": "Default editable example at the first accepted sample (t = 0 s). Child operation: discrete integrator. The output checks below are execution oracles for this example.",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "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 one scalar input and one scalar output; the outer vector length is fixed at 1–256 elements.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-for-each-submodel",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:control-dataflow",
      "type": "Reference",
      "label": "Synchronous Data Flow",
      "properties": {
        "title": "Synchronous Data Flow",
        "authors": [
          "Edward A. Lee",
          "David G. Messerschmitt"
        ],
        "year": 1987,
        "url": "https://ptolemy.berkeley.edu/publications/papers/87/index.htm",
        "publisher": "Proceedings of the IEEE, 75(9), 1235–1245",
        "type": "Research article",
        "scope": "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.",
        "accessed": "2026-10-27"
      }
    }
  ]
}
