{
  "schemaVersion": 1,
  "slug": "shower-cost-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "ec9f6ebdf8fe2919ea1669bb753a925aa7025c0da2a70c1647d82f4edc0aba4b",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/shower-cost-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": "G = t×f; E = G×8.34×(T_o−T_i)×100÷η÷3412; C = G÷1000×r_w + E×r_e; Y = C×n×52×p",
    "vars": [
      [
        "t",
        "Shower duration (min)"
      ],
      [
        "f",
        "Flow rate (gal/min)"
      ],
      [
        "η",
        "Water heater efficiency (%)"
      ],
      [
        "T_o",
        "Outlet temp (°F)"
      ],
      [
        "T_i",
        "Inlet temp (°F)"
      ],
      [
        "r_w",
        "Water rate ($/1,000 gal)"
      ],
      [
        "C",
        "Cost per shower"
      ],
      [
        "r_e",
        "Energy rate ($/kWh)"
      ],
      [
        "n",
        "Showers per week"
      ],
      [
        "p",
        "People in household"
      ],
      [
        "G",
        "Water used per shower (gal)"
      ],
      [
        "E",
        "Energy per shower (kWh)"
      ],
      [
        "Y",
        "Yearly household cost ($)"
      ]
    ],
    "note": "8.34 lb/gal is water weight; 3412 BTU = 1 kWh; yearly cost uses n showers/week × 52 weeks × p people."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "EPA WaterSense — Water-use measurement and fixtures",
        "url": "https://www.epa.gov/watersense/showerheads"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "ec9f6ebdf8fe2919ea1669bb753a925aa7025c0da2a70c1647d82f4edc0aba4b",
    "basis": "G = t×f; E = G×8.34×(T_o−T_i)×100÷η÷3412; C = G÷1000×r_w + E×r_e; Y = C×n×52×p",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const gallonsPerShower = minutes*flow; const kwh = gallonsPerShower*8.34*Math.max(0, outletTemp-inletTemp)/(heaterEfficiency/100)/3412; const perShower = gallonsPerShower/1000*waterRate+kwh*energyRate; const perYear = perShower*showersPerWeek*52*people; return { gallonsPerShower, waterCost: gallonsPerShower/1000*waterRate, energyCost: kwh*energyRate, costPerShower: perShower, yearlyCost: perYear, yearlyGallons: gallonsPerShower*showersPerWeek*52*people };",
    "inputs": [
      {
        "name": "minutes",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 60,
        "step": 1,
        "slider": true
      },
      {
        "name": "flow",
        "type": "number",
        "default": 2,
        "min": 0.5,
        "max": 10,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "showersPerWeek",
        "type": "number",
        "default": 7,
        "min": 0,
        "max": 21,
        "step": 1,
        "slider": true
      },
      {
        "name": "people",
        "type": "number",
        "default": 3,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "waterRate",
        "type": "number",
        "default": 4.5,
        "min": 0,
        "max": 50,
        "step": 0.1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "energyRate",
        "type": "number",
        "default": 0.17,
        "min": 0,
        "max": 5,
        "step": 0.001,
        "slider": true,
        "advanced": true
      },
      {
        "name": "inletTemp",
        "type": "number",
        "default": 60,
        "min": 32,
        "max": 90,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "outletTemp",
        "type": "number",
        "default": 105,
        "min": 80,
        "max": 130,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "heaterEfficiency",
        "type": "number",
        "default": 90,
        "min": 50,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      }
    ],
    "outputs": [
      {
        "name": "costPerShower",
        "precision": 3,
        "unit": "$"
      },
      {
        "name": "gallonsPerShower",
        "precision": 1,
        "unit": "gal"
      },
      {
        "name": "waterCost",
        "precision": 3,
        "unit": "$"
      },
      {
        "name": "energyCost",
        "precision": 3,
        "unit": "$"
      },
      {
        "name": "yearlyCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "yearlyGallons",
        "precision": 0,
        "unit": "gal"
      }
    ],
    "interpret": null
  }
}
