{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.pcb.trace_width.input.json",
  "title": "PCB trace width — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "width",
        "current"
      ],
      "description": "width from I, or current from width_mil"
    },
    "I": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Trace current (A); required for mode=width"
    },
    "width_mil": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Trace width (mil); required for mode=current"
    },
    "dT": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Temperature rise (°C)"
    },
    "copper_oz": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Copper weight (oz/ft²); default 1"
    },
    "layer": {
      "type": "string",
      "enum": [
        "external",
        "internal"
      ],
      "description": "k=0.048 external / 0.024 internal"
    },
    "u_I": {
      "type": "number",
      "minimum": 0,
      "description": "Optional standard uncertainty of I (A); used in mode=width"
    },
    "u_width_mil": {
      "type": "number",
      "minimum": 0,
      "description": "Optional standard uncertainty of width_mil (mil); used in mode=current"
    },
    "u_dT": {
      "type": "number",
      "minimum": 0,
      "description": "Optional standard uncertainty of dT (°C)"
    },
    "u_copper_oz": {
      "type": "number",
      "minimum": 0,
      "description": "Optional standard uncertainty of copper_oz"
    },
    "uncertainty_k": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Coverage factor for expanded U on primary result; default 2 when any u_* is set (not the IPC layer k). Requires at least one u_*. Mutually exclusive with confidence."
    },
    "confidence": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1,
      "description": "Optional coverage probability instead of uncertainty_k. Requires at least one u_*."
    }
  },
  "required": [
    "dT"
  ],
  "allOf": [
    {
      "not": {
        "required": [
          "uncertainty_k",
          "confidence"
        ]
      }
    },
    {
      "if": {
        "anyOf": [
          {
            "required": [
              "uncertainty_k"
            ]
          },
          {
            "required": [
              "confidence"
            ]
          }
        ]
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "u_I"
            ]
          },
          {
            "required": [
              "u_width_mil"
            ]
          },
          {
            "required": [
              "u_dT"
            ]
          },
          {
            "required": [
              "u_copper_oz"
            ]
          }
        ]
      }
    }
  ],
  "description": "Size PCB copper traces or check ampacity with the IPC-2221 I = k·ΔT^0.44·A^0.725 relation for external and internal layers; optional u_* compose expanded uncertainty on width or I via Uncertainty Engine. (calculation_version 1.1.1)"
}
