{
  "schemaVersion": 1,
  "slug": "voltage-drop-calculator",
  "category": "electrical",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "f2ad48f9b846f798426ea4c9148f42a195a80bab11f0cfd4e8323ca6d0bad909",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/voltage-drop-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "R = 2KL÷CM; ΔV = I×R; pct = ΔV÷V×100; L_max = 0.03V÷(I×R÷L)",
    "vars": [
      [
        "I",
        "Current (A)"
      ],
      [
        "L",
        "One-way length (ft)"
      ],
      [
        "K",
        "Resistivity constant"
      ],
      [
        "CM",
        "Circular mils (gauge)"
      ],
      [
        "ΔV",
        "Voltage drop (V)"
      ],
      [
        "pct",
        "Drop (%)"
      ]
    ],
    "note": "Uses fixed K values (copper 12.9, aluminium 21.2) and listed AWG circular-mil areas; length is one-way and loop resistance doubles it. The maximum-length output uses a model-selected 3% reference only; it is not a code check. Actual design depends on installation and local rules."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const CM = {14:4110, 12:6530, 10:10380, 8:16510, 6:26240, 4:41740};\nconst K = Number(material)===2 ? 21.2 : 12.9;\nconst cm = CM[Number(gauge)] || 6530;\nconst loop = 2*K*length/cm;\nconst drop = current*loop;\nif (drop >= voltage) return { dropPercent:null, voltageDrop:null, endVoltage:null, loopResistance:null, maxLength:null, __error:'voltage-drop' };\nconst pct = voltage>0 ? drop/voltage*100 : 0;\nconst perFt = loop/length;\nconst allowed = voltage*0.03;\nreturn {\n  dropPercent: pct,\n  voltageDrop: drop,\n  endVoltage: voltage-drop,\n  loopResistance: loop,\n  maxLength: (perFt>0 && current>0) ? allowed/(current*perFt) : 0,\n};",
    "inputs": [
      {
        "name": "voltage",
        "type": "number",
        "default": 120,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "current",
        "type": "number",
        "default": 15,
        "min": 0.1,
        "max": 1000,
        "step": 0.1
      },
      {
        "name": "length",
        "type": "number",
        "default": 100,
        "min": 1,
        "max": 5000,
        "step": 1,
        "slider": true
      },
      {
        "name": "gauge",
        "type": "select",
        "default": 12,
        "options": [
          {
            "value": 14
          },
          {
            "value": 12
          },
          {
            "value": 10
          },
          {
            "value": 8
          },
          {
            "value": 6
          },
          {
            "value": 4
          }
        ]
      },
      {
        "name": "material",
        "type": "select",
        "default": 1,
        "options": [
          {
            "value": 1
          },
          {
            "value": 2
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "dropPercent",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "voltageDrop",
        "precision": 2,
        "unit": "V"
      },
      {
        "name": "endVoltage",
        "precision": 2,
        "unit": "V"
      },
      {
        "name": "loopResistance",
        "precision": 4,
        "unit": "Ω"
      },
      {
        "name": "maxLength",
        "precision": 0,
        "unit": "ft"
      }
    ],
    "interpret": [
      {
        "max": 3,
        "key": "vdGood"
      },
      {
        "max": 5,
        "key": "vdAcceptable"
      },
      {
        "max": null,
        "key": "vdHigh"
      }
    ]
  }
}
