{
  "schemaVersion": 1,
  "slug": "engine-rpm-calculator",
  "category": "automotive",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "39f51bcf4e9e3c3f5b3b1b6a3faa42ffa394c6c0daddf085badc5c14054d23e3",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/engine-rpm-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": "RPM = v × G × F × 1056 ÷ (π × (D + 2 × w × a ÷ 100 ÷ 25.4))",
    "vars": [
      [
        "v",
        "Vehicle speed (mph)"
      ],
      [
        "G",
        "Gear ratio"
      ],
      [
        "F",
        "Final drive ratio"
      ],
      [
        "w",
        "Tire width (mm)"
      ],
      [
        "a",
        "Aspect ratio (%)"
      ],
      [
        "D",
        "Rim diameter (in)"
      ]
    ],
    "note": "Tire diameter (in) = rim diameter + 2 × (width × aspect ratio ÷ 100) ÷ 25.4. Engine rpm = mph × gear ratio × final drive × 1,056 ÷ tire circumference (in). Assumes no tire slip or growth."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const sidewall = tireWidth*aspect/100; const tireDiameter = rimSize+sidewall*2/25.4; const circumference = Math.PI*tireDiameter; const gearTotal = gearRatio*finalDrive; const rpmCalc = circumference > 0 ? speed*gearTotal*1056/circumference : 0; const speedAt2000 = gearTotal > 0 ? 2000*circumference/(1056*gearTotal) : 0; return { tireDiameter, tireCircumference: circumference, rpm: rpmCalc, speedAt2000 };",
    "inputs": [
      {
        "name": "speed",
        "type": "number",
        "default": 60,
        "min": 0,
        "max": 300,
        "step": 1,
        "slider": true
      },
      {
        "name": "gearRatio",
        "type": "number",
        "default": 1,
        "min": 0.1,
        "max": 10,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "finalDrive",
        "type": "number",
        "default": 3.73,
        "min": 0.5,
        "max": 10,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "tireWidth",
        "type": "number",
        "default": 225,
        "min": 100,
        "max": 400,
        "step": 5,
        "slider": true
      },
      {
        "name": "aspect",
        "type": "number",
        "default": 45,
        "min": 20,
        "max": 90,
        "step": 5,
        "slider": true
      },
      {
        "name": "rimSize",
        "type": "number",
        "default": 17,
        "min": 10,
        "max": 26,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "rpm",
        "precision": 0,
        "unit": "rpm"
      },
      {
        "name": "tireDiameter",
        "precision": 2,
        "unit": "in"
      },
      {
        "name": "tireCircumference",
        "precision": 2,
        "unit": "in"
      },
      {
        "name": "speedAt2000",
        "precision": 1,
        "unit": "mph"
      }
    ],
    "interpret": null
  }
}
