forked from EduCraft/curriculum-project-hub
feat(cph): implement nested outline manifest and batch/combined export
ADR-0029 — nested outline manifest, supersedes ADR-0008's flat [[parts]]:
- cph-model: recursive loader over manifest.toml containers / element.toml
leaves; Lesson.parts (pure elements, DFS order) + Lesson.outline (elements
interleaved with section headings at their DFS-open position); rejects
ambiguous/incomplete folders and root-vs-container table misplacement
- cph-diag: new DiagCode::ManifestMalformed for carrier-document structure
errors (discharges an existing TODO)
- cph-typst: augmented manifest now serializes the outline (element/section
entries) instead of a flat parts array
- render/lib.typ: render-lesson renders section headings at their depth
- examples/TH-141 migrated to 5 nested section containers + 3 root segments,
byte-identical element order; smoke-verified via cph check/build + pdftotext
ADR-0030 — batch & combined export, extends ADR-0009/0011:
- cph build with no --target batches every declared target (repeatable
--target for an explicit subset); any target failure => non-zero exit,
per-target ledger, independent per-target execution
- cph-model: bundle.toml loader (directory + [info]/[targets.*]/ordered
lessons with per-lesson target overrides)
- cph-typst: augmented bundle manifest (path-prefixed member outlines),
Engine::{compile_check_bundle,build_bundle_pdf}
- render/lib.typ: render-bundle assembles member lessons under per-lesson
headings, depth-shifts their own section headings, resets example/lemma
counters at each lesson boundary by default
- cph-cli: `cph bundle <path> --target <name>` subcommand, same batching
contract as `cph build`
- new bundle fixtures/tests (cph-model unit + cph-typst through-template PDF
compile), smoke-verified via a real 2-lesson merged PDF
Verification: cargo fmt/clippy/test clean across the workspace (68 tests);
real cph check/build/bundle runs against TH-141 and a bundle fixture, PDF
content inspected via pdftotext.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
kind = "example"
|
||||
source = "41 届物理竞赛复赛第三大题(1)"
|
||||
@@ -0,0 +1,7 @@
|
||||
某油井内未抽出的石油温度 $100 thin "℃"$,密度为水的 $80%$、比热容为水的 $60%$,记此为参考态。混合物表面张力系数
|
||||
|
||||
$ sigma \/ (10^(-3) thin "N/m") = 60 + 0.065 thin T \/ "K" - 24.0 thin p \/ "bar" + 3.15 thin (p \/ "bar")^2 . $
|
||||
|
||||
参考态下 $p$ 与 $T$ 成正比,比例系数为等容压强系数 $beta = 7.28 times 10^(-3) thin "bar/K"$。
|
||||
|
||||
某区域原本充满参考态石油,抽出一半的同时等体积注入水,混合后总体积等于两者之和,抽注过程绝热。问为使混合物 $sigma$ 最小,注入水的温度应为多少 ℃。
|
||||
@@ -0,0 +1,27 @@
|
||||
参考态满足 $p = beta T$。混合过程总体积不变,仍属等容过程,故混合后亦满足 $p = beta T$。即整个过程始终有 $p = beta T$。
|
||||
|
||||
代入 $sigma(T, p)$,令 $tau equiv T \/ "K"$,得 $sigma$ 退化为 $tau$ 的单变量函数
|
||||
|
||||
$ sigma(tau) \/ (10^(-3) "N/m") = 60 + 0.065 tau - 24.0 thin (beta tau) + 3.15 thin (beta tau)^2 . $
|
||||
|
||||
代入 $beta = 7.28 times 10^(-3)$,注意 $24.0 times 7.28 times 10^(-3) = 0.1747$、$3.15 times (7.28 times 10^(-3))^2 = 1.670 times 10^(-4)$:
|
||||
|
||||
$ sigma(tau) \/ (10^(-3) "N/m") = 60 - 0.1097 tau + 1.670 times 10^(-4) tau^2 . $
|
||||
|
||||
对 $tau$ 求导取零:
|
||||
|
||||
$ tau_("mix") = 0.1097 / (2 times 1.670 times 10^(-4)) approx 328.4 , $
|
||||
|
||||
即 $T_("mix") approx 328.4 thin "K" approx 55.3 thin "℃"$。
|
||||
|
||||
混合的热平衡。设参考态石油温度 $T_0 = 373.15 thin "K"$、密度 $rho_0 = 0.8 rho_w$、比热容 $c_0 = 0.6 c_w$;注入水温度 $T_w$、密度 $rho_w$、比热容 $c_w$。等体积混合且绝热给出
|
||||
|
||||
$ rho_0 c_0 (T_0 - T_("mix")) = rho_w c_w (T_("mix") - T_w) , $
|
||||
|
||||
代入 $rho_0 c_0 = 0.48 thin rho_w c_w$,
|
||||
|
||||
$ 0.48 (T_0 - T_("mix")) = T_("mix") - T_w , $
|
||||
|
||||
解出
|
||||
|
||||
$ T_w = T_("mix") - 0.48 (T_0 - T_("mix")) approx 306.9 thin "K" approx 33.7 thin "℃" . $
|
||||
@@ -0,0 +1 @@
|
||||
kind = "lemma"
|
||||
@@ -0,0 +1,5 @@
|
||||
设液体的摩尔体积为 $V_m$、临界温度为 $T_c$,则其表面张力随温度的标度律为
|
||||
|
||||
$ sigma thin V_m^(2\/3) = k (T_c - T) , $ <Eötvös规则>
|
||||
|
||||
其中 $k approx 2.1 times 10^(-7) thin "J" dot "K"^(-1) dot "mol"^(-2\/3)$ 是一个对所有液体共用的普适常数,称为 Eötvös 常数。
|
||||
@@ -0,0 +1 @@
|
||||
kind = "lemma"
|
||||
@@ -0,0 +1,5 @@
|
||||
Eötvös 规则 @Eötvös规则 在 $T arrow.r T_c$ 附近预言 $sigma prop (T_c - T)$ 线性趋零。实验观测显示趋零行为更接近幂律:
|
||||
|
||||
$ sigma = sigma_0 (1 - T \/ T_c)^n , quad n approx 11 \/ 9 . $ <GK规则>
|
||||
|
||||
@GK规则 在临界点附近比 @Eötvös规则 更准确。
|
||||
@@ -0,0 +1 @@
|
||||
kind = "lemma"
|
||||
@@ -0,0 +1,11 @@
|
||||
$sigma$ 的热力学定义是恒温恒容下单位面积自由能:$sigma = (partial F \/ partial A)_(T, V)$。自由能微分
|
||||
|
||||
$ dif F = - S dif T - p dif V + sigma dif A , $
|
||||
|
||||
给出 Maxwell 关系
|
||||
|
||||
$ ((partial sigma) / (partial T))_(A, V) = - ((partial S) / (partial A))_(T, V) = - s_s , $
|
||||
|
||||
其中 $s_s equiv (partial S \/ partial A)_(T, V)$。代回即 @表面熵。
|
||||
|
||||
液面分子被约束在准二维层内,可达微观态数比体相分子少,故 $s_s > 0$,进而 $dif sigma \/ dif T < 0$。
|
||||
@@ -0,0 +1,5 @@
|
||||
设单位面积表面熵为 $s_s$,则表面张力对温度的变化率满足
|
||||
|
||||
$ (dif sigma) / (dif T) = - s_s . $ <表面熵>
|
||||
|
||||
物理上 $s_s > 0$,故 $dif sigma \/ dif T < 0$,$sigma$ 随温度升高单调下降。
|
||||
@@ -0,0 +1,34 @@
|
||||
[group]
|
||||
title = "σTp 态函数建模"
|
||||
|
||||
[[children]]
|
||||
kind = "segment"
|
||||
path = "segments/σT建模导言"
|
||||
|
||||
[[children]]
|
||||
kind = "segment"
|
||||
path = "segments/微观派Lm下降"
|
||||
|
||||
[[children]]
|
||||
kind = "lemma"
|
||||
path = "lemmas/Eötvös规则"
|
||||
|
||||
[[children]]
|
||||
kind = "lemma"
|
||||
path = "lemmas/Guggenheim-Katayama改良"
|
||||
|
||||
[[children]]
|
||||
kind = "lemma"
|
||||
path = "lemmas/表面熵热力学关系"
|
||||
|
||||
[[children]]
|
||||
kind = "segment"
|
||||
path = "segments/σTp态函数导言"
|
||||
|
||||
[[children]]
|
||||
kind = "segment"
|
||||
path = "segments/σ作为态函数的图像"
|
||||
|
||||
[[children]]
|
||||
kind = "example"
|
||||
path = "examples/41届复赛三-1-混注石油"
|
||||
@@ -0,0 +1 @@
|
||||
kind = "segment"
|
||||
@@ -0,0 +1,3 @@
|
||||
= $sigma(T, p)$ 态函数与工程应用
|
||||
|
||||
以上所有模型都从微观或唯象规律推出 $sigma$。在工程实际中,$sigma$ 常被直接当作状态变量 $(T, p, "组分")$ 的态函数处理,由实验数据拟合给出。本节给出一道典型的工程应用题:把 $sigma(T, p)$ 当作给定的多项式态函数,用它解一个混合优化问题。
|
||||
@@ -0,0 +1 @@
|
||||
kind = "segment"
|
||||
@@ -0,0 +1,3 @@
|
||||
= $sigma(T)$ 的建模
|
||||
|
||||
以上讨论都默认温度固定。但 $sigma$ 随温度变化的图像是物理学的常识——温度升高时分子热运动加剧,表面层的亏损能下降,$sigma$ 随之下降,在临界点处趋零。本节给出 $sigma(T)$ 的几条关系:从缺键模型直接读出的 $L_m(T)$ 单调下降图像、唯象的 Eötvös 规则及其幂律修正、以及把 $sigma$ 升级为自由能的热力学关系 $dif sigma \/ dif T = - s_s$。
|
||||
@@ -0,0 +1 @@
|
||||
kind = "segment"
|
||||
@@ -0,0 +1,3 @@
|
||||
$sigma$ 是温度、压强、组分的态函数。在工程实际中,对某一类流体(如石油、混合液烃、电池电解液)做大量实验测量后用多项式拟合 $sigma(T, p)$ 给出经验公式,并直接代入应用。这种"输入最多、假设最少"的建模方式与前面从分子层面推出 $sigma$ 的方式互不冲突,是同一物理量在不同抽象层级的两种表达。
|
||||
|
||||
下题给出一道把 $sigma(T, p)$ 当作给定的多项式态函数、求工程优化条件的真实问题。题中所有外加参数都是给定的——本题考查的是把态函数代入混合过程后如何利用其变量关系简化为单变量优化。
|
||||
@@ -0,0 +1 @@
|
||||
kind = "segment"
|
||||
@@ -0,0 +1 @@
|
||||
从缺键模型 @缺键一般式 看,$sigma$ 对 $T$ 的依赖完全由 $L_m(T)$ 携带——另几个量 $rho$、$mu$、$N_A$ 与温度关系微弱,可视为常数。摩尔汽化热 $L_m$ 随 $T$ 升高单调下降:分子热运动加剧,平均键合能减弱,把分子从液体里拉出来所需的能量变小。临界点处 $L_m arrow.r 0$,故由 @缺键一般式 有 $sigma arrow.r 0$。这一行为是微观模型内禀给出的,不依赖任何外加假设。
|
||||
Reference in New Issue
Block a user