{
  "node": {
    "id": "block:native-extract-diagonal",
    "type": "Block",
    "label": "Extract diagonal",
    "properties": {
      "id": "native-extract-diagonal",
      "name": "Extract diagonal",
      "kind": "studio",
      "summary": "Extracts a main or offset matrix diagonal.",
      "behavior": "yᵢ = Aᵢ,ᵢ₊offset, using valid diagonal indices. The worked example connects this operation to signals in Lemonergy Studio.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "1",
          "description": "Matrix; real 2 × 2 array.",
          "shape": [
            2,
            2
          ],
          "elementType": "real"
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "1",
          "description": "Diagonal; real 2 array.",
          "shape": [
            2
          ],
          "elementType": "real"
        }
      ],
      "parameters": [
        {
          "key": "params[0]",
          "label": "Diagonal offset",
          "unit": "1",
          "default": 0,
          "description": "0 main diagonal; positive above; negative below."
        }
      ],
      "equations": [
        "yᵢ = Aᵢ,ᵢ₊offset, using valid diagonal indices"
      ],
      "example": {
        "title": "Extract diagonal — worked example",
        "text": "Matrix = [1,3,2,4]. Diagonal at 0 s = [1,4].",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-extract-diagonal",
        "label": "Open Studio example",
        "inputs": [
          {
            "port": "in0",
            "label": "Matrix",
            "value": [
              1,
              3,
              2,
              4
            ],
            "unit": "1"
          }
        ],
        "checks": [
          {
            "port": "out0",
            "label": "Diagonal",
            "atS": 0,
            "value": [
              1,
              4
            ],
            "unit": "1",
            "tolerance": 1e-08
          }
        ]
      },
      "limits": [
        "Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed."
      ],
      "references": [
        "nist-dlmf-linear-algebra"
      ],
      "caseIds": [
        "native-native-extract-diagonal"
      ],
      "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",
      "exampleTraces": [
        {
          "id": "native-extract-diagonal",
          "url": "https://lemonergy.com/learn/glossary/api/traces/native-extract-diagonal.json?v=8e49ee48b59e",
          "title": "Extract diagonal recorded example",
          "exampleId": "block-native-extract-diagonal",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 2,
          "channels": 2,
          "omittedChannels": 0,
          "interpolation": "linear",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "no-continuous-states"
          }
        }
      ],
      "type": "native-extract-diagonal",
      "implementationId": "native-extract-diagonal",
      "url": "https://lemonergy.com/learn/glossary/blocks/native-extract-diagonal/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/native-extract-diagonal/",
      "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-extract-diagonal"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-native-extract-diagonal/0",
      "type": "usesBlock",
      "source": "workflow:native-native-extract-diagonal",
      "target": "block:native-extract-diagonal",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Extract diagonal",
        "type": "native-extract-diagonal",
        "role": "yᵢ = Aᵢ,ᵢ₊offset, using valid diagonal indices. The worked example connects this operation to signals in Lemonergy Studio.",
        "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-extract-diagonal/reference:nist-dlmf-linear-algebra",
      "type": "cites",
      "source": "block:native-extract-diagonal",
      "target": "reference:nist-dlmf-linear-algebra",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-native-extract-diagonal",
      "type": "Workflow",
      "label": "Extract diagonal — worked example",
      "properties": {
        "id": "native-native-extract-diagonal",
        "title": "Extract diagonal — worked example",
        "kind": "studio",
        "summary": "Extracts a main or offset matrix diagonal.",
        "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": "Matrix = [1,3,2,4]. Diagonal at 0 s = [1,4].",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-extract-diagonal",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:nist-dlmf-linear-algebra",
      "type": "Reference",
      "label": "NIST Digital Library of Mathematical Functions, §3.2 Linear Algebra",
      "properties": {
        "title": "NIST Digital Library of Mathematical Functions, §3.2 Linear Algebra",
        "publisher": "National Institute of Standards and Technology",
        "url": "https://dlmf.nist.gov/3.2",
        "type": "Mathematical reference",
        "scope": "Linear algebra and matrix operations; conceptual background, not software certification.",
        "accessed": "2026-10-27"
      }
    }
  ]
}
