{
  "node": {
    "id": "block:battery-charge-envelope",
    "type": "Block",
    "label": "Charge-current envelope",
    "properties": {
      "id": "battery-charge-envelope",
      "name": "Charge-current envelope",
      "kind": "studio",
      "summary": "Selects the most restrictive cell voltage and temperature current limit.",
      "behavior": "Interpolates voltage and temperature limit tables for every channel, then selects the smallest nonnegative magnitude together with the nominal cap. Disabling the block returns zero. The envelope feeds a controller or current actuator.",
      "ports": [
        {
          "name": "voltage",
          "direction": "input",
          "unit": "V",
          "description": "Cell voltages; 3 channels at the default configuration.",
          "shape": [
            3
          ],
          "elementType": "real",
          "quantity": "voltage"
        },
        {
          "name": "temperature",
          "direction": "input",
          "unit": "K",
          "description": "Cell temperatures; 3 channels at the default configuration.",
          "shape": [
            3
          ],
          "elementType": "real",
          "quantity": "temperature"
        },
        {
          "name": "enable",
          "direction": "input",
          "unit": "true / false",
          "description": "Enable; scalar.",
          "shape": [],
          "elementType": "bool",
          "quantity": "dimensionless"
        },
        {
          "name": "limit",
          "direction": "output",
          "unit": "A",
          "description": "Allowed current magnitude; scalar.",
          "shape": [],
          "elementType": "real",
          "quantity": "current"
        },
        {
          "name": "voltageLimit",
          "direction": "output",
          "unit": "A",
          "description": "Voltage limit; scalar.",
          "shape": [],
          "elementType": "real",
          "quantity": "current"
        },
        {
          "name": "temperatureLimit",
          "direction": "output",
          "unit": "A",
          "description": "Temperature limit; scalar.",
          "shape": [],
          "elementType": "real",
          "quantity": "current"
        }
      ],
      "parameters": [
        {
          "key": "cells",
          "label": "Number of measurement channels",
          "unit": "1",
          "default": 3,
          "description": "Number of measurement channels. This is an editable model input; the default belongs to the synthetic worked example."
        },
        {
          "key": "nominalA",
          "label": "Nominal current limit (A)",
          "unit": "A",
          "default": 2,
          "description": "Nominal current limit (A). This is an editable model input; the default belongs to the synthetic worked example."
        },
        {
          "key": "voltageTable",
          "label": "Voltage limit table [V, A]",
          "unit": "See field order",
          "default": [
            [
              4,
              2
            ],
            [
              4.1,
              0
            ]
          ],
          "description": "Voltage limit table [V, A]. Rows are ordered coordinate/value pairs; the first column must be strictly increasing."
        },
        {
          "key": "temperatureTable",
          "label": "Temperature limit table [K, A]",
          "unit": "See field order",
          "default": [
            [
              273.15,
              0
            ],
            [
              283.15,
              2
            ],
            [
              313.15,
              2
            ],
            [
              323.15,
              0
            ]
          ],
          "description": "Temperature limit table [K, A]. Rows are ordered coordinate/value pairs; the first column must be strictly increasing."
        }
      ],
      "equations": [
        "allowed = enable ? min(nominal, all voltage limits, all temperature limits) : 0"
      ],
      "example": {
        "title": "Charge-current envelope worked example",
        "text": "Use the defaults below with Cell voltages = [4, 4.05, 4.02] V, Cell temperatures = [298.15, 318.15, 300] K, Enable = 1 true / false. At 0 s, Allowed current magnitude is 1 A. Additional checks are listed below.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-battery-charge-envelope",
        "label": "Open Studio example",
        "checks": [
          {
            "port": "limit",
            "atS": 0,
            "value": 1,
            "tolerance": 1e-08,
            "label": "Allowed current magnitude",
            "unit": "A"
          }
        ],
        "inputs": [
          {
            "port": "voltage",
            "label": "Cell voltages",
            "value": [
              4,
              4.05,
              4.02
            ],
            "unit": "V"
          },
          {
            "port": "temperature",
            "label": "Cell temperatures",
            "value": [
              298.15,
              318.15,
              300
            ],
            "unit": "K"
          },
          {
            "port": "enable",
            "label": "Enable",
            "value": 1,
            "unit": "true / false"
          }
        ]
      },
      "limits": [
        "The tables are supplied by the model author. Their synthetic defaults do not establish a safe charging or discharging envelope.",
        "The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks."
      ],
      "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."
      },
      "references": [
        "tomaszewska-charging"
      ],
      "evidence": [
        "docs/glossary/native-block-verification.json"
      ],
      "sourceRepository": "Lemonergy Studio public contract",
      "sourceRevision": "verification-2026-10-27",
      "caseIds": [
        "native-battery-charge-envelope"
      ],
      "exampleTraces": [
        {
          "id": "battery-charge-envelope",
          "url": "https://lemonergy.com/learn/glossary/api/traces/battery-charge-envelope.json?v=d05749eba926",
          "title": "Charge-current envelope recorded example",
          "exampleId": "block-battery-charge-envelope",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 2,
          "channels": 3,
          "omittedChannels": 0,
          "interpolation": "linear",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "no-continuous-states"
          }
        }
      ],
      "type": "battery-charge-envelope",
      "implementationId": "battery-charge-envelope",
      "url": "https://lemonergy.com/learn/glossary/blocks/battery-charge-envelope/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/battery-charge-envelope/",
      "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-battery-charge-envelope"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-battery-charge-envelope/0",
      "type": "usesBlock",
      "source": "workflow:native-battery-charge-envelope",
      "target": "block:battery-charge-envelope",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Charge-current envelope",
        "type": "battery-charge-envelope",
        "role": "Interpolates voltage and temperature limit tables for every channel, then selects the smallest nonnegative magnitude together with the nominal cap. Disabling the block returns zero. The envelope feeds a controller or current actuator.",
        "settings": [
          "Use the parameter values in the block reference.",
          "Bundled example verified on the production release of 28 October 2026."
        ]
      }
    }
  ],
  "outgoing": [
    {
      "id": "edge:cites/block:battery-charge-envelope/reference:tomaszewska-charging",
      "type": "cites",
      "source": "block:battery-charge-envelope",
      "target": "reference:tomaszewska-charging",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-battery-charge-envelope",
      "type": "Workflow",
      "label": "Charge-current envelope worked example",
      "properties": {
        "id": "native-battery-charge-envelope",
        "title": "Charge-current envelope worked example",
        "kind": "studio",
        "summary": "Selects the most restrictive cell voltage and temperature current limit.",
        "steps": [
          "Review the block inputs, units and model limits.",
          "Open the Studio example and run its bundled model.",
          "Compare the output channels with the numerical checks; change one input and run again."
        ],
        "example": "Use the defaults below with Cell voltages = [4, 4.05, 4.02] V, Cell temperatures = [298.15, 318.15, 300] K, Enable = 1 true / false. At 0 s, Allowed current magnitude is 1 A. Additional checks are listed below.",
        "observe": "Inspect the outputs and numerical checks on the block reference page.",
        "limits": "The tables are supplied by the model author. Their synthetic defaults do not establish a safe charging or discharging envelope. The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-battery-charge-envelope",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:tomaszewska-charging",
      "type": "Reference",
      "label": "Lithium-ion battery fast charging: A review",
      "properties": {
        "title": "Lithium-ion battery fast charging: A review",
        "publisher": "eTransportation",
        "url": "https://doi.org/10.1016/j.etran.2019.100011",
        "type": "Review article",
        "scope": "CC-CV and alternative charging protocols, transport limitations, degradation and thermal implications; results depend on cell and test conditions. Software behavior is documented separately in Lemonergy block references.",
        "year": 2019,
        "authors": [
          "Anna Tomaszewska et al."
        ],
        "accessed": "2026-10-27"
      }
    }
  ]
}
