科研 Skill
测量不确定度分析
measurement-uncertainty-propagation
Builds a GUM-style measurement uncertainty budget from Type A/B evaluation, RSS combination, and error propagation to a derived result. Use when a reported value needs a defensible plus-or-minus.
SKILL.md
Measurement Uncertainty Propagation
Builds an uncertainty budget for an experimental result, following the structure of the ISO GUM (Guide to the Expression of Uncertainty in Measurement): identify every input quantity's uncertainty source, evaluate it as Type A (statistical, from repeated readings) or Type B (from a spec sheet, calibration certificate, or judgment), combine them, and propagate through to a derived result with partial derivatives or Monte Carlo. Use this whenever a reported number needs a defensible "+/-", not just the number itself.
Purpose
- Turn repeated readings into a Type A standard uncertainty (standard deviation of the mean) with the right degrees of freedom.
- Turn an instrument spec (accuracy class, resolution, calibration certificate) into a Type B standard uncertainty with the correct assumed distribution (rectangular, triangular, or normal) and divisor.
- Combine multiple uncertainty components for one input quantity (RSS, or correlated with a covariance term when components share a cause, e.g. the same calibration).
- Propagate input uncertainties through a derived quantity (e.g. efficiency from measured flow, head and power) via the first-order Taylor/error-propagation formula, cross-checked with a Monte Carlo sample when the function is strongly nonlinear or the inputs are not independent.
- Report an expanded uncertainty U = k*u_c at a stated coverage (k=2 for ~95% under a normal-ish combined distribution is the common engineering default).
Prerequisites
numpy and scipy (pip install numpy scipy). For each input quantity: either a set of
repeated readings (Type A) or a stated tolerance/accuracy with its source and assumed
distribution (Type B). For propagation: an explicit formula for the derived quantity in
terms of the input quantities (the script differentiates it numerically; it does not
need or use a symbolic formula string evaluated unsafely — see Workflow step 4).
Workflow
-
List every input quantity and how it enters the result. Write the measurement equation explicitly (e.g.
eta = (rho*g*Q*H) / P_shaft). An uncertainty analysis without an explicit equation is not reproducible. -
Type A evaluation (repeated readings):
python scripts/uncertainty.py type-a --readings readings.csv --col valuereports the mean, sample standard deviation, standard uncertainty of the mean (s / sqrt(n)), and degrees of freedom (n-1). Flagn < 10as a high-uncertainty-on-the-uncertainty case (the Student-t correction in step 6 matters most here). -
Type B evaluation (spec/calibration):
python scripts/uncertainty.py type-b --half-width 0.05 --distribution rectangularconverts a stated +/- half-width to a standard uncertainty (half_width / sqrt(3)for rectangular,/sqrt(6)for triangular,/kfor a normal distribution with stated coverage factor k). Always record the source of the half-width (datasheet page, cal certificate number). -
Combine components for one input (if more than one source applies to the same quantity, e.g. calibration + resolution + drift):
python scripts/uncertainty.py combine --components 0.02,0.01,0.015applies RSS combination (components assumed independent; use--correlationto supply a correlation matrix when they are not). -
Propagate to the derived result:
python scripts/uncertainty.py propagate --inputs inputs.csv --expr-module my_model.py --func efficiencynumerically differentiates the named Python function (imported from a file the user provides and controls — never a string evaluated witheval()) with central finite differences at each input's nominal value, forms the sensitivity coefficientsc_i = dF/dx_i, and combinesu_c(y) = sqrt(sum((c_i*u_i)^2))for independent inputs (add covariance terms via--correlationotherwise). -
Cross-check with Monte Carlo when inputs are strongly correlated, the function is markedly nonlinear over the uncertainty range, or any input distribution is far from normal:
python scripts/uncertainty.py monte-carlo --inputs inputs.csv --expr-module my_model.py --func efficiency --n 100000samples each input from its stated distribution and reports the empirical standard deviation and percentile interval of the output; a large disagreement with step 5's linear result is itself a finding (it means the first-order approximation is not valid here). -
Expand and report:
python scripts/uncertainty.py expand --uc 0.0083 --k 2reportsU = k*u_c. Use k=2 (≈95% coverage for an approximately normal combined distribution) unless the user needs a different coverage probability, in which case use the Student-t value for the effective degrees of freedom (Welch-Satterthwaite,scripts/uncertainty.py welch-satterthwaite) rather than assuming normality when a dominant component has few degrees of freedom. -
Report: the measurement equation, a table of every input with its value, uncertainty, type (A/B), distribution and source, the sensitivity coefficients, the combined standard uncertainty, the expanded uncertainty with its coverage factor and approximate confidence level, and the single largest contributor (useful for deciding where to invest in a better instrument).
Limitations
- The linear (first-order Taylor) propagation formula assumes the function is approximately linear over the range of the input uncertainties; it under- or over-estimates the output uncertainty for strongly nonlinear functions or large relative uncertainties — always sanity-check against the Monte Carlo result (step 6) before trusting the linear number alone for a critical result.
- Treats unlisted correlation as zero by default; shared calibration standards, shared
reference instruments, or simultaneous environmental effects (e.g. one temperature
sensor used to correct several readings) create real correlation that must be supplied
explicitly via
--correlation, or the combined uncertainty will be wrong (usually understated). - Type B "distribution" choices (rectangular/triangular/normal) are standard GUM conventions, not a universal law; use the distribution the source actually implies (e.g. a stated calibration uncertainty with a coverage factor is normal-like, a stated tolerance band with no further information is conventionally rectangular).
- Does not handle uncertainty in a quantity with intrinsically asymmetric bounds (e.g. a one-sided detection limit) — flag these to the user rather than forcing a symmetric U.
- This is a calculation aid, not a substitute for a lab's or standard's own uncertainty procedure (e.g. ISO/IEC 17025 for an accredited lab); follow the governing procedure when one applies.
Related skills
research-data-analysis (the broader experimental-design and validation workflow this
uncertainty budget feeds into), sympy-symbolic (deriving the measurement equation or
its analytic partial derivatives symbolically before numeric propagation), pint-units
(keeping units consistent across the inputs before this skill combines them),
engineering-calc-report (presenting the final uncertainty budget in a formal report).
Quality checks
python scripts/uncertainty.py --selftestchecks the Type B rectangular/triangular divisors, the RSS combination formula, and the linear-propagation sensitivity coefficients against a hand-solvable linear case (y = ax1 + bx2); run it after any edit to the script.- Every reported uncertainty number is accompanied by its type (A/B), source, assumed distribution, and degrees of freedom (where relevant) — a bare "+/- X" without this is treated as incomplete.
- When step 5 (linear) and step 6 (Monte Carlo) disagree by more than about 10% on the combined uncertainty, the report says so explicitly rather than picking one silently.
示例提示词
帮我把这组流量和压力读数的不确定度传递到效率计算结果上。
所属插件
安装该插件会一并获得同领域的 17 个 Skill / MCP。
同插件的其他科研 Skill
- 控制系统分析与PID设计Models, analyzes, and designs feedback control systems with python-control and scipy.signal: transfer functions, Bode plots, root locus, and PID tuning. Use for SISO control design.
- FEniCSx有限元分析Runs FEA with FEniCSx or scikit-fem: mesh generation, boundary conditions, linear elasticity, heat conduction, and result visualization. Use for custom open-source finite-element workflows.
- 热流体系统研究方法指导Applies source-aware mechanical-engineering judgment to research tasks spanning thermal-fluids, turbomachinery, experiments, and writing. Use for broad mechanical-engineering research support.
- 可靠性工程分析Covers reliability engineering methods: Weibull analysis, fault tree analysis, FMEA, reliability block diagrams, and accelerated life testing. Use for failure-rate or reliability-prediction tasks.
- 工程实验数据分析设计Designs and analyzes engineering experiments or simulations with baseline cases, hypothesis-driven DOE, and uncertainty quantification. Use for CFD, lab data, or parameter-study analysis.
- 科研导师式反馈Gives constructive, evidence-based mentoring feedback on student manuscripts, proposals, code, and figures without impersonating an advisor. Use for advisor-style review of student work.
- 研究计划书撰写Develops research proposals with solicitation alignment, reviewer-focused logic, evidence-bounded preliminary results, and milestones. Use for federal, foundation, or internal research proposals.
- 科研示意图制作Creates publication-quality, editable scientific and engineering schematics with explicit physical meaning and clear labels. Use for experimental-facility diagrams, mechanisms, or graphical abstracts.
- 科研汇报幻灯片设计Designs clean, graphics-first technical presentations and posters with logical progression and visual hierarchy. Use for research talks, conference slides, or defenses.
- 科研写作与文献综述Writes and revises research narratives, literature reviews, manuscript sections, and figure discussions with proper citations. Use for drafting or revising technical manuscript text.
- 审稿人作者迭代改稿Runs an iterative manuscript-improvement loop where a reviewer agent critiques, an author agent revises, and a verifier checks each revision. Use for simulated peer review or rebuttal prep.
- ROS2机器人开发Covers ROS2 robotics development with rclpy: nodes, topics, services, actions, tf2 transforms, and Nav2 navigation. Use when building or debugging a ROS2 node or navigation stack.
- 数字信号处理Covers digital signal processing with scipy.signal: filter design, spectral analysis, peak detection, and PSD estimation. Use for vibration, biomedical, or time-series signal tasks.
- SimPy离散事件仿真Builds discrete-event simulations with SimPy: M/M/c queues, manufacturing lines, resource contention, and confidence intervals via replications. Use for queueing or throughput analysis.
- 热流体系统分析指导Analyzes thermal-fluid systems, experiments, CFD, and correlations with explicit assumptions, validity limits, and uncertainty. Use for heat transfer or thermal-management analysis.
- 机械振动与故障诊断Analyzes mechanical vibration: SDOF/MDOF natural frequencies, resonance checks, and FFT-based diagnosis of rotating-machinery faults such as imbalance or bearing defects. Use for vibration diagnosis.
常见问题
测量不确定度分析能做什么?
Builds a GUM-style measurement uncertainty budget from Type A/B evaluation, RSS combination, and error propagation to a derived result. Use when a reported value needs a defensible plus-or-minus。
如何安装测量不确定度分析?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「测量不确定度分析」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
测量不确定度分析需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
测量不确定度分析经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。