{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/engineering.uncertainty.propagate.input.json",
  "title": "Uncertainty propagation — input",
  "type": "object",
  "oneOf": [
    {
      "title": "sum",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "a",
        "ua",
        "b",
        "ub"
      ],
      "properties": {
        "mode": {
          "const": "sum"
        },
        "a": {
          "type": "number",
          "description": "First value"
        },
        "ua": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of a"
        },
        "b": {
          "type": "number",
          "description": "Second value"
        },
        "ub": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of b"
        },
        "unit_a": {
          "type": "string",
          "description": "Optional unit label for a (e.g. V)"
        },
        "unit_b": {
          "type": "string",
          "description": "Optional unit label for b (e.g. V)"
        },
        "rho": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "Optional correlation coefficient between a and b (−1…1; default 0)"
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "nua": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for a (binary); null = ν→∞; use with nub"
        },
        "nub": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for b (binary); null = ν→∞; use with nua"
        },
        "type_a": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "type_b": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "difference",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "a",
        "ua",
        "b",
        "ub"
      ],
      "properties": {
        "mode": {
          "const": "difference"
        },
        "a": {
          "type": "number",
          "description": "First value"
        },
        "ua": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of a"
        },
        "b": {
          "type": "number",
          "description": "Second value"
        },
        "ub": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of b"
        },
        "unit_a": {
          "type": "string",
          "description": "Optional unit label for a (e.g. V)"
        },
        "unit_b": {
          "type": "string",
          "description": "Optional unit label for b (e.g. V)"
        },
        "rho": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "Optional correlation coefficient between a and b (−1…1; default 0)"
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "nua": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for a (binary); null = ν→∞; use with nub"
        },
        "nub": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for b (binary); null = ν→∞; use with nua"
        },
        "type_a": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "type_b": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "product",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "a",
        "ua",
        "b",
        "ub"
      ],
      "properties": {
        "mode": {
          "const": "product"
        },
        "a": {
          "type": "number",
          "description": "First value (zero allowed)"
        },
        "ua": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of a"
        },
        "b": {
          "type": "number",
          "description": "Second value (zero allowed)"
        },
        "ub": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of b"
        },
        "unit_a": {
          "type": "string",
          "description": "Optional unit label for a (e.g. V)"
        },
        "unit_b": {
          "type": "string",
          "description": "Optional unit label for b (e.g. V)"
        },
        "rho": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "Optional correlation coefficient between a and b (−1…1; default 0)"
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "nua": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for a (binary); null = ν→∞; use with nub"
        },
        "nub": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for b (binary); null = ν→∞; use with nua"
        },
        "type_a": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "type_b": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "quotient",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "a",
        "ua",
        "b",
        "ub"
      ],
      "properties": {
        "mode": {
          "const": "quotient"
        },
        "a": {
          "type": "number",
          "description": "Numerator (zero allowed)"
        },
        "ua": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of a"
        },
        "b": {
          "type": "number",
          "description": "Denominator (must be non-zero at runtime)"
        },
        "ub": {
          "type": "number",
          "minimum": 0,
          "description": "Standard uncertainty of b"
        },
        "unit_a": {
          "type": "string",
          "description": "Optional unit label for a (e.g. V)"
        },
        "unit_b": {
          "type": "string",
          "description": "Optional unit label for b (e.g. V)"
        },
        "rho": {
          "type": "number",
          "minimum": -1,
          "maximum": 1,
          "description": "Optional correlation coefficient between a and b (−1…1; default 0)"
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "nua": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for a (binary); null = ν→∞; use with nub"
        },
        "nub": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Optional ν for b (binary); null = ν→∞; use with nua"
        },
        "type_a": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "type_b": {
          "type": "string",
          "enum": [
            "A",
            "B"
          ]
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "sensitivity",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "coefficients",
        "uncertainties"
      ],
      "properties": {
        "mode": {
          "const": "sensitivity"
        },
        "coefficients": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "number"
          },
          "description": "Sensitivity coefficients ∂f/∂x_i (same length as uncertainties)"
        },
        "uncertainties": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "number",
            "minimum": 0
          },
          "description": "Standard uncertainties u(x_i)"
        },
        "y": {
          "type": "number",
          "description": "Optional result value for relative uncertainty"
        },
        "unit": {
          "type": "string",
          "description": "Optional unit label for y / u_c"
        },
        "correlations": {
          "type": "array",
          "description": "Optional correlation pairs for sensitivity: [{i,j,rho}] 0-based indices",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "i",
              "j",
              "rho"
            ],
            "properties": {
              "i": {
                "oneOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ],
                "description": "0-based index or component name"
              },
              "j": {
                "oneOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ],
                "description": "0-based index or component name"
              },
              "rho": {
                "type": "number",
                "minimum": -1,
                "maximum": 1
              }
            }
          }
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "dof": {
          "type": "array",
          "description": "Optional degrees of freedom ν_i (sensitivity/rss); null/Infinity → ν→∞",
          "items": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "types": {
          "type": "array",
          "description": "Optional Type A/B labels (metadata)",
          "items": {
            "type": "string",
            "enum": [
              "A",
              "B"
            ]
          }
        },
        "labels": {
          "type": "array",
          "description": "Optional component labels",
          "items": {
            "type": "string"
          }
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "budget",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "components"
      ],
      "properties": {
        "mode": {
          "const": "budget"
        },
        "components": {
          "type": "array",
          "minItems": 1,
          "description": "Budget components: [{name?,u,c?,type?,nu?,distribution?,x?}]",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "u"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "u": {
                "type": "number",
                "minimum": 0,
                "description": "Standard uncertainty (canonical)"
              },
              "c": {
                "type": "number",
                "description": "Sensitivity ∂f/∂x (default 1)"
              },
              "type": {
                "type": "string",
                "enum": [
                  "A",
                  "B"
                ]
              },
              "nu": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                ],
                "description": "Degrees of freedom; null = ν→∞"
              },
              "distribution": {
                "type": "string"
              },
              "x": {
                "type": "number",
                "description": "Optional nominal value for y = Σ c·x"
              }
            }
          }
        },
        "correlations": {
          "type": "array",
          "description": "Optional correlation pairs with indices or component names",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "i",
              "j",
              "rho"
            ],
            "properties": {
              "i": {
                "oneOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ],
                "description": "0-based index or component name"
              },
              "j": {
                "oneOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ],
                "description": "0-based index or component name"
              },
              "rho": {
                "type": "number",
                "minimum": -1,
                "maximum": 1
              }
            }
          }
        },
        "y": {
          "type": "number",
          "description": "Optional result; else Σ cᵢ xᵢ when all x set"
        },
        "unit": {
          "type": "string"
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "rss",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "uncertainties"
      ],
      "properties": {
        "mode": {
          "const": "rss"
        },
        "uncertainties": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "number",
            "minimum": 0
          },
          "description": "Standard uncertainties to combine"
        },
        "y": {
          "type": "number",
          "description": "Optional result value for relative uncertainty"
        },
        "unit": {
          "type": "string",
          "description": "Optional unit label for y / u_c"
        },
        "k": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Optional coverage factor; when set, U = k·u_c"
        },
        "dof": {
          "type": "array",
          "description": "Optional degrees of freedom ν_i (sensitivity/rss); null/Infinity → ν→∞",
          "items": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "types": {
          "type": "array",
          "description": "Optional Type A/B labels (metadata)",
          "items": {
            "type": "string",
            "enum": [
              "A",
              "B"
            ]
          }
        },
        "labels": {
          "type": "array",
          "description": "Optional component labels",
          "items": {
            "type": "string"
          }
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "description": "Optional two-sided coverage probability (e.g. 0.95). When k omitted, sets k from Student-t(νeff) (ν→∞ → normal). Mutually exclusive with k."
        }
      }
    },
    {
      "title": "montecarlo",
      "description": "Monte Carlo: binary model (a,ua,b,ub) or budget components with x",
      "oneOf": [
        {
          "title": "binary",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "model",
            "a",
            "ua",
            "b",
            "ub"
          ],
          "properties": {
            "mode": {
              "const": "montecarlo"
            },
            "model": {
              "type": "string",
              "enum": [
                "sum",
                "difference",
                "product",
                "quotient"
              ],
              "description": "Binary measurement model"
            },
            "a": {
              "type": "number"
            },
            "ua": {
              "type": "number",
              "minimum": 0
            },
            "b": {
              "type": "number"
            },
            "ub": {
              "type": "number",
              "minimum": 0
            },
            "N": {
              "type": "integer",
              "minimum": 100,
              "maximum": 100000,
              "description": "Monte Carlo trials (default 10000)"
            },
            "seed": {
              "type": "integer",
              "description": "PRNG seed (default 1)"
            },
            "distribution": {
              "type": "string",
              "enum": [
                "normal",
                "rectangular"
              ],
              "description": "Default draw distribution for MC"
            },
            "distribution_a": {
              "type": "string",
              "enum": [
                "normal",
                "rectangular"
              ]
            },
            "distribution_b": {
              "type": "string",
              "enum": [
                "normal",
                "rectangular"
              ]
            },
            "k": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "Optional coverage factor; when set, U = k·u_c"
            },
            "confidence": {
              "type": "number",
              "exclusiveMinimum": 0,
              "exclusiveMaximum": 1,
              "description": "Optional coverage probability (MC → percentile interval). Mutually exclusive with k."
            },
            "unit": {
              "type": "string"
            },
            "unit_a": {
              "type": "string"
            },
            "unit_b": {
              "type": "string"
            },
            "rho": {
              "type": "number",
              "minimum": -1,
              "maximum": 1,
              "description": "Optional correlation (binary MC; normal marginals only)"
            }
          }
        },
        {
          "title": "budget",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "components"
          ],
          "properties": {
            "mode": {
              "const": "montecarlo"
            },
            "components": {
              "type": "array",
              "minItems": 1,
              "description": "Named components with x (means) and u (std); used as MC multi-input model",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "u",
                  "x"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "u": {
                    "type": "number",
                    "minimum": 0
                  },
                  "c": {
                    "type": "number",
                    "description": "Sensitivity (default 1)"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "A",
                      "B"
                    ]
                  },
                  "nu": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    ]
                  },
                  "distribution": {
                    "type": "string",
                    "enum": [
                      "normal",
                      "rectangular"
                    ]
                  },
                  "x": {
                    "type": "number",
                    "description": "Nominal / mean value (required for MC)"
                  }
                }
              }
            },
            "correlations": {
              "type": "array",
              "description": "Optional correlation pairs (normal marginals only)",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "i",
                  "j",
                  "rho"
                ],
                "properties": {
                  "i": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "string",
                        "minLength": 1
                      }
                    ],
                    "description": "0-based index or component name"
                  },
                  "j": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "string",
                        "minLength": 1
                      }
                    ],
                    "description": "0-based index or component name"
                  },
                  "rho": {
                    "type": "number",
                    "minimum": -1,
                    "maximum": 1
                  }
                }
              }
            },
            "N": {
              "type": "integer",
              "minimum": 100,
              "maximum": 100000,
              "description": "Monte Carlo trials (default 10000)"
            },
            "seed": {
              "type": "integer",
              "description": "PRNG seed (default 1)"
            },
            "distribution": {
              "type": "string",
              "enum": [
                "normal",
                "rectangular"
              ],
              "description": "Default draw distribution for MC"
            },
            "k": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "Optional coverage factor; when set, U = k·u_c"
            },
            "confidence": {
              "type": "number",
              "exclusiveMinimum": 0,
              "exclusiveMaximum": 1,
              "description": "Optional coverage probability (MC → percentile interval). Mutually exclusive with k."
            },
            "unit": {
              "type": "string"
            }
          }
        }
      ]
    }
  ],
  "description": "Propagate standard uncertainties: GUM linear (binary/sensitivity/RSS/budget) or Monte Carlo (JCGM 101); optional correlations, contributions, νeff, Student-t/percentile coverage → U. (calculation_version 1.9.8)"
}
