{
  "schemaVersion": 1,
  "slug": "insulation-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "fe2981a7f6a32730f50e854c9e77db641ea5cf286b9721e3d2e1f4f65fd806a6",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/insulation-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": "t = R ÷ r ; A = L × W × (1 + w ÷ 100) ; C = A × p",
    "vars": [
      [
        "R",
        "target R-value"
      ],
      [
        "r",
        "R-value per inch"
      ],
      [
        "L",
        "area length (ft)"
      ],
      [
        "W",
        "area width (ft)"
      ],
      [
        "w",
        "waste allowance (%)"
      ],
      [
        "p",
        "price per sq ft"
      ]
    ],
    "note": "t is insulation thickness in inches; A includes waste allowance; C is total material cost."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const area = length*width; const thickness = targetR/(rPerInch || 1); const totalArea = area*(1+waste/100); return { area, thickness, totalArea, totalCost: totalArea*pricePerSqft };",
    "inputs": [
      {
        "name": "length",
        "type": "number",
        "default": 40,
        "min": 0,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "width",
        "type": "number",
        "default": 24,
        "min": 0,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "targetR",
        "type": "number",
        "default": 38,
        "min": 1,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "rPerInch",
        "type": "number",
        "default": 3.2,
        "min": 0.5,
        "max": 8,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "waste",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 30,
        "step": 1,
        "slider": true
      },
      {
        "name": "pricePerSqft",
        "type": "number",
        "default": 1.2,
        "min": 0,
        "max": 50,
        "step": 0.05,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "area",
        "precision": 1,
        "unit": "sq ft"
      },
      {
        "name": "thickness",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "totalArea",
        "precision": 1,
        "unit": "sq ft"
      },
      {
        "name": "totalCost",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
