{
  "schemaVersion": 1,
  "slug": "momentum-calculator",
  "category": "science",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "f2998127b0a508ad7fa8ef6db74b0b09464856ffa22a35825ee6e4a11961ecdc",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/momentum-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": "P = m₁v₁ + m₂v₂; v′ = P ÷ (m₁ + m₂); ΔE = ½m₁v₁² + ½m₂v₂² − ½(m₁ + m₂)v′²",
    "vars": [
      [
        "P",
        "total momentum"
      ],
      [
        "v′",
        "velocity after joining"
      ],
      [
        "m₁, m₂",
        "masses"
      ],
      [
        "v₁, v₂",
        "velocities before collision"
      ],
      [
        "ΔE",
        "kinetic energy lost"
      ]
    ],
    "note": "Perfectly inelastic collision (bodies stick together); ΔE is floored at 0."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "OpenStax — Types of collisions",
        "url": "https://openstax.org/books/university-physics-volume-1/pages/9-4-types-of-collisions"
      }
    ],
    "basis": "Linear momentum is mass × signed velocity. Combined velocity is total momentum divided by combined mass; kinetic energy loss compares initial energy with that of the combined object.",
    "limitations": "Assumes a one-dimensional perfectly inelastic collision with no external impulse. Combined velocity is not the solution for objects that rebound.",
    "implementationHash": "f2998127b0a508ad7fa8ef6db74b0b09464856ffa22a35825ee6e4a11961ecdc"
  },
  "contract": {
    "compute": "const totalMass=mass1+mass2;if(totalMass<=0)return{momentum1:null,momentum2:null,totalMomentum:null,combinedVelocity:null,kineticEnergy:null,energyLoss:null,__error:'inputError'};const p1=mass1*velocity1,p2=mass2*velocity2,total=p1+p2,vc=total/totalMass,e=0.5*mass1*velocity1*velocity1+0.5*mass2*velocity2*velocity2,after=0.5*totalMass*vc*vc;return{momentum1:p1,momentum2:p2,totalMomentum:total,combinedVelocity:vc,kineticEnergy:e,energyLoss:Math.max(0,e-after)}",
    "inputs": [
      {
        "name": "mass1",
        "type": "number",
        "default": 1000,
        "min": 0,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "velocity1",
        "type": "number",
        "default": 10,
        "min": -10000,
        "max": 10000,
        "step": 0.1
      },
      {
        "name": "mass2",
        "type": "number",
        "default": 800,
        "min": 0,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "velocity2",
        "type": "number",
        "default": -5,
        "min": -10000,
        "max": 10000,
        "step": 0.1
      }
    ],
    "outputs": [
      {
        "name": "momentum1",
        "precision": 2,
        "unit": "kg·m/s"
      },
      {
        "name": "momentum2",
        "precision": 2,
        "unit": "kg·m/s"
      },
      {
        "name": "totalMomentum",
        "precision": 2,
        "unit": "kg·m/s"
      },
      {
        "name": "combinedVelocity",
        "precision": 3,
        "unit": "m/s"
      },
      {
        "name": "kineticEnergy",
        "precision": 2,
        "unit": "J"
      },
      {
        "name": "energyLoss",
        "precision": 2,
        "unit": "J"
      }
    ],
    "interpret": null
  }
}
