{
  "node": {
    "id": "block:native-discrete-lead-lag",
    "type": "Block",
    "label": "Discrete lead-lag filter",
    "properties": {
      "id": "native-discrete-lead-lag",
      "name": "Discrete lead-lag filter",
      "kind": "studio",
      "summary": "Applies a discrete lead-lag response derived from configured continuous time constants.",
      "behavior": "H(s) = gain × (lead_time s + 1)/(lag_time s + 1). s is replaced by (2/T) × (1−z⁻¹)/(1+z⁻¹). The worked example connects this operation to signals in Lemonergy Studio.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "1",
          "description": "Input; real scalar.",
          "shape": [],
          "elementType": "real"
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "1",
          "description": "Output; real scalar.",
          "shape": [],
          "elementType": "real"
        }
      ],
      "parameters": [
        {
          "key": "sampleTimeS",
          "label": "Sample period",
          "unit": "s",
          "default": 0.1,
          "description": "Exact sample grid period. Elapsed-time integration begins after initialization.",
          "min": 1e-06
        },
        {
          "key": "params[0]",
          "label": "Lead time",
          "unit": "s",
          "default": 0.1,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[1]",
          "label": "Lag time",
          "unit": "s",
          "default": 0.2,
          "description": "Configured finite numerical parameter."
        },
        {
          "key": "params[2]",
          "label": "Gain",
          "unit": "1",
          "default": 1,
          "description": "Bilinear transform of gain × (lead·s + 1)/(lag·s + 1)."
        }
      ],
      "equations": [
        "H(s) = gain × (lead_time s + 1)/(lag_time s + 1)",
        "s is replaced by (2/T) × (1−z⁻¹)/(1+z⁻¹)"
      ],
      "example": {
        "title": "Discrete lead-lag filter — worked example",
        "text": "Input = 5. Output at 0 s = 3.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-discrete-lead-lag",
        "label": "Open Studio example",
        "inputs": [
          {
            "port": "in0",
            "label": "Input",
            "value": 5,
            "unit": "1"
          }
        ],
        "checks": [
          {
            "port": "out0",
            "label": "Output",
            "atS": 0,
            "value": 3,
            "unit": "1",
            "tolerance": 1e-08
          }
        ]
      },
      "limits": [
        "Bilinear-transform realization with nonnegative lead time, positive lag time and explicit sample time.",
        "Shapes and element types are explicit. Values must be finite; automatic reshaping and unit conversion are not performed."
      ],
      "references": [
        "smith-digital-filters"
      ],
      "caseIds": [
        "native-native-discrete-lead-lag"
      ],
      "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-discrete-lead-lag",
          "url": "https://lemonergy.com/learn/glossary/api/traces/native-discrete-lead-lag.json?v=e2afaa7e0832",
          "title": "Discrete lead-lag filter recorded example",
          "exampleId": "block-native-discrete-lead-lag",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 11,
          "channels": 1,
          "omittedChannels": 0,
          "interpolation": "step",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "no-continuous-states"
          }
        }
      ],
      "type": "native-discrete-lead-lag",
      "implementationId": "native-discrete-lead-lag",
      "url": "https://lemonergy.com/learn/glossary/blocks/native-discrete-lead-lag/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/native-discrete-lead-lag/",
      "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-discrete-lead-lag"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-native-discrete-lead-lag/0",
      "type": "usesBlock",
      "source": "workflow:native-native-discrete-lead-lag",
      "target": "block:native-discrete-lead-lag",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Discrete lead-lag filter",
        "type": "native-discrete-lead-lag",
        "role": "H(s) = gain × (lead_time s + 1)/(lag_time s + 1). s is replaced by (2/T) × (1−z⁻¹)/(1+z⁻¹). 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-discrete-lead-lag/reference:smith-digital-filters",
      "type": "cites",
      "source": "block:native-discrete-lead-lag",
      "target": "reference:smith-digital-filters",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-native-discrete-lead-lag",
      "type": "Workflow",
      "label": "Discrete lead-lag filter — worked example",
      "properties": {
        "id": "native-native-discrete-lead-lag",
        "title": "Discrete lead-lag filter — worked example",
        "kind": "studio",
        "summary": "Applies a discrete lead-lag response derived from configured continuous time constants.",
        "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": "Input = 5. Output at 0 s = 3.",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "Bilinear-transform realization with nonnegative lead time, positive lag time and explicit sample time. 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-discrete-lead-lag",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:smith-digital-filters",
      "type": "Reference",
      "label": "Introduction to Digital Filters with Audio Applications — Difference Equation",
      "properties": {
        "title": "Introduction to Digital Filters with Audio Applications — Difference Equation",
        "authors": [
          "Julius O. Smith III"
        ],
        "publisher": "Author text, Stanford CCRMA; online edition hosted by DSPRelated",
        "year": 2007,
        "url": "https://www.dsprelated.com/freebooks/filters/Difference_Equation_I.html",
        "type": "Textbook",
        "scope": "Causal FIR/IIR difference equations and coefficient/history conventions.",
        "accessed": "2026-10-27"
      }
    }
  ]
}
