lab-report
Skill1 starsChanged 31 days agoApache-2.0View on GitHub
面向理工科实验报告的结构化写作与数据处理:用 uncertainties 做误差传递、scipy curve_fit 拟合、matplotlib 画误差棒图,并规范有效数字与误差分析。当用户写物理/化学/电子/材料等实验报告、处理实验数据、做误差分析或曲线拟合时使用。
4 other projects use a version of this.
Adopted by
Most recently taken up by
- id-andyyy/LabAItheir own version, first seen Nov 8, 2026
- Wasif-ZA/metatroopertheir own version, first seen Nov 8, 2026
- adeahejshshsh/coldbrew-dshtheir own version, first seen Nov 1, 2026
- ata-akhunzhanov/hypolabtheir own version, first seen Apr 11, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- adeahejshshsh/coldbrew-dsh★ 12same name
- id-andyyy/LabAI★ 3same name
- ata-akhunzhanov/hypolab★ 1same name
- Wasif-ZA/metatrooper★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- academic-figuresSkill
- citation-managementSkill
- cn-literatureSkill
- cpp-workflowSkill
- data-analysisSkill
- design-materialSkill
- doc-batchSkill
- email-calendarSkill
- math-modelingSkill
- meeting-notesSkill
- office-docsSkill
- paper-researchSkill
- python-workflowSkill
- study-tutorSkill
- thesis-formatSkill
- web-researchSkill
The file
Files
理工科实验报告
0. ⚠️ 学术诚信底线(先写死)
- 实验数据必须来自真实测量,绝不允许编造、修改、平滑或挑选数据去凑一个好看的结果
- 如果学生没做实验,AI 只能帮分析方法、整理报告结构和公式,不得生成任何实验数据
- 任何「让数据好看一点」的请求都要拒绝并说明原因
1. 报告结构(按此组织)
- 实验目的:明确要验证 / 测量什么
- 实验原理:相关公式、定律,注明符号含义
- 器材:仪器名称、型号、精度(精度直接影响误差分析)
- 步骤:可复现的操作流程
- 原始数据:表格记录,保留测量原始精度,先不修约
- 数据处理:由原始数据算出结果,写清公式与中间量
- 误差分析:分类讨论(见第 5 节)
- 结论与讨论:结论对应目的;讨论偏差来源与改进方向
2. 误差传递:uncertainties
pip 包名 uncertainties,用 ufloat 构造带不确定度的量,运算时自动传播误差。
from uncertainties import ufloat
from uncertainties import umath
# ufloat(标称值, 标准不确定度)
l = ufloat(1.234, 0.005) # 长度 (m)
t = ufloat(2.50, 0.02) # 时间 (s)
v = l / t # 相除,不确定度自动传播
print(v) # 形如 0.4936+/-0.0045
print(f"{v:.3uS}") # 按有效数字格式化输出
# 三角函数 / 对数 / 开方等:用 umath,而非 math
w = 2 * umath.pi # ufloat 参与时用 umath要点:
- 用
ufloat后普通 + - * / 会自动传播,不用手写误差公式 - 三角函数 / 对数 / 开方用
umath,直接math不支持 ufloat {x:.3uS}按有效数字输出(u管不确定度、S是科学记数样式),具体格式串可再微调
3. 曲线拟合:scipy curve_fit
import numpy as np
from scipy.optimize import curve_fit
def model(x, a, b):
return a * np.exp(-b * x)
x = np.array([...]); y = np.array([...])
popt, pcov = curve_fit(model, x, y, p0=[1.0, 0.5])
# 参数误差 = 协方差矩阵对角线的平方根
perr = np.sqrt(np.diag(pcov))
for name, v, e in zip(["a", "b"], popt, perr):
print(f"{name} = {v:.4g} ± {e:.1g}")要点:
pcov是协方差矩阵,参数标准误差 =np.sqrt(np.diag(pcov))p0给初始猜测,能显著提高收敛成功率,尤其指数 / 多参数模型- 有已知 y 误差时传
sigma=yerr, absolute_sigma=True,误差估计才更可信 - 拟合优度可算
R²,或看残差图,别只看参数值
4. 画误差棒图:matplotlib errorbar
import matplotlib.pyplot as plt
plt.errorbar(x, y, yerr=dy, xerr=dx, fmt="o", capsize=3, label="测量值")
plt.xlabel("电压 $U$ / V") # 名称带单位;量符号斜体
plt.ylabel("电流 $I$ / A")
plt.legend(); plt.grid(True)
plt.savefig("plot.png", dpi=150, bbox_inches="tight")要点(图表规范):
- 坐标轴名称必须带单位:写成「物理量 / 单位」,如
电压 U / V - 量符号斜体(用
$U$),单位正体 - 图注(caption)放在图下方,编号并写清是什么图
- 数据点用散点 + 误差棒,拟合曲线用
plt.plot叠加,用图例区分
5. 有效数字与修约
- 不确定度取 1~2 位有效数字(一般取 2 位,首位是 1 时可保留 2 位)
- 测量值末位与不确定度末位对齐:如
(1.234 ± 0.005) m,不能写1.2345 ± 0.005 - 中间计算多留 1~2 位,最后一步再修约,避免累积误差
- 修约用「四舍六入五成双」(银行家舍入),不是简单四舍五入
- 加减法看绝对误差末位对齐;乘除法看相对误差(有效数字位数)
6. 误差来源分析(分类)
| 类型 | 特征 | 识别与处理 |
| 系统误差 | 单向、可重复,多次测量仍偏同一方向 | 来自仪器零点、方法/公式近似、环境影响;用校准、改进方法、加修正值减小 |
| 随机误差 | 时大时小、正负都有,服从统计分布 | 来自读数波动、环境起伏;用多次测量取平均减小,可用标准差估计 |
| 粗大误差 | 个别值明显偏离 | 来自读错、记错、操作失误;用 3σ 准则 / 格拉布斯准则判断后剔除,并说明依据 |
写报告要具体点名本实验可能的误差来源,而不是套话罗列。
7. 常见坑自检
- ⚠️ 数据来自真实测量,没有编造或修饰
- 原始数据表保留了原始精度
- 误差传递用了
uncertainties,没有手推错公式 - 拟合参数误差取自
np.sqrt(np.diag(pcov)) - 有效数字修约正确,测量值与不确定度末位对齐
- 图表坐标轴带单位、量符号斜体、图注在图下
- 误差分析分类且具体,不是空泛罗列
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

