Class UncertaintyBudget<Q extends Quantity<Q>>

java.lang.Object
org.episteme.core.measure.metrology.UncertaintyBudget<Q>

public class UncertaintyBudget<Q extends Quantity<Q>> extends Object
An uncertainty budget following ISO/IEC Guide 98-3 (GUM) methodology.

Combines multiple uncertainty sources (Type A and Type B) to compute the combined standard uncertainty and expanded uncertainty.

Example Usage:

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • UncertaintyBudget

      public UncertaintyBudget()
  • Method Details

    • addSource

      public void addSource(String name, Quantity<Q> uncertainty, UncertaintyBudget.UncertaintyType type)
      Adds an uncertainty source to the budget.
      Parameters:
      name - the source name (e.g., "Repeatability", "Calibration")
      uncertainty - the standard uncertainty contribution
      type - the uncertainty type (A or B)
    • addSource

      public void addSource(String name, Quantity<Q> uncertainty, UncertaintyBudget.UncertaintyType type, Real sensitivityCoefficient)
      Adds an uncertainty source with sensitivity coefficient.

      The sensitivity coefficient c_i represents ∂f/∂x_i, the partial derivative of the measurement function with respect to the input.

      Parameters:
      name - the source name
      uncertainty - the standard uncertainty
      type - the uncertainty type
      sensitivityCoefficient - the sensitivity coefficient c_i
    • getCombinedUncertainty

      public Quantity<Q> getCombinedUncertainty()
      Returns the combined standard uncertainty.

      Combined uncertainty u_c = √(Σ u_i²), where u_i are individual standard uncertainties (possibly multiplied by sensitivity coefficients).

      Returns:
      the combined standard uncertainty
    • getExpandedUncertainty

      public Quantity<Q> getExpandedUncertainty(double coverageFactor)
      Returns the expanded uncertainty.

      Expanded uncertainty U = k × u_c, where k is the coverage factor. Common values:

      • k = 2 for ~95% confidence
      • k = 3 for ~99.7% confidence
      Parameters:
      coverageFactor - the coverage factor k
      Returns:
      the expanded uncertainty
    • getSensitivityCoefficients

      public Map<String,Real> getSensitivityCoefficients()
      Returns the sensitivity coefficients for all sources.

      The sensitivity coefficient quantifies how much the output changes with respect to each input variable.

      Returns:
      a map of source names to sensitivity coefficients
    • getContributions

      public Map<String,Double> getContributions()
      Returns the contribution of each source to the combined uncertainty.

      Contribution percentage = (c_i × u_i)² / u_c² × 100%

      Returns:
      a map of source names to percentage contributions
    • generateReport

      public String generateReport()
      Generates a formatted uncertainty budget report.
      Returns:
      the formatted report