{
  "schemaVersion": 1,
  "slug": "spring-constant-calculator",
  "category": "science",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "507b8f2d0d6026d1dd6bbe252ca7c078cb700e3e8fa83552b6146e495d7c3a89",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/spring-constant-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": "k = F ÷ (x × N); ω = √(k×N ÷ m); T = 2π ÷ ω; U = ½ × k × N × x²",
    "vars": [
      [
        "F",
        "Force (N)"
      ],
      [
        "x",
        "Displacement (m)"
      ],
      [
        "N",
        "Number of springs"
      ],
      [
        "m",
        "Mass (kg)"
      ]
    ],
    "note": "For identical springs in parallel, each stiffness = force ÷ displacement ÷ count. Total stiffness drives the ideal undamped period and frequency, defined only for positive mass and stiffness."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "OpenStax — Simple harmonic motion",
        "url": "https://openstax.org/books/university-physics-volume-1/pages/15-1-simple-harmonic-motion"
      }
    ],
    "basis": "Hooke stiffness is force divided by displacement. The page divides total stiffness by the count of identical parallel springs; period uses 2π × sqrt(mass / total stiffness).",
    "limitations": "Assumes identical linear springs in parallel, negligible spring mass and no damping. It does not model springs in series or behavior beyond the elastic range.",
    "implementationHash": "507b8f2d0d6026d1dd6bbe252ca7c078cb700e3e8fa83552b6146e495d7c3a89"
  },
  "contract": {
    "compute": "const k = displacement > 0 ? force/displacement/springCount : null; const totalK = k===null ? null : k*springCount; const omega = mass>0 && totalK>0 ? Math.sqrt(totalK/mass) : null; return { springConstant:k, springConstantPerMm:k===null?null:k/1000, period:omega===null?null:2*Math.PI/omega, frequency:omega===null?null:omega/(2*Math.PI), angularFrequency:omega, potentialEnergy:totalK===null?null:0.5*totalK*displacement*displacement };",
    "inputs": [
      {
        "name": "force",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 1000000,
        "step": 0.01
      },
      {
        "name": "displacement",
        "type": "number",
        "default": 0.05,
        "min": 0.000001,
        "max": 100000,
        "step": 0.0001
      },
      {
        "name": "mass",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 1000000,
        "step": 0.01
      },
      {
        "name": "springCount",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "springConstant",
        "precision": 4,
        "unit": "N/m"
      },
      {
        "name": "springConstantPerMm",
        "precision": 5,
        "unit": "N/mm"
      },
      {
        "name": "period",
        "precision": 4,
        "unit": "s",
        "optional": true
      },
      {
        "name": "frequency",
        "precision": 4,
        "unit": "Hz",
        "optional": true
      },
      {
        "name": "angularFrequency",
        "precision": 4,
        "unit": "rad/s",
        "optional": true
      },
      {
        "name": "potentialEnergy",
        "precision": 5,
        "unit": "J"
      }
    ],
    "interpret": null
  }
}
