# Dimension equation check

`dimension-equation-check` · version 1.0.0 · Numbers & math · free, no key needed

Check both sides of an equation have the same dimension (optionally a claimed one); returns the first bad node or side.

**Use when you need to: check an equation for dimensional homogeneity · do both sides of this equation have the same units · dimensional analysis of a physics equation.**

## Decide before calling

Read the [versioned contract](/v1/tools/dimension-equation-check/versions/1.0.0) and the supported scope below. Reuse `dimension-equation-check@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `dimension-equation-check@1.0.0` for check an equation for dimensional homogeneity. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- check an equation for dimensional homogeneity
- do both sides of this equation have the same units
- dimensional analysis of a physics equation
- is E = m v dimensionally correct
- find the inconsistent side of an equation
- verify equation dimensions before using it
- בדיקת הומוגניות ממדית של משוואה

## Not supported

- solving the equation or checking numeric correctness
- inequalities, systems written in one string, or chained a = b = c
- quantity kinds beyond dimension (torque versus energy)
- unit conversion factors

## Behavior

- Reference: ISO 80000-1:2022 (both sides of a quantity equation have the same dimension; sums need equal dimensions; transcendental arguments have dimension one) and SI Brochure 9th ed. 2019 (section 2.3.3 dimension symbols, Table 4); every output carries reference_version "iso-80000-1-2022+si-brochure-9e-2019".
- equation: two formulas joined by exactly one "=". Formula grammar, functions, symbol names, dimension strings and canonical output are those of dimension-expression-check (literal integer or (p/q) exponents only; dimension symbols L M T I Θ N J; no Unicode normalization).
- Order: left side in post-order (side "left"), right side in post-order (side "right"), then unequal_sides {left, right}, then the optional claimed_dimension (omitted means no claim) -> dimension_mismatch {claimed, actual}. Node failures carry side, path (relative to the side root), start and end (code point offsets in the whole equation) and text.
- dimension is the common dimension when both sides are consistent and equal (also on dimension_mismatch), else null; node_count counts nodes on both sides.
- Limits: 2048 UTF-8 bytes, 512 nodes for the whole equation, nesting depth 64, 128 symbols (names at most 64 UTF-8 bytes), 200-character dimension strings; limit_exceeded is raised before evaluation.

## Input

- `equation` (string, required): min length 1
- `symbols` (array of object, required): max items 128
- `claimed_dimension` (string, optional): min length 1; max length 200

## Output

- `valid` (boolean, required)
- `reason` (one of "unknown_symbol", "unlike_addition", "non_dimensionless_argument", "unequal_sides", "dimension_mismatch", null, required)
- `first_discrepancy` (object or null, required)
- `dimension` (string or null, required)
- `node_count` (integer, required): min 0
- `reference_version` (constant "iso-80000-1-2022+si-brochure-9e-2019", required)

## Limits

- max expression bytes: 2048
- max symbols: 128
- max symbol bytes: 64
- max dimension chars: 200
- max nodes: 512
- max depth: 64

## Example

Request input:

```json
{
  "equation": "E = m*v^2/2",
  "symbols": [
    {
      "symbol": "E",
      "dimension": "L^2 M T^-2"
    },
    {
      "symbol": "m",
      "dimension": "M"
    },
    {
      "symbol": "v",
      "dimension": "L T^-1"
    }
  ]
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "dimension": "L^2 M T^-2",
    "node_count": 7,
    "reference_version": "iso-80000-1-2022+si-brochure-9e-2019"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "dimension-equation-check",
  "version": "1.0.0",
  "input": {
    "equation": "E = m*v^2/2",
    "symbols": [
      {
        "symbol": "E",
        "dimension": "L^2 M T^-2"
      },
      {
        "symbol": "m",
        "dimension": "M"
      },
      {
        "symbol": "v",
        "dimension": "L T^-1"
      }
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/dimension-equation-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"equation":"E = m*v^2/2","symbols":[{"symbol":"E","dimension":"L^2 M T^-2"},{"symbol":"m","dimension":"M"},{"symbol":"v","dimension":"L T^-1"}]}'
```

The machine-readable contract is at [/v1/tools/dimension-equation-check/versions/1.0.0](/v1/tools/dimension-equation-check/versions/1.0.0).

### CLI

```sh
node cli.mjs run dimension-equation-check 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Dimension expression check](/tools/dimension-expression-check): Check a formula over dimensioned symbols is consistent and has the claimed dimension; returns the first bad node.
- [Dimension assignment check](/tools/dimension-assignment-check): Check claimed dimensions of unknown symbols make every given equation homogeneous; returns the first failure.
- [Chi square decomposition check](/tools/chi-square-decomposition-check): Check a claimed Pearson chi-square, its per-cell (O-E)^2/E terms and df exactly; returns the first wrong term.
- [Polynomial identity check](/tools/polynomial-identity-check): Check a polynomial identity over exact rationals by expanding both sides; report the lowest disagreeing coefficient.
- [Graph coloring check](/tools/graph-coloring-check): Check that a node colouring of an undirected graph is proper (and within k colours); returns the first conflict.
- [Maximum flow certificate check](/tools/maximum-flow-certificate-check): Check a claimed max flow with a min-cut certificate or residual search; reports the first failure or augmenting path.
