universal-physics-tensor 11.0.0 → 12.0.0

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 (287) hide show
  1. package/README.md +36 -34
  2. package/data/applied-cases.json +1892 -0
  3. package/data/applied-cases.schema.json +194 -0
  4. package/data/atlas/atlas.json +21 -21
  5. package/data/atlas/atlas.jsonld +1 -1
  6. package/data/atlas/diffusion.json +5 -5
  7. package/data/atlas/oscillators.json +7 -7
  8. package/data/atlas/waves.json +11 -11
  9. package/data/bridge-catalog.json +20 -4
  10. package/data/units.json +6 -25
  11. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  12. package/dist/atlas/benchmark/stats.js +6 -20
  13. package/dist/atlas/benchmark/stats.js.map +1 -1
  14. package/dist/atlas/physjs-entries.generated.d.ts +13 -4
  15. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  16. package/dist/atlas/physjs-entries.generated.js +15 -4
  17. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  18. package/dist/atlas/physjs-reviewed.js +2 -2
  19. package/dist/atlas/physjs-reviewed.js.map +1 -1
  20. package/dist/cases/catalog-checks.d.ts +10 -0
  21. package/dist/cases/catalog-checks.d.ts.map +1 -0
  22. package/dist/cases/catalog-checks.js +241 -0
  23. package/dist/cases/catalog-checks.js.map +1 -0
  24. package/dist/cases/catalog.d.ts +83 -0
  25. package/dist/cases/catalog.d.ts.map +1 -0
  26. package/dist/cases/catalog.js +118 -0
  27. package/dist/cases/catalog.js.map +1 -0
  28. package/dist/cases/engine.d.ts +13 -0
  29. package/dist/cases/engine.d.ts.map +1 -0
  30. package/dist/cases/engine.js +179 -0
  31. package/dist/cases/engine.js.map +1 -0
  32. package/dist/cases/index.d.ts.map +1 -1
  33. package/dist/cases/index.js +5 -7
  34. package/dist/cases/index.js.map +1 -1
  35. package/dist/cases/methods.d.ts +215 -0
  36. package/dist/cases/methods.d.ts.map +1 -0
  37. package/dist/cases/methods.js +743 -0
  38. package/dist/cases/methods.js.map +1 -0
  39. package/dist/cases/types.d.ts +12 -0
  40. package/dist/cases/types.d.ts.map +1 -1
  41. package/dist/cases/types.js.map +1 -1
  42. package/dist/cli/args.d.ts +2 -0
  43. package/dist/cli/args.d.ts.map +1 -1
  44. package/dist/cli/args.js.map +1 -1
  45. package/dist/cli/command.d.ts +3 -0
  46. package/dist/cli/command.d.ts.map +1 -1
  47. package/dist/cli/command.js.map +1 -1
  48. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  49. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  50. package/dist/cli/commands/_discovery-opts.js +1 -0
  51. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  52. package/dist/cli/commands/discover.d.ts.map +1 -1
  53. package/dist/cli/commands/discover.js +116 -71
  54. package/dist/cli/commands/discover.js.map +1 -1
  55. package/dist/cli/commands/evaluate.js +2 -2
  56. package/dist/cli/commands/evaluate.js.map +1 -1
  57. package/dist/cli/commands/explain.d.ts.map +1 -1
  58. package/dist/cli/commands/explain.js +22 -2
  59. package/dist/cli/commands/explain.js.map +1 -1
  60. package/dist/cli/commands/ground.d.ts.map +1 -1
  61. package/dist/cli/commands/ground.js +6 -1
  62. package/dist/cli/commands/ground.js.map +1 -1
  63. package/dist/cli/commands/map.d.ts.map +1 -1
  64. package/dist/cli/commands/map.js +9 -6
  65. package/dist/cli/commands/map.js.map +1 -1
  66. package/dist/cli/determination.d.ts +1 -0
  67. package/dist/cli/determination.d.ts.map +1 -1
  68. package/dist/cli/determination.js.map +1 -1
  69. package/dist/cli/flag-help.d.ts +1 -0
  70. package/dist/cli/flag-help.d.ts.map +1 -1
  71. package/dist/cli/flag-help.js +1 -0
  72. package/dist/cli/flag-help.js.map +1 -1
  73. package/dist/cli/graphs.d.ts +2 -0
  74. package/dist/cli/graphs.d.ts.map +1 -1
  75. package/dist/cli/graphs.js +1 -0
  76. package/dist/cli/graphs.js.map +1 -1
  77. package/dist/cli/main.d.ts +1 -0
  78. package/dist/cli/main.d.ts.map +1 -1
  79. package/dist/cli/main.js +1 -0
  80. package/dist/cli/main.js.map +1 -1
  81. package/dist/cli/output.d.ts +8 -0
  82. package/dist/cli/output.d.ts.map +1 -1
  83. package/dist/cli/output.js +8 -0
  84. package/dist/cli/output.js.map +1 -1
  85. package/dist/cli/statuses.d.ts.map +1 -1
  86. package/dist/cli/statuses.js +12 -2
  87. package/dist/cli/statuses.js.map +1 -1
  88. package/dist/cli/version.d.ts +1 -0
  89. package/dist/cli/version.d.ts.map +1 -1
  90. package/dist/cli/version.js +1 -0
  91. package/dist/cli/version.js.map +1 -1
  92. package/dist/cli-api.d.ts +2 -0
  93. package/dist/cli-api.d.ts.map +1 -1
  94. package/dist/cli-api.js +2 -0
  95. package/dist/cli-api.js.map +1 -1
  96. package/dist/composition/canonical-graph.d.ts +2 -2
  97. package/dist/composition/canonical-graph.js +2 -2
  98. package/dist/composition/canonical-graph.js.map +1 -1
  99. package/dist/composition/consequence.d.ts +15 -5
  100. package/dist/composition/consequence.d.ts.map +1 -1
  101. package/dist/composition/consequence.js +6 -4
  102. package/dist/composition/consequence.js.map +1 -1
  103. package/dist/composition/discovery.d.ts +78 -14
  104. package/dist/composition/discovery.d.ts.map +1 -1
  105. package/dist/composition/discovery.js +73 -23
  106. package/dist/composition/discovery.js.map +1 -1
  107. package/dist/composition/expr-eval.d.ts +1 -1
  108. package/dist/composition/expr-eval.d.ts.map +1 -1
  109. package/dist/composition/expr-eval.js +4 -4
  110. package/dist/composition/expr-eval.js.map +1 -1
  111. package/dist/composition/expr-simplify.d.ts +10 -14
  112. package/dist/composition/expr-simplify.d.ts.map +1 -1
  113. package/dist/composition/expr-simplify.js +49 -52
  114. package/dist/composition/expr-simplify.js.map +1 -1
  115. package/dist/composition/grounding.d.ts.map +1 -1
  116. package/dist/composition/grounding.js +19 -7
  117. package/dist/composition/grounding.js.map +1 -1
  118. package/dist/composition/mathts-quiet.d.ts +4 -6
  119. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  120. package/dist/composition/mathts-quiet.js +4 -14
  121. package/dist/composition/mathts-quiet.js.map +1 -1
  122. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  123. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  124. package/dist/composition/own-equation-magnitude.js +270 -0
  125. package/dist/composition/own-equation-magnitude.js.map +1 -0
  126. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  127. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  128. package/dist/composition/probe/backend-protocol.js.map +1 -1
  129. package/dist/composition/probe/candidate-store.d.ts +1 -0
  130. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  131. package/dist/composition/probe/candidate-store.js +1 -0
  132. package/dist/composition/probe/candidate-store.js.map +1 -1
  133. package/dist/composition/probe/corpus.d.ts +4 -2
  134. package/dist/composition/probe/corpus.d.ts.map +1 -1
  135. package/dist/composition/probe/corpus.js +3 -3
  136. package/dist/composition/probe/corpus.js.map +1 -1
  137. package/dist/composition/probe/dataset.d.ts +1 -0
  138. package/dist/composition/probe/dataset.d.ts.map +1 -1
  139. package/dist/composition/probe/dataset.js.map +1 -1
  140. package/dist/composition/probe/experiment-design.d.ts +2 -0
  141. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  142. package/dist/composition/probe/experiment-design.js.map +1 -1
  143. package/dist/composition/probe/falsify.d.ts +2 -0
  144. package/dist/composition/probe/falsify.d.ts.map +1 -1
  145. package/dist/composition/probe/falsify.js.map +1 -1
  146. package/dist/composition/probe/fit.d.ts +1 -0
  147. package/dist/composition/probe/fit.d.ts.map +1 -1
  148. package/dist/composition/probe/fit.js.map +1 -1
  149. package/dist/composition/probe/generator.d.ts +3 -0
  150. package/dist/composition/probe/generator.d.ts.map +1 -1
  151. package/dist/composition/probe/generator.js +5 -6
  152. package/dist/composition/probe/generator.js.map +1 -1
  153. package/dist/composition/probe/limits.d.ts +1 -0
  154. package/dist/composition/probe/limits.d.ts.map +1 -1
  155. package/dist/composition/probe/limits.js.map +1 -1
  156. package/dist/composition/probe/pipeline.d.ts +5 -0
  157. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  158. package/dist/composition/probe/pipeline.js +64 -21
  159. package/dist/composition/probe/pipeline.js.map +1 -1
  160. package/dist/composition/probe/power-law.d.ts.map +1 -1
  161. package/dist/composition/probe/power-law.js +3 -7
  162. package/dist/composition/probe/power-law.js.map +1 -1
  163. package/dist/composition/probe/problem.d.ts +1 -0
  164. package/dist/composition/probe/problem.d.ts.map +1 -1
  165. package/dist/composition/probe/problem.js.map +1 -1
  166. package/dist/composition/probe/residual.d.ts +1 -0
  167. package/dist/composition/probe/residual.d.ts.map +1 -1
  168. package/dist/composition/probe/residual.js +1 -0
  169. package/dist/composition/probe/residual.js.map +1 -1
  170. package/dist/composition/probe/run-manifest.d.ts +1 -0
  171. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  172. package/dist/composition/probe/run-manifest.js.map +1 -1
  173. package/dist/composition/probe/scalar-search.d.ts +50 -0
  174. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  175. package/dist/composition/probe/scalar-search.js +169 -0
  176. package/dist/composition/probe/scalar-search.js.map +1 -0
  177. package/dist/composition/probe/scoring.d.ts +1 -0
  178. package/dist/composition/probe/scoring.d.ts.map +1 -1
  179. package/dist/composition/probe/scoring.js.map +1 -1
  180. package/dist/composition/probe/study.d.ts +2 -2
  181. package/dist/composition/probe/study.d.ts.map +1 -1
  182. package/dist/composition/probe/study.js +6 -10
  183. package/dist/composition/probe/study.js.map +1 -1
  184. package/dist/composition/probe/t-tail.d.ts +3 -4
  185. package/dist/composition/probe/t-tail.d.ts.map +1 -1
  186. package/dist/composition/probe/t-tail.js +7 -10
  187. package/dist/composition/probe/t-tail.js.map +1 -1
  188. package/dist/composition/proposed-bridges.d.ts +11 -2
  189. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  190. package/dist/composition/proposed-bridges.js +7 -5
  191. package/dist/composition/proposed-bridges.js.map +1 -1
  192. package/dist/composition/rational-exponent.d.ts +2 -2
  193. package/dist/composition/rational-exponent.d.ts.map +1 -1
  194. package/dist/composition/rational-exponent.js +4 -4
  195. package/dist/composition/rational-exponent.js.map +1 -1
  196. package/dist/composition/representative-values.d.ts.map +1 -1
  197. package/dist/composition/representative-values.js +6 -0
  198. package/dist/composition/representative-values.js.map +1 -1
  199. package/dist/composition/retrodiction.d.ts +15 -0
  200. package/dist/composition/retrodiction.d.ts.map +1 -1
  201. package/dist/composition/retrodiction.js +10 -3
  202. package/dist/composition/retrodiction.js.map +1 -1
  203. package/dist/composition/user-equation.d.ts +1 -0
  204. package/dist/composition/user-equation.d.ts.map +1 -1
  205. package/dist/composition/user-equation.js +1 -0
  206. package/dist/composition/user-equation.js.map +1 -1
  207. package/dist/core/constants.d.ts +12 -11
  208. package/dist/core/constants.d.ts.map +1 -1
  209. package/dist/core/constants.js +24 -21
  210. package/dist/core/constants.js.map +1 -1
  211. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  212. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  213. package/dist/diff/bridge-ast-gradient.js +75 -173
  214. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  215. package/dist/dimensional/ast-types.d.ts +15 -0
  216. package/dist/dimensional/ast-types.d.ts.map +1 -1
  217. package/dist/dimensional/ast-types.js.map +1 -1
  218. package/dist/dimensional/curvature-composite.d.ts +1 -1
  219. package/dist/dimensional/curvature-composite.js.map +1 -1
  220. package/dist/dimensional/exact-scale.d.ts +41 -11
  221. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  222. package/dist/dimensional/exact-scale.js +115 -123
  223. package/dist/dimensional/exact-scale.js.map +1 -1
  224. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  225. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  226. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  227. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  228. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  229. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  230. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  231. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  232. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  233. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  234. package/dist/dimensional/scalar-lowering.js +45 -0
  235. package/dist/dimensional/scalar-lowering.js.map +1 -0
  236. package/dist/dimensional/unit-data.d.ts +5 -1
  237. package/dist/dimensional/unit-data.d.ts.map +1 -1
  238. package/dist/dimensional/unit-data.js +28 -4
  239. package/dist/dimensional/unit-data.js.map +1 -1
  240. package/dist/dimensional/units.d.ts +2 -0
  241. package/dist/dimensional/units.d.ts.map +1 -1
  242. package/dist/dimensional/units.js +59 -3
  243. package/dist/dimensional/units.js.map +1 -1
  244. package/dist/dimensional/validator.d.ts +2 -0
  245. package/dist/dimensional/validator.d.ts.map +1 -1
  246. package/dist/dimensional/validator.js.map +1 -1
  247. package/dist/index.js.map +1 -1
  248. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  249. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  250. package/dist/numerical/connection-lowering-helpers.js +11 -15
  251. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  252. package/dist/numerical/pderiv.d.ts.map +1 -1
  253. package/dist/numerical/pderiv.js +2 -6
  254. package/dist/numerical/pderiv.js.map +1 -1
  255. package/dist/numerical/quadrature.js +3 -3
  256. package/dist/numerical/quadrature.js.map +1 -1
  257. package/dist/numerical/statistics.js +1 -1
  258. package/dist/numerical/statistics.js.map +1 -1
  259. package/dist/numerical/strides.d.ts +3 -2
  260. package/dist/numerical/strides.d.ts.map +1 -1
  261. package/dist/numerical/strides.js +3 -10
  262. package/dist/numerical/strides.js.map +1 -1
  263. package/package.json +9 -12
  264. package/dist/cases/brownian-sphere.d.ts +0 -68
  265. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  266. package/dist/cases/brownian-sphere.js +0 -355
  267. package/dist/cases/brownian-sphere.js.map +0 -1
  268. package/dist/cases/damped-resonator.d.ts +0 -23
  269. package/dist/cases/damped-resonator.d.ts.map +0 -1
  270. package/dist/cases/damped-resonator.js +0 -221
  271. package/dist/cases/damped-resonator.js.map +0 -1
  272. package/dist/cases/kepler-rv.d.ts +0 -13
  273. package/dist/cases/kepler-rv.d.ts.map +0 -1
  274. package/dist/cases/kepler-rv.js +0 -173
  275. package/dist/cases/kepler-rv.js.map +0 -1
  276. package/dist/cases/lumped-cooling.d.ts +0 -51
  277. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  278. package/dist/cases/lumped-cooling.js +0 -259
  279. package/dist/cases/lumped-cooling.js.map +0 -1
  280. package/dist/cases/resistor-noise.d.ts +0 -14
  281. package/dist/cases/resistor-noise.d.ts.map +0 -1
  282. package/dist/cases/resistor-noise.js +0 -215
  283. package/dist/cases/resistor-noise.js.map +0 -1
  284. package/dist/cases/skin-depth.d.ts +0 -17
  285. package/dist/cases/skin-depth.d.ts.map +0 -1
  286. package/dist/cases/skin-depth.js +0 -170
  287. package/dist/cases/skin-depth.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/cases/catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAmD9D,MAAM,GAAG,GAAG,IAAI,GAAG,CAA+B,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AAErE;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,eAAe;IACf,cAAc;IACd,qBAAqB;IACrB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;CACZ,CAAC;AAEX,gFAAgF;AAChF,MAAM,UAAU,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E;QACb,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACxG,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,GAAG,EAAE,IAAI,CAAC,GAAG;KACd,CAAC;AACJ,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,cAAc;IAC5B,OAAO,kBAAkB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["/**\n * The applied-case catalog: `data/applied-cases.json`, validated at load.\n *\n * @module cases/catalog\n */\nimport { checkedDataFile, dataSchema, parseDataFile } from '../core/data-file.js';\nimport { catalogRelations } from '../bridges/catalog-load.js';\nimport type { JsonSchema } from '../core/json-schema.js';\nimport type { EvaluatorParameter } from '../bridges/evaluators.js';\nimport type { AppliedCase, CaseComparison, CaseExample } from './types.js';\n\n/** One catalog check, evaluated through the formula grammar. @internal */\nexport interface AppliedCaseCheckRecord {\n readonly id: string;\n readonly premise: string;\n readonly quantity: string;\n readonly expr: string;\n readonly op: '<=' | '>=' | '>';\n readonly bound: number;\n readonly threshold: string;\n}\n\n/** One catalog output before runtime wiring. @internal */\nexport interface AppliedCaseOutputRecord {\n readonly key: string;\n readonly symbol: string;\n readonly unit: string;\n readonly meaning: string;\n readonly expr?: string;\n readonly method?: string;\n readonly relation?: { readonly relation: string; readonly inputs: Readonly<Record<string, string>> };\n}\n\n/** One applied-case record in the catalog file. @internal */\nexport interface AppliedCaseRecord {\n readonly id: string;\n readonly title: string;\n readonly parameters: readonly EvaluatorParameter[];\n readonly governing: AppliedCase['governing'];\n readonly observable: string;\n readonly outputs: readonly AppliedCaseOutputRecord[];\n readonly checks: readonly AppliedCaseCheckRecord[];\n readonly conditions: readonly string[];\n readonly comparison?: CaseComparison;\n readonly notIncluded: readonly string[];\n readonly measurement: readonly string[];\n readonly links: readonly { readonly id: string; readonly role: string }[];\n readonly examples: { readonly valid: CaseExample; readonly failures: readonly CaseExample[] };\n readonly regimeAt?: string;\n}\n\n/** The on-disk catalog shape. @internal */\nexport interface AppliedCaseFile {\n readonly schemaVersion: 1;\n readonly cases: readonly AppliedCaseRecord[];\n}\n\nconst OPS = new Set<AppliedCaseCheckRecord['op']>(['<=', '>=', '>']);\n\n/**\n * Per-case module names B8 deleted. The published package has no `src/`, so\n * this list is the loader's record; {@link isForbiddenCaseModule} and the\n * directory test fail if one of these, or a new `case-*.ts`, comes back.\n */\nexport const FORBIDDEN_PER_CASE_MODULES = [\n 'skin-depth.ts',\n 'kepler-rv.ts',\n 'damped-resonator.ts',\n 'resistor-noise.ts',\n 'lumped-cooling.ts',\n 'brownian-sphere.ts',\n] as const;\n\n/** True for a deleted per-case file or a new `case-*.ts` under `src/cases/`. */\nexport function isForbiddenCaseModule(name: string): boolean {\n return (FORBIDDEN_PER_CASE_MODULES as readonly string[]).includes(name)\n || /^case-.+\\.ts$/.test(name);\n}\n\n/**\n * Parse and validate catalog text. Schema problems and semantic problems throw\n * with every message listed.\n * @internal\n */\nexport function readAppliedCaseFile(text: string, schema: JsonSchema = dataSchema('applied-cases.json')): AppliedCaseFile {\n const parsed = parseDataFile('applied-cases.json', text, schema) as AppliedCaseFile;\n catalogSemanticProblems(parsed).forEach((msg) => {\n throw new Error(msg);\n });\n return parsed;\n}\n\n/** Semantic rules a schema cannot state. @internal */\nexport function catalogSemanticProblems(file: AppliedCaseFile, methodNames?: ReadonlySet<string>): string[] {\n const problems: string[] = [];\n const seen = new Set<string>();\n for (const row of file.cases) {\n if (row.id.length === 0) problems.push('applied-cases: a case is missing id');\n if (seen.has(row.id)) problems.push(`applied-cases: duplicate id '${row.id}'`);\n seen.add(row.id);\n for (const check of row.checks) {\n if (!OPS.has(check.op)) problems.push(`${row.id}: check '${check.id}' has unknown op '${check.op}'`);\n if (check.expr.trim().length === 0) problems.push(`${row.id}: check '${check.id}' has no expr`);\n }\n if (methodNames !== undefined) {\n for (const output of row.outputs) {\n const kinds = [output.expr !== undefined, output.relation !== undefined, output.method !== undefined].filter(Boolean).length;\n if (kinds !== 1) {\n problems.push(`${row.id}: output '${output.key}' must have exactly one of expr, relation, method`);\n } else if (output.method !== undefined && !methodNames.has(output.method)) {\n problems.push(`${row.id}: output '${output.key}' names unknown method '${output.method}'`);\n } else if (output.relation !== undefined) {\n const rel = catalogRelations().find((r) => r.id === output.relation!.relation);\n if (rel === undefined) {\n problems.push(`${row.id}: output '${output.key}' names unknown relation '${output.relation.relation}'`);\n }\n }\n }\n }\n }\n return problems;\n}\n\n/** `data/applied-cases.json`, checked once per process. @internal */\nexport function appliedCaseCatalog(): AppliedCaseFile {\n return checkedDataFile('applied-cases.json') as AppliedCaseFile;\n}\n\n/** One record by id; throws when the id is absent. @internal */\nexport function appliedCaseRecord(id: string): AppliedCaseRecord {\n const row = appliedCaseCatalog().cases.find((c) => c.id === id);\n if (row === undefined) throw new Error(`applied-cases.json: no case '${id}'`);\n return row;\n}\n\n/** Declarative fields of an {@link AppliedCase} as a catalog record (no `run`). @internal */\nexport function projectAppliedCaseRecord(\n c: AppliedCase,\n checks: readonly AppliedCaseCheckRecord[],\n): AppliedCaseRecord {\n const { run: _run, regimeAt: _regime, ...rest } = c;\n return {\n ...rest,\n outputs: rest.outputs.map((o) => ({ key: o.key, symbol: o.symbol, unit: o.unit, meaning: o.meaning })),\n checks: [...checks],\n };\n}\n\n/** Attach a runtime implementation to a catalog record. @internal */\nexport function assembleAppliedCase(\n record: AppliedCaseRecord,\n impl: Pick<AppliedCase, 'run'> & { regimeAt?: AppliedCase['regimeAt'] },\n): AppliedCase {\n return {\n id: record.id,\n title: record.title,\n parameters: record.parameters,\n governing: record.governing,\n observable: record.observable,\n outputs: record.outputs.map((o) => ({ key: o.key, symbol: o.symbol, unit: o.unit, meaning: o.meaning })),\n conditions: record.conditions,\n comparison: record.comparison,\n notIncluded: record.notIncluded,\n measurement: record.measurement,\n links: record.links,\n examples: record.examples,\n regimeAt: impl.regimeAt,\n run: impl.run,\n };\n}\n\n/** Every catalog id in file order. @internal */\nexport function appliedCaseIds(): readonly string[] {\n return appliedCaseCatalog().cases.map((c) => c.id);\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { AppliedCaseRecord } from './catalog.js';
2
+ import { type CaseResult } from './types.js';
3
+ /** Resolve a catalog output field through a named numeric method. */
4
+ export type CaseOutputMethod = (inputs: Readonly<Record<string, number>>, outputs: Readonly<Record<string, number | null>>) => number | null;
5
+ type CaseMethodMap = Record<string, CaseOutputMethod | ((...args: never[]) => unknown)>;
6
+ /** Wire catalog `method` names to implementations (called from `methods.ts` at load). @internal */
7
+ export declare function registerCaseMethods(map: CaseMethodMap): void;
8
+ /** True when the record drives outputs through the catalog engine rather than a legacy runner. @internal */
9
+ export declare function usesCatalogEngine(record: AppliedCaseRecord): boolean;
10
+ /** Run one catalog record whose outputs are wired as expressions or methods. @internal */
11
+ export declare function runAppliedCaseEngine(record: AppliedCaseRecord, inputs: Readonly<Record<string, number>>): CaseResult;
12
+ export {};
13
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/cases/engine.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAmD,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACvG,OAAO,EAA0C,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAErF,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GAAG,CAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,KAC7C,MAAM,GAAG,IAAI,CAAC;AAEnB,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC;AAGxF,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAE5D;AAMD,4GAA4G;AAC5G,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAYpE;AA+ID,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CA8BpH"}
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Evaluate applied-case outputs and checks from catalog `expr`, `relation`, and
3
+ * `method` fields.
4
+ *
5
+ * @module cases/engine
6
+ */
7
+ import { catalogRelations } from '../bridges/catalog-load.js';
8
+ import { evaluateCatalogRelation } from '../bridges/relation-eval.js';
9
+ import { evaluateFormula } from '../bridges/expr-parse.js';
10
+ import { convertValue } from '../dimensional/units.js';
11
+ import { check, requirePositive } from './types.js';
12
+ let registeredCaseMethods = {};
13
+ /** Wire catalog `method` names to implementations (called from `methods.ts` at load). @internal */
14
+ export function registerCaseMethods(map) {
15
+ registeredCaseMethods = map;
16
+ }
17
+ const DELEGATED_RUN_METHODS = new Set(['runCaseResistorNoise', 'runCaseLumpedCooling', 'runCaseBrownianSphere']);
18
+ const ENGINE_CASE_IDS = new Set(['case-skin-depth', 'case-kepler-rv', 'case-damped-resonator']);
19
+ /** True when the record drives outputs through the catalog engine rather than a legacy runner. @internal */
20
+ export function usesCatalogEngine(record) {
21
+ if (ENGINE_CASE_IDS.has(record.id))
22
+ return true;
23
+ const wired = (o) => o.expr !== undefined || o.relation !== undefined || o.method !== undefined;
24
+ if (!record.outputs.every(wired))
25
+ return false;
26
+ if (record.outputs.every((o) => o.method !== undefined && DELEGATED_RUN_METHODS.has(o.method)))
27
+ return false;
28
+ return record.outputs.some((o) => o.expr !== undefined ||
29
+ o.relation !== undefined ||
30
+ (o.method !== undefined && !DELEGATED_RUN_METHODS.has(o.method)));
31
+ }
32
+ function mergeBindings(inputs, outputs, extra = {}) {
33
+ const merged = { ...inputs, ...extra };
34
+ for (const [key, value] of Object.entries(outputs)) {
35
+ if (value !== null && Number.isFinite(value))
36
+ merged[key] = value;
37
+ }
38
+ return merged;
39
+ }
40
+ function evalOutputExpr(expr, inputs, outputs, extra = {}) {
41
+ return evaluateFormula(expr, mergeBindings(inputs, outputs, extra));
42
+ }
43
+ function evalRelationOutput(relationId, inputMap, scope) {
44
+ const rel = catalogRelations().find((row) => row.id === relationId);
45
+ if (rel === undefined)
46
+ throw new Error(`applied case: relation '${relationId}' is not in the catalog`);
47
+ const relInputs = {};
48
+ for (const [target, expr] of Object.entries(inputMap)) {
49
+ relInputs[target] = evaluateFormula(expr, scope);
50
+ }
51
+ return evaluateCatalogRelation(rel, relInputs);
52
+ }
53
+ function evalOutput(row, inputs, outputs, extra = {}) {
54
+ const bindings = mergeBindings(inputs, outputs, extra);
55
+ if (row.expr !== undefined)
56
+ return evalOutputExpr(row.expr, inputs, outputs, extra);
57
+ if (row.relation !== undefined)
58
+ return evalRelationOutput(row.relation.relation, row.relation.inputs, bindings);
59
+ if (row.method !== undefined) {
60
+ const fn = registeredCaseMethods[row.method];
61
+ if (fn === undefined)
62
+ throw new Error(`applied case: unknown method '${row.method}'`);
63
+ return fn(inputs, outputs);
64
+ }
65
+ throw new Error(`applied case: output '${row.key}' has no expr, relation, or method`);
66
+ }
67
+ function evalCheck(row, inputs, outputs, extra = {}) {
68
+ const value = evalOutputExpr(row.expr, inputs, outputs, extra);
69
+ return check(row.id, row.premise, row.quantity, value, row.op, row.bound, row.threshold);
70
+ }
71
+ const SKIN_UNCHECKED = [
72
+ 'ρ, μ_r and ε_r are the values at the conductor\'s temperature and at f; τ = l/v assumes one carrier species with one speed',
73
+ 'the conductor is planar on the scale of δ (a wire of radius a needs a ≫ δ, not checked here)',
74
+ ];
75
+ const KEPLER_UNCHECKED = [
76
+ 'no third body: an outer companion adds its own reflex signal and perturbs P and ω',
77
+ 'the companion\'s radius is also small beside r_p (only the star\'s is checked)',
78
+ ];
79
+ const DAMPED_UNDERDAMPED_OUTPUTS = new Set([
80
+ 'f_d_Hz',
81
+ 'x_m',
82
+ 'envelope_m',
83
+ 'linewidth_windowed_Hz',
84
+ 'windowed_excess',
85
+ ]);
86
+ const DAMPED_DEFERRED_OUTPUTS = new Set(['x_th_rms_m', 'envelope_rms_m']);
87
+ function validateKeplerInputs(id, inputs) {
88
+ requirePositive(id, inputs, ['M_star_kg', 'm_p_kg', 'P_s', 'sin_i', 'R_star_m', 'T_obs_s']);
89
+ const e = inputs.eccentricity;
90
+ if (!Number.isFinite(e) || e < 0 || e >= 1)
91
+ throw new Error(`${id}: eccentricity must be in [0, 1) (got ${e})`);
92
+ if (inputs.sin_i > 1)
93
+ throw new Error(`${id}: sin_i must be in (0, 1] (got ${inputs.sin_i})`);
94
+ return { julian_year_s: convertValue('1 yr', 's').value };
95
+ }
96
+ function validateDampedInputs(id, inputs) {
97
+ requirePositive(id, inputs, ['f0_Hz', 'Q', 't_obs_s']);
98
+ const { x0_m: x0, t_s: t } = inputs;
99
+ if (!Number.isFinite(x0))
100
+ throw new Error(`${id}: x0_m must be finite (got ${x0})`);
101
+ if (!Number.isFinite(t) || t < 0)
102
+ throw new Error(`${id}: t_s must be a finite number ≥ 0 (got ${t})`);
103
+ if ((inputs.T_K === undefined) !== (inputs.k_N_per_m === undefined)) {
104
+ throw new Error(`${id}: give T_K and k_N_per_m together, or neither`);
105
+ }
106
+ return { underdamped: inputs.Q > 0.5 };
107
+ }
108
+ function runDampedEngine(record, inputs) {
109
+ const { underdamped } = validateDampedInputs(record.id, inputs);
110
+ const outputs = {};
111
+ for (const row of record.outputs) {
112
+ if (DAMPED_DEFERRED_OUTPUTS.has(row.key))
113
+ continue;
114
+ if (!underdamped && DAMPED_UNDERDAMPED_OUTPUTS.has(row.key)) {
115
+ outputs[row.key] = null;
116
+ continue;
117
+ }
118
+ outputs[row.key] = evalOutput(row, inputs, outputs);
119
+ }
120
+ let xTh = null;
121
+ if (inputs.T_K !== undefined) {
122
+ requirePositive(record.id, inputs, ['T_K', 'k_N_per_m']);
123
+ xTh = evalOutputExpr('sqrt(k_B*T_K/k_N_per_m)', inputs, outputs);
124
+ outputs.x_th_rms_m = xTh;
125
+ const envelope = outputs.envelope_m;
126
+ outputs.envelope_rms_m =
127
+ envelope === null || xTh === null ? null : evalOutputExpr('sqrt(envelope_m^2 + 2*x_th_rms_m^2)', inputs, outputs);
128
+ }
129
+ else {
130
+ outputs.x_th_rms_m = null;
131
+ outputs.envelope_rms_m = null;
132
+ }
133
+ const checks = record.checks
134
+ .filter((row) => {
135
+ if (row.id !== 'above-thermal')
136
+ return true;
137
+ return xTh !== null && outputs.envelope_m !== null;
138
+ })
139
+ .map((row) => evalCheck(row, inputs, outputs));
140
+ const unchecked = underdamped
141
+ ? ['the damping is viscous (velocity-proportional) and the same over the whole ring-down']
142
+ : ['for Q ≤ 1/2 the displacement is x0 (r₂e^{r₁t} − r₁e^{r₂t})/(r₂ − r₁) with real r₁, r₂; this case does not evaluate it'];
143
+ if (inputs.T_K !== undefined) {
144
+ unchecked.push('the thermal motion is in equilibrium with the damping bath at T and uncorrelated with the release; the read-out adds no noise of its own');
145
+ }
146
+ return { outputs, checks, unchecked };
147
+ }
148
+ /** Run one catalog record whose outputs are wired as expressions or methods. @internal */
149
+ export function runAppliedCaseEngine(record, inputs) {
150
+ if (record.id === 'case-damped-resonator')
151
+ return runDampedEngine(record, inputs);
152
+ let extra = {};
153
+ if (record.id === 'case-skin-depth') {
154
+ requirePositive(record.id, inputs, [
155
+ 'rho_ohm_m',
156
+ 'f_Hz',
157
+ 'mu_r',
158
+ 'eps_r',
159
+ 'l_mfp_m',
160
+ 'v_carrier_m_per_s',
161
+ 'thickness_m',
162
+ ]);
163
+ }
164
+ else if (record.id === 'case-kepler-rv') {
165
+ extra = validateKeplerInputs(record.id, inputs);
166
+ }
167
+ const outputs = {};
168
+ for (const row of record.outputs) {
169
+ outputs[row.key] = evalOutput(row, inputs, outputs, extra);
170
+ }
171
+ const checks = record.checks.map((row) => evalCheck(row, inputs, outputs, extra));
172
+ const unchecked = record.id === 'case-skin-depth'
173
+ ? [...SKIN_UNCHECKED]
174
+ : record.id === 'case-kepler-rv'
175
+ ? [...KEPLER_UNCHECKED]
176
+ : [];
177
+ return { outputs, checks, unchecked };
178
+ }
179
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/cases/engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,eAAe,EAAmC,MAAM,YAAY,CAAC;AASrF,IAAI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\n *\n * @module cases/engine\n */\nimport { catalogRelations } from '../bridges/catalog-load.js';\nimport { evaluateCatalogRelation } from '../bridges/relation-eval.js';\nimport { evaluateFormula } from '../bridges/expr-parse.js';\nimport { convertValue } from '../dimensional/units.js';\nimport type { AppliedCaseCheckRecord, AppliedCaseOutputRecord, AppliedCaseRecord } from './catalog.js';\nimport { check, requirePositive, type CaseCheck, type CaseResult } from './types.js';\n\n/** Resolve a catalog output field through a named numeric method. */\nexport type CaseOutputMethod = (\n inputs: Readonly<Record<string, number>>,\n outputs: Readonly<Record<string, number | null>>,\n) => number | null;\n\ntype CaseMethodMap = Record<string, CaseOutputMethod | ((...args: never[]) => unknown)>;\nlet registeredCaseMethods: CaseMethodMap = {};\n\n/** Wire catalog `method` names to implementations (called from `methods.ts` at load). @internal */\nexport function registerCaseMethods(map: CaseMethodMap): void {\n registeredCaseMethods = map;\n}\n\nconst DELEGATED_RUN_METHODS = new Set(['runCaseResistorNoise', 'runCaseLumpedCooling', 'runCaseBrownianSphere']);\n\nconst ENGINE_CASE_IDS = new Set(['case-skin-depth', 'case-kepler-rv', 'case-damped-resonator']);\n\n/** True when the record drives outputs through the catalog engine rather than a legacy runner. @internal */\nexport function usesCatalogEngine(record: AppliedCaseRecord): boolean {\n if (ENGINE_CASE_IDS.has(record.id)) return true;\n const wired = (o: AppliedCaseOutputRecord) =>\n o.expr !== undefined || o.relation !== undefined || o.method !== undefined;\n if (!record.outputs.every(wired)) return false;\n if (record.outputs.every((o) => o.method !== undefined && DELEGATED_RUN_METHODS.has(o.method!))) return false;\n return record.outputs.some(\n (o) =>\n o.expr !== undefined ||\n o.relation !== undefined ||\n (o.method !== undefined && !DELEGATED_RUN_METHODS.has(o.method)),\n );\n}\n\nfunction mergeBindings(\n inputs: Readonly<Record<string, number>>,\n outputs: Readonly<Record<string, number | null>>,\n extra: Readonly<Record<string, number>> = {},\n): Record<string, number> {\n const merged: Record<string, number> = { ...inputs, ...extra };\n for (const [key, value] of Object.entries(outputs)) {\n if (value !== null && Number.isFinite(value)) merged[key] = value;\n }\n return merged;\n}\n\nfunction evalOutputExpr(\n expr: string,\n inputs: Readonly<Record<string, number>>,\n outputs: Readonly<Record<string, number | null>>,\n extra: Readonly<Record<string, number>> = {},\n): number {\n return evaluateFormula(expr, mergeBindings(inputs, outputs, extra));\n}\n\nfunction evalRelationOutput(\n relationId: string,\n inputMap: Readonly<Record<string, string>>,\n scope: Record<string, number>,\n): number {\n const rel = catalogRelations().find((row) => row.id === relationId);\n if (rel === undefined) throw new Error(`applied case: relation '${relationId}' is not in the catalog`);\n const relInputs: Record<string, number> = {};\n for (const [target, expr] of Object.entries(inputMap)) {\n relInputs[target] = evaluateFormula(expr, scope);\n }\n return evaluateCatalogRelation(rel, relInputs);\n}\n\nfunction evalOutput(\n row: AppliedCaseOutputRecord,\n inputs: Readonly<Record<string, number>>,\n outputs: Readonly<Record<string, number | null>>,\n extra: Readonly<Record<string, number>> = {},\n): number | null {\n const bindings = mergeBindings(inputs, outputs, extra);\n if (row.expr !== undefined) return evalOutputExpr(row.expr, inputs, outputs, extra);\n if (row.relation !== undefined) return evalRelationOutput(row.relation.relation, row.relation.inputs, bindings);\n if (row.method !== undefined) {\n const fn = registeredCaseMethods[row.method] as CaseOutputMethod | undefined;\n if (fn === undefined) throw new Error(`applied case: unknown method '${row.method}'`);\n return fn(inputs, outputs);\n }\n throw new Error(`applied case: output '${row.key}' has no expr, relation, or method`);\n}\n\nfunction evalCheck(\n row: AppliedCaseCheckRecord,\n inputs: Readonly<Record<string, number>>,\n outputs: Readonly<Record<string, number | null>>,\n extra: Readonly<Record<string, number>> = {},\n) {\n const value = evalOutputExpr(row.expr, inputs, outputs, extra);\n return check(row.id, row.premise, row.quantity, value, row.op, row.bound, row.threshold);\n}\n\nconst SKIN_UNCHECKED = [\n 'ρ, μ_r and ε_r are the values at the conductor\\'s temperature and at f; τ = l/v assumes one carrier species with one speed',\n 'the conductor is planar on the scale of δ (a wire of radius a needs a ≫ δ, not checked here)',\n] as const;\n\nconst KEPLER_UNCHECKED = [\n 'no third body: an outer companion adds its own reflex signal and perturbs P and ω',\n 'the companion\\'s radius is also small beside r_p (only the star\\'s is checked)',\n] as const;\n\nconst DAMPED_UNDERDAMPED_OUTPUTS = new Set([\n 'f_d_Hz',\n 'x_m',\n 'envelope_m',\n 'linewidth_windowed_Hz',\n 'windowed_excess',\n]);\n\nconst DAMPED_DEFERRED_OUTPUTS = new Set(['x_th_rms_m', 'envelope_rms_m']);\n\nfunction validateKeplerInputs(id: string, inputs: Readonly<Record<string, number>>): Record<string, number> {\n requirePositive(id, inputs, ['M_star_kg', 'm_p_kg', 'P_s', 'sin_i', 'R_star_m', 'T_obs_s']);\n const e = inputs.eccentricity;\n if (!Number.isFinite(e) || e < 0 || e >= 1) throw new Error(`${id}: eccentricity must be in [0, 1) (got ${e})`);\n if (inputs.sin_i! > 1) throw new Error(`${id}: sin_i must be in (0, 1] (got ${inputs.sin_i})`);\n return { julian_year_s: convertValue('1 yr', 's').value };\n}\n\nfunction validateDampedInputs(id: string, inputs: Readonly<Record<string, number>>): { underdamped: boolean } {\n requirePositive(id, inputs, ['f0_Hz', 'Q', 't_obs_s']);\n const { x0_m: x0, t_s: t } = inputs;\n if (!Number.isFinite(x0)) throw new Error(`${id}: x0_m must be finite (got ${x0})`);\n if (!Number.isFinite(t) || t! < 0) throw new Error(`${id}: t_s must be a finite number ≥ 0 (got ${t})`);\n if ((inputs.T_K === undefined) !== (inputs.k_N_per_m === undefined)) {\n throw new Error(`${id}: give T_K and k_N_per_m together, or neither`);\n }\n return { underdamped: inputs.Q! > 0.5 };\n}\n\nfunction runDampedEngine(record: AppliedCaseRecord, inputs: Readonly<Record<string, number>>): CaseResult {\n const { underdamped } = validateDampedInputs(record.id, inputs);\n const outputs: Record<string, number | null> = {};\n for (const row of record.outputs) {\n if (DAMPED_DEFERRED_OUTPUTS.has(row.key)) continue;\n if (!underdamped && DAMPED_UNDERDAMPED_OUTPUTS.has(row.key)) {\n outputs[row.key] = null;\n continue;\n }\n outputs[row.key] = evalOutput(row, inputs, outputs);\n }\n let xTh: number | null = null;\n if (inputs.T_K !== undefined) {\n requirePositive(record.id, inputs, ['T_K', 'k_N_per_m']);\n xTh = evalOutputExpr('sqrt(k_B*T_K/k_N_per_m)', inputs, outputs);\n outputs.x_th_rms_m = xTh;\n const envelope = outputs.envelope_m;\n outputs.envelope_rms_m =\n envelope === null || xTh === null ? null : evalOutputExpr('sqrt(envelope_m^2 + 2*x_th_rms_m^2)', inputs, outputs);\n } else {\n outputs.x_th_rms_m = null;\n outputs.envelope_rms_m = null;\n }\n const checks: CaseCheck[] = record.checks\n .filter((row) => {\n if (row.id !== 'above-thermal') return true;\n return xTh !== null && outputs.envelope_m !== null;\n })\n .map((row) => evalCheck(row, inputs, outputs));\n const unchecked = underdamped\n ? ['the damping is viscous (velocity-proportional) and the same over the whole ring-down']\n : ['for Q ≤ 1/2 the displacement is x0 (r₂e^{r₁t} − r₁e^{r₂t})/(r₂ − r₁) with real r₁, r₂; this case does not evaluate it'];\n if (inputs.T_K !== undefined) {\n unchecked.push(\n 'the thermal motion is in equilibrium with the damping bath at T and uncorrelated with the release; the read-out adds no noise of its own',\n );\n }\n return { outputs, checks, unchecked };\n}\n\n/** Run one catalog record whose outputs are wired as expressions or methods. @internal */\nexport function runAppliedCaseEngine(record: AppliedCaseRecord, inputs: Readonly<Record<string, number>>): CaseResult {\n if (record.id === 'case-damped-resonator') return runDampedEngine(record, inputs);\n\n let extra: Record<string, number> = {};\n if (record.id === 'case-skin-depth') {\n requirePositive(record.id, inputs, [\n 'rho_ohm_m',\n 'f_Hz',\n 'mu_r',\n 'eps_r',\n 'l_mfp_m',\n 'v_carrier_m_per_s',\n 'thickness_m',\n ]);\n } else if (record.id === 'case-kepler-rv') {\n extra = validateKeplerInputs(record.id, inputs);\n }\n\n const outputs: Record<string, number | null> = {};\n for (const row of record.outputs) {\n outputs[row.key] = evalOutput(row, inputs, outputs, extra);\n }\n const checks = record.checks.map((row) => evalCheck(row, inputs, outputs, extra));\n const unchecked =\n record.id === 'case-skin-depth'\n ? [...SKIN_UNCHECKED]\n : record.id === 'case-kepler-rv'\n ? [...KEPLER_UNCHECKED]\n : [];\n return { outputs, checks, unchecked };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cases/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE9F,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9G,gCAAgC;AAChC,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAE1D,CAAC;AAoBF,oHAAoH;AACpH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAuE,CAAC;AAEtI;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAO/F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cases/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE9F,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAK9G,gCAAgC;AAChC,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAwB,CAAC;AAoBpF,oHAAoH;AACpH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAuE,CAAC;AAEtI;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAO/F"}
@@ -3,15 +3,13 @@
3
3
  *
4
4
  * @module cases
5
5
  */
6
- import { BROWNIAN_SPHERE_CASE } from './brownian-sphere.js';
7
- import { DAMPED_RESONATOR_CASE } from './damped-resonator.js';
8
- import { KEPLER_RV_CASE } from './kepler-rv.js';
9
- import { LUMPED_COOLING_CASE } from './lumped-cooling.js';
10
- import { RESISTOR_NOISE_CASE } from './resistor-noise.js';
11
- import { SKIN_DEPTH_CASE } from './skin-depth.js';
6
+ import { appliedCaseCatalog } from './catalog.js';
7
+ import { APPLIED_CASE_RUNNERS } from './methods.js';
12
8
  import { checkInputs, inputContract } from '../bridges/input-contract.js';
9
+ /** Validate the catalog once at load. @internal */
10
+ appliedCaseCatalog();
13
11
  /** Case id → case. @internal */
14
- export const APPLIED_CASES = new Map([RESISTOR_NOISE_CASE, BROWNIAN_SPHERE_CASE, DAMPED_RESONATOR_CASE, SKIN_DEPTH_CASE, LUMPED_COOLING_CASE, KEPLER_RV_CASE].map((c) => [c.id, c]));
12
+ export const APPLIED_CASES = APPLIED_CASE_RUNNERS;
15
13
  /**
16
14
  * The declared inputs of a case: one listed slot per parameter, spelled by its
17
15
  * key and converted from its alternates, required unless the parameter is optional.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cases/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,E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AC,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtI;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU,EAAE,MAAwC;IACjF,MAAM,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,4BAA4B,EAAE,aAAa,CAAC,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtG,CAAC;IACD,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * The applied-case registry behind `upt evaluate case-<id>`.\n *\n * @module cases\n */\nimport { BROWNIAN_SPHERE_CASE } from './brownian-sphere.js';\nimport { DAMPED_RESONATOR_CASE } from './damped-resonator.js';\nimport { KEPLER_RV_CASE } from './kepler-rv.js';\nimport { LUMPED_COOLING_CASE } from './lumped-cooling.js';\nimport { RESISTOR_NOISE_CASE } from './resistor-noise.js';\nimport { SKIN_DEPTH_CASE } from './skin-depth.js';\nimport type { AppliedCase, CaseResult } from './types.js';\nimport { checkInputs, inputContract, type InputContract } from '../bridges/input-contract.js';\n\nexport type { AppliedCase, CaseCheck, CaseComparison, CaseExample, CaseOutput, CaseResult } from './types.js';\n\n/** Case id → case. @internal */\nexport const APPLIED_CASES: ReadonlyMap<string, AppliedCase> = new Map(\n [RESISTOR_NOISE_CASE, BROWNIAN_SPHERE_CASE, DAMPED_RESONATOR_CASE, SKIN_DEPTH_CASE, LUMPED_COOLING_CASE, KEPLER_RV_CASE].map((c) => [c.id, c]),\n);\n\n/**\n * The declared inputs of a case: one listed slot per parameter, spelled by its\n * key and converted from its alternates, required unless the parameter is optional.\n */\nfunction caseContract(c: AppliedCase): InputContract {\n return inputContract(\n c.id,\n c.parameters.map((p) => ({\n key: p.key,\n spellings: [p.key],\n alternates: (p.alternates ?? []).map((alt) => ({ key: alt.key, toKey: alt.toKey })),\n optional: p.optional === true,\n readBy: 'value' as const,\n listed: true,\n })),\n );\n}\n\n/** Case id → its input contract, built once at load (a contract that spells one key twice fails here). @internal */\nexport const CASE_CONTRACTS: ReadonlyMap<string, InputContract> = new Map([...APPLIED_CASES].map(([id, c]) => [id, caseContract(c)]));\n\n/**\n * Run a case with a numeric input record. The inputs go through the same\n * {@link checkInputs} contract as a catalog evaluator before the case's model runs.\n * @throws Error on an unknown id.\n * @throws UnknownInputError, InputTypeError, NonFiniteInputError, DuplicateInputError or\n * MissingInputError on an input the contract refuses.\n * @throws Error from the case's model on an input outside its domain.\n * @internal\n */\nexport function runAppliedCase(id: string, inputs: Readonly<Record<string, number>>): CaseResult {\n const c = APPLIED_CASES.get(id);\n const contract = CASE_CONTRACTS.get(id);\n if (c === undefined || contract === undefined) {\n throw new Error(`runAppliedCase: no case '${id}' (cases: ${[...APPLIED_CASES.keys()].join(', ')})`);\n }\n return c.run(checkInputs(contract, inputs));\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cases/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAsB,MAAM,8BAA8B,CAAC;AAI9F,mDAAmD;AACnD,kBAAkB,EAAE,CAAC;AAErB,gCAAgC;AAChC,MAAM,CAAC,MAAM,aAAa,GAAqC,oBAAoB,CAAC;AAEpF;;;GAGG;AACH,SAAS,YAAY,CAAC,CAAc;IAClC,OAAO,aAAa,CAClB,CAA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EAAE,MAAM,CAAC,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * The applied-case registry behind `upt evaluate case-<id>`.\n *\n * @module cases\n */\nimport { appliedCaseCatalog } from './catalog.js';\nimport { APPLIED_CASE_RUNNERS } from './methods.js';\nimport type { AppliedCase, CaseResult } from './types.js';\nimport { checkInputs, inputContract, type InputContract } from '../bridges/input-contract.js';\n\nexport type { AppliedCase, CaseCheck, CaseComparison, CaseExample, CaseOutput, CaseResult } from './types.js';\n\n/** Validate the catalog once at load. @internal */\nappliedCaseCatalog();\n\n/** Case id → case. @internal */\nexport const APPLIED_CASES: ReadonlyMap<string, AppliedCase> = APPLIED_CASE_RUNNERS;\n\n/**\n * The declared inputs of a case: one listed slot per parameter, spelled by its\n * key and converted from its alternates, required unless the parameter is optional.\n */\nfunction caseContract(c: AppliedCase): InputContract {\n return inputContract(\n c.id,\n c.parameters.map((p) => ({\n key: p.key,\n spellings: [p.key],\n alternates: (p.alternates ?? []).map((alt) => ({ key: alt.key, toKey: alt.toKey })),\n optional: p.optional === true,\n readBy: 'value' as const,\n listed: true,\n })),\n );\n}\n\n/** Case id → its input contract, built once at load (a contract that spells one key twice fails here). @internal */\nexport const CASE_CONTRACTS: ReadonlyMap<string, InputContract> = new Map([...APPLIED_CASES].map(([id, c]) => [id, caseContract(c)]));\n\n/**\n * Run a case with a numeric input record. The inputs go through the same\n * {@link checkInputs} contract as a catalog evaluator before the case's model runs.\n * @throws Error on an unknown id.\n * @throws UnknownInputError, InputTypeError, NonFiniteInputError, DuplicateInputError or\n * MissingInputError on an input the contract refuses.\n * @throws Error from the case's model on an input outside its domain.\n * @internal\n */\nexport function runAppliedCase(id: string, inputs: Readonly<Record<string, number>>): CaseResult {\n const c = APPLIED_CASES.get(id);\n const contract = CASE_CONTRACTS.get(id);\n if (c === undefined || contract === undefined) {\n throw new Error(`runAppliedCase: no case '${id}' (cases: ${[...APPLIED_CASES.keys()].join(', ')})`);\n }\n return c.run(checkInputs(contract, inputs));\n}\n"]}
@@ -0,0 +1,215 @@
1
+ import { type AppliedCase, type CaseResult, type LumpedRadiating } from './types.js';
2
+ /** Lumped body with radiative cooling parameters (re-export). */
3
+ export type { LumpedRadiating } from './types.js';
4
+ /** ωε/σ ceiling: the displacement current then moves the penetration depth by ≈ ωε/(2σ) ≤ 0.5%. @internal */
5
+ export declare const MAX_DISPLACEMENT_RATIO = 0.01;
6
+ /** l/δ ceiling for a local (classical) conductivity. @internal */
7
+ export declare const MAX_MFP_RATIO = 0.1;
8
+ /** ωτ ceiling: the Drude σ(ω) = σ0/(1 − iωτ) is then within 0.5% of σ0 in modulus. @internal */
9
+ export declare const MAX_OMEGA_TAU = 0.1;
10
+ /** d/δ floor: the field reaching the back face is then ≤ e^{−5} ≈ 0.7% of the surface field. @internal */
11
+ export declare const MIN_THICKNESS_RATIO = 5;
12
+ /**
13
+ * δ_Maxwell/δ for the plane wave k² = ω²με + iωμσ, as a function of r = ωε/σ:
14
+ * 1/Im k = δ √(√(1 + r²) + r), written without the cancellation of |z| − Re z.
15
+ * @internal
16
+ */
17
+ export declare function maxwellDepthFactor(r: number): number;
18
+ /** Parent penetration depth δ_M from classical δ and r = ωε/σ. @internal */
19
+ export declare function skinDeltaMaxwellM(_inputs: Readonly<Record<string, number>>, outputs: Readonly<Record<string, number | null>>): number;
20
+ /**
21
+ * Evaluate the skin-depth applied case at the given SI inputs.
22
+ * @internal
23
+ */
24
+ export declare function runCaseSkinDepth(i: Readonly<Record<string, number>>): CaseResult;
25
+ /** The Julian year, the year BE-52 takes (s): the unit table's `julian_year` row (`yr`). @internal */
26
+ export declare const JULIAN_YEAR_S: number;
27
+ /** m_p/M_* ceiling: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%. @internal */
28
+ export declare const MAX_MASS_RATIO = 0.01;
29
+ /** Ceiling on the stellar radius over the periastron separation, for point masses. @internal */
30
+ export declare const MAX_RADIUS_RATIO = 0.1;
31
+ /** G(M_* + m_p)/(c² a) ceiling for Newtonian gravity. @internal */
32
+ export declare const MAX_WEAK_FIELD = 0.0001;
33
+ /** e·Δω accumulated over the record (rad) ceiling for a fixed ellipse. @internal */
34
+ export declare const MAX_APSIDAL_MISFIT = 0.01;
35
+ /**
36
+ * Evaluate the Kepler radial-velocity applied case at the given SI inputs.
37
+ * @internal
38
+ */
39
+ export declare function runCaseKeplerRv(i: Readonly<Record<string, number>>): CaseResult;
40
+ /** Q floor for the single-Lorentzian (near-resonance) form of the spectrum. @internal */
41
+ export declare const MIN_Q_LORENTZIAN = 10;
42
+ /** (1/t_obs)/linewidth ceiling: the record resolves the line. @internal */
43
+ export declare const MAX_RESOLUTION_RATIO = 0.1;
44
+ /**
45
+ * √(k_BT/k)/A ceiling. Thermal motion of one mode is x = X cos ω_d t + Y sin ω_d t
46
+ * with ⟨X²⟩ = ⟨Y²⟩ = k_BT/k (equipartition), so the envelope of the ring-down
47
+ * plus it is Rician with ⟨A_obs²⟩ = A² + 2k_BT/k (Rice 1944); at the ceiling
48
+ * √(1 + 2·0.01) − 1 ≈ 0.0100.
49
+ * @internal
50
+ */
51
+ export declare const MAX_THERMAL_RATIO = 0.1;
52
+ /**
53
+ * FWHM in Hz of |∫₀ᵀ e^{−(α + iΔω)t} dt|², the near-resonance power spectrum of
54
+ * a ring-down x0 e^{−αt} cos(ω_d t) recorded for T. The negative-frequency
55
+ * pole is dropped, which is the Q ≫ 1 approximation. The peak is at Δω = 0:
56
+ * the integrand is positive, so |X(Δω)| ≤ X(0).
57
+ * @internal
58
+ */
59
+ export declare function windowedLinewidthHz(alpha: number, T: number): number;
60
+ /** Catalog engine: FWHM of the truncated ring-down spectrum (null when overdamped). @internal */
61
+ export declare function windowedLinewidthCatalogHz(inputs: Readonly<Record<string, number>>, outputs: Readonly<Record<string, number | null>>): number | null;
62
+ /**
63
+ * Evaluate the damped-resonator applied case at the given SI inputs.
64
+ * @internal
65
+ */
66
+ export declare function runCaseDampedResonator(i: Readonly<Record<string, number>>): CaseResult;
67
+ /** h f_hi/(k_B T) ceiling: the Planck factor x/(eˣ−1) is then within x/2 ≤ 0.5% of 1. @internal */
68
+ export declare const CLASSICAL_MAX_X = 0.01;
69
+ /** 2π f_hi R_eff C_in ceiling: the input RC pole then passes 1/(1+w²) ≥ 99% at f_hi. @internal */
70
+ export declare const FLAT_BAND_MAX_WRC = 0.1;
71
+ /**
72
+ * Ceiling on σ(S_R)/S_R = 1/(φ√(B t_avg)): the resistor's noise power, left after
73
+ * subtracting an exactly known amplifier power, scatters by ≤ 1%. The total
74
+ * power scatters by 1/√(B t_avg) (Dicke 1946); φ is the resistor's share of it.
75
+ * @internal
76
+ */
77
+ export declare const AMPLIFIER_MAX_REL_SIGMA = 0.01;
78
+ /**
79
+ * Evaluate the resistor thermal-noise applied case at the given SI inputs.
80
+ * @internal
81
+ */
82
+ export declare function runCaseResistorNoise(i: Readonly<Record<string, number>>): CaseResult;
83
+ /** The Stefan–Boltzmann constant (W m⁻² K⁻⁴) is `core/constants`'s; re-exported so the record's module-export table keeps its row. @internal */
84
+ export { SIGMA_SB_SI } from '../core/constants.js';
85
+ /** Bi = h L_c/k ceiling, L_c = V/A (Incropera §5.2, eq. 5.10). @internal */
86
+ export declare const MAX_BIOT = 0.1;
87
+ /** h_rad,max/h ceiling for a loss linear in T − T∞. @internal */
88
+ export declare const MAX_RADIATION_RATIO = 0.1;
89
+ /**
90
+ * T(t) of ρcV dT/dt = −A[h(T − T∞) + εσ_SB(T⁴ − T∞⁴)] for a sphere (V/A =
91
+ * a/3), by classical RK4 (`integrateRK4`, MathTS `solveODESystem` with `dt`,
92
+ * one call per step) with each step 1/100 of the local relaxation time
93
+ * ρca/(3(h + 4εσ_SB T³)). Stops early once |T − T∞| is below 1e-15 |T0 − T∞|.
94
+ * @internal
95
+ */
96
+ export declare function lumpedRadiatingTemperature(p: LumpedRadiating): number;
97
+ /**
98
+ * The first n roots of 1 − ζ cot ζ = Bi (Bi = h a/k, radius-based): the n-th
99
+ * lies in ((n−1)π, nπ), where the left side runs from −∞ (0 for n = 1) to +∞.
100
+ * Each is MathTS `findRoot` (Brent) on that interval, pulled in from the
101
+ * poles by a few ulps of kπ, since the solver evaluates both ends: at 0 the
102
+ * function is 0/0, and at an exact multiple of π `Math.tan` has no sign to
103
+ * trust. The tolerance is the bracket's own floating-point resolution.
104
+ * @internal
105
+ */
106
+ export declare function sphereEigenvalues(biRadius: number, n: number): number[];
107
+ /**
108
+ * θ/θ0 = (T − T∞)/(T0 − T∞) from the series solution of the sphere with a
109
+ * convective surface, at Fourier number Fo = αt/a², for the volume mean, the
110
+ * centre and the surface. Terms are summed until e^{−ζ²Fo} < 1e-18.
111
+ * @throws Error when Fo is so small that the series would need over 1e5 terms.
112
+ * @internal
113
+ */
114
+ export declare function sphereSeries(biRadius: number, fo: number): {
115
+ mean: number;
116
+ centre: number;
117
+ surface: number;
118
+ };
119
+ /**
120
+ * Evaluate the lumped thermal cooling applied case at the given SI inputs.
121
+ * @internal
122
+ */
123
+ export declare function runCaseLumpedCooling(i: Readonly<Record<string, number>>): CaseResult;
124
+ /** Standard gravity (CGPM 1901), for the sedimentation speed: the unit table's `standard_gravity` row, read as newtons per kilogram-force. @internal */
125
+ export declare const G_STANDARD: number;
126
+ /** The thresholds `ab-stokes-einstein` states: Re ≤ 0.1 and τ_p/t ≤ 0.01. @internal */
127
+ export declare const MAX_RE = 0.1;
128
+ /** τ_p/t ceiling beside the Stokes–Einstein regime. @internal */
129
+ export declare const MAX_TAU_P_RATIO = 0.01;
130
+ /** Ceiling on the memory term's own share of the MSD, |MSD_H/MSD_OU − 1|. @internal */
131
+ export declare const MAX_MEMORY_CORRECTION = 0.01;
132
+ /** (v_s t)²/(2Dt) ceiling along gravity when the vertical axis is tracked. @internal */
133
+ export declare const MAX_DRIFT_RATIO = 0.01;
134
+ /** Ceiling on |MSD/MSD_wall − 1|: the wall's correction to the tracked MSD is negligible. @internal */
135
+ export declare const MAX_WALL_CORRECTION = 0.01;
136
+ /** Ceiling on the last retained Faxén term (a/h)⁵/16 over the series' value. @internal */
137
+ export declare const MAX_FAXEN_LAST_TERM = 0.01;
138
+ /** Ceiling on √(2 D_⊥ t)/(h − a): the height, and so D_∥ and D_⊥, barely change over t. @internal */
139
+ export declare const MAX_WALL_EXCURSION = 0.1;
140
+ /** t − τ(1 − e^{−t/τ}) in units of τ, i.e. x − (1 − e^{−x}), without its cancellation at small x. @internal */
141
+ export declare function ballisticDeficit(x: number): number;
142
+ /**
143
+ * MSD/(2Dt) per axis for a sphere with fluid inertia: added mass and the Basset
144
+ * memory force, in an unbounded incompressible fluid, velocities in equilibrium.
145
+ *
146
+ * The velocity autocorrelation has the Laplace transform
147
+ * Ĉ(s) = k_BT/(M s + γ(1 + √(s τ_f))), M = m + m_f/2, from the frequency-dependent
148
+ * Stokes drag γ(1 + √(sτ_f)) + s m_f/2 (Stokes 1851; the Basset 1888 term is its
149
+ * √s part; Hinch 1975, J. Fluid Mech. 72, 499; Clercx & Schram 1992, Phys. Rev.
150
+ * A 46, 1942). Its poles in √s both have negative real part, so Ĉ has none on the
151
+ * principal sheet and C(t) is the branch-cut integral
152
+ * C(t) = (k_BT/πγ) ∫₀^∞ e^{−ut} √(τ_f u)/((1 − τ_p u)² + τ_f u) du, τ_p = M/γ.
153
+ * Then ⟨Δx²⟩ = 2∫₀ᵗ (t − s) C(s) ds, and with v = ut,
154
+ * MSD/(2Dt) = (1/π) ∫₀^∞ √(βv) (v − 1 + e^{−v}) / (v² ((1 − αv)² + βv)) dv, α = τ_p/t, β = τ_f/t,
155
+ * integrated here over ln v by MathTS `quad` (adaptive Gauss–Kronrod), split at v = 1, 1/β and around
156
+ * the near-resonance at v = 1/α (width √(β/α) in ln v; β/α ≤ 9 for any densities).
157
+ *
158
+ * Limits: → 1 − 2√(τ_f/(πt)) + (τ_f − τ_p)/t for t ≫ τ_p, τ_f (expanding Ĉ in √s),
159
+ * whose second derivative is the VACF tail k_BT/(12 ρ_f (πνt)^{3/2}); → t/(2τ_p)
160
+ * for t ≪ τ_p, i.e. ⟨Δx²⟩ → (k_BT/M) t². Requires β > 0: without memory the
161
+ * poles reach the principal sheet and this integral no longer holds them.
162
+ * @internal
163
+ */
164
+ export declare function hydrodynamicMsdRatio(alpha: number, beta: number): number;
165
+ /**
166
+ * D_∥/D₀ for a sphere translating parallel to a plane wall, centre at h:
167
+ * 1 − (9/16)ξ + (1/8)ξ³ − (45/256)ξ⁴ − (1/16)ξ⁵, ξ = a/h (Faxén 1923, method of
168
+ * reflections, as quoted in Happel & Brenner 1965, Low Reynolds Number
169
+ * Hydrodynamics, ch. 7). A series in a/h, truncated:
170
+ * its error is not bounded here, and near contact it misses the logarithmic
171
+ * lubrication divergence of the drag.
172
+ * @internal
173
+ */
174
+ export declare function faxenParallel(aOverH: number): number;
175
+ /**
176
+ * λ = F/(6πηaU) for a sphere approaching a plane wall head-on, centre at h > a,
177
+ * exact in Stokes flow (Brenner 1961, Chem. Eng. Sci. 16, 242, bispherical coordinates):
178
+ * λ = (4/3) sinh α Σₙ n(n+1)/((2n−1)(2n+3)) · [(2 sinh(2n+1)α + (2n+1) sinh 2α) /
179
+ * (4 sinh²(n+½)α − (2n+1)² sinh²α) − 1], cosh α = h/a. D_⊥ = D₀/λ.
180
+ *
181
+ * The bracket is rewritten over 4 sinh²(n+½)α so that no sinh overflows; its
182
+ * terms fall as e^{−(2n+1)α}, so near contact (α → 0) the sum needs ~40/α terms,
183
+ * and the low-n denominators lose ~α⁻² of relative precision to cancellation.
184
+ * Limits: λ → 1 + (9/8)(a/h) far away (Lorentz 1907); λ → a/δ + (1/5) ln(a/δ) +
185
+ * 0.971 as the gap δ = h − a → 0 (Cox & Brenner 1967, Chem. Eng. Sci. 22, 1753).
186
+ * @throws Error if h/a ≤ 1.
187
+ * @internal
188
+ */
189
+ export declare function brennerPerpendicular(hOverA: number): number;
190
+ /** Regime tag string for the brownian-sphere case at the current inputs and outputs. */
191
+ export declare function brownianSphereRegimeAt(inputs: Readonly<Record<string, number>>, outputs: Readonly<Record<string, number | null>>): string;
192
+ /**
193
+ * Evaluate the brownian-sphere applied case at the given SI inputs.
194
+ * @internal
195
+ */
196
+ export declare function runCaseBrownianSphere(i: Readonly<Record<string, number>>): CaseResult;
197
+ /** Case id → case assembled from the catalog and a runner. @internal */
198
+ export declare const APPLIED_CASE_RUNNERS: ReadonlyMap<string, AppliedCase>;
199
+ /** Names exported numeric methods for catalog validation. @internal */
200
+ export declare const CASE_METHOD_NAMES: ReadonlySet<string>;
201
+ /** Named numeric methods invoked from catalog output `method` fields. */
202
+ export declare const CASE_METHODS: Record<string, (...args: never[]) => unknown>;
203
+ /** Assembled skin-depth applied case (catalog + runner). */
204
+ export declare const SKIN_DEPTH_CASE: AppliedCase;
205
+ /** Assembled Kepler RV applied case (catalog + runner). */
206
+ export declare const KEPLER_RV_CASE: AppliedCase;
207
+ /** Assembled damped-resonator applied case (catalog + runner). */
208
+ export declare const DAMPED_RESONATOR_CASE: AppliedCase;
209
+ /** Assembled resistor-noise applied case (catalog + runner). */
210
+ export declare const RESISTOR_NOISE_CASE: AppliedCase;
211
+ /** Assembled lumped-cooling applied case (catalog + runner). */
212
+ export declare const LUMPED_COOLING_CASE: AppliedCase;
213
+ /** Assembled brownian-sphere applied case (catalog + runner). */
214
+ export declare const BROWNIAN_SPHERE_CASE: AppliedCase;
215
+ //# sourceMappingURL=methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/cases/methods.ts"],"names":[],"mappings":"AAcA,OAAO,EAAoD,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvI,iEAAiE;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,6GAA6G;AAC7G,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,kEAAkE;AAClE,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,gGAAgG;AAChG,eAAO,MAAM,aAAa,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