ocs-calculators 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +36 -28
  3. package/README_EN.md +131 -23
  4. package/dist/bvalue/index.cjs +2 -2
  5. package/dist/bvalue/index.d.cts +1 -1
  6. package/dist/bvalue/index.d.ts +1 -1
  7. package/dist/bvalue/index.js +1 -1
  8. package/dist/{chunk-D5F5ES2R.js → chunk-2HYOBL6M.js} +8 -6
  9. package/dist/chunk-2HYOBL6M.js.map +1 -0
  10. package/dist/{chunk-IUENDAAJ.js → chunk-53ONNIVL.js} +9 -3
  11. package/dist/chunk-53ONNIVL.js.map +1 -0
  12. package/dist/{chunk-X25CXRVE.cjs → chunk-DHJGNVCI.cjs} +8 -6
  13. package/dist/chunk-DHJGNVCI.cjs.map +1 -0
  14. package/dist/{chunk-3GREMF76.js → chunk-DN6BVPCQ.js} +3 -4
  15. package/dist/chunk-DN6BVPCQ.js.map +1 -0
  16. package/dist/{chunk-IQR3SRCD.js → chunk-ES3AQ52A.js} +43 -26
  17. package/dist/chunk-ES3AQ52A.js.map +1 -0
  18. package/dist/{chunk-J2UXRMTU.cjs → chunk-FHPRIOTM.cjs} +24 -25
  19. package/dist/chunk-FHPRIOTM.cjs.map +1 -0
  20. package/dist/{chunk-MTAYG3U2.cjs → chunk-FRYBXJCM.cjs} +43 -26
  21. package/dist/chunk-FRYBXJCM.cjs.map +1 -0
  22. package/dist/{chunk-KOSC6EA3.js → chunk-G5ZI24PW.js} +3 -2
  23. package/dist/chunk-G5ZI24PW.js.map +1 -0
  24. package/dist/{chunk-RVP3IU2L.cjs → chunk-NSVETJYA.cjs} +9 -3
  25. package/dist/chunk-NSVETJYA.cjs.map +1 -0
  26. package/dist/{chunk-5Q6IASB2.cjs → chunk-TXFBPGHR.cjs} +3 -2
  27. package/dist/{chunk-5Q6IASB2.cjs.map → chunk-TXFBPGHR.cjs.map} +1 -1
  28. package/dist/{chunk-4UU7WA7N.cjs → chunk-VPW4T6YN.cjs} +7 -6
  29. package/dist/chunk-VPW4T6YN.cjs.map +1 -0
  30. package/dist/{chunk-UO2PHBC3.js → chunk-XQBTMD7W.js} +24 -25
  31. package/dist/chunk-XQBTMD7W.js.map +1 -0
  32. package/dist/{chunk-IFVYGNT3.js → chunk-XRSWKYS6.js} +7 -6
  33. package/dist/chunk-XRSWKYS6.js.map +1 -0
  34. package/dist/{chunk-HXALVJ4G.cjs → chunk-YGTESFOQ.cjs} +3 -4
  35. package/dist/chunk-YGTESFOQ.cjs.map +1 -0
  36. package/dist/copper/index.cjs +2 -2
  37. package/dist/copper/index.d.cts +24 -4
  38. package/dist/copper/index.d.ts +24 -4
  39. package/dist/copper/index.js +1 -1
  40. package/dist/cross-span/index.cjs +2 -2
  41. package/dist/cross-span/index.d.cts +4 -1
  42. package/dist/cross-span/index.d.ts +4 -1
  43. package/dist/cross-span/index.js +1 -1
  44. package/dist/curve-stagger/index.cjs +2 -2
  45. package/dist/curve-stagger/index.d.cts +6 -5
  46. package/dist/curve-stagger/index.d.ts +6 -5
  47. package/dist/curve-stagger/index.js +1 -1
  48. package/dist/dropper/index.cjs +2 -2
  49. package/dist/dropper/index.d.cts +21 -13
  50. package/dist/dropper/index.d.ts +21 -13
  51. package/dist/dropper/index.js +1 -1
  52. package/dist/index.cjs +11 -9
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.cts +3 -0
  55. package/dist/index.d.ts +3 -0
  56. package/dist/index.js +10 -8
  57. package/dist/index.js.map +1 -1
  58. package/dist/stroke/index.cjs +2 -2
  59. package/dist/stroke/index.js +1 -1
  60. package/dist/voltage-drop/index.cjs +2 -2
  61. package/dist/voltage-drop/index.d.cts +6 -0
  62. package/dist/voltage-drop/index.d.ts +6 -0
  63. package/dist/voltage-drop/index.js +1 -1
  64. package/package.json +1 -1
  65. package/dist/chunk-3GREMF76.js.map +0 -1
  66. package/dist/chunk-4UU7WA7N.cjs.map +0 -1
  67. package/dist/chunk-D5F5ES2R.js.map +0 -1
  68. package/dist/chunk-HXALVJ4G.cjs.map +0 -1
  69. package/dist/chunk-IFVYGNT3.js.map +0 -1
  70. package/dist/chunk-IQR3SRCD.js.map +0 -1
  71. package/dist/chunk-IUENDAAJ.js.map +0 -1
  72. package/dist/chunk-J2UXRMTU.cjs.map +0 -1
  73. package/dist/chunk-KOSC6EA3.js.map +0 -1
  74. package/dist/chunk-MTAYG3U2.cjs.map +0 -1
  75. package/dist/chunk-RVP3IU2L.cjs.map +0 -1
  76. package/dist/chunk-UO2PHBC3.js.map +0 -1
  77. package/dist/chunk-X25CXRVE.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,80 @@
3
3
  本文件格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
4
4
  版本号遵循[语义化版本](https://semver.org/lang/zh-CN/)。
5
5
 
6
+ ## [0.3.1] - 2026-09-20
7
+
8
+ ### 适配说明
9
+
10
+ 本版为适配 **TB/T 2809-2026《电气化铁路接触网 铜合金接触线》**(2026-09-01 实施)的数据与计算口径修正版本,与站点 itswe.com 全量对齐。
11
+
12
+ ### 修复
13
+
14
+ - **载流量双口径化(copper,对齐站点 2026 表5,修复批 E2)**:
15
+ `TB2809_WIRE_PARAMS` 六行 `ampacityIndoor150A` 主值切换为 TB/T 2809-2026
16
+ 表5 室内值——CTMH-120 430→**442**、CTMH-150 500→**524**、CTAH-120
17
+ 515→**509**、CTAH-150 620→**593**、CTS-120 515→**511**、CTS-150
18
+ 620→**590**;新增必填对照字段 `ampacityIndoor150A2017`(`WireParamEntry`
19
+ 同步新增、`wireLookup` 返回结果跟随),保留 2017 表5 同点位值
20
+ 430/500/515/620/515/620(既有线历史采购参照)。室外 `ampacityOutdoor150A`
21
+ 两版同值不动(560/650/680/785/680/790)。`src/data/tb2809-ampacity.ts`
22
+ 保留为 2017 全 9 材质历史参考表,头注注明口径关系。与站点同批对齐
23
+ (2026-09-19),测试期望改为双口径断言。
24
+ - **吊弦长度公式角色更正(dropper,修复批 D)**:旧实现把承力索/接触线弛度
25
+ 角色写反(简单模式 l=H−f_c、弹性模式 l=H−f_c+f_m)。正确口径(物理推导+
26
+ 站内 design/dropper-layout.wiki 双证):承力索下垂使吊弦变短、接触线(相对
27
+ 水平)下垂使吊弦变长——承力索弛度按总荷载 w=q_c+q_m 口径
28
+ f_m_max=w·L²/(8T_m),简单链形 l=H−f_m(x)、弹性链形 l=H−f_m(x)+f_c(x)
29
+ (f_c_max=q_c·L²/(8T_c))。`messenger` 参数改为两种悬挂类型均必填;
30
+ 回归锚点(H=1.4/Tc=13/qc=0.0135/Tm=15/qm=0.0105/L=60/d=6):
31
+ f_m_max=0.72、跨中简单 0.68、跨中弹性 1.14730769。与站点 calc-core.js
32
+ 及 /calculator/dropper/ 页面同批更正(2026-09-19)。
33
+ - **超高横移 δ 纳入综合偏移合成(curve-stagger,修复批 D)**:旧实现 δ 仅
34
+ 计算返回、不参与 e(原注释「δ 不参与合成」删除)。新口径
35
+ e_max=max(|ā+c−δ|, |ā−c+δ|)+p_w,与站点 calc-core.js 同批更正
36
+ (2026-09-19)。默认工况(δ=0.52264808)e_max 由 0.80142625 变为
37
+ 0.5428243336236934,主导风向由 e₊ 变为 e₋,判定仍为超限(未翻转);
38
+ 外轨超高 h 现直接影响判定结果。
39
+ - **热稳定系数 C 推算参考值重生成(站点 ampacity 页,修复批 D)**:统一
40
+ q=0.385×d 口径(比热 0.385 J/(g·K);密度铜/铜银/铜镁 8.89、铜锡/铜铬锆
41
+ 8.92 g/cm³)、ρ 取上限、α 按 2026 版 6.10 合金值,九材质逐个精算后页面
42
+ 维持 6 行、合并行(CTSM/CTM=145/121、CTSH/CTMM=134/111)取成员较小 C
43
+ (保守);锚点 CTA=155/128 精确吻合、CTCZ=143/119、CTMH=135/112。
44
+ npm 侧无 C 值数据表(C 为设计输入),无需同步。
45
+ - **电阻温度系数 per-alloy 实装(copper/voltage-drop,修复批 D)**:
46
+ `WireParamEntry` 新增 `resistanceAlphaPerDegC`(CTMH 0.00270/CTAH
47
+ 0.00380/CTS 0.00320,TB/T 2809-2026 6.10),`wireLookup` 温修按型号真值
48
+ α;`voltageDropCheck` 新增可选 `alphaPerDegC`(缺省纯铜 0.00393 供无型号
49
+ 场景)。vd 默认工况(CTMH-120)r_T 0.23847846→**0.2330394**、ΔU
50
+ 3577.1769→**3495.591**、Uend→**24004.409**、压降率→**12.71124 %**;
51
+ 「纯铜近似」说明文字改写为按各材质真值 α。与站点同批更正(2026-09-19)。
52
+ - **补偿行程长度口径改半锚段(stroke,修复批 D)**:站点页面长度输入 label
53
+ 改「锚段长度(半锚段:中心锚结至补偿器)」、默认 1500→750 m(双边补偿
54
+ 每侧补偿装置仅服务半锚段);npm 无默认值,站点回归夹具跟随
55
+ (每℃ 12.75 mm/℃、ΔL=1020 mm、S=3×1020+200=3260 mm)。
56
+ 判定阈值与公式不动。
57
+ - **接触线 r₂₀ 错档更正(copper 数据表)**:`TB2809_WIRE_PARAMS` 四行 r20 取错
58
+ 2017 表3 电阻率档——CTMH-120 0.2113→**0.2211**、CTMH-150 0.169→**0.1769**
59
+ (旧误用 0.02535=CTMM 档,CTMH 应 0.02653);CTS-120 0.1916→**0.1545**、
60
+ CTS-150 0.1533→**0.1236**(旧误用 0.02299=CTCZ 档,CTS 应 0.01854)。
61
+ 口径=各材质 20℃ 电阻率上限 ÷ 标称截面(CTAH 两行原值验证该口径自洽)。
62
+ 与站点 `/calculator/assets/calc-core.js` 同批更正(2026-09-19)。测试期望同步。
63
+ - **软横跨节点布设对齐站点(cross-span)**:节点位置由旧 npm 口径
64
+ x_i=a·(i+1)(约束 N·a<L)改为站点页面内联实现的对称布设
65
+ x₁=(L−(N−1)a)/2、x_i=x₁+(i−1)a,约束改为 L>(N−1)a;
66
+ Q/f_i/b_i/H 公式不变。新增审计回归算例(N=5、a=5、L=60、l₁=30、f_max=6、
67
+ J=65、q₀=0.615、n=2、g_c=0.615、P=50 → 节点 x=20/25/30/35/40、
68
+ H=1242.25 kg)锁定站点行为;旧布设测试按「与站点实现的同步政策」改写。
69
+ - **CTAH-120 弹性模量更正(wire-specs)**:`WIRE_PRESETS` ctha120 的
70
+ `elasticModulusGPa` 120→**117** GPa,对齐站点 `/calculator/tension/` 预设
71
+ (铜银合金档,旧值误沿用铜镁档)。
72
+ - **接触线单位重量六行更正(copper 数据表)**:`TB2809_WIRE_PARAMS`
73
+ unitWeightKgPerKm 按 TB/T 2809-2017 表3 参考单位质量逐项更正(2026-09-19):
74
+ CTMH-120 1082→**1076**、CTMH-150 1350→**1342**、CTAH-120 1070→**1076**、
75
+ CTAH-150 1330→**1342**、CTS-120 1080→**1079**、CTS-150 1345→**1347**;
76
+ 测试期望与「150/120≈1.25 倍」派生断言跟随(1342/1076=1.247 仍近似成立)。
77
+ - **坠砣重量换算统一(bvalue)**:`weightKg` 由 W=(T/n)×102 改为
78
+ W=T·1000/(n·9.81) kg,对齐站点 `/calculator/bvalue/` 页面换算式;测试跟随。
79
+
6
80
  ## [0.3.0] - 2026-09-15
7
81
 
8
82
  ### 修复
package/README.md CHANGED
@@ -2,12 +2,15 @@
2
2
 
3
3
  **铁路接触网(OCS)工程计算工具 —— 公式公开、零依赖、可直接在你的项目里引用。**
4
4
 
5
+ **20 个模块 · 228 项单元测试 · 零依赖 · 纯函数 TypeScript**(Node ≥ 18)
6
+
5
7
  🔗 在线使用:<https://www.itswe.com/Category:tools>
6
- 📖 配套百科:<https://www.itswe.com>(504 条接触网专业词条)
8
+ 📖 配套百科:<https://www.itswe.com>(670+ 页接触网专业内容)
7
9
 
8
10
  [English](./README_EN.md) | 简体中文
9
11
 
10
12
  ![npm version](https://img.shields.io/npm/v/ocs-calculators)
13
+ ![npm downloads](https://img.shields.io/npm/dm/ocs-calculators)
11
14
  [![CI](https://github.com/showhoo/ocs-calculators/actions/workflows/ci.yml/badge.svg)](https://github.com/showhoo/ocs-calculators/actions/workflows/ci.yml)
12
15
  ![license](https://img.shields.io/npm/l/ocs-calculators)
13
16
  ![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)
@@ -29,14 +32,16 @@
29
32
  npm install ocs-calculators
30
33
  ```
31
34
 
32
- > ⚠️ **请使用 ≥ 0.2.1**。`0.2.0` 曾因子路径 exports 键写错(缺少 `./` 前缀)导致 `import 'ocs-calculators'` 报 `ERR_INVALID_PACKAGE_CONFIG`,已由 `0.2.1` 修复。裸 `npm install ocs-calculators` 会取 latest(0.2.1),无需特殊处理;若你的依赖显式锁了 `@0.2.0`,请升级到 `@0.2.1`。
35
+ 要求 Node ≥ 18。
36
+
37
+ > ⚠️ **请使用 ≥ 0.2.1**。`0.2.0` 曾因子路径 exports 键写错(缺少 `./` 前缀)导致子路径导入抛 `ERR_PACKAGE_PATH_NOT_EXPORTED`,已由 `0.2.1` 修复。裸 `npm install ocs-calculators` 会取 latest(0.3.0),无需特殊处理;只有依赖显式锁了 `@0.2.0` 时才需要升级。完整版本历史见 [CHANGELOG.md](./CHANGELOG.md)。
33
38
 
34
39
  ## 快速开始
35
40
 
36
41
  ```ts
37
42
  import { tensionCurve } from 'ocs-calculators';
38
43
 
39
- // 张力-温度安装曲线:CTHM-120,当量跨距 55 m,基准 20 kN @ -20 ℃
44
+ // 张力-温度安装曲线:CTMH-120,当量跨距 55 m,基准 20 kN @ -20 ℃
40
45
  const curve = tensionCurve(
41
46
  {
42
47
  baseTensionKN: 20,
@@ -83,28 +88,28 @@ import { cantileverCut } from 'ocs-calculators/cantilever';
83
88
 
84
89
  对应 <https://www.itswe.com/Category:tools> 的 20 个在线计算器,全部已实现并逐项回归。
85
90
 
86
- | 状态 | 计算器 | 模块 | 在线地址 |
91
+ | 计算器 | 模块 | 计算内容 | 在线地址 |
87
92
  |---|---|---|---|
88
- | ✅ 已实现 | 张力-温度安装曲线 | `tension` | [/calculator/tension/](https://www.itswe.com/calculator/tension/) |
89
- | ✅ 已实现 | 弓网接触力评价 | `force` | [/calculator/force/](https://www.itswe.com/calculator/force/) |
90
- | ✅ 已实现 | 载流量与热稳定 | `ampacity` | [/calculator/ampacity/](https://www.itswe.com/calculator/ampacity/) |
91
- | ✅ 已实现 | 吊弦长度计算 | `dropper` | [/calculator/dropper/](https://www.itswe.com/calculator/dropper/) |
92
- | ✅ 已实现 | 风偏限界校验 | `wind` | [/calculator/wind/](https://www.itswe.com/calculator/wind/) |
93
- | ✅ 已实现 | 接触线磨耗率 | `wear` | [/calculator/wear/](https://www.itswe.com/calculator/wear/) |
94
- | ✅ 已实现 | 接触线参数速查 | `copper` | [/calculator/copper/](https://www.itswe.com/calculator/copper/) |
95
- | ✅ 已实现 | 补偿行程 | `stroke` | [/calculator/stroke/](https://www.itswe.com/calculator/stroke/) |
96
- | ✅ 已实现 | 波速利用率 | `wavespeed` | [/calculator/wavespeed/](https://www.itswe.com/calculator/wavespeed/) |
97
- | ✅ 已实现 | 电压降校核 | `voltage-drop` | [/calculator/voltage-drop/](https://www.itswe.com/calculator/voltage-drop/) |
98
- | ✅ 已实现 | 曲线拉出值校核 | `curve-stagger` | [/calculator/curve-stagger/](https://www.itswe.com/calculator/curve-stagger/) |
99
- | ✅ 已实现 | 覆冰荷载校核 | `icing` | [/calculator/icing/](https://www.itswe.com/calculator/icing/) |
100
- | ✅ 已实现 | 弛度速算 | `sag` | [/calculator/sag/](https://www.itswe.com/calculator/sag/) |
101
- | ✅ 已实现 | b 值(坠砣高度)安装曲线 | `bvalue` | [/calculator/bvalue/](https://www.itswe.com/calculator/bvalue/) |
102
- | ✅ 已实现 | 绝缘子爬电距离选型校核 | `creepage` | [/calculator/creepage/](https://www.itswe.com/calculator/creepage/) |
103
- | ✅ 已实现 | 锚段长度张力差校核 | `anchor-length` | [/calculator/anchor-length/](https://www.itswe.com/calculator/anchor-length/) |
104
- | ✅ 已实现 | 定位器坡度校核 | `steady-arm` | [/calculator/steady-arm/](https://www.itswe.com/calculator/steady-arm/) |
105
- | ✅ 已实现 | 软横跨负载计算 | `cross-span` | [/calculator/cross-span/](https://www.itswe.com/calculator/cross-span/) |
106
- | ✅ 已实现 | 支柱容量选型校核 | `pole-capacity` | [/calculator/pole-capacity/](https://www.itswe.com/calculator/pole-capacity/) |
107
- | ✅ 已实现 | 腕臂预配(勾股下料) | `cantilever` | [/calculator/cantilever/](https://www.itswe.com/calculator/cantilever/) |
93
+ | 张力-温度安装曲线 | `tension` | 状态方程求任意温度下的张力与弛度 | [/calculator/tension/](https://www.itswe.com/calculator/tension/) |
94
+ | 弓网接触力评价 | `force` | EN 50367 统计评价 F'max/F'min 与参考目标力 | [/calculator/force/](https://www.itswe.com/calculator/force/) |
95
+ | 载流量与热稳定 | `ampacity` | 环境温度载流量修正与短路热稳定最小截面 | [/calculator/ampacity/](https://www.itswe.com/calculator/ampacity/) |
96
+ | 吊弦长度计算 | `dropper` | 简单/弹性链形悬挂逐点吊弦长度 | [/calculator/dropper/](https://www.itswe.com/calculator/dropper/) |
97
+ | 风偏限界校验 | `wind` | 跨中风偏移与限界判据 | [/calculator/wind/](https://www.itswe.com/calculator/wind/) |
98
+ | 接触线磨耗率 | `wear` | 按残截面/残径求磨耗率与更换判定 | [/calculator/wear/](https://www.itswe.com/calculator/wear/) |
99
+ | 接触线参数速查 | `copper` | 6 型号单位重/电阻/载流量速查 | [/calculator/copper/](https://www.itswe.com/calculator/copper/) |
100
+ | 补偿行程 | `stroke` | 温度伸缩量与补偿行程(1:2~1:4 传动比) | [/calculator/stroke/](https://www.itswe.com/calculator/stroke/) |
101
+ | 波速利用率 | `wavespeed` | 波速、利用率 β 与共振车速 | [/calculator/wavespeed/](https://www.itswe.com/calculator/wavespeed/) |
102
+ | 电压降校核 | `voltage-drop` | 馈线压降与末端电压 | [/calculator/voltage-drop/](https://www.itswe.com/calculator/voltage-drop/) |
103
+ | 曲线拉出值校核 | `curve-stagger` | 曲线处拉出值与风偏合成 | [/calculator/curve-stagger/](https://www.itswe.com/calculator/curve-stagger/) |
104
+ | 覆冰荷载校核 | `icing` | 冰筒模型覆冰荷载与弛度增幅 | [/calculator/icing/](https://www.itswe.com/calculator/icing/) |
105
+ | 弛度速算 | `sag` | 由张力/跨距/单位重速算弛度,或反求最大跨距 | [/calculator/sag/](https://www.itswe.com/calculator/sag/) |
106
+ | b 值(坠砣高度)安装曲线 | `bvalue` | 坠砣高度随温度变化曲线与 b_min 校核 | [/calculator/bvalue/](https://www.itswe.com/calculator/bvalue/) |
107
+ | 绝缘子爬电距离选型校核 | `creepage` | 污区爬电比距 → 所需爬电距离判定 | [/calculator/creepage/](https://www.itswe.com/calculator/creepage/) |
108
+ | 锚段长度张力差校核 | `anchor-length` | 曲线/直线支张力差与锚段长度判据 | [/calculator/anchor-length/](https://www.itswe.com/calculator/anchor-length/) |
109
+ | 定位器坡度校核 | `steady-arm` | 定位器坡度多分量合成与限值判定 | [/calculator/steady-arm/](https://www.itswe.com/calculator/steady-arm/) |
110
+ | 软横跨负载计算 | `cross-span` | 软横跨负载分力与横向承力索张力 | [/calculator/cross-span/](https://www.itswe.com/calculator/cross-span/) |
111
+ | 支柱容量选型校核 | `pole-capacity` | 支柱检验弯矩与容量选型 | [/calculator/pole-capacity/](https://www.itswe.com/calculator/pole-capacity/) |
112
+ | 腕臂预配(勾股下料) | `cantilever` | 腕臂各段下料长度与安装裕度 | [/calculator/cantilever/](https://www.itswe.com/calculator/cantilever/) |
108
113
 
109
114
  原 12 个模块的公式与默认参数取自站点 `/calculator/assets/calc-core.js` 源码;
110
115
  新增的 8 个模块(sag/bvalue/creepage/anchor-length/steady-arm/cross-span/pole-capacity/cantilever)为站点**内联引擎计算器**(引擎直嵌页面 HTML,不经 calc-core),本仓库按其 online 页面公式提炼,单元测试期望值由公式独立算出,未从服务器渲染结果反推。
@@ -142,9 +147,12 @@ console.log(tensionMeta.disclaimer); // 免责声明
142
147
  - 新增 8 个模块(`sag`/`bvalue`/`creepage`/`anchor-length`/`steady-arm`/`cross-span`/`pole-capacity`/`cantilever`)为站点**内联引擎计算器**(引擎直嵌页面 HTML,不经 calc-core),以其 online 页面公式为基准;
143
148
  - 站点侧公式变更时,本仓库同步更新并补充/修订对应测试;
144
149
  - 本仓库的公式变更同样会回流站点,两边的计算结果保持一致;
145
- - `meta.ts` 中的参考依据(标准号 + 年份)随两侧更新同步修订。
150
+ - `meta.ts` 中的参考依据(标准号 + 年份)随两侧更新同步修订;
151
+ - 库侧输入域守卫与站点页面的有效输入域(`data-min`/`data-max`)对齐:越界输入在库内抛 `RangeError`(站点页面另受表单控件约束,不影响在线使用)。
146
152
 
147
- 当前同步状态:20 个模块与站点一致(2026-09-14 校验,212 项测试全绿)。
153
+ 当前同步状态:2026-09-19 全量对齐站点(含载流量双口径;228 项测试全绿)——
154
+ `copper` 载流量室内主值已切 TB/T 2809-2026 表5,`ampacityIndoor150A2017`
155
+ 保留 2017 表5 同点位对照,单位重量列亦两侧一致。
148
156
 
149
157
  ## ⚠️ 免责声明
150
158
 
@@ -164,7 +172,7 @@ console.log(tensionMeta.disclaimer); // 免责声明
164
172
  (把尺寸公差计入后的截面)用的,不是配标称截面:
165
173
  `121 × 8.94 × 1e-3 = 1.08174 ≈ 1.082 kg/m`。
166
174
 
167
- 因此 CTHM-120 自重 `g = 1.082 × 9.81 = 10.61442 N/m`,
175
+ 因此 CTMH-120 自重 `g = 1.082 × 9.81 = 10.61442 N/m`,
168
176
  与站点 `/calculator/tension/` 的预设 `rho=1.082`、表单默认值 `10.61`、
169
177
  以及本库 `TB2809_WIRE_PARAMS` 的 `1082` 三处同源。
170
178
 
@@ -198,7 +206,7 @@ src/<模块名>/
198
206
 
199
207
  ## 相关项目
200
208
 
201
- - ocs-wiki-content — 504 条词条快照与结构化数据(规划中,仓库未建,建仓后再挂链接)
209
+ - ocs-wiki-content — 词条快照与结构化数据(规划中,仓库未建,建仓后再挂链接)
202
210
  - [itswe](https://github.com/showhoo/itswe) — 站点介绍与建站文档
203
211
 
204
212
  ## 赞助
package/README_EN.md CHANGED
@@ -2,12 +2,15 @@
2
2
 
3
3
  **Engineering calculators for railway overhead contact systems (catenary) — open formulas, zero dependencies, embeddable in your own projects.**
4
4
 
5
+ **20 modules · 222 unit tests · zero dependencies · pure TypeScript** (Node ≥ 18)
6
+
5
7
  🔗 Try online: <https://www.itswe.com/Category:tools>
6
- 📖 Companion wiki (Chinese, 504 entries): <https://www.itswe.com>
8
+ 📖 Companion wiki: <https://www.itswe.com> (670+ pages of catenary engineering content, in Chinese)
7
9
 
8
10
  [简体中文](./README.md) | English
9
11
 
10
12
  ![npm version](https://img.shields.io/npm/v/ocs-calculators)
13
+ ![npm downloads](https://img.shields.io/npm/dm/ocs-calculators)
11
14
  [![CI](https://github.com/showhoo/ocs-calculators/actions/workflows/ci.yml/badge.svg)](https://github.com/showhoo/ocs-calculators/actions/workflows/ci.yml)
12
15
  ![license](https://img.shields.io/npm/l/ocs-calculators)
13
16
  ![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)
@@ -35,13 +38,21 @@ This library is that missing piece:
35
38
  npm install ocs-calculators
36
39
  ```
37
40
 
41
+ Requires Node ≥ 18.
42
+
43
+ > ⚠️ **Use ≥ 0.2.1.** In `0.2.0` the sub-path `exports` keys were missing the
44
+ > `./` prefix, so sub-path imports threw `ERR_PACKAGE_PATH_NOT_EXPORTED`.
45
+ > Fixed in `0.2.1`. A bare `npm install ocs-calculators` resolves to the
46
+ > latest version (0.3.0); only pins on `@0.2.0` need upgrading. Full history
47
+ > in [CHANGELOG.md](./CHANGELOG.md).
48
+
38
49
  ## Usage
39
50
 
40
51
  ```ts
41
52
  import { tensionCurve } from 'ocs-calculators';
42
53
 
43
54
  // Tension-temperature installation curve.
44
- // CTHM-120 contact wire, equivalent span 55 m, reference 20 kN @ -20 °C.
55
+ // CTMH-120 contact wire, equivalent span 55 m, reference 20 kN @ -20 °C.
45
56
  const curve = tensionCurve(
46
57
  {
47
58
  baseTensionKN: 20,
@@ -67,37 +78,73 @@ for (const p of curve) {
67
78
  // 40°C T= 8.00 kN f=0.502 m
68
79
  ```
69
80
 
70
- This matches <https://www.itswe.com/calculator/tension/> exactly.
81
+ This matches <https://www.itswe.com/calculator/tension/> exactly, row by row.
82
+
83
+ Sub-path imports are also supported, which helps bundlers tree-shake:
84
+
85
+ ```ts
86
+ import { windClearanceCheck } from 'ocs-calculators/wind';
87
+ import { wearRatio } from 'ocs-calculators/wear';
88
+ import { steadyArmAngleDeg } from 'ocs-calculators/steady-arm';
89
+ import { crossSpanAnalyze } from 'ocs-calculators/cross-span';
90
+ import { bValue } from 'ocs-calculators/bvalue';
91
+ import { sagMM } from 'ocs-calculators/sag';
92
+ import { anchorLengthCheck } from 'ocs-calculators/anchor-length';
93
+ import { creepageCheck } from 'ocs-calculators/creepage';
94
+ import { poleCapacityCheck } from 'ocs-calculators/pole-capacity';
95
+ import { cantileverCut } from 'ocs-calculators/cantilever';
96
+ ```
71
97
 
72
98
  ## Modules
73
99
 
74
- | Status | Calculator | Module |
75
- |---|---|---|
76
- | ✅ Available | Tension-temperature installation curve | `tension` |
77
- | ✅ Available | Pantograph-catenary contact force | `force` |
78
- | ✅ Available | Ampacity and thermal stability | `ampacity` |
79
- | ✅ Available | Dropper length | `dropper` |
80
- | ✅ Available | Wind deflection clearance | `wind` |
81
- | ✅ Available | Contact wire wear | `wear` |
82
- | ✅ Available | Copper weight | `copper` |
83
- | ✅ Available | Compensation stroke | `stroke` |
84
- | ✅ Available | Wave propagation speed | `wavespeed` |
85
- | ✅ Available | Voltage drop | `voltage-drop` |
86
- | ✅ Available | Curve stagger | `curve-stagger` |
87
- | ✅ Available | Ice load | `icing` |
100
+ All 20 calculators of <https://www.itswe.com/Category:tools> are implemented
101
+ and regression-tested.
102
+
103
+ | Calculator | Module | What it computes | Online |
104
+ |---|---|---|---|
105
+ | Tension–temperature installation curve | `tension` | Tension and sag at any temperature, via the state equation | [/calculator/tension/](https://www.itswe.com/calculator/tension/) |
106
+ | Pantograph–catenary contact force | `force` | EN 50367 statistical review F'max/F'min and reference target force | [/calculator/force/](https://www.itswe.com/calculator/force/) |
107
+ | Ampacity and thermal stability | `ampacity` | Ambient-temperature ampacity correction and short-circuit minimum cross-section | [/calculator/ampacity/](https://www.itswe.com/calculator/ampacity/) |
108
+ | Dropper length | `dropper` | Dropper lengths point by point, simple and stitched catenary | [/calculator/dropper/](https://www.itswe.com/calculator/dropper/) |
109
+ | Wind deflection clearance | `wind` | Mid-span wind deflection and clearance check | [/calculator/wind/](https://www.itswe.com/calculator/wind/) |
110
+ | Contact wire wear | `wear` | Wear ratio from residual section or diameter, replacement criterion | [/calculator/wear/](https://www.itswe.com/calculator/wear/) |
111
+ | Contact wire parameter lookup | `copper` | Unit weight / resistance / ampacity for 6 wire types | [/calculator/copper/](https://www.itswe.com/calculator/copper/) |
112
+ | Compensation stroke | `stroke` | Thermal expansion and compensation stroke (1:2–1:4 gearing) | [/calculator/stroke/](https://www.itswe.com/calculator/stroke/) |
113
+ | Wave propagation speed | `wavespeed` | Wave speed, utilization ratio β and resonant speed | [/calculator/wavespeed/](https://www.itswe.com/calculator/wavespeed/) |
114
+ | Voltage drop | `voltage-drop` | Feeder voltage drop and end-of-line voltage | [/calculator/voltage-drop/](https://www.itswe.com/calculator/voltage-drop/) |
115
+ | Curve stagger | `curve-stagger` | Stagger at curves combined with wind deflection | [/calculator/curve-stagger/](https://www.itswe.com/calculator/curve-stagger/) |
116
+ | Ice load | `icing` | Ice-load cylinder model and sag increase | [/calculator/icing/](https://www.itswe.com/calculator/icing/) |
117
+ | Quick sag estimate | `sag` | Sag from tension / span / weight, or max span from sag | [/calculator/sag/](https://www.itswe.com/calculator/sag/) |
118
+ | B-value (counterweight height) curve | `bvalue` | Counterweight height vs. temperature and b_min check | [/calculator/bvalue/](https://www.itswe.com/calculator/bvalue/) |
119
+ | Insulator creepage distance | `creepage` | Required creepage distance from pollution-zone specific creepage | [/calculator/creepage/](https://www.itswe.com/calculator/creepage/) |
120
+ | Anchor section tension difference | `anchor-length` | Tension difference on curved/straight spans, anchor section length criterion | [/calculator/anchor-length/](https://www.itswe.com/calculator/anchor-length/) |
121
+ | Steady-arm slope | `steady-arm` | Steady-arm slope from combined components vs. limits | [/calculator/steady-arm/](https://www.itswe.com/calculator/steady-arm/) |
122
+ | Cross-span (headspan) load | `cross-span` | Cross-span load components and counter-catenary tension | [/calculator/cross-span/](https://www.itswe.com/calculator/cross-span/) |
123
+ | Pole (mast) capacity | `pole-capacity` | Design bending moment and capacity selection | [/calculator/pole-capacity/](https://www.itswe.com/calculator/pole-capacity/) |
124
+ | Cantilever pre-assembly | `cantilever` | Cut lengths of cantilever members and assembly allowance | [/calculator/cantilever/](https://www.itswe.com/calculator/cantilever/) |
125
+
126
+ Provenance: the formulas and default parameters of the original 12 modules
127
+ come from the site asset `calculator/assets/calc-core.js`. The 8 newer modules
128
+ (`sag` / `bvalue` / `creepage` / `anchor-length` / `steady-arm` / `cross-span`
129
+ / `pole-capacity` / `cantilever`) are **inline-engine calculators** on the
130
+ site (the engine is embedded in each page's HTML, not in calc-core); this
131
+ repository distills them from the published page formulas, and the test
132
+ expectations are computed independently from the formulas — not reverse-
133
+ engineered from server-rendered output.
88
134
 
89
135
  ## Unit conventions
90
136
 
91
137
  | Suffix | Unit | Example |
92
138
  |---|---|---|
93
139
  | `...KN` | kN | `baseTensionKN`, `tensionKN` |
94
- | `...N` | N | `residualN` |
140
+ | `...N` | N | `residualN`, `tensionN` |
95
141
  | `...NPerM` | N/m | `weightPerLengthNPerM` |
96
142
  | `...M` | m | `spanM`, `sagM` |
97
143
  | `...MM` / `...MM2` | mm / mm² | `wireDiameterMM`, `crossSectionMM2` |
98
144
  | `...GPa` | GPa | `elasticModulusGPa` |
99
145
  | `...PerDegC` | 1/°C | `expansionPerDegC` |
100
146
  | `...DegC` | °C | `baseTempDegC` |
147
+ | `...KgPerM` / `...KgPerM3` | kg/m / kg/m³ | `linearMassKgPerM` |
101
148
 
102
149
  ## Per-module metadata
103
150
 
@@ -110,14 +157,56 @@ tensionMeta.scope; // validity range: span 20-90 m, E 50-200 GPa …
110
157
  tensionMeta.disclaimer;
111
158
  ```
112
159
 
160
+ ## Synchronization policy
161
+
162
+ This repository is the formula/algorithm layer of the online calculators at
163
+ [itswe.com](https://www.itswe.com). The sync baseline is the site's assets:
164
+
165
+ - The original 12 modules follow
166
+ [`calculator/assets/calc-core.js`](https://www.itswe.com/calculator/assets/calc-core.js);
167
+ - The 8 newer modules are the site's **inline-engine calculators** and follow
168
+ their published page formulas;
169
+ - When the site's formulas change, this repository is updated accordingly and
170
+ the corresponding tests are added or revised;
171
+ - Formula changes made here flow back to the site — both sides always produce
172
+ the same numbers;
173
+ - `meta.ts` references (standard numbers + years) are revised on both sides
174
+ together;
175
+ - Input-domain guards in the library mirror the pages' valid input ranges
176
+ (`data-min` / `data-max`): out-of-range input throws a `RangeError` (the
177
+ online pages are additionally constrained by their form controls).
178
+
179
+ Current sync status: fully aligned with the site as of 2026-09-19
180
+ (including dual-caliber ampacity fields; 228 tests green) — the `copper`
181
+ indoor ampacity main values follow TB/T 2809-2026 table 5, with
182
+ `ampacityIndoor150A2017` keeping the 2017 table 5 counterparts, and the
183
+ unit-weight column matches on both sides.
184
+
185
+ ## Wire self-weight convention (confirmed)
186
+
187
+ Linear density is taken from the standards' "reference unit mass" table, not
188
+ derived from the nominal cross-section. For CTMH-120 the standard lists
189
+ `nominal 120 mm² | calculated 121 mm² | reference unit mass 1082 kg/km`, with
190
+ a note that the mass is computed at 8.94 g/cm³ — a density that pairs with the
191
+ **calculated** section (which includes dimensional tolerances), not the
192
+ nominal one: `121 × 8.94 × 1e-3 ≈ 1.082 kg/m`. Hence the self-weight
193
+ `g = 1.082 × 9.81 = 10.61442 N/m`, consistent across the site preset
194
+ (`rho = 1.082`), the form default (`10.61`) and this library
195
+ (`TB2809_WIRE_PARAMS`, `1082`).
196
+
197
+ Basis: TB/T 2810-2017 (copper) and TB/T 2821-2017 (copper-silver) dimension
198
+ tables. See the [Chinese README](./README.md) for the full investigation
199
+ record.
200
+
113
201
  ## ⚠️ Disclaimer
114
202
 
115
203
  **Results are indicative only and are not a substitute for engineering design,
116
204
  construction or acceptance documentation.**
117
205
 
118
- Always verify against the applicable design documents, the current edition of
119
- the relevant standards, and the manufacturer's product specifications. Wire
120
- parameters in `wire-specs.ts` are nominal reference values.
206
+ - Always verify against the applicable design documents, the current edition
207
+ of the relevant standards, and product specifications
208
+ - Wire parameters in `wire-specs.ts` are nominal reference values
209
+ - Formula forms follow design documents and catenary design textbooks/handbooks
121
210
 
122
211
  See [DISCLAIMER.md](./DISCLAIMER.md).
123
212
 
@@ -133,6 +222,21 @@ src/<module>/
133
222
  └── <module>.test.ts # expected values taken from the online calculator
134
223
  ```
135
224
 
225
+ Three conventions:
226
+
227
+ 1. Export pure functions only; no third-party runtime dependencies
228
+ 2. `meta.ts` must fill in `formula` / `references` / `scope` / `disclaimer`
229
+ 3. Test expectations come from the online calculator, with 1% tolerance
230
+ (site output is display-rounded)
231
+
232
+ Full conventions and the sync policy: [CONTRIBUTING.md](./CONTRIBUTING.md).
233
+
234
+ ## Related projects
235
+
236
+ - ocs-wiki-content — entry snapshots and structured data (planned; link will
237
+ be added once the repository exists)
238
+ - [itswe](https://github.com/showhoo/itswe) — site introduction and build notes
239
+
136
240
  ## Sponsors
137
241
 
138
242
  Development and maintenance of this project is supported by:
@@ -141,8 +245,12 @@ Development and maintenance of this project is supported by:
141
245
 
142
246
  ## License
143
247
 
144
- Code: [MIT](./LICENSE). Companion wiki content: CC BY-SA 4.0.
248
+ Code: [MIT](./LICENSE). Companion wiki content: CC BY-SA 4.0 (see the
249
+ [itswe](https://github.com/showhoo/itswe) repository LICENSE and
250
+ [itswe.com](https://www.itswe.com)).
145
251
 
146
252
  ---
147
253
 
148
- Maintained by [思维接触网百科](https://www.itswe.com).
254
+ Maintained by [思维接触网百科](https://www.itswe.com). Found a formula or
255
+ parameter bug? Please open an issue — that's the most valuable contribution
256
+ to this library.
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkHXALVJ4Gcjs = require('../chunk-HXALVJ4G.cjs');
4
+ var _chunkYGTESFOQcjs = require('../chunk-YGTESFOQ.cjs');
5
5
 
6
6
 
7
7
 
8
- exports.bValue = _chunkHXALVJ4Gcjs.bValue; exports.bvalueMeta = _chunkHXALVJ4Gcjs.bvalueMeta;
8
+ exports.bValue = _chunkYGTESFOQcjs.bValue; exports.bvalueMeta = _chunkYGTESFOQcjs.bvalueMeta;
9
9
  //# sourceMappingURL=index.cjs.map
@@ -26,7 +26,7 @@ interface BValueResult {
26
26
  readonly stretchMM: number;
27
27
  /** 坠砣侧行程变化 n·ΔL,mm */
28
28
  readonly strokeMM: number;
29
- /** 坠砣总质量(W=T/n,m≈102·W,g 取 9.81 m/s²),kg */
29
+ /** 坠砣总质量 W = T·1000/(n·9.81),kg(对齐站点 /calculator/bvalue/ 换算口径) */
30
30
  readonly weightKg: number | null;
31
31
  }
32
32
  /** b 值计算:b_x = b_min + n·α·L·(t_max − t_x) */
@@ -26,7 +26,7 @@ interface BValueResult {
26
26
  readonly stretchMM: number;
27
27
  /** 坠砣侧行程变化 n·ΔL,mm */
28
28
  readonly strokeMM: number;
29
- /** 坠砣总质量(W=T/n,m≈102·W,g 取 9.81 m/s²),kg */
29
+ /** 坠砣总质量 W = T·1000/(n·9.81),kg(对齐站点 /calculator/bvalue/ 换算口径) */
30
30
  readonly weightKg: number | null;
31
31
  }
32
32
  /** b 值计算:b_x = b_min + n·α·L·(t_max − t_x) */
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  bValue,
3
3
  bvalueMeta
4
- } from "../chunk-3GREMF76.js";
4
+ } from "../chunk-DN6BVPCQ.js";
5
5
  export {
6
6
  bValue,
7
7
  bvalueMeta
@@ -15,7 +15,8 @@ var crossSpanMeta = {
15
15
  references: [
16
16
  "\u6559\u6750\u8D1F\u8F7D\u8BA1\u7B97\u6CD5\uFF08\u8F6F\u6A2A\u8DE8\uFF09\uFF0C\u8282\u70B9\u8D1F\u8F7D\u6309\u5927\u7AD9 65 kg / \u5C0F\u7AD9 45 kg \u53D6\u503C",
17
17
  "\u629B\u7269\u7EBF\u8FD1\u4F3C\uFF0C\u9002\u7528\u4E8E\u5F1B\u8DE8\u6BD4 f/L \u2264 1/10 \u5DE5\u51B5",
18
- "2026-09-14 \u7AD9\u957F\u63D0\u4F9B\u6587\u672C\u6838\u5BF9\uFF08\u8D1F\u8F7D\u8BA1\u7B97\u6CD5\uFF09"
18
+ "2026-09-14 \u7AD9\u957F\u63D0\u4F9B\u6587\u672C\u6838\u5BF9\uFF08\u8D1F\u8F7D\u8BA1\u7B97\u6CD5\uFF09",
19
+ "2026-09-19 \u4E0E\u7AD9\u70B9\u9875\u9762\u5B9E\u73B0\u5BF9\u9F50\uFF1A\u8282\u70B9\u5BF9\u79F0\u5E03\u8BBE x\u2081=(L\u2212(N\u22121)a)/2\u3001x_i=x\u2081+(i\u22121)a\uFF0C\u7EA6\u675F L>(N\u22121)a"
19
20
  ],
20
21
  scope: [
21
22
  "\u8282\u70B9\u6570 N\uFF1A2 ~ 20",
@@ -76,16 +77,17 @@ function crossSpanAnalyze(input) {
76
77
  if (!(P >= 0)) {
77
78
  throw new RangeError(`\u7EDD\u7F18\u5B50\u4E32\u5206\u644A\u8D1F\u8F7D\u4E0D\u80FD\u4E3A\u8D1F\uFF0C\u6536\u5230 ${P} kg`);
78
79
  }
79
- const lastX = a * nodeCount;
80
- if (!(lastX < L)) {
80
+ const spanNeed = (nodeCount - 1) * a;
81
+ if (!(L > spanNeed)) {
81
82
  throw new RangeError(
82
- `\u672B\u8282\u70B9\u4F4D\u7F6E ${lastX} m \u8D85\u51FA\u8DE8\u8DDD ${L} m\uFF0C\u8BF7\u51CF\u5C0F\u8282\u70B9\u6570\u6216\u80A1\u9053\u95F4\u8DDD`
83
+ `\u8DE8\u8DDD\u5E94\u5927\u4E8E (N\u22121)\xD7a = ${spanNeed} m\uFF0C\u6536\u5230 L = ${L} m\uFF0C\u8BF7\u51CF\u5C0F\u8282\u70B9\u6570\u6216\u80A1\u9053\u95F4\u8DDD`
83
84
  );
84
85
  }
85
86
  const Q = J + n * q0 * a + P + gc * a;
86
87
  const nodeX = [];
88
+ const x1 = (L - spanNeed) / 2;
87
89
  for (let i = 0; i < nodeCount; i++) {
88
- nodeX.push(a * (i + 1));
90
+ nodeX.push(x1 + i * a);
89
91
  }
90
92
  const nodeQ = nodeX.map(() => Q);
91
93
  const nodeSag = nodeX.map((x) => {
@@ -160,4 +162,4 @@ export {
160
162
  crossSpanMeta,
161
163
  crossSpanAnalyze
162
164
  };
163
- //# sourceMappingURL=chunk-D5F5ES2R.js.map
165
+ //# sourceMappingURL=chunk-2HYOBL6M.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cross-span/meta.ts","../src/cross-span/index.ts"],"sourcesContent":["import type { CalculatorMeta } from '../types';\n\nexport const crossSpanMeta: CalculatorMeta = {\n name: '软横跨负载计算',\n nameEn: 'Soft Cross-Span Load Calculation',\n summary:\n '按负载计算法(教材口径)计算软横跨各节点垂直负载、抛物线节点弛度、水平张力与总索长,用于接触网软横跨设计校核。',\n formula: [\n '节点垂直负载(均匀间距简化):Q_i = J + n·q₀·a + P + g_c·a',\n '节点弛度(抛物线分布,最低点在 l₁):f_i = f_max·(1 − ((x_i−l₁)/c_i)²),c_i = l₁(x_i≤l₁)或 L−l₁(x_i>l₁)',\n '水平张力(精确式):H = M(l₁)/f_max,M(l₁) 为悬挂负载对最低点截面(简支梁)弯矩',\n '水平张力(简化式对照):H′ = ΣQ_i·l₁/(2·f_max)',\n '分段索长:b_i ≈ a + (f_{i+1}−f_i)²/(2a)',\n '支柱锚固段:b_end = x₁ + f₁²/(2·x₁),支柱端弛度为 0',\n '总索长:Σb = b_endL + Σb_i + b_endR',\n ],\n references: [\n '教材负载计算法(软横跨),节点负载按大站 65 kg / 小站 45 kg 取值',\n '抛物线近似,适用于弛跨比 f/L ≤ 1/10 工况',\n '2026-09-14 站长提供文本核对(负载计算法)',\n '2026-09-19 与站点页面实现对齐:节点对称布设 x₁=(L−(N−1)a)/2、x_i=x₁+(i−1)a,约束 L>(N−1)a',\n ],\n scope: [\n '节点数 N:2 ~ 20',\n '股道间距 a:4 ~ 8 m',\n '跨距 L:15 ~ 80 m',\n '节点负载 J:45 / 65 kg',\n '接触悬挂单位重 q₀:1.0 ~ 3.0 kg/m',\n '悬挂组数 n:1 ~ 3',\n '横承索 + 定位索单位重 g_c:0.2 ~ 1.5 kg/m',\n '最大弛度 f_max:1 ~ 6 m,须小于最低点两侧悬挂高度',\n '未计入温度对索长与张力的影响、横承索弧垂非线性修正',\n ],\n disclaimer: '本工具结果仅供参考,工程应用以设计文件为准。详见 DISCLAIMER.md。',\n online: 'https://www.itswe.com/calculator/cross-span/',\n};\n","export { crossSpanMeta } from './meta';\n\n/** 软横跨负载计算(负载计算法)的输入参数 */\nexport interface CrossSpanNodeInput {\n /** 股道悬挂节点数 N */\n readonly nodeCount: number;\n /** 股道间距 a,m(节点对称均匀布设,x₁=(L−(N−1)a)/2) */\n readonly spacingM: number;\n /** 横承索跨距 L,m */\n readonly spanTotalM: number;\n /** 最低点距左支柱距离 l₁,m */\n readonly lowPointFromLeftM: number;\n /** 最大弛度 f_max,m(最低点弛度) */\n readonly maxSagM: number;\n /** 节点负载 J,kg(大站 65 / 小站 45) */\n readonly nodeLoadKg: number;\n /** 接触悬挂单位重 q₀,kg/m */\n readonly suspensionWeightKgPerM: number;\n /** 每节点悬挂组数 n */\n readonly suspensionGroups: number;\n /** 横承索 + 定位索单位重 g_c,kg/m */\n readonly cableWeightKgPerM: number;\n /** 绝缘子串分摊负载 P,kg */\n readonly insulatorDistributedKg: number;\n}\n\n/** 软横跨负载计算结果 */\nexport interface CrossSpanResult {\n /** 各节点距左支柱距离 x_i,m */\n readonly nodeX: readonly number[];\n /** 各节点垂直负载 Q_i,kg */\n readonly nodeQ: readonly number[];\n /** 各节点弛度 f_i,m */\n readonly nodeSag: readonly number[];\n /** 相邻节点间分段索长 b_i,m(共 N−1 段) */\n readonly segmentLength: readonly number[];\n /** 左端支柱锚固段索长,m */\n readonly endLeftM: number;\n /** 右端支柱锚固段索长,m */\n readonly endRightM: number;\n /** 总索长 Σb,m */\n readonly totalLengthM: number;\n /** 水平张力(力矩平衡精确式)H = M(l₁)/f_max,kg */\n readonly horizontalForceKg: number;\n /** 水平张力(简化式对照)H' = ΣQ_i·l₁/(2·f_max),kg */\n readonly horizontalForceSimpleKg: number;\n /** 总垂直负载 ΣQ,kg */\n readonly totalLoadKg: number;\n}\n\n/**\n * 软横跨负载计算(负载计算法,教材口径)。\n *\n * 节点对称布设(与站点 /calculator/cross-span/ 页面实现一致,2026-09-19 对齐):\n * 约束 L > (N−1)·a;x₁ = (L−(N−1)·a)/2,x_i = x₁+(i−1)·a\n *\n * 节点垂直负载(均匀间距简化):\n * Q_i = J + n·q₀·a + P + g_c·a\n *\n * 节点弛度(抛物线分布,最低点在 l₁):\n * f_i = f_max·(1 − ((x_i−l₁)/c_i)²),c_i = l₁(x_i≤l₁)或 L−l₁(x_i>l₁)\n *\n * 水平张力:精确式 H = M(l₁)/f_max,其中 M(l₁) 为悬挂负载对最低点截面的\n * 简支梁弯矩;简化式对照 H' = ΣQ_i·l₁/(2·f_max)。\n *\n * 分段索长:b_i ≈ a + (f_{i+1}−f_i)²/(2a);两端支柱锚固段\n * b_end = x₁ + f₁²/(2·x₁)(支柱端弛度为 0)。\n */\nexport function crossSpanAnalyze(input: CrossSpanNodeInput): CrossSpanResult {\n const {\n nodeCount,\n spacingM: a,\n spanTotalM: L,\n lowPointFromLeftM: l1,\n maxSagM: fMax,\n nodeLoadKg: J,\n suspensionWeightKgPerM: q0,\n suspensionGroups: n,\n cableWeightKgPerM: gc,\n insulatorDistributedKg: P,\n } = input;\n\n if (!Number.isInteger(nodeCount) || !(nodeCount >= 2)) {\n throw new RangeError(`节点数须为不小于 2 的整数,收到 ${nodeCount}`);\n }\n if (!(a > 0)) {\n throw new RangeError(`股道间距必须为正数,收到 ${a} m`);\n }\n if (!(L > 0)) {\n throw new RangeError(`跨距必须为正数,收到 ${L} m`);\n }\n if (!(l1 > 0 && l1 < L)) {\n throw new RangeError(`最低点距左支柱距离须在 (0, L) 内,收到 ${l1} m`);\n }\n if (!(fMax > 0)) {\n throw new RangeError(`最大弛度必须为正数,收到 ${fMax} m`);\n }\n if (!(J >= 0)) {\n throw new RangeError(`节点负载不能为负,收到 ${J} kg`);\n }\n if (!(q0 >= 0)) {\n throw new RangeError(`接触悬挂单位重不能为负,收到 ${q0} kg/m`);\n }\n if (!(n > 0)) {\n throw new RangeError(`每节点悬挂组数须为正数,收到 ${n}`);\n }\n if (!(gc >= 0)) {\n throw new RangeError(`横承索单位重不能为负,收到 ${gc} kg/m`);\n }\n if (!(P >= 0)) {\n throw new RangeError(`绝缘子串分摊负载不能为负,收到 ${P} kg`);\n }\n\n // 节点对称布设(站点页面口径):L > (N−1)·a,x₁ = (L−(N−1)·a)/2,x_i = x₁+(i−1)·a\n const spanNeed = (nodeCount - 1) * a;\n if (!(L > spanNeed)) {\n throw new RangeError(\n `跨距应大于 (N−1)×a = ${spanNeed} m,收到 L = ${L} m,请减小节点数或股道间距`,\n );\n }\n\n const Q = J + n * q0 * a + P + gc * a;\n\n const nodeX: number[] = [];\n const x1 = (L - spanNeed) / 2;\n for (let i = 0; i < nodeCount; i++) {\n nodeX.push(x1 + i * a);\n }\n\n const nodeQ: number[] = nodeX.map(() => Q);\n const nodeSag: number[] = nodeX.map((x) => {\n const c = x <= l1 ? l1 : L - l1;\n return fMax * (1 - ((x - l1) / c) * ((x - l1) / c));\n });\n\n // 相邻节点间分段索长 b_i = a + (f_{i+1}−f_i)²/(2a)\n const segmentLength: number[] = [];\n for (let i = 0; i < nodeCount - 1; i++) {\n const fi = nodeSag[i];\n const fj = nodeSag[i + 1];\n if (fi === undefined || fj === undefined) {\n throw new Error(`缺少节点 ${i} 或 ${i + 1} 的弛度`);\n }\n const d = fj - fi;\n segmentLength.push(a + (d * d) / (2 * a));\n }\n\n // 两端支柱锚固段(支柱端弛度为 0)\n const x0 = nodeX[0];\n const f0 = nodeSag[0];\n if (x0 === undefined || f0 === undefined) {\n throw new Error('缺少首节点位置或弛度');\n }\n const endLeftM = x0 + (f0 * f0) / (2 * x0);\n\n const xLast = nodeX[nodeX.length - 1];\n const fLast = nodeSag[nodeSag.length - 1];\n if (xLast === undefined || fLast === undefined) {\n throw new Error('缺少末节点位置或弛度');\n }\n const gapRight = L - xLast;\n const endRightM = gapRight + (fLast * fLast) / (2 * gapRight);\n\n let segmentSum = 0;\n for (const b of segmentLength) segmentSum += b;\n const totalLengthM = endLeftM + segmentSum + endRightM;\n\n // 水平张力(力矩平衡精确式):以左右支柱为简支梁,求最低点截面弯矩\n let rLeft = 0;\n for (let i = 0; i < nodeCount; i++) {\n const x = nodeX[i];\n const q = nodeQ[i];\n if (x === undefined || q === undefined) {\n throw new Error(`缺少节点 ${i} 的位置或负载`);\n }\n rLeft += (q * (L - x)) / L;\n }\n let moment = rLeft * l1;\n for (let i = 0; i < nodeCount; i++) {\n const x = nodeX[i];\n const q = nodeQ[i];\n if (x === undefined || q === undefined) {\n throw new Error(`缺少节点 ${i} 的位置或负载`);\n }\n if (x < l1) {\n moment -= q * (l1 - x);\n }\n }\n const horizontalForceKg = moment / fMax;\n\n let totalLoadKg = 0;\n for (const q of nodeQ) totalLoadKg += q;\n\n const horizontalForceSimpleKg = (totalLoadKg * l1) / (2 * fMax);\n\n return {\n nodeX,\n nodeQ,\n nodeSag,\n segmentLength,\n endLeftM,\n endRightM,\n totalLengthM,\n horizontalForceKg,\n horizontalForceSimpleKg,\n totalLoadKg,\n };\n}\n"],"mappings":";AAEO,IAAM,gBAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SACE;AAAA,EACF,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YA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 +9,8 @@ var voltageDropMeta = {
8
9
  nameEn: "Voltage Drop Check",
9
10
  summary: "\u6309\u6E29\u5EA6\u4FEE\u6B63\u540E\u7684\u5355\u4F4D\u7535\u963B\u8BA1\u7B97\u4F9B\u7535\u81C2\u7535\u538B\u635F\u5931 \u0394U \u4E0E\u672B\u7AEF\u7535\u538B\uFF0C\u7528\u4E8E\u4F9B\u7535\u81C2\u957F\u5EA6\u4E0E\u5BFC\u7EBF\u622A\u9762\u6821\u6838\u3002",
10
11
  formula: [
11
- "\u5355\u4F4D\u7535\u963B\u6E29\u5EA6\u4FEE\u6B63\uFF1Ar_T = r\u2082\u2080\xB7[1 + \u03B1\xB7(T \u2212 20)]\uFF08\u03B1 = 0.00393 /\u2103\uFF09",
12
+ "\u5355\u4F4D\u7535\u963B\u6E29\u5EA6\u4FEE\u6B63\uFF1Ar_T = r\u2082\u2080\xB7[1 + \u03B1\xB7(T \u2212 20)]\uFF0C\u03B1 \u987B\u4E0E r\u2082\u2080 \u5BF9\u5E94\u6750\u8D28\u914D\u5957",
13
+ "\u6E29\u4FEE\u6309\u5404\u6750\u8D28\u771F\u503C \u03B1\uFF08TB/T 2809-2026 6.10\uFF09\uFF1A\u94F6 0.00380 / \u9521 0.00320 / \u9541 0.00270 / \u94EC\u9506 0.00290\uFF1B\u7F3A\u7701\u7EAF\u94DC 0.00393 \u4F9B\u65E0\u578B\u53F7\u573A\u666F",
12
14
  "\u5E76\u8054 n \u8DEF\u65F6\uFF1Ar_T / n",
13
15
  "\u7535\u538B\u635F\u5931\uFF1A\u0394U = I \xB7 r_T \xB7 L\uFF08r_T \u5355\u4F4D \u03A9/km\uFF0CL \u5355\u4F4D km\uFF09",
14
16
  "\u672B\u7AEF\u7535\u538B\uFF1AU_end = U\u2080 \u2212 \u0394U\uFF1B\u538B\u964D\u7387 = \u0394U / U\u2080"
@@ -47,7 +49,11 @@ function voltageDropCheck(input) {
47
49
  throw new RangeError(`\u5E76\u8054\u5BFC\u7EBF\u6570\u5FC5\u987B\u4E3A\u6B63\u6574\u6570\uFF0C\u6536\u5230 ${parallelCount}`);
48
50
  }
49
51
  const minEndVoltageV = input.minEndVoltageV ?? DEFAULT_MIN_END_VOLTAGE_V;
50
- const rT = resistanceAtTempOhmPerKm(r20OhmPerKm, input.tempDegC ?? 25) / parallelCount;
52
+ const rT = resistanceAtTempOhmPerKm(
53
+ r20OhmPerKm,
54
+ input.tempDegC ?? 25,
55
+ input.alphaPerDegC ?? COPPER_ALPHA_PER_DEG_C
56
+ ) / parallelCount;
51
57
  const voltageDropV = currentA * rT * feederLengthKm;
52
58
  const endVoltageV = busVoltageV - voltageDropV;
53
59
  return {
@@ -64,4 +70,4 @@ export {
64
70
  DEFAULT_MIN_END_VOLTAGE_V,
65
71
  voltageDropCheck
66
72
  };
67
- //# sourceMappingURL=chunk-IUENDAAJ.js.map
73
+ //# sourceMappingURL=chunk-53ONNIVL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/voltage-drop/meta.ts","../src/voltage-drop/index.ts"],"sourcesContent":["import type { CalculatorMeta } from '../types';\n\nexport const voltageDropMeta: CalculatorMeta = {\n name: '电压降校核',\n nameEn: 'Voltage Drop Check',\n summary:\n '按温度修正后的单位电阻计算供电臂电压损失 ΔU 与末端电压,用于供电臂长度与导线截面校核。',\n formula: [\n '单位电阻温度修正:r_T = r₂₀·[1 + α·(T − 20)],α 须与 r₂₀ 对应材质配套',\n '温修按各材质真值 α(TB/T 2809-2026 6.10):银 0.00380 / 锡 0.00320 / 镁 0.00270 / 铬锆 0.00290;缺省纯铜 0.00393 供无型号场景',\n '并联 n 路时:r_T / n',\n '电压损失:ΔU = I · r_T · L(r_T 单位 Ω/km,L 单位 km)',\n '末端电压:U_end = U₀ − ΔU;压降率 = ΔU / U₀',\n ],\n references: [\n '依据本站 供电计算 / 电气设计 条目',\n '末端电压限值:25kV 体系常按 20kV 掌握;实际限值以设计文件与供电计算书为准',\n ],\n scope: [\n '母线电压 U₀:20000 ~ 30000 V',\n '持续电流 I:10 ~ 3000 A',\n '单位电阻 r₂₀:0.05 ~ 1 Ω/km',\n '供电臂等效长度 L:1 ~ 60 km',\n '环境温度:−40 ~ 80 ℃',\n '单回路集中负荷模型,未考虑负荷沿供电臂分布与再生制动',\n ],\n disclaimer: '本工具结果仅供参考,工程应用以设计文件为准。详见 DISCLAIMER.md。',\n online: 'https://www.itswe.com/calculator/voltage-drop/',\n};\n","export { voltageDropMeta } from './meta';\n\n/** 25kV 体系常用的末端电压下限,V */\nexport const DEFAULT_MIN_END_VOLTAGE_V = 20000;\n\n// 电阻温度修正统一来自 src/common/resistance.ts(copper 与 voltage-drop 共用)\nimport { COPPER_ALPHA_PER_DEG_C, resistanceAtTempOhmPerKm } from '../common/resistance';\n\nexport interface VoltageDropInput {\n /** 变电所母线电压 U₀,V */\n readonly busVoltageV: number;\n /** 持续电流 I,A */\n readonly currentA: number;\n /** 20℃ 单位电阻 r₂₀,Ω/km */\n readonly r20OhmPerKm: number;\n /** 供电臂等效长度 L,km */\n readonly feederLengthKm: number;\n /** 环境温度 T,℃。缺省 25 */\n readonly tempDegC?: number;\n /** 并联导线数。缺省 1 */\n readonly parallelCount?: number;\n /** 末端最低允许电压,V。缺省 20000 */\n readonly minEndVoltageV?: number;\n /**\n * 电阻温度系数 α,1/℃(2026-09-19 实装,修复批 D)。\n * 须与 r₂₀ 对应材质配套(TB/T 2809-2026 6.10):银 0.00380 / 锡 0.00320 /\n * 镁 0.00270 / 铬锆 0.00290。缺省纯铜 0.00393(供无型号场景)。\n */\n readonly alphaPerDegC?: number;\n}\n\nexport interface VoltageDropResult {\n /** 温度修正(并含并联折减)后的单位电阻 r_T,Ω/km */\n readonly rTOhmPerKm: number;\n /** 电压损失 ΔU,V */\n readonly voltageDropV: number;\n /** 末端电压 U_end,V */\n readonly endVoltageV: number;\n /** 压降率,% */\n readonly dropPercent: number;\n /** 末端电压是否满足要求 */\n readonly passes: boolean;\n}\n\n/**\n * 电压降校核:ΔU = I·r_T·L(并联 n 路时 r_T/n),U_end = U₀ − ΔU。\n */\nexport function voltageDropCheck(input: VoltageDropInput): VoltageDropResult {\n const { busVoltageV, currentA, r20OhmPerKm, feederLengthKm } = input;\n\n if (!(busVoltageV > 0)) {\n throw new RangeError(`母线电压必须为正数,收到 ${busVoltageV} V`);\n }\n if (!(currentA > 0)) {\n throw new RangeError(`持续电流必须为正数,收到 ${currentA} A`);\n }\n if (!(feederLengthKm > 0)) {\n throw new RangeError(`供电臂长度必须为正数,收到 ${feederLengthKm} km`);\n }\n\n const parallelCount = input.parallelCount ?? 1;\n if (!(parallelCount > 0) || !Number.isInteger(parallelCount)) {\n throw new RangeError(`并联导线数必须为正整数,收到 ${parallelCount}`);\n }\n\n const minEndVoltageV = input.minEndVoltageV ?? DEFAULT_MIN_END_VOLTAGE_V;\n\n const rT =\n resistanceAtTempOhmPerKm(\n r20OhmPerKm,\n input.tempDegC ?? 25,\n input.alphaPerDegC ?? COPPER_ALPHA_PER_DEG_C,\n ) / parallelCount;\n const voltageDropV = currentA * rT * feederLengthKm;\n const endVoltageV = busVoltageV - voltageDropV;\n\n return {\n rTOhmPerKm: rT,\n voltageDropV,\n endVoltageV,\n dropPercent: (voltageDropV / busVoltageV) * 100,\n passes: endVoltageV >= minEndVoltageV,\n };\n}\n"],"mappings":";;;;;;AAEO,IAAM,kBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SACE;AAAA,EACF,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AACV;;;ACzBO,IAAM,4BAA4B;AA4ClC,SAAS,iBAAiB,OAA4C;AAC3E,QAAM,EAAE,aAAa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