{
  "schemaVersion": 1,
  "slug": "hot-tub-cost-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "de559464c8f3031f5e3a8ccfa0019c84e603cb9c24f54d8e49fe4fdb8b779463",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/hot-tub-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": "EkWh = V × 8.34 × max(0, Ttarget − Tfill) ÷ 3412.142 ÷ (η ÷ 100) ; heating hours = EkWh ÷ (heater watts ÷ 1000) ; monthly cost = daily kWh × 30.44 × rate",
    "vars": [
      [
        "V",
        "water volume (US gallons)"
      ],
      [
        "Ttarget",
        "target water temperature (°F)"
      ],
      [
        "Tfill",
        "fill-water temperature (°F)"
      ],
      [
        "η",
        "heater efficiency (%)"
      ],
      [
        "rate",
        "electricity rate (USD/kWh)"
      ]
    ],
    "note": "Recurring cost uses the total daily consumption entered (including all spa equipment) × 30.44 days or 365 days × the rate. Daily use is user-measured or user-estimated, not predicted from ambient temperature or cover quality. Fresh-fill heat-up is an idealized water-only estimate; real heat loss and warm-up time may be higher."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const waterKwh=gallons*8.34*Math.max(0,targetTemp-fillWaterTemp)/3412.142; const heatUpKwh=waterKwh/(heaterEfficiency/100); const monthlyKwh=dailyKwh*30.44; const yearlyKwh=dailyKwh*365; return {monthlyKwh,yearlyKwh,monthlyCost:monthlyKwh*rate,yearlyCost:yearlyKwh*rate,heatUpKwh,heatUpCost:heatUpKwh*rate,heatUpHours:heaterWatts>0?heatUpKwh/(heaterWatts/1000):0};",
    "inputs": [
      {
        "name": "dailyKwh",
        "type": "number",
        "default": 5,
        "min": 0,
        "max": 100,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "rate",
        "type": "number",
        "default": 0.17,
        "min": 0,
        "max": 5,
        "step": 0.001,
        "slider": true
      },
      {
        "name": "gallons",
        "type": "number",
        "default": 350,
        "min": 50,
        "max": 3000,
        "step": 10,
        "slider": true
      },
      {
        "name": "fillWaterTemp",
        "type": "number",
        "default": 50,
        "min": -20,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "targetTemp",
        "type": "number",
        "default": 102,
        "min": 80,
        "max": 110,
        "step": 1,
        "slider": true
      },
      {
        "name": "heaterWatts",
        "type": "number",
        "default": 4000,
        "min": 500,
        "max": 30000,
        "step": 100,
        "slider": true
      },
      {
        "name": "heaterEfficiency",
        "type": "number",
        "default": 98,
        "min": 50,
        "max": 100,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "monthlyKwh",
        "precision": 1,
        "unit": "kWh"
      },
      {
        "name": "yearlyKwh",
        "precision": 0,
        "unit": "kWh"
      },
      {
        "name": "monthlyCost",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "yearlyCost",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "heatUpKwh",
        "precision": 2,
        "unit": "kWh"
      },
      {
        "name": "heatUpCost",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "heatUpHours",
        "precision": 1,
        "unit": "h"
      }
    ],
    "interpret": null
  }
}
