universal-physics-tensor 10.0.0 → 11.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 (720) hide show
  1. package/README.md +4 -3
  2. package/bin/upt.mjs +13 -1
  3. package/data/atlas/atlas.json +25 -25
  4. package/data/atlas/atlas.jsonld +1 -1
  5. package/data/atlas/diffusion.json +6 -6
  6. package/data/atlas/oscillators.json +7 -7
  7. package/data/atlas/waves.json +14 -14
  8. package/data/atlas/witness-results.json +11 -11
  9. package/data/bridge-catalog.json +371 -228
  10. package/data/bridge-catalog.schema.json +45 -7
  11. package/dist/atlas/applicability.d.ts.map +1 -1
  12. package/dist/atlas/applicability.js +21 -15
  13. package/dist/atlas/applicability.js.map +1 -1
  14. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
  15. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  16. package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
  17. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  18. package/dist/atlas/benchmark/loader.js +2 -2
  19. package/dist/atlas/benchmark/loader.js.map +1 -1
  20. package/dist/atlas/benchmark/stats.d.ts +2 -2
  21. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  22. package/dist/atlas/benchmark/stats.js +15 -7
  23. package/dist/atlas/benchmark/stats.js.map +1 -1
  24. package/dist/atlas/catalog-formal-ref.d.ts +26 -3
  25. package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
  26. package/dist/atlas/catalog-formal-ref.js +52 -5
  27. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  28. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  29. package/dist/atlas/chain-pipeline.js +7 -8
  30. package/dist/atlas/chain-pipeline.js.map +1 -1
  31. package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
  32. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  33. package/dist/atlas/diffusion/bridges-closure.js +8 -12
  34. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  35. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  36. package/dist/atlas/diffusion/bridges.js +27 -39
  37. package/dist/atlas/diffusion/bridges.js.map +1 -1
  38. package/dist/atlas/diffusion/dimensions.d.ts +6 -14
  39. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
  40. package/dist/atlas/diffusion/dimensions.js +8 -16
  41. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  42. package/dist/atlas/diffusion/models.d.ts +3 -3
  43. package/dist/atlas/diffusion/models.d.ts.map +1 -1
  44. package/dist/atlas/diffusion/models.js +5 -10
  45. package/dist/atlas/diffusion/models.js.map +1 -1
  46. package/dist/atlas/diffusion/numerics.d.ts +16 -4
  47. package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
  48. package/dist/atlas/diffusion/numerics.js +38 -24
  49. package/dist/atlas/diffusion/numerics.js.map +1 -1
  50. package/dist/atlas/link-prediction.d.ts +106 -3
  51. package/dist/atlas/link-prediction.d.ts.map +1 -1
  52. package/dist/atlas/link-prediction.js +212 -66
  53. package/dist/atlas/link-prediction.js.map +1 -1
  54. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  55. package/dist/atlas/oscillators/bridges-coarse.js +7 -11
  56. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  57. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  58. package/dist/atlas/oscillators/bridges-exact.js +6 -7
  59. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  60. package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
  61. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  62. package/dist/atlas/oscillators/bridges-limits.js +23 -34
  63. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  64. package/dist/atlas/oscillators/dimensions.d.ts +9 -21
  65. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
  66. package/dist/atlas/oscillators/dimensions.js +9 -21
  67. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  68. package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
  69. package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
  70. package/dist/atlas/oscillators/limit-witnesses.js +17 -15
  71. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  72. package/dist/atlas/oscillators/models.d.ts.map +1 -1
  73. package/dist/atlas/oscillators/models.js +2 -6
  74. package/dist/atlas/oscillators/models.js.map +1 -1
  75. package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
  76. package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
  77. package/dist/atlas/oscillators/pendulum-motion.js +60 -40
  78. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  79. package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
  80. package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
  81. package/dist/atlas/oscillators/phase-translation.js +3 -4
  82. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  83. package/dist/atlas/oscillators/position-translation.d.ts +68 -7
  84. package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
  85. package/dist/atlas/oscillators/position-translation.js +123 -12
  86. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  87. package/dist/atlas/oscillators/rejections.d.ts +0 -2
  88. package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
  89. package/dist/atlas/oscillators/rejections.js +0 -7
  90. package/dist/atlas/oscillators/rejections.js.map +1 -1
  91. package/dist/atlas/physjs-entries.generated.d.ts +25 -24
  92. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  93. package/dist/atlas/physjs-entries.generated.js +25 -24
  94. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  95. package/dist/atlas/physjs-ref.d.ts +34 -31
  96. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  97. package/dist/atlas/physjs-ref.js +55 -53
  98. package/dist/atlas/physjs-ref.js.map +1 -1
  99. package/dist/atlas/physjs-reviewed.d.ts +1 -1
  100. package/dist/atlas/physjs-reviewed.js +15 -15
  101. package/dist/atlas/physjs-reviewed.js.map +1 -1
  102. package/dist/atlas/poster/statements.d.ts +0 -19
  103. package/dist/atlas/poster/statements.d.ts.map +1 -1
  104. package/dist/atlas/poster/statements.js +1 -1
  105. package/dist/atlas/poster/statements.js.map +1 -1
  106. package/dist/atlas/proof-target.d.ts +1 -1
  107. package/dist/atlas/proof-target.js +1 -1
  108. package/dist/atlas/proof-target.js.map +1 -1
  109. package/dist/atlas/regime.d.ts +1 -1
  110. package/dist/atlas/regime.d.ts.map +1 -1
  111. package/dist/atlas/regime.js +1 -1
  112. package/dist/atlas/regime.js.map +1 -1
  113. package/dist/atlas/text-overlap.d.ts +23 -0
  114. package/dist/atlas/text-overlap.d.ts.map +1 -0
  115. package/dist/atlas/text-overlap.js +41 -0
  116. package/dist/atlas/text-overlap.js.map +1 -0
  117. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  118. package/dist/atlas/waves/bridges-closure.js +2 -6
  119. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  120. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  121. package/dist/atlas/waves/bridges.js +32 -48
  122. package/dist/atlas/waves/bridges.js.map +1 -1
  123. package/dist/atlas/waves/models.d.ts +5 -6
  124. package/dist/atlas/waves/models.d.ts.map +1 -1
  125. package/dist/atlas/waves/models.js +7 -13
  126. package/dist/atlas/waves/models.js.map +1 -1
  127. package/dist/atlas/waves/numerics.d.ts.map +1 -1
  128. package/dist/atlas/waves/numerics.js +10 -3
  129. package/dist/atlas/waves/numerics.js.map +1 -1
  130. package/dist/atlas/witness-numeric.d.ts +30 -0
  131. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  132. package/dist/atlas/witness-numeric.js +53 -0
  133. package/dist/atlas/witness-numeric.js.map +1 -1
  134. package/dist/atlas/witness-specs.d.ts.map +1 -1
  135. package/dist/atlas/witness-specs.js +19 -0
  136. package/dist/atlas/witness-specs.js.map +1 -1
  137. package/dist/atlas/witness-symbolic.d.ts +75 -3
  138. package/dist/atlas/witness-symbolic.d.ts.map +1 -1
  139. package/dist/atlas/witness-symbolic.js +116 -10
  140. package/dist/atlas/witness-symbolic.js.map +1 -1
  141. package/dist/bridges/catalog-load.d.ts.map +1 -1
  142. package/dist/bridges/catalog-load.js +13 -8
  143. package/dist/bridges/catalog-load.js.map +1 -1
  144. package/dist/bridges/catalog-types.d.ts +26 -2
  145. package/dist/bridges/catalog-types.d.ts.map +1 -1
  146. package/dist/bridges/catalog-types.js +11 -1
  147. package/dist/bridges/catalog-types.js.map +1 -1
  148. package/dist/bridges/evaluation-errors.d.ts +31 -1
  149. package/dist/bridges/evaluation-errors.d.ts.map +1 -1
  150. package/dist/bridges/evaluation-errors.js +20 -2
  151. package/dist/bridges/evaluation-errors.js.map +1 -1
  152. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  153. package/dist/bridges/evaluator-inputs.js +7 -5
  154. package/dist/bridges/evaluator-inputs.js.map +1 -1
  155. package/dist/bridges/evaluators.d.ts.map +1 -1
  156. package/dist/bridges/evaluators.js +27 -12
  157. package/dist/bridges/evaluators.js.map +1 -1
  158. package/dist/bridges/expr-parse.d.ts +11 -0
  159. package/dist/bridges/expr-parse.d.ts.map +1 -1
  160. package/dist/bridges/expr-parse.js +14 -5
  161. package/dist/bridges/expr-parse.js.map +1 -1
  162. package/dist/bridges/holds.d.ts +35 -3
  163. package/dist/bridges/holds.d.ts.map +1 -1
  164. package/dist/bridges/holds.js +117 -23
  165. package/dist/bridges/holds.js.map +1 -1
  166. package/dist/bridges/notices.d.ts.map +1 -1
  167. package/dist/bridges/notices.js +5 -5
  168. package/dist/bridges/notices.js.map +1 -1
  169. package/dist/bridges/relation-eval.d.ts +4 -4
  170. package/dist/bridges/relation-eval.d.ts.map +1 -1
  171. package/dist/bridges/relation-eval.js +15 -16
  172. package/dist/bridges/relation-eval.js.map +1 -1
  173. package/dist/bridges/sensitivity.d.ts.map +1 -1
  174. package/dist/bridges/sensitivity.js +3 -3
  175. package/dist/bridges/sensitivity.js.map +1 -1
  176. package/dist/bridges/validity.d.ts +33 -0
  177. package/dist/bridges/validity.d.ts.map +1 -0
  178. package/dist/bridges/validity.js +67 -0
  179. package/dist/bridges/validity.js.map +1 -0
  180. package/dist/canonical/entries/atomic.js +1 -3
  181. package/dist/canonical/entries/atomic.js.map +1 -1
  182. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  183. package/dist/canonical/entries/condensed-matter.js +4 -5
  184. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  185. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  186. package/dist/canonical/entries/dimensional-classics.js +3 -4
  187. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  188. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  189. package/dist/canonical/entries/electromagnetism.js +4 -10
  190. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  191. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  192. package/dist/canonical/entries/fluids-waves.js +3 -7
  193. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  194. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  195. package/dist/canonical/entries/mechanics.js +4 -6
  196. package/dist/canonical/entries/mechanics.js.map +1 -1
  197. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  198. package/dist/canonical/entries/nonmonomial.js +9 -17
  199. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  200. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  201. package/dist/canonical/entries/relativity.js +6 -6
  202. package/dist/canonical/entries/relativity.js.map +1 -1
  203. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  204. package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
  205. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  206. package/dist/canonical/fixed-points.d.ts +94 -0
  207. package/dist/canonical/fixed-points.d.ts.map +1 -0
  208. package/dist/canonical/fixed-points.js +81 -0
  209. package/dist/canonical/fixed-points.js.map +1 -0
  210. package/dist/canonical/linkage.d.ts.map +1 -1
  211. package/dist/canonical/linkage.js +25 -44
  212. package/dist/canonical/linkage.js.map +1 -1
  213. package/dist/canonical/normal-form.d.ts.map +1 -1
  214. package/dist/canonical/normal-form.js +5 -11
  215. package/dist/canonical/normal-form.js.map +1 -1
  216. package/dist/canonical/structural.d.ts +21 -21
  217. package/dist/canonical/structural.d.ts.map +1 -1
  218. package/dist/canonical/structural.js +40 -19
  219. package/dist/canonical/structural.js.map +1 -1
  220. package/dist/cases/brownian-sphere.d.ts +3 -3
  221. package/dist/cases/brownian-sphere.d.ts.map +1 -1
  222. package/dist/cases/brownian-sphere.js +6 -5
  223. package/dist/cases/brownian-sphere.js.map +1 -1
  224. package/dist/cases/damped-resonator.d.ts.map +1 -1
  225. package/dist/cases/damped-resonator.js +6 -9
  226. package/dist/cases/damped-resonator.js.map +1 -1
  227. package/dist/cases/kepler-rv.d.ts +1 -1
  228. package/dist/cases/kepler-rv.d.ts.map +1 -1
  229. package/dist/cases/kepler-rv.js +3 -2
  230. package/dist/cases/kepler-rv.js.map +1 -1
  231. package/dist/cases/lumped-cooling.d.ts +8 -3
  232. package/dist/cases/lumped-cooling.d.ts.map +1 -1
  233. package/dist/cases/lumped-cooling.js +21 -23
  234. package/dist/cases/lumped-cooling.js.map +1 -1
  235. package/dist/cases/quadrature.d.ts +7 -9
  236. package/dist/cases/quadrature.d.ts.map +1 -1
  237. package/dist/cases/quadrature.js +28 -32
  238. package/dist/cases/quadrature.js.map +1 -1
  239. package/dist/cases/resistor-noise.js +4 -4
  240. package/dist/cases/resistor-noise.js.map +1 -1
  241. package/dist/cases/skin-depth.d.ts +0 -4
  242. package/dist/cases/skin-depth.d.ts.map +1 -1
  243. package/dist/cases/skin-depth.js +3 -7
  244. package/dist/cases/skin-depth.js.map +1 -1
  245. package/dist/cli/args.d.ts +23 -1
  246. package/dist/cli/args.d.ts.map +1 -1
  247. package/dist/cli/args.js +30 -8
  248. package/dist/cli/args.js.map +1 -1
  249. package/dist/cli/bindings.d.ts.map +1 -1
  250. package/dist/cli/bindings.js +5 -4
  251. package/dist/cli/bindings.js.map +1 -1
  252. package/dist/cli/command.d.ts +8 -1
  253. package/dist/cli/command.d.ts.map +1 -1
  254. package/dist/cli/command.js.map +1 -1
  255. package/dist/cli/commands/_atlas-map.d.ts +0 -9
  256. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  257. package/dist/cli/commands/_atlas-map.js +8 -18
  258. package/dist/cli/commands/_atlas-map.js.map +1 -1
  259. package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
  260. package/dist/cli/commands/_atlas-route.js +6 -2
  261. package/dist/cli/commands/_atlas-route.js.map +1 -1
  262. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  263. package/dist/cli/commands/_discovery-opts.js +8 -9
  264. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  265. package/dist/cli/commands/atlas.d.ts.map +1 -1
  266. package/dist/cli/commands/atlas.js +8 -5
  267. package/dist/cli/commands/atlas.js.map +1 -1
  268. package/dist/cli/commands/audit.d.ts.map +1 -1
  269. package/dist/cli/commands/audit.js +8 -1
  270. package/dist/cli/commands/audit.js.map +1 -1
  271. package/dist/cli/commands/axes.d.ts.map +1 -1
  272. package/dist/cli/commands/axes.js +20 -1
  273. package/dist/cli/commands/axes.js.map +1 -1
  274. package/dist/cli/commands/confront.d.ts.map +1 -1
  275. package/dist/cli/commands/confront.js +8 -14
  276. package/dist/cli/commands/confront.js.map +1 -1
  277. package/dist/cli/commands/derive.d.ts.map +1 -1
  278. package/dist/cli/commands/derive.js +22 -22
  279. package/dist/cli/commands/derive.js.map +1 -1
  280. package/dist/cli/commands/discover.d.ts.map +1 -1
  281. package/dist/cli/commands/discover.js +6 -2
  282. package/dist/cli/commands/discover.js.map +1 -1
  283. package/dist/cli/commands/eval.d.ts.map +1 -1
  284. package/dist/cli/commands/eval.js +1 -0
  285. package/dist/cli/commands/eval.js.map +1 -1
  286. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  287. package/dist/cli/commands/evaluate.js +65 -37
  288. package/dist/cli/commands/evaluate.js.map +1 -1
  289. package/dist/cli/commands/explain.d.ts.map +1 -1
  290. package/dist/cli/commands/explain.js +2 -1
  291. package/dist/cli/commands/explain.js.map +1 -1
  292. package/dist/cli/commands/ground.d.ts.map +1 -1
  293. package/dist/cli/commands/ground.js +1 -0
  294. package/dist/cli/commands/ground.js.map +1 -1
  295. package/dist/cli/commands/map.d.ts.map +1 -1
  296. package/dist/cli/commands/map.js +75 -5
  297. package/dist/cli/commands/map.js.map +1 -1
  298. package/dist/cli/commands/metric.d.ts.map +1 -1
  299. package/dist/cli/commands/metric.js +12 -9
  300. package/dist/cli/commands/metric.js.map +1 -1
  301. package/dist/cli/commands/path.d.ts +10 -0
  302. package/dist/cli/commands/path.d.ts.map +1 -1
  303. package/dist/cli/commands/path.js +25 -3
  304. package/dist/cli/commands/path.js.map +1 -1
  305. package/dist/cli/commands/probe.d.ts.map +1 -1
  306. package/dist/cli/commands/probe.js +59 -16
  307. package/dist/cli/commands/probe.js.map +1 -1
  308. package/dist/cli/commands/regime.d.ts.map +1 -1
  309. package/dist/cli/commands/regime.js +1 -0
  310. package/dist/cli/commands/regime.js.map +1 -1
  311. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  312. package/dist/cli/commands/retrieve.js +1 -0
  313. package/dist/cli/commands/retrieve.js.map +1 -1
  314. package/dist/cli/commands/search.d.ts.map +1 -1
  315. package/dist/cli/commands/search.js +1 -0
  316. package/dist/cli/commands/search.js.map +1 -1
  317. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  318. package/dist/cli/commands/symbolic.js +19 -28
  319. package/dist/cli/commands/symbolic.js.map +1 -1
  320. package/dist/cli/commands/testplan.d.ts.map +1 -1
  321. package/dist/cli/commands/testplan.js +4 -2
  322. package/dist/cli/commands/testplan.js.map +1 -1
  323. package/dist/cli/expr-print.d.ts +0 -2
  324. package/dist/cli/expr-print.d.ts.map +1 -1
  325. package/dist/cli/expr-print.js +7 -31
  326. package/dist/cli/expr-print.js.map +1 -1
  327. package/dist/cli/main.d.ts +7 -0
  328. package/dist/cli/main.d.ts.map +1 -1
  329. package/dist/cli/main.js +18 -3
  330. package/dist/cli/main.js.map +1 -1
  331. package/dist/cli/numeric-flag.d.ts +12 -0
  332. package/dist/cli/numeric-flag.d.ts.map +1 -0
  333. package/dist/cli/numeric-flag.js +44 -0
  334. package/dist/cli/numeric-flag.js.map +1 -0
  335. package/dist/cli/output.d.ts +20 -0
  336. package/dist/cli/output.d.ts.map +1 -1
  337. package/dist/cli/output.js +15 -0
  338. package/dist/cli/output.js.map +1 -1
  339. package/dist/cli/record-reach.js +2 -2
  340. package/dist/cli/record-reach.js.map +1 -1
  341. package/dist/cli/record-tables.d.ts.map +1 -1
  342. package/dist/cli/record-tables.js +6 -5
  343. package/dist/cli/record-tables.js.map +1 -1
  344. package/dist/cli/record.d.ts +1 -5
  345. package/dist/cli/record.d.ts.map +1 -1
  346. package/dist/cli/record.js +9 -8
  347. package/dist/cli/record.js.map +1 -1
  348. package/dist/cli/search-index.d.ts.map +1 -1
  349. package/dist/cli/search-index.js +7 -6
  350. package/dist/cli/search-index.js.map +1 -1
  351. package/dist/cli/statuses.d.ts +0 -2
  352. package/dist/cli/statuses.d.ts.map +1 -1
  353. package/dist/cli/statuses.js +0 -7
  354. package/dist/cli/statuses.js.map +1 -1
  355. package/dist/cli/stored-results.d.ts +7 -0
  356. package/dist/cli/stored-results.d.ts.map +1 -0
  357. package/dist/cli/stored-results.js +23 -0
  358. package/dist/cli/stored-results.js.map +1 -0
  359. package/dist/cli/version.d.ts.map +1 -1
  360. package/dist/cli/version.js +7 -5
  361. package/dist/cli/version.js.map +1 -1
  362. package/dist/cli-api.d.ts +34 -5
  363. package/dist/cli-api.d.ts.map +1 -1
  364. package/dist/cli-api.js +28 -4
  365. package/dist/cli-api.js.map +1 -1
  366. package/dist/composition/algebraic-equivalence.d.ts +43 -0
  367. package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
  368. package/dist/composition/algebraic-equivalence.js +115 -0
  369. package/dist/composition/algebraic-equivalence.js.map +1 -0
  370. package/dist/composition/axes.d.ts +0 -6
  371. package/dist/composition/axes.d.ts.map +1 -1
  372. package/dist/composition/axes.js +6 -6
  373. package/dist/composition/axes.js.map +1 -1
  374. package/dist/composition/axis-audit.d.ts +47 -20
  375. package/dist/composition/axis-audit.d.ts.map +1 -1
  376. package/dist/composition/axis-audit.js +82 -9
  377. package/dist/composition/axis-audit.js.map +1 -1
  378. package/dist/composition/bridge-analysis.d.ts +17 -0
  379. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  380. package/dist/composition/bridge-analysis.js +102 -55
  381. package/dist/composition/bridge-analysis.js.map +1 -1
  382. package/dist/composition/canonical-compare.d.ts +40 -0
  383. package/dist/composition/canonical-compare.d.ts.map +1 -1
  384. package/dist/composition/canonical-compare.js +122 -24
  385. package/dist/composition/canonical-compare.js.map +1 -1
  386. package/dist/composition/canonical-graph.d.ts +1 -1
  387. package/dist/composition/canonical-graph.d.ts.map +1 -1
  388. package/dist/composition/canonical-graph.js +9 -36
  389. package/dist/composition/canonical-graph.js.map +1 -1
  390. package/dist/composition/canonical-json.js +2 -2
  391. package/dist/composition/canonical-json.js.map +1 -1
  392. package/dist/composition/catalog-graph.d.ts.map +1 -1
  393. package/dist/composition/catalog-graph.js +2 -5
  394. package/dist/composition/catalog-graph.js.map +1 -1
  395. package/dist/composition/chain-candidate.d.ts +8 -0
  396. package/dist/composition/chain-candidate.d.ts.map +1 -1
  397. package/dist/composition/chain-candidate.js +9 -2
  398. package/dist/composition/chain-candidate.js.map +1 -1
  399. package/dist/composition/chain-match.d.ts +6 -3
  400. package/dist/composition/chain-match.d.ts.map +1 -1
  401. package/dist/composition/chain-match.js +4 -1
  402. package/dist/composition/chain-match.js.map +1 -1
  403. package/dist/composition/chain-result.d.ts.map +1 -1
  404. package/dist/composition/chain-result.js +2 -14
  405. package/dist/composition/chain-result.js.map +1 -1
  406. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  407. package/dist/composition/compose-symbolic.js +3 -2
  408. package/dist/composition/compose-symbolic.js.map +1 -1
  409. package/dist/composition/compose.d.ts.map +1 -1
  410. package/dist/composition/compose.js +13 -5
  411. package/dist/composition/compose.js.map +1 -1
  412. package/dist/composition/composition-recovery.d.ts.map +1 -1
  413. package/dist/composition/composition-recovery.js +4 -7
  414. package/dist/composition/composition-recovery.js.map +1 -1
  415. package/dist/composition/discovery.d.ts +56 -0
  416. package/dist/composition/discovery.d.ts.map +1 -1
  417. package/dist/composition/discovery.js +114 -60
  418. package/dist/composition/discovery.js.map +1 -1
  419. package/dist/composition/edge.d.ts +21 -2
  420. package/dist/composition/edge.d.ts.map +1 -1
  421. package/dist/composition/edge.js +23 -1
  422. package/dist/composition/edge.js.map +1 -1
  423. package/dist/composition/enumerate.d.ts.map +1 -1
  424. package/dist/composition/enumerate.js +18 -3
  425. package/dist/composition/enumerate.js.map +1 -1
  426. package/dist/composition/evaluate-relation.d.ts +35 -11
  427. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  428. package/dist/composition/evaluate-relation.js +60 -39
  429. package/dist/composition/evaluate-relation.js.map +1 -1
  430. package/dist/composition/explain.d.ts +3 -12
  431. package/dist/composition/explain.d.ts.map +1 -1
  432. package/dist/composition/explain.js +7 -20
  433. package/dist/composition/explain.js.map +1 -1
  434. package/dist/composition/expr-eval.d.ts.map +1 -1
  435. package/dist/composition/expr-eval.js +2 -11
  436. package/dist/composition/expr-eval.js.map +1 -1
  437. package/dist/composition/expr-simplify.d.ts +16 -0
  438. package/dist/composition/expr-simplify.d.ts.map +1 -1
  439. package/dist/composition/expr-simplify.js +15 -20
  440. package/dist/composition/expr-simplify.js.map +1 -1
  441. package/dist/composition/formula-shape.d.ts +23 -4
  442. package/dist/composition/formula-shape.d.ts.map +1 -1
  443. package/dist/composition/formula-shape.js +57 -17
  444. package/dist/composition/formula-shape.js.map +1 -1
  445. package/dist/composition/graph-structure.d.ts +98 -0
  446. package/dist/composition/graph-structure.d.ts.map +1 -0
  447. package/dist/composition/graph-structure.js +167 -0
  448. package/dist/composition/graph-structure.js.map +1 -0
  449. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  450. package/dist/composition/graph-viz-svg.js +1 -1
  451. package/dist/composition/graph-viz-svg.js.map +1 -1
  452. package/dist/composition/graph-viz.d.ts.map +1 -1
  453. package/dist/composition/graph-viz.js +8 -37
  454. package/dist/composition/graph-viz.js.map +1 -1
  455. package/dist/composition/identifiability.d.ts +91 -4
  456. package/dist/composition/identifiability.d.ts.map +1 -1
  457. package/dist/composition/identifiability.js +363 -6
  458. package/dist/composition/identifiability.js.map +1 -1
  459. package/dist/composition/index.d.ts +8 -4
  460. package/dist/composition/index.d.ts.map +1 -1
  461. package/dist/composition/index.js +3 -2
  462. package/dist/composition/index.js.map +1 -1
  463. package/dist/composition/mathts-quiet.d.ts +4 -3
  464. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  465. package/dist/composition/mathts-quiet.js +4 -3
  466. package/dist/composition/mathts-quiet.js.map +1 -1
  467. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  468. package/dist/composition/mathts-scalar-symbols.js +2 -1
  469. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  470. package/dist/composition/probe/corpus.d.ts +4 -2
  471. package/dist/composition/probe/corpus.d.ts.map +1 -1
  472. package/dist/composition/probe/corpus.js +20 -9
  473. package/dist/composition/probe/corpus.js.map +1 -1
  474. package/dist/composition/probe/dataset.d.ts +17 -0
  475. package/dist/composition/probe/dataset.d.ts.map +1 -1
  476. package/dist/composition/probe/dataset.js +95 -50
  477. package/dist/composition/probe/dataset.js.map +1 -1
  478. package/dist/composition/probe/experiment-design.d.ts +5 -1
  479. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  480. package/dist/composition/probe/experiment-design.js +44 -24
  481. package/dist/composition/probe/experiment-design.js.map +1 -1
  482. package/dist/composition/probe/falsify.d.ts.map +1 -1
  483. package/dist/composition/probe/falsify.js +2 -0
  484. package/dist/composition/probe/falsify.js.map +1 -1
  485. package/dist/composition/probe/fit.d.ts +6 -0
  486. package/dist/composition/probe/fit.d.ts.map +1 -1
  487. package/dist/composition/probe/fit.js +46 -22
  488. package/dist/composition/probe/fit.js.map +1 -1
  489. package/dist/composition/probe/frontier.d.ts.map +1 -1
  490. package/dist/composition/probe/frontier.js +33 -15
  491. package/dist/composition/probe/frontier.js.map +1 -1
  492. package/dist/composition/probe/generator.d.ts +27 -1
  493. package/dist/composition/probe/generator.d.ts.map +1 -1
  494. package/dist/composition/probe/generator.js +53 -30
  495. package/dist/composition/probe/generator.js.map +1 -1
  496. package/dist/composition/probe/index.d.ts +14 -0
  497. package/dist/composition/probe/index.d.ts.map +1 -1
  498. package/dist/composition/probe/index.js +6 -0
  499. package/dist/composition/probe/index.js.map +1 -1
  500. package/dist/composition/probe/limits.d.ts +24 -1
  501. package/dist/composition/probe/limits.d.ts.map +1 -1
  502. package/dist/composition/probe/limits.js +53 -11
  503. package/dist/composition/probe/limits.js.map +1 -1
  504. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  505. package/dist/composition/probe/pipeline.js +10 -4
  506. package/dist/composition/probe/pipeline.js.map +1 -1
  507. package/dist/composition/probe/power-law.d.ts +121 -0
  508. package/dist/composition/probe/power-law.d.ts.map +1 -0
  509. package/dist/composition/probe/power-law.js +255 -0
  510. package/dist/composition/probe/power-law.js.map +1 -0
  511. package/dist/composition/probe/problem.d.ts +7 -4
  512. package/dist/composition/probe/problem.d.ts.map +1 -1
  513. package/dist/composition/probe/problem.js +177 -49
  514. package/dist/composition/probe/problem.js.map +1 -1
  515. package/dist/composition/probe/report.js +1 -1
  516. package/dist/composition/probe/report.js.map +1 -1
  517. package/dist/composition/probe/residual.d.ts +6 -1
  518. package/dist/composition/probe/residual.d.ts.map +1 -1
  519. package/dist/composition/probe/residual.js +9 -7
  520. package/dist/composition/probe/residual.js.map +1 -1
  521. package/dist/composition/probe/structure.d.ts +82 -17
  522. package/dist/composition/probe/structure.d.ts.map +1 -1
  523. package/dist/composition/probe/structure.js +129 -55
  524. package/dist/composition/probe/structure.js.map +1 -1
  525. package/dist/composition/probe/study.d.ts +31 -9
  526. package/dist/composition/probe/study.d.ts.map +1 -1
  527. package/dist/composition/probe/study.js +236 -181
  528. package/dist/composition/probe/study.js.map +1 -1
  529. package/dist/composition/probe/t-tail.d.ts +17 -0
  530. package/dist/composition/probe/t-tail.d.ts.map +1 -0
  531. package/dist/composition/probe/t-tail.js +32 -0
  532. package/dist/composition/probe/t-tail.js.map +1 -0
  533. package/dist/composition/probe/types.d.ts +3 -0
  534. package/dist/composition/probe/types.d.ts.map +1 -1
  535. package/dist/composition/probe/types.js.map +1 -1
  536. package/dist/composition/proposed-bridges.d.ts +41 -10
  537. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  538. package/dist/composition/proposed-bridges.js +100 -55
  539. package/dist/composition/proposed-bridges.js.map +1 -1
  540. package/dist/composition/quantity-clusters.d.ts +48 -0
  541. package/dist/composition/quantity-clusters.d.ts.map +1 -0
  542. package/dist/composition/quantity-clusters.js +98 -0
  543. package/dist/composition/quantity-clusters.js.map +1 -0
  544. package/dist/composition/rational-exponent.d.ts +40 -0
  545. package/dist/composition/rational-exponent.d.ts.map +1 -0
  546. package/dist/composition/rational-exponent.js +65 -0
  547. package/dist/composition/rational-exponent.js.map +1 -0
  548. package/dist/composition/representative-values.d.ts +22 -0
  549. package/dist/composition/representative-values.d.ts.map +1 -1
  550. package/dist/composition/representative-values.js +23 -0
  551. package/dist/composition/representative-values.js.map +1 -1
  552. package/dist/composition/retrodiction.d.ts.map +1 -1
  553. package/dist/composition/retrodiction.js +2 -1
  554. package/dist/composition/retrodiction.js.map +1 -1
  555. package/dist/composition/user-equation.d.ts.map +1 -1
  556. package/dist/composition/user-equation.js +2 -2
  557. package/dist/composition/user-equation.js.map +1 -1
  558. package/dist/core/assignment.d.ts +19 -0
  559. package/dist/core/assignment.d.ts.map +1 -0
  560. package/dist/core/assignment.js +19 -0
  561. package/dist/core/assignment.js.map +1 -0
  562. package/dist/core/compare.d.ts +32 -0
  563. package/dist/core/compare.d.ts.map +1 -0
  564. package/dist/core/compare.js +46 -0
  565. package/dist/core/compare.js.map +1 -0
  566. package/dist/core/constants.d.ts +30 -30
  567. package/dist/core/constants.d.ts.map +1 -1
  568. package/dist/core/constants.js +47 -30
  569. package/dist/core/constants.js.map +1 -1
  570. package/dist/core/data-file.d.ts +7 -0
  571. package/dist/core/data-file.d.ts.map +1 -1
  572. package/dist/core/data-file.js +17 -0
  573. package/dist/core/data-file.js.map +1 -1
  574. package/dist/core/format.d.ts +36 -0
  575. package/dist/core/format.d.ts.map +1 -0
  576. package/dist/core/format.js +39 -0
  577. package/dist/core/format.js.map +1 -0
  578. package/dist/core/hash.d.ts +14 -0
  579. package/dist/core/hash.d.ts.map +1 -0
  580. package/dist/core/hash.js +17 -0
  581. package/dist/core/hash.js.map +1 -0
  582. package/dist/core/json-schema.d.ts +2 -0
  583. package/dist/core/json-schema.d.ts.map +1 -1
  584. package/dist/core/json-schema.js +14 -13
  585. package/dist/core/json-schema.js.map +1 -1
  586. package/dist/core/labeled-tensor.d.ts.map +1 -1
  587. package/dist/core/labeled-tensor.js +0 -8
  588. package/dist/core/labeled-tensor.js.map +1 -1
  589. package/dist/core/mathts-read.d.ts +25 -0
  590. package/dist/core/mathts-read.d.ts.map +1 -0
  591. package/dist/core/mathts-read.js +51 -0
  592. package/dist/core/mathts-read.js.map +1 -0
  593. package/dist/core/tensor.d.ts.map +1 -1
  594. package/dist/core/tensor.js +24 -0
  595. package/dist/core/tensor.js.map +1 -1
  596. package/dist/core/types.d.ts +5 -5
  597. package/dist/diff/bridge-gradient.d.ts +19 -6
  598. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  599. package/dist/diff/bridge-gradient.js +19 -11
  600. package/dist/diff/bridge-gradient.js.map +1 -1
  601. package/dist/diff/bridge-specs.d.ts.map +1 -1
  602. package/dist/diff/bridge-specs.js +3 -0
  603. package/dist/diff/bridge-specs.js.map +1 -1
  604. package/dist/dimensional/algebra.d.ts +18 -0
  605. package/dist/dimensional/algebra.d.ts.map +1 -1
  606. package/dist/dimensional/algebra.js +41 -1
  607. package/dist/dimensional/algebra.js.map +1 -1
  608. package/dist/dimensional/ast-builders.d.ts +7 -0
  609. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  610. package/dist/dimensional/ast-builders.js +11 -0
  611. package/dist/dimensional/ast-builders.js.map +1 -1
  612. package/dist/dimensional/ast-leaves.d.ts +81 -0
  613. package/dist/dimensional/ast-leaves.d.ts.map +1 -0
  614. package/dist/dimensional/ast-leaves.js +146 -0
  615. package/dist/dimensional/ast-leaves.js.map +1 -0
  616. package/dist/dimensional/buckingham.d.ts.map +1 -1
  617. package/dist/dimensional/buckingham.js +15 -27
  618. package/dist/dimensional/buckingham.js.map +1 -1
  619. package/dist/dimensional/constant-rows.js +9 -9
  620. package/dist/dimensional/constant-rows.js.map +1 -1
  621. package/dist/dimensional/dimension-inference.d.ts.map +1 -1
  622. package/dist/dimensional/dimension-inference.js +1 -2
  623. package/dist/dimensional/dimension-inference.js.map +1 -1
  624. package/dist/dimensional/errors.d.ts +1 -1
  625. package/dist/dimensional/errors.d.ts.map +1 -1
  626. package/dist/dimensional/errors.js +1 -15
  627. package/dist/dimensional/errors.js.map +1 -1
  628. package/dist/dimensional/exact-scale.d.ts +0 -17
  629. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  630. package/dist/dimensional/exact-scale.js +8 -8
  631. package/dist/dimensional/exact-scale.js.map +1 -1
  632. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  633. package/dist/dimensional/gauge-field.js +2 -2
  634. package/dist/dimensional/gauge-field.js.map +1 -1
  635. package/dist/dimensional/hyphen-names.d.ts +12 -2
  636. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  637. package/dist/dimensional/hyphen-names.js +44 -19
  638. package/dist/dimensional/hyphen-names.js.map +1 -1
  639. package/dist/dimensional/metric.d.ts.map +1 -1
  640. package/dist/dimensional/metric.js +0 -1
  641. package/dist/dimensional/metric.js.map +1 -1
  642. package/dist/dimensional/symbolic-constants.d.ts +9 -0
  643. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  644. package/dist/dimensional/symbolic-constants.js +13 -1
  645. package/dist/dimensional/symbolic-constants.js.map +1 -1
  646. package/dist/dimensional/types.d.ts +36 -0
  647. package/dist/dimensional/types.d.ts.map +1 -1
  648. package/dist/dimensional/types.js +45 -7
  649. package/dist/dimensional/types.js.map +1 -1
  650. package/dist/dimensional/unit-data.js +2 -2
  651. package/dist/dimensional/unit-data.js.map +1 -1
  652. package/dist/index.d.ts +9 -3
  653. package/dist/index.d.ts.map +1 -1
  654. package/dist/index.js +10 -4
  655. package/dist/index.js.map +1 -1
  656. package/dist/numerical/christoffel-flat.d.ts.map +1 -1
  657. package/dist/numerical/christoffel-flat.js +3 -2
  658. package/dist/numerical/christoffel-flat.js.map +1 -1
  659. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  660. package/dist/numerical/covariant-eikonal.js +34 -11
  661. package/dist/numerical/covariant-eikonal.js.map +1 -1
  662. package/dist/numerical/curvature-lowering-helpers.js +3 -2
  663. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  664. package/dist/numerical/errors.d.ts.map +1 -1
  665. package/dist/numerical/errors.js +0 -3
  666. package/dist/numerical/errors.js.map +1 -1
  667. package/dist/numerical/finite-difference.d.ts +22 -0
  668. package/dist/numerical/finite-difference.d.ts.map +1 -0
  669. package/dist/numerical/finite-difference.js +27 -0
  670. package/dist/numerical/finite-difference.js.map +1 -0
  671. package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
  672. package/dist/numerical/geodesic-integrator.js +22 -14
  673. package/dist/numerical/geodesic-integrator.js.map +1 -1
  674. package/dist/numerical/geometrized.d.ts.map +1 -1
  675. package/dist/numerical/geometrized.js +0 -1
  676. package/dist/numerical/geometrized.js.map +1 -1
  677. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  678. package/dist/numerical/mathts-engine.js +10 -24
  679. package/dist/numerical/mathts-engine.js.map +1 -1
  680. package/dist/numerical/metric-inverse.d.ts.map +1 -1
  681. package/dist/numerical/metric-inverse.js +83 -46
  682. package/dist/numerical/metric-inverse.js.map +1 -1
  683. package/dist/numerical/null-ray-integrator.d.ts +2 -1
  684. package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
  685. package/dist/numerical/null-ray-integrator.js +12 -12
  686. package/dist/numerical/null-ray-integrator.js.map +1 -1
  687. package/dist/numerical/painleve-gullstrand-metric.js +2 -2
  688. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  689. package/dist/numerical/perihelion-finder.d.ts +0 -36
  690. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  691. package/dist/numerical/perihelion-finder.js +41 -87
  692. package/dist/numerical/perihelion-finder.js.map +1 -1
  693. package/dist/numerical/quadrature.d.ts.map +1 -1
  694. package/dist/numerical/quadrature.js +8 -10
  695. package/dist/numerical/quadrature.js.map +1 -1
  696. package/dist/numerical/rk4-trajectory.d.ts +10 -0
  697. package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
  698. package/dist/numerical/rk4-trajectory.js +37 -0
  699. package/dist/numerical/rk4-trajectory.js.map +1 -0
  700. package/dist/numerical/schwarzschild.d.ts +14 -0
  701. package/dist/numerical/schwarzschild.d.ts.map +1 -0
  702. package/dist/numerical/schwarzschild.js +17 -0
  703. package/dist/numerical/schwarzschild.js.map +1 -0
  704. package/dist/numerical/spacetime-metrics.d.ts +12 -0
  705. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  706. package/dist/numerical/spacetime-metrics.js +72 -56
  707. package/dist/numerical/spacetime-metrics.js.map +1 -1
  708. package/dist/numerical/statistics.d.ts +24 -0
  709. package/dist/numerical/statistics.d.ts.map +1 -0
  710. package/dist/numerical/statistics.js +52 -0
  711. package/dist/numerical/statistics.js.map +1 -0
  712. package/dist/numerical/tensor-engine.d.ts +21 -0
  713. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  714. package/dist/numerical/tensor-engine.js +12 -0
  715. package/dist/numerical/tensor-engine.js.map +1 -1
  716. package/dist/relations/regime.d.ts +10 -0
  717. package/dist/relations/regime.d.ts.map +1 -1
  718. package/dist/relations/regime.js +18 -1
  719. package/dist/relations/regime.js.map +1 -1
  720. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"brownian-sphere.js","sourceRoot":"","sources":["../../src/cases/brownian-sphere.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAoB,MAAM,YAAY,CAAC;AAEhG,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAElC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAElC,uFAAuF;AACvF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;AAC1B,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC,uFAAuF;AACvF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC,uGAAuG;AACvG,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,+GAA+G;AAC/G,MAA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AAkB,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;gBAClC,IAAI,EAAE,CAAC;gBACP,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,IAAI;gBACb,aAAa,EAAE,IAAI;gBACnB,EAAE,EAAE,EAAE;gBACN,eAAe,EAAE,WAAW;gBAC5B,kBAAkB,EAAE,GAAG,GAAG,WAAW,GAAG,CAAC;gBACzC,YAAY,EAAE,QAAQ;gBACtB,mBAAmB,EAAE,QAAQ,GAAG,GAAG;gBACnC,eAAe,EAAE,GAAG,GAAG,QAAQ,GAAG,CAAC;gBACnC,iBAAiB,EAAE,MAAM;gBACzB,mBAAmB,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI;gBACvC,eAAe,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI;gBACpC,WAAW,EAAE,IAAI,EAAE,OAAO,IAAI,IAAI;gBAClC,cAAc,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC;aAC9D;YACD,MAAM;YACN,SAAS;SACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: a Brownian sphere tracked in a fluid — the diffusion\n * coefficient and mean-square displacement from the particle's radius and the\n * fluid's viscosity and temperature, with the regime checks that make the\n * Stokes–Einstein scalar applicable.\n *\n * The atlas bridge `ab-stokes-einstein` derives D = k_BT/(6πηa) from the\n * Langevin model and Stokes drag, with Re ≤ 0.1 and m/(γt) ≤ 0.01. This case\n * evaluates it for a named geometry (radius, or diameter through an exact\n * alternate) and fluid, computes Re from the particle's own velocity scales,\n * includes the displaced-fluid added mass in the momentum relaxation time, and\n * evaluates the hydrodynamic memory (the Basset force) that the bridge does not\n * check: the full MSD with fluid inertia, and the correction it makes at t.\n * Given a distance to a plane wall, it applies the wall's drag corrections to D.\n *\n * `CE-stokes-einstein` is encoded only up to its 6π (scalar-up-to-constant);\n * the 6π here comes from Stokes drag, not from that entry.\n *\n * @module cases/brownian-sphere\n */\nimport { K_B_SI } from '../core/constants.js';\nimport { adaptiveSimpson } from './quadrature.js';\nimport { check, requirePositive, signedRelativeDifference, type AppliedCase } from './types.js';\n\nconst ID = 'case-brownian-sphere';\n\n/** Standard gravity (CGPM 1901), for the sedimentation speed. @internal */\nexport const G_STANDARD = 9.80665;\n\n/** The thresholds `ab-stokes-einstein` states: Re ≤ 0.1 and τ_p/t ≤ 0.01. @internal */\nexport const MAX_RE = 0.1;\nexport const MAX_TAU_P_RATIO = 0.01;\n\n/** Ceiling on the memory term's own share of the MSD, |MSD_H/MSD_OU − 1|. @internal */\nexport const MAX_MEMORY_CORRECTION = 0.01;\n\n/** (v_s t)²/(2Dt) ceiling along gravity when the vertical axis is tracked. @internal */\nexport const MAX_DRIFT_RATIO = 0.01;\n\n/** Ceiling on |MSD/MSD_wall − 1|: the wall's correction to the tracked MSD is negligible. @internal */\nexport const MAX_WALL_CORRECTION = 0.01;\n\n/** Ceiling on the last retained Faxén term (a/h)⁵/16 over the series' value. @internal */\nexport const MAX_FAXEN_LAST_TERM = 0.01;\n\n/** Ceiling on √(2 D_⊥ t)/(h − a): the height, and so D_∥ and D_⊥, barely change over t. @internal */\nexport const MAX_WALL_EXCURSION = 0.1;\n\n/** t − τ(1 − e^{−t/τ}) in units of τ, i.e. x − (1 − e^{−x}), without its cancellation at small x. @internal */\nexport function ballisticDeficit(x: number): number {\n return x < 1e-3 ? x * x * (1 / 2 - x / 6 + (x * x) / 24 - (x * x * x) / 120) : x + Math.expm1(-x);\n}\n\n/**\n * MSD/(2Dt) per axis for a sphere with fluid inertia: added mass and the Basset\n * memory force, in an unbounded incompressible fluid, velocities in equilibrium.\n *\n * The velocity autocorrelation has the Laplace transform\n * Ĉ(s) = k_BT/(M s + γ(1 + √(s τ_f))), M = m + m_f/2, from the frequency-dependent\n * Stokes drag γ(1 + √(sτ_f)) + s m_f/2 (Stokes 1851; the Basset 1888 term is its\n * √s part; Hinch 1975, J. Fluid Mech. 72, 499; Clercx & Schram 1992, Phys. Rev.\n * A 46, 1942). Its poles in √s both have negative real part, so Ĉ has none on the\n * principal sheet and C(t) is the branch-cut integral\n * C(t) = (k_BT/πγ) ∫₀^∞ e^{−ut} √(τ_f u)/((1 − τ_p u)² + τ_f u) du, τ_p = M/γ.\n * Then ⟨Δx²⟩ = 2∫₀ᵗ (t − s) C(s) ds, and with v = ut,\n * MSD/(2Dt) = (1/π) ∫₀^∞ √(βv) (v − 1 + e^{−v}) / (v² ((1 − αv)² + βv)) dv, α = τ_p/t, β = τ_f/t,\n * integrated here over ln v by adaptive Simpson, split at v = 1, 1/β and around\n * the near-resonance at v = 1/α (width √(β/α) in ln v; β/α ≤ 9 for any densities).\n *\n * Limits: → 1 − 2√(τ_f/(πt)) + (τ_f − τ_p)/t for t ≫ τ_p, τ_f (expanding Ĉ in √s),\n * whose second derivative is the VACF tail k_BT/(12 ρ_f (πνt)^{3/2}); → t/(2τ_p)\n * for t ≪ τ_p, i.e. ⟨Δx²⟩ → (k_BT/M) t². Requires β > 0: without memory the\n * poles reach the principal sheet and this integral no longer holds them.\n * @internal\n */\nexport function hydrodynamicMsdRatio(alpha: number, beta: number): number {\n const f = (y: number) => {\n const v = Math.exp(y);\n const lag = 1 - alpha * v;\n return (Math.sqrt(beta * v) * (ballisticDeficit(v) / v)) / (lag * lag + beta * v);\n };\n const peak = -Math.log(alpha);\n const w = Math.min(1, Math.sqrt(beta / alpha));\n const points = [0, -Math.log(beta), peak, ...[1, 2, 4].flatMap((k) => [peak - k * w, peak + k * w])].sort((x, y) => x - y);\n // The integrand falls as v^{3/2} below and v^{−3/2} above the breakpoints: e^{−75} at ±50 in ln v.\n const edges = [points[0]! - 50, ...points, points[points.length - 1]! + 50];\n let sum = 0;\n for (let k = 1; k < edges.length; k++) if (edges[k]! > edges[k - 1]!) sum += adaptiveSimpson(f, edges[k - 1]!, edges[k]!, 1e-12);\n return sum / Math.PI;\n}\n\n/**\n * D_∥/D₀ for a sphere translating parallel to a plane wall, centre at h:\n * 1 − (9/16)ξ + (1/8)ξ³ − (45/256)ξ⁴ − (1/16)ξ⁵, ξ = a/h (Faxén 1923, method of\n * reflections, as quoted in Happel & Brenner 1965, Low Reynolds Number\n * Hydrodynamics, ch. 7). A series in a/h, truncated:\n * its error is not bounded here, and near contact it misses the logarithmic\n * lubrication divergence of the drag.\n * @internal\n */\nexport function faxenParallel(aOverH: number): number {\n const x = aOverH;\n return 1 - (9 / 16) * x + (1 / 8) * x ** 3 - (45 / 256) * x ** 4 - (1 / 16) * x ** 5;\n}\n\n/**\n * λ = F/(6πηaU) for a sphere approaching a plane wall head-on, centre at h > a,\n * exact in Stokes flow (Brenner 1961, Chem. Eng. Sci. 16, 242, bispherical coordinates):\n * λ = (4/3) sinh α Σₙ n(n+1)/((2n−1)(2n+3)) · [(2 sinh(2n+1)α + (2n+1) sinh 2α) /\n * (4 sinh²(n+½)α − (2n+1)² sinh²α) − 1], cosh α = h/a. D_⊥ = D₀/λ.\n *\n * The bracket is rewritten over 4 sinh²(n+½)α so that no sinh overflows; its\n * terms fall as e^{−(2n+1)α}, so near contact (α → 0) the sum needs ~40/α terms,\n * and the low-n denominators lose ~α⁻² of relative precision to cancellation.\n * Limits: λ → 1 + (9/8)(a/h) far away (Lorentz 1907); λ → a/δ + (1/5) ln(a/δ) +\n * 0.971 as the gap δ = h − a → 0 (Cox & Brenner 1967, Chem. Eng. Sci. 22, 1753).\n * @throws Error if h/a ≤ 1.\n * @internal\n */\nexport function brennerPerpendicular(hOverA: number): number {\n if (!(hOverA > 1)) throw new Error(`brennerPerpendicular: need h/a > 1 (got ${hOverA})`);\n const al = Math.acosh(hOverA);\n const s = Math.sinh(al);\n const s2a = Math.sinh(2 * al);\n let sum = 0;\n for (let n = 1; ; n++) {\n const x = (n + 0.5) * al;\n const k = 2 * n + 1;\n const inv4Sinh2 = Math.exp(-2 * x) / Math.expm1(-2 * x) ** 2;\n const cothMinus1 = 2 / Math.expm1(2 * x);\n const bracket = (cothMinus1 + k * s2a * inv4Sinh2 + k * k * s * s * inv4Sinh2) / (1 - k * k * s * s * inv4Sinh2);\n const term = ((n * (n + 1)) / ((2 * n - 1) * (2 * n + 3))) * bracket;\n sum += term;\n if (term < 1e-17 * sum) break;\n if (n > 1e7) throw new Error(`brennerPerpendicular: no convergence at h/a = ${hOverA}`);\n }\n return (4 / 3) * s * sum;\n}\n\nexport const BROWNIAN_SPHERE_CASE: AppliedCase = {\n id: ID,\n title: 'Brownian sphere in a fluid (particle geometry, fluid conditions)',\n parameters: [\n { key: 'T_K', quantity: 'temperature', symbol: 'T', unit: 'K', meaning: 'absolute temperature of the fluid, > 0 K', temperature: 'absolute' },\n { key: 'eta_Pa_s', quantity: 'dynamic viscosity', symbol: 'η', unit: 'Pa*s', meaning: 'viscosity of the fluid at T (water at 20 °C ≈ 1.0e-3 Pa·s), > 0' },\n {\n key: 'a_m',\n quantity: 'particle radius',\n symbol: 'a',\n unit: 'm',\n meaning: 'hydrodynamic radius of the sphere, > 0',\n geometry: 'radius',\n alternates: [{ key: 'diameter_m', meaning: 'the diameter 2a of the sphere', toKey: 0.5 }],\n },\n { key: 'rho_p_kg_per_m3', quantity: 'particle density', symbol: 'ρ_p', unit: 'kg/m^3', meaning: 'mass density of the sphere (silica ≈ 2000), > 0' },\n { key: 'rho_f_kg_per_m3', quantity: 'fluid density', symbol: 'ρ_f', unit: 'kg/m^3', meaning: 'mass density of the fluid (water ≈ 998), > 0' },\n { key: 't_s', quantity: 'lag time', symbol: 't', unit: 's', meaning: 'the time over which the displacement is measured, > 0' },\n { key: 'd', quantity: 'tracked dimensions', symbol: 'd', unit: '', meaning: 'number of Cartesian axes tracked: 1, 2 (a microscope image plane, horizontal) or 3' },\n {\n key: 'h_m',\n quantity: 'distance to a wall',\n symbol: 'h',\n unit: 'm',\n meaning: \"distance from the sphere's centre to one plane horizontal wall (a coverslip), > a; leave out when no wall is within many radii\",\n geometry: 'separation',\n optional: true,\n },\n ],\n governing: {\n parent: [\n 'm dv/dt = −γ v + ξ(t), ⟨ξ_i(t) ξ_j(t′)⟩ = 2γ k_BT δ_ij δ(t − t′) (Langevin, a 3-vector equation; model-langevin)',\n 'η ∇²u = ∇p, ∇·u = 0, u = v on the sphere (no slip), u → 0 far away (Stokes creeping flow, a field; model-stokes-drag) ⇒ γ = 6πηa',\n 'm dv/dt = −γ v − (m_f/2) dv/dt − 6a²√(πηρ_f) ∫_{−∞}^t v′(s)/√(t − s) ds + ξ(t), ξ coloured by the same kernel ' +\n '(unsteady Stokes flow: added mass and the Basset memory force; Hinch 1975)',\n ],\n scalar: [\n 'D = k_BT/(6πηa) (Stokes–Einstein; ab-stokes-einstein)',\n '⟨|Δr|²⟩ = 2 d D t over the d tracked axes',\n ],\n distinction:\n 'The parents are a vector stochastic equation for the velocity and a field equation for the flow around the sphere; ' +\n 'the scalar keeps one isotropic number D and a mean-square displacement linear in t. Dropped: the velocity as a ' +\n 'state (the ballistic regime t ≲ τ_p), the flow field (and with it the hydrodynamic memory for t ≲ τ_f), the shape ' +\n 'beyond the radius, and every anisotropy.',\n },\n observable: 'MSD_m2',\n outputs: [\n { key: 'gamma_kg_per_s', symbol: 'γ', unit: 'kg/s', meaning: 'Stokes drag coefficient 6πηa' },\n { key: 'D_m2_per_s', symbol: 'D', unit: 'm^2/s', meaning: 'diffusion coefficient k_BT/(6πηa)' },\n { key: 'MSD_m2', symbol: '⟨|Δr|²⟩', unit: 'm^2', meaning: 'mean-square displacement 2dDt over the tracked axes' },\n { key: 'rms_displacement_m', symbol: '√⟨|Δr|²⟩', unit: 'm', meaning: 'root-mean-square displacement over the tracked axes' },\n { key: 'm_kg', symbol: 'm', unit: 'kg', meaning: 'particle mass (4/3)πa³ρ_p' },\n { key: 'tau_p_s', symbol: 'τ_p', unit: 's', meaning: 'momentum relaxation time (m + m_f/2)/γ, with the displaced-fluid added mass m_f/2' },\n { key: 'tau_f_s', symbol: 'τ_f', unit: 's', meaning: 'vorticity diffusion time ρ_f a²/η over one radius (hydrodynamic memory)' },\n { key: 'v_sed_m_per_s', symbol: 'v_s', unit: 'm/s', meaning: 'Stokes sedimentation speed (2/9)(ρ_p − ρ_f) g a²/η; negative means the sphere rises' },\n { key: 'Re', symbol: 'Re', unit: '', meaning: 'ρ_f a max(√(k_BT/m), |v_s|)/η — radius-based; a diameter-based Re is twice this' },\n { key: 'MSD_langevin_m2', symbol: '⟨|Δr|²⟩_L', unit: 'm^2', meaning: 'the Langevin parent: 2dD[t − τ(1 − e^{−t/τ})], τ = m/γ (bare mass)' },\n { key: 'langevin_deviation', symbol: 'MSD/MSD_L − 1', unit: '', meaning: signedRelativeDifference('diffusive MSD', 'Langevin one') },\n {\n key: 'MSD_hydro_m2',\n symbol: '⟨|Δr|²⟩_H',\n unit: 'm^2',\n meaning: 'the Langevin–Basset parent: added mass and hydrodynamic memory, unbounded incompressible fluid (branch-cut integral of its Laplace-domain VACF)',\n },\n { key: 'hydro_correction_m2', symbol: '⟨|Δr|²⟩_H − ⟨|Δr|²⟩', unit: 'm^2', meaning: 'what inertia and memory change in the MSD at t; ≈ −4dD√(τ_f t/π) at t ≫ τ_f' },\n { key: 'hydro_deviation', symbol: 'MSD/MSD_H − 1', unit: '', meaning: signedRelativeDifference('diffusive MSD', 'Langevin–Basset one') },\n {\n key: 'memory_correction',\n symbol: 'MSD_H/MSD_OU − 1',\n unit: '',\n meaning: \"the memory force's own share: MSD_H against the Ornstein–Uhlenbeck MSD with the same τ_p (added mass, no memory)\",\n },\n { key: 'D_parallel_m2_per_s', symbol: 'D_∥', unit: 'm^2/s', meaning: 'D beside the wall, parallel to it: D·(Faxén series in a/h); not defined without h_m' },\n { key: 'D_perp_m2_per_s', symbol: 'D_⊥', unit: 'm^2/s', meaning: 'D normal to the wall: D/λ, λ from Brenner\\'s exact series; not defined without h_m' },\n { key: 'MSD_wall_m2', symbol: '⟨|Δr|²⟩_w', unit: 'm^2', meaning: '2t(d_∥ D_∥ + d_⊥ D_⊥): the tracked horizontal axes parallel to the wall, a third one normal to it; not defined without h_m' },\n { key: 'wall_deviation', symbol: 'MSD/MSD_w − 1', unit: '', meaning: signedRelativeDifference('unbounded-fluid MSD', 'wall-corrected one', 'not defined without h_m') },\n ],\n comparison: {\n reference: 'the parent Langevin model (bare mass, white noise; it has neither added mass nor hydrodynamic memory)',\n valueKey: 'MSD_m2',\n referenceKey: 'MSD_langevin_m2',\n deviationKey: 'langevin_deviation',\n method: 'closed form of the Ornstein–Uhlenbeck MSD, velocities starting in equilibrium',\n },\n conditions: [\n 'a rigid sphere released at r = 0; its displacement density starts as δ(r) and spreads as a Gaussian of variance 2Dt per axis',\n 'no-slip boundary on the sphere; the fluid is at rest far from it (no imposed flow; no wall within many radii, or with h_m one plane no-slip wall)',\n 'fluid in thermal equilibrium at T; one isolated particle (dilute: no hydrodynamic interaction with others)',\n ],\n notIncluded: [\n 'walls other than one plane: a second wall, a channel or a curved surface; and, with h_m, the spread of heights the sphere samples (D_∥, D_⊥ are taken at h)',\n 'localization error and camera motion blur of the tracking, which offset and bias the measured MSD',\n 'fluid compressibility: the incompressible memory kernel gives ⟨v²⟩ = k_BT/(m + m_f/2) at t = 0; sound restores k_BT/m over a/c_s (Zwanzig & Bixon 1970)',\n 'the memory force near a wall: MSD_hydro is the unbounded-fluid result, and a wall within √(νt) changes the memory tail',\n 'the rotational diffusion of the sphere, and any non-spherical shape',\n ],\n measurement: [\n 'single-particle tracking: fit ⟨|Δr|²⟩(t) over the d tracked axes, slope 2dD; compare D and MSD_m2 at the chosen lag ' +\n '(with N independent displacements the relative scatter of the MSD is ≈ √(2/(dN)))',\n 'subtract the static localization offset 2dσ_loc² (measured on an immobilized particle) before comparing',\n 'dynamic light scattering: the field autocorrelation decays at Γ = D q², an independent route to the same D',\n ],\n links: [\n { id: 'ab-stokes-einstein', role: 'the derivation D = k_BT/(6πηa) with its regime Re ≤ 0.1, m/(γt) ≤ 0.01 (`upt atlas ab-stokes-einstein`)' },\n { id: 'ab-langevin-diffusion', role: 'the overdamped coarse-graining D = k_BT/γ and its ballistic counterexample' },\n { id: 'model-stokes-drag', role: 'the creeping-flow drag γ = 6πηa' },\n { id: 'CE-stokes-einstein', role: 'encoded only up to its dimensionless 6π (scalar-up-to-constant); the 6π here is from Stokes drag' },\n ],\n examples: {\n valid: {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=2000', 'rho_f_kg_per_m3=998', 't_s=1', 'd=2', 'h_m=100um'],\n note: 'a 1 µm-radius silica sphere in water at 20 °C, 100 µm above the coverslip, tracked in the image plane over 1 s',\n fails: [],\n },\n failures: [\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=2000', 'rho_f_kg_per_m3=998', 't_s=1us', 'd=2'],\n note: 'the same sphere over 1 µs: still ballistic (t ≈ 2τ_p) and inside the hydrodynamic memory time',\n fails: ['overdamped', 'memory'],\n },\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=50um', 'rho_p_kg_per_m3=7800', 'rho_f_kg_per_m3=998', 't_s=100', 'd=3'],\n note: 'a 50 µm-radius steel sphere tracked in 3-D: it sinks at ≈ 3.7 cm/s, Re ≈ 1.9, and the drift swamps diffusion',\n fails: ['creeping-flow', 'drift'],\n },\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=1050', 'rho_f_kg_per_m3=998', 't_s=50ms', 'd=2', 'h_m=3um'],\n note: 'a 1 µm-radius polystyrene sphere 3 µm (centre) above the coverslip: the wall slows D_∥ by ≈ 19%',\n fails: ['wall'],\n },\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=1050', 'rho_f_kg_per_m3=998', 't_s=50ms', 'd=2', 'h_m=1.2um'],\n note: 'the same sphere with a 0.2 µm gap: past the range of the Faxén series, and its height changes by more than the gap allows over t',\n fails: ['faxen-range', 'wall', 'wall-static'],\n },\n ],\n },\n /** Evaluate the Stokes-Einstein MSD and regime checks for the supplied Brownian-sphere inputs. */\n regimeAt(inputs, outputs) {\n const re = outputs.Re;\n const m = outputs.m_kg;\n const gamma = outputs.gamma_kg_per_s;\n const t = inputs.t_s;\n if (re == null || m == null || gamma == null || t == null) return '';\n return `upt regime diffusion --at Re=${re} m=${m} gamma=${gamma} t=${t}`;\n },\n /** Compute the Stokes-Einstein diffusion, MSD and regime checks for one set of Brownian-sphere inputs. */\n run(i) {\n requirePositive(ID, i, ['T_K', 'eta_Pa_s', 'a_m', 'rho_p_kg_per_m3', 'rho_f_kg_per_m3', 't_s']);\n const { T_K: T, eta_Pa_s: eta, a_m: a, rho_p_kg_per_m3: rhoP, rho_f_kg_per_m3: rhoF, t_s: t, d } = i as Record<string, number>;\n if (d !== 1 && d !== 2 && d !== 3) throw new Error(`${ID}: d must be 1, 2 or 3 (got ${d})`);\n const kT = K_B_SI * T;\n const gamma = 6 * Math.PI * eta * a;\n const D = kT / gamma;\n const msd = 2 * d * D * t;\n const volume = (4 / 3) * Math.PI * a ** 3;\n const m = volume * rhoP;\n const tauP = (m + 0.5 * volume * rhoF) / gamma;\n const tauF = (rhoF * a * a) / eta;\n const vSed = ((2 / 9) * (rhoP - rhoF) * G_STANDARD * a * a) / eta;\n const re = (rhoF * a * Math.max(Math.sqrt(kT / m), Math.abs(vSed))) / eta;\n const tauBare = m / gamma;\n const msdLangevin = 2 * d * D * tauBare * ballisticDeficit(t / tauBare);\n const msdHydro = msd * hydrodynamicMsdRatio(tauP / t, tauF / t);\n const msdAddedMass = 2 * d * D * tauP * ballisticDeficit(t / tauP);\n const memory = msdHydro / msdAddedMass - 1;\n const checks = [\n check('creeping-flow', 'creeping flow around the sphere, Re ≪ 1', 'ρ_f a max(√(k_BT/m), |v_s|)/η', re, '<=', MAX_RE,\n \"the threshold ab-stokes-einstein states: a chosen machine form of Re ≪ 1\"),\n check('overdamped', 'overdamped times t ≫ τ_p', '(m + m_f/2)/(γ t)', tauP / t, '<=', MAX_TAU_P_RATIO,\n \"ab-stokes-einstein's m/(γt) ≤ 0.01, with the added mass m_f/2 included (stricter)\"),\n check('memory', 'past the hydrodynamic memory, t ≫ τ_f = ρ_f a²/η', '|MSD_H/MSD_OU − 1|', Math.abs(memory), '<=', MAX_MEMORY_CORRECTION,\n 'chosen threshold: the Basset memory changes the MSD by ≤ 1% at t (computed, not estimated; ≈ 2√(τ_f/(πt)) at t ≫ τ_f)'),\n ];\n const unchecked = ['the particle is a rigid sphere and a is its hydrodynamic radius (a coating or a shell changes it)'];\n let wall: { dPar: number; dPerp: number; msdWall: number } | null = null;\n if (i.h_m !== undefined) {\n const h = i.h_m;\n if (!Number.isFinite(h) || !(h > a)) throw new Error(`${ID}: h_m must be a finite distance > a_m, centre to wall (got ${h})`);\n const faxen = faxenParallel(a / h);\n const lambda = brennerPerpendicular(h / a);\n const dPar = D * faxen;\n const dPerp = D / lambda;\n const msdWall = 2 * t * (Math.min(d, 2) * dPar + (d === 3 ? dPerp : 0));\n wall = { dPar, dPerp, msdWall };\n const excursion = Math.sqrt(2 * dPerp * t) + (Math.abs(vSed) * t) / lambda;\n checks.push(\n check('faxen-range', 'the Faxén series in a/h holds for D_∥', '(a/h)⁵/16 ÷ (D_∥/D)', (a / h) ** 5 / 16 / faxen, '<=', MAX_FAXEN_LAST_TERM,\n 'chosen threshold: the last retained term is ≤ 1% of the series — a size estimate of the truncation, not a bound; D_⊥ (Brenner) is exact at any h > a'),\n check('wall', 'the wall correction to the tracked MSD is negligible', '|MSD/MSD_w − 1|', Math.abs(msd / msdWall - 1), '<=', MAX_WALL_CORRECTION,\n 'chosen threshold: the unbounded-fluid D is then within 1% for the tracked axes; otherwise read MSD_wall_m2'),\n check('wall-static', 'the height barely changes over t', '(√(2 D_⊥ t) + |v_s| t/λ)/(h − a)', excursion / (h - a), '<=', MAX_WALL_EXCURSION,\n 'chosen threshold: diffusion plus wall-slowed sedimentation normal to the wall move the sphere by ≤ 10% of the gap, so D_∥, D_⊥ taken at h hold over t'),\n );\n unchecked.push(\n 'the wall is plane, rigid, no-slip and horizontal, and the gap h − a is many molecular sizes and roughness heights (no surface forces, no lubrication-scale slip)',\n );\n }\n if (d === 3) {\n checks.push(\n check('drift', 'sedimentation drift negligible along gravity over t', '(v_s t)²/(2 D t)', (vSed * t) ** 2 / (2 * D * t), '<=',\n MAX_DRIFT_RATIO, 'chosen threshold: the vertical MSD then carries ≤ 1% from the deterministic drift'),\n );\n } else {\n unchecked.push(\n `the ${d === 1 ? 'tracked axis is' : 'tracked axes are'} horizontal, so sedimentation (${Number(Math.abs(vSed * t).toPrecision(3))} m over t) moves the sphere out of the plane but not along ${d === 1 ? 'it' : 'them'}`,\n );\n }\n return {\n outputs: {\n gamma_kg_per_s: gamma,\n D_m2_per_s: D,\n MSD_m2: msd,\n rms_displacement_m: Math.sqrt(msd),\n m_kg: m,\n tau_p_s: tauP,\n tau_f_s: tauF,\n v_sed_m_per_s: vSed,\n Re: re,\n MSD_langevin_m2: msdLangevin,\n langevin_deviation: msd / msdLangevin - 1,\n MSD_hydro_m2: msdHydro,\n hydro_correction_m2: msdHydro - msd,\n hydro_deviation: msd / msdHydro - 1,\n memory_correction: memory,\n D_parallel_m2_per_s: wall?.dPar ?? null,\n D_perp_m2_per_s: wall?.dPerp ?? null,\n MSD_wall_m2: wall?.msdWall ?? null,\n wall_deviation: wall === null ? null : msd / wall.msdWall - 1,\n },\n checks,\n unchecked,\n };\n },\n};\n"]}
1
+ {"version":3,"file":"brownian-sphere.js","sourceRoot":"","sources":["../../src/cases/brownian-sphere.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,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AC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC;aAC9D;YACD,MAAM;YACN,SAAS;SACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: a Brownian sphere tracked in a fluid — the diffusion\n * coefficient and mean-square displacement from the particle's radius and the\n * fluid's viscosity and temperature, with the regime checks that make the\n * Stokes–Einstein scalar applicable.\n *\n * The atlas bridge `ab-stokes-einstein` derives D = k_BT/(6πηa) from the\n * Langevin model and Stokes drag, with Re ≤ 0.1 and m/(γt) ≤ 0.01. This case\n * evaluates it for a named geometry (radius, or diameter through an exact\n * alternate) and fluid, computes Re from the particle's own velocity scales,\n * includes the displaced-fluid added mass in the momentum relaxation time, and\n * evaluates the hydrodynamic memory (the Basset force) that the bridge does not\n * check: the full MSD with fluid inertia, and the correction it makes at t.\n * Given a distance to a plane wall, it applies the wall's drag corrections to D.\n *\n * `CE-stokes-einstein` is encoded only up to its 6π (scalar-up-to-constant);\n * the 6π here comes from Stokes drag, not from that entry.\n *\n * @module cases/brownian-sphere\n */\nimport { K_B_SI } from '../core/constants.js';\nimport { convertValue } from '../dimensional/units.js';\nimport { adaptiveQuadrature } from './quadrature.js';\nimport { check, requirePositive, signedRelativeDifference, type AppliedCase } from './types.js';\n\nconst ID = 'case-brownian-sphere';\n\n/** Standard gravity (CGPM 1901), for the sedimentation speed: the unit table's `standard_gravity` row, read as newtons per kilogram-force. @internal */\nexport const G_STANDARD = convertValue('1 kgf/kg', 'm/s^2').value;\n\n/** The thresholds `ab-stokes-einstein` states: Re ≤ 0.1 and τ_p/t ≤ 0.01. @internal */\nexport const MAX_RE = 0.1;\nexport const MAX_TAU_P_RATIO = 0.01;\n\n/** Ceiling on the memory term's own share of the MSD, |MSD_H/MSD_OU − 1|. @internal */\nexport const MAX_MEMORY_CORRECTION = 0.01;\n\n/** (v_s t)²/(2Dt) ceiling along gravity when the vertical axis is tracked. @internal */\nexport const MAX_DRIFT_RATIO = 0.01;\n\n/** Ceiling on |MSD/MSD_wall − 1|: the wall's correction to the tracked MSD is negligible. @internal */\nexport const MAX_WALL_CORRECTION = 0.01;\n\n/** Ceiling on the last retained Faxén term (a/h)⁵/16 over the series' value. @internal */\nexport const MAX_FAXEN_LAST_TERM = 0.01;\n\n/** Ceiling on √(2 D_⊥ t)/(h − a): the height, and so D_∥ and D_⊥, barely change over t. @internal */\nexport const MAX_WALL_EXCURSION = 0.1;\n\n/** t − τ(1 − e^{−t/τ}) in units of τ, i.e. x − (1 − e^{−x}), without its cancellation at small x. @internal */\nexport function ballisticDeficit(x: number): number {\n return x < 1e-3 ? x * x * (1 / 2 - x / 6 + (x * x) / 24 - (x * x * x) / 120) : x + Math.expm1(-x);\n}\n\n/**\n * MSD/(2Dt) per axis for a sphere with fluid inertia: added mass and the Basset\n * memory force, in an unbounded incompressible fluid, velocities in equilibrium.\n *\n * The velocity autocorrelation has the Laplace transform\n * Ĉ(s) = k_BT/(M s + γ(1 + √(s τ_f))), M = m + m_f/2, from the frequency-dependent\n * Stokes drag γ(1 + √(sτ_f)) + s m_f/2 (Stokes 1851; the Basset 1888 term is its\n * √s part; Hinch 1975, J. Fluid Mech. 72, 499; Clercx & Schram 1992, Phys. Rev.\n * A 46, 1942). Its poles in √s both have negative real part, so Ĉ has none on the\n * principal sheet and C(t) is the branch-cut integral\n * C(t) = (k_BT/πγ) ∫₀^∞ e^{−ut} √(τ_f u)/((1 − τ_p u)² + τ_f u) du, τ_p = M/γ.\n * Then ⟨Δx²⟩ = 2∫₀ᵗ (t − s) C(s) ds, and with v = ut,\n * MSD/(2Dt) = (1/π) ∫₀^∞ √(βv) (v − 1 + e^{−v}) / (v² ((1 − αv)² + βv)) dv, α = τ_p/t, β = τ_f/t,\n * integrated here over ln v by MathTS `quad` (adaptive Gauss–Kronrod), split at v = 1, 1/β and around\n * the near-resonance at v = 1/α (width √(β/α) in ln v; β/α ≤ 9 for any densities).\n *\n * Limits: → 1 − 2√(τ_f/(πt)) + (τ_f − τ_p)/t for t ≫ τ_p, τ_f (expanding Ĉ in √s),\n * whose second derivative is the VACF tail k_BT/(12 ρ_f (πνt)^{3/2}); → t/(2τ_p)\n * for t ≪ τ_p, i.e. ⟨Δx²⟩ → (k_BT/M) t². Requires β > 0: without memory the\n * poles reach the principal sheet and this integral no longer holds them.\n * @internal\n */\nexport function hydrodynamicMsdRatio(alpha: number, beta: number): number {\n const f = (y: number) => {\n const v = Math.exp(y);\n const lag = 1 - alpha * v;\n return (Math.sqrt(beta * v) * (ballisticDeficit(v) / v)) / (lag * lag + beta * v);\n };\n const peak = -Math.log(alpha);\n const w = Math.min(1, Math.sqrt(beta / alpha));\n const points = [0, -Math.log(beta), peak, ...[1, 2, 4].flatMap((k) => [peak - k * w, peak + k * w])].sort((x, y) => x - y);\n // The integrand falls as v^{3/2} below and v^{−3/2} above the breakpoints: e^{−75} at ±50 in ln v.\n const edges = [points[0]! - 50, ...points, points[points.length - 1]! + 50];\n let sum = 0;\n for (let k = 1; k < edges.length; k++) if (edges[k]! > edges[k - 1]!) sum += adaptiveQuadrature(f, edges[k - 1]!, edges[k]!, 1e-12);\n return sum / Math.PI;\n}\n\n/**\n * D_∥/D₀ for a sphere translating parallel to a plane wall, centre at h:\n * 1 − (9/16)ξ + (1/8)ξ³ − (45/256)ξ⁴ − (1/16)ξ⁵, ξ = a/h (Faxén 1923, method of\n * reflections, as quoted in Happel & Brenner 1965, Low Reynolds Number\n * Hydrodynamics, ch. 7). A series in a/h, truncated:\n * its error is not bounded here, and near contact it misses the logarithmic\n * lubrication divergence of the drag.\n * @internal\n */\nexport function faxenParallel(aOverH: number): number {\n const x = aOverH;\n return 1 - (9 / 16) * x + (1 / 8) * x ** 3 - (45 / 256) * x ** 4 - (1 / 16) * x ** 5;\n}\n\n/**\n * λ = F/(6πηaU) for a sphere approaching a plane wall head-on, centre at h > a,\n * exact in Stokes flow (Brenner 1961, Chem. Eng. Sci. 16, 242, bispherical coordinates):\n * λ = (4/3) sinh α Σₙ n(n+1)/((2n−1)(2n+3)) · [(2 sinh(2n+1)α + (2n+1) sinh 2α) /\n * (4 sinh²(n+½)α − (2n+1)² sinh²α) − 1], cosh α = h/a. D_⊥ = D₀/λ.\n *\n * The bracket is rewritten over 4 sinh²(n+½)α so that no sinh overflows; its\n * terms fall as e^{−(2n+1)α}, so near contact (α → 0) the sum needs ~40/α terms,\n * and the low-n denominators lose ~α⁻² of relative precision to cancellation.\n * Limits: λ → 1 + (9/8)(a/h) far away (Lorentz 1907); λ → a/δ + (1/5) ln(a/δ) +\n * 0.971 as the gap δ = h − a → 0 (Cox & Brenner 1967, Chem. Eng. Sci. 22, 1753).\n * @throws Error if h/a ≤ 1.\n * @internal\n */\nexport function brennerPerpendicular(hOverA: number): number {\n if (!(hOverA > 1)) throw new Error(`brennerPerpendicular: need h/a > 1 (got ${hOverA})`);\n const al = Math.acosh(hOverA);\n const s = Math.sinh(al);\n const s2a = Math.sinh(2 * al);\n let sum = 0;\n for (let n = 1; ; n++) {\n const x = (n + 0.5) * al;\n const k = 2 * n + 1;\n const inv4Sinh2 = Math.exp(-2 * x) / Math.expm1(-2 * x) ** 2;\n const cothMinus1 = 2 / Math.expm1(2 * x);\n const bracket = (cothMinus1 + k * s2a * inv4Sinh2 + k * k * s * s * inv4Sinh2) / (1 - k * k * s * s * inv4Sinh2);\n const term = ((n * (n + 1)) / ((2 * n - 1) * (2 * n + 3))) * bracket;\n sum += term;\n if (term < 1e-17 * sum) break;\n if (n > 1e7) throw new Error(`brennerPerpendicular: no convergence at h/a = ${hOverA}`);\n }\n return (4 / 3) * s * sum;\n}\n\nexport const BROWNIAN_SPHERE_CASE: AppliedCase = {\n id: ID,\n title: 'Brownian sphere in a fluid (particle geometry, fluid conditions)',\n parameters: [\n { key: 'T_K', quantity: 'temperature', symbol: 'T', unit: 'K', meaning: 'absolute temperature of the fluid, > 0 K', temperature: 'absolute' },\n { key: 'eta_Pa_s', quantity: 'dynamic viscosity', symbol: 'η', unit: 'Pa*s', meaning: 'viscosity of the fluid at T (water at 20 °C ≈ 1.0e-3 Pa·s), > 0' },\n {\n key: 'a_m',\n quantity: 'particle radius',\n symbol: 'a',\n unit: 'm',\n meaning: 'hydrodynamic radius of the sphere, > 0',\n geometry: 'radius',\n alternates: [{ key: 'diameter_m', meaning: 'the diameter 2a of the sphere', toKey: 0.5 }],\n },\n { key: 'rho_p_kg_per_m3', quantity: 'particle density', symbol: 'ρ_p', unit: 'kg/m^3', meaning: 'mass density of the sphere (silica ≈ 2000), > 0' },\n { key: 'rho_f_kg_per_m3', quantity: 'fluid density', symbol: 'ρ_f', unit: 'kg/m^3', meaning: 'mass density of the fluid (water ≈ 998), > 0' },\n { key: 't_s', quantity: 'lag time', symbol: 't', unit: 's', meaning: 'the time over which the displacement is measured, > 0' },\n { key: 'd', quantity: 'tracked dimensions', symbol: 'd', unit: '', meaning: 'number of Cartesian axes tracked: 1, 2 (a microscope image plane, horizontal) or 3' },\n {\n key: 'h_m',\n quantity: 'distance to a wall',\n symbol: 'h',\n unit: 'm',\n meaning: \"distance from the sphere's centre to one plane horizontal wall (a coverslip), > a; leave out when no wall is within many radii\",\n geometry: 'separation',\n optional: true,\n },\n ],\n governing: {\n parent: [\n 'm dv/dt = −γ v + ξ(t), ⟨ξ_i(t) ξ_j(t′)⟩ = 2γ k_BT δ_ij δ(t − t′) (Langevin, a 3-vector equation; model-langevin)',\n 'η ∇²u = ∇p, ∇·u = 0, u = v on the sphere (no slip), u → 0 far away (Stokes creeping flow, a field; model-stokes-drag) ⇒ γ = 6πηa',\n 'm dv/dt = −γ v − (m_f/2) dv/dt − 6a²√(πηρ_f) ∫_{−∞}^t v′(s)/√(t − s) ds + ξ(t), ξ coloured by the same kernel ' +\n '(unsteady Stokes flow: added mass and the Basset memory force; Hinch 1975)',\n ],\n scalar: [\n 'D = k_BT/(6πηa) (Stokes–Einstein; ab-stokes-einstein)',\n '⟨|Δr|²⟩ = 2 d D t over the d tracked axes',\n ],\n distinction:\n 'The parents are a vector stochastic equation for the velocity and a field equation for the flow around the sphere; ' +\n 'the scalar keeps one isotropic number D and a mean-square displacement linear in t. Dropped: the velocity as a ' +\n 'state (the ballistic regime t ≲ τ_p), the flow field (and with it the hydrodynamic memory for t ≲ τ_f), the shape ' +\n 'beyond the radius, and every anisotropy.',\n },\n observable: 'MSD_m2',\n outputs: [\n { key: 'gamma_kg_per_s', symbol: 'γ', unit: 'kg/s', meaning: 'Stokes drag coefficient 6πηa' },\n { key: 'D_m2_per_s', symbol: 'D', unit: 'm^2/s', meaning: 'diffusion coefficient k_BT/(6πηa)' },\n { key: 'MSD_m2', symbol: '⟨|Δr|²⟩', unit: 'm^2', meaning: 'mean-square displacement 2dDt over the tracked axes' },\n { key: 'rms_displacement_m', symbol: '√⟨|Δr|²⟩', unit: 'm', meaning: 'root-mean-square displacement over the tracked axes' },\n { key: 'm_kg', symbol: 'm', unit: 'kg', meaning: 'particle mass (4/3)πa³ρ_p' },\n { key: 'tau_p_s', symbol: 'τ_p', unit: 's', meaning: 'momentum relaxation time (m + m_f/2)/γ, with the displaced-fluid added mass m_f/2' },\n { key: 'tau_f_s', symbol: 'τ_f', unit: 's', meaning: 'vorticity diffusion time ρ_f a²/η over one radius (hydrodynamic memory)' },\n { key: 'v_sed_m_per_s', symbol: 'v_s', unit: 'm/s', meaning: 'Stokes sedimentation speed (2/9)(ρ_p − ρ_f) g a²/η; negative means the sphere rises' },\n { key: 'Re', symbol: 'Re', unit: '', meaning: 'ρ_f a max(√(k_BT/m), |v_s|)/η — radius-based; a diameter-based Re is twice this' },\n { key: 'MSD_langevin_m2', symbol: '⟨|Δr|²⟩_L', unit: 'm^2', meaning: 'the Langevin parent: 2dD[t − τ(1 − e^{−t/τ})], τ = m/γ (bare mass)' },\n { key: 'langevin_deviation', symbol: 'MSD/MSD_L − 1', unit: '', meaning: signedRelativeDifference('diffusive MSD', 'Langevin one') },\n {\n key: 'MSD_hydro_m2',\n symbol: '⟨|Δr|²⟩_H',\n unit: 'm^2',\n meaning: 'the Langevin–Basset parent: added mass and hydrodynamic memory, unbounded incompressible fluid (branch-cut integral of its Laplace-domain VACF)',\n },\n { key: 'hydro_correction_m2', symbol: '⟨|Δr|²⟩_H − ⟨|Δr|²⟩', unit: 'm^2', meaning: 'what inertia and memory change in the MSD at t; ≈ −4dD√(τ_f t/π) at t ≫ τ_f' },\n { key: 'hydro_deviation', symbol: 'MSD/MSD_H − 1', unit: '', meaning: signedRelativeDifference('diffusive MSD', 'Langevin–Basset one') },\n {\n key: 'memory_correction',\n symbol: 'MSD_H/MSD_OU − 1',\n unit: '',\n meaning: \"the memory force's own share: MSD_H against the Ornstein–Uhlenbeck MSD with the same τ_p (added mass, no memory)\",\n },\n { key: 'D_parallel_m2_per_s', symbol: 'D_∥', unit: 'm^2/s', meaning: 'D beside the wall, parallel to it: D·(Faxén series in a/h); not defined without h_m' },\n { key: 'D_perp_m2_per_s', symbol: 'D_⊥', unit: 'm^2/s', meaning: 'D normal to the wall: D/λ, λ from Brenner\\'s exact series; not defined without h_m' },\n { key: 'MSD_wall_m2', symbol: '⟨|Δr|²⟩_w', unit: 'm^2', meaning: '2t(d_∥ D_∥ + d_⊥ D_⊥): the tracked horizontal axes parallel to the wall, a third one normal to it; not defined without h_m' },\n { key: 'wall_deviation', symbol: 'MSD/MSD_w − 1', unit: '', meaning: signedRelativeDifference('unbounded-fluid MSD', 'wall-corrected one', 'not defined without h_m') },\n ],\n comparison: {\n reference: 'the parent Langevin model (bare mass, white noise; it has neither added mass nor hydrodynamic memory)',\n valueKey: 'MSD_m2',\n referenceKey: 'MSD_langevin_m2',\n deviationKey: 'langevin_deviation',\n method: 'closed form of the Ornstein–Uhlenbeck MSD, velocities starting in equilibrium',\n },\n conditions: [\n 'a rigid sphere released at r = 0; its displacement density starts as δ(r) and spreads as a Gaussian of variance 2Dt per axis',\n 'no-slip boundary on the sphere; the fluid is at rest far from it (no imposed flow; no wall within many radii, or with h_m one plane no-slip wall)',\n 'fluid in thermal equilibrium at T; one isolated particle (dilute: no hydrodynamic interaction with others)',\n ],\n notIncluded: [\n 'walls other than one plane: a second wall, a channel or a curved surface; and, with h_m, the spread of heights the sphere samples (D_∥, D_⊥ are taken at h)',\n 'localization error and camera motion blur of the tracking, which offset and bias the measured MSD',\n 'fluid compressibility: the incompressible memory kernel gives ⟨v²⟩ = k_BT/(m + m_f/2) at t = 0; sound restores k_BT/m over a/c_s (Zwanzig & Bixon 1970)',\n 'the memory force near a wall: MSD_hydro is the unbounded-fluid result, and a wall within √(νt) changes the memory tail',\n 'the rotational diffusion of the sphere, and any non-spherical shape',\n ],\n measurement: [\n 'single-particle tracking: fit ⟨|Δr|²⟩(t) over the d tracked axes, slope 2dD; compare D and MSD_m2 at the chosen lag ' +\n '(with N independent displacements the relative scatter of the MSD is ≈ √(2/(dN)))',\n 'subtract the static localization offset 2dσ_loc² (measured on an immobilized particle) before comparing',\n 'dynamic light scattering: the field autocorrelation decays at Γ = D q², an independent route to the same D',\n ],\n links: [\n { id: 'ab-stokes-einstein', role: 'the derivation D = k_BT/(6πηa) with its regime Re ≤ 0.1, m/(γt) ≤ 0.01 (`upt atlas ab-stokes-einstein`)' },\n { id: 'ab-langevin-diffusion', role: 'the overdamped coarse-graining D = k_BT/γ and its ballistic counterexample' },\n { id: 'model-stokes-drag', role: 'the creeping-flow drag γ = 6πηa' },\n { id: 'CE-stokes-einstein', role: 'encoded only up to its dimensionless 6π (scalar-up-to-constant); the 6π here is from Stokes drag' },\n ],\n examples: {\n valid: {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=2000', 'rho_f_kg_per_m3=998', 't_s=1', 'd=2', 'h_m=100um'],\n note: 'a 1 µm-radius silica sphere in water at 20 °C, 100 µm above the coverslip, tracked in the image plane over 1 s',\n fails: [],\n },\n failures: [\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=2000', 'rho_f_kg_per_m3=998', 't_s=1us', 'd=2'],\n note: 'the same sphere over 1 µs: still ballistic (t ≈ 2τ_p) and inside the hydrodynamic memory time',\n fails: ['overdamped', 'memory'],\n },\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=50um', 'rho_p_kg_per_m3=7800', 'rho_f_kg_per_m3=998', 't_s=100', 'd=3'],\n note: 'a 50 µm-radius steel sphere tracked in 3-D: it sinks at ≈ 3.7 cm/s, Re ≈ 1.9, and the drift swamps diffusion',\n fails: ['creeping-flow', 'drift'],\n },\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=1050', 'rho_f_kg_per_m3=998', 't_s=50ms', 'd=2', 'h_m=3um'],\n note: 'a 1 µm-radius polystyrene sphere 3 µm (centre) above the coverslip: the wall slows D_∥ by ≈ 19%',\n fails: ['wall'],\n },\n {\n args: ['T_K=293.15', 'eta_Pa_s=1e-3', 'a_m=1um', 'rho_p_kg_per_m3=1050', 'rho_f_kg_per_m3=998', 't_s=50ms', 'd=2', 'h_m=1.2um'],\n note: 'the same sphere with a 0.2 µm gap: past the range of the Faxén series, and its height changes by more than the gap allows over t',\n fails: ['faxen-range', 'wall', 'wall-static'],\n },\n ],\n },\n /** Evaluate the Stokes-Einstein MSD and regime checks for the supplied Brownian-sphere inputs. */\n regimeAt(inputs, outputs) {\n const re = outputs.Re;\n const m = outputs.m_kg;\n const gamma = outputs.gamma_kg_per_s;\n const t = inputs.t_s;\n if (re == null || m == null || gamma == null || t == null) return '';\n return `upt regime diffusion --at Re=${re} m=${m} gamma=${gamma} t=${t}`;\n },\n /** Compute the Stokes-Einstein diffusion, MSD and regime checks for one set of Brownian-sphere inputs. */\n run(i) {\n requirePositive(ID, i, ['T_K', 'eta_Pa_s', 'a_m', 'rho_p_kg_per_m3', 'rho_f_kg_per_m3', 't_s']);\n const { T_K: T, eta_Pa_s: eta, a_m: a, rho_p_kg_per_m3: rhoP, rho_f_kg_per_m3: rhoF, t_s: t, d } = i as Record<string, number>;\n if (d !== 1 && d !== 2 && d !== 3) throw new Error(`${ID}: d must be 1, 2 or 3 (got ${d})`);\n const kT = K_B_SI * T;\n const gamma = 6 * Math.PI * eta * a;\n const D = kT / gamma;\n const msd = 2 * d * D * t;\n const volume = (4 / 3) * Math.PI * a ** 3;\n const m = volume * rhoP;\n const tauP = (m + 0.5 * volume * rhoF) / gamma;\n const tauF = (rhoF * a * a) / eta;\n const vSed = ((2 / 9) * (rhoP - rhoF) * G_STANDARD * a * a) / eta;\n const re = (rhoF * a * Math.max(Math.sqrt(kT / m), Math.abs(vSed))) / eta;\n const tauBare = m / gamma;\n const msdLangevin = 2 * d * D * tauBare * ballisticDeficit(t / tauBare);\n const msdHydro = msd * hydrodynamicMsdRatio(tauP / t, tauF / t);\n const msdAddedMass = 2 * d * D * tauP * ballisticDeficit(t / tauP);\n const memory = msdHydro / msdAddedMass - 1;\n const checks = [\n check('creeping-flow', 'creeping flow around the sphere, Re ≪ 1', 'ρ_f a max(√(k_BT/m), |v_s|)/η', re, '<=', MAX_RE,\n \"the threshold ab-stokes-einstein states: a chosen machine form of Re ≪ 1\"),\n check('overdamped', 'overdamped times t ≫ τ_p', '(m + m_f/2)/(γ t)', tauP / t, '<=', MAX_TAU_P_RATIO,\n \"ab-stokes-einstein's m/(γt) ≤ 0.01, with the added mass m_f/2 included (stricter)\"),\n check('memory', 'past the hydrodynamic memory, t ≫ τ_f = ρ_f a²/η', '|MSD_H/MSD_OU − 1|', Math.abs(memory), '<=', MAX_MEMORY_CORRECTION,\n 'chosen threshold: the Basset memory changes the MSD by ≤ 1% at t (computed, not estimated; ≈ 2√(τ_f/(πt)) at t ≫ τ_f)'),\n ];\n const unchecked = ['the particle is a rigid sphere and a is its hydrodynamic radius (a coating or a shell changes it)'];\n let wall: { dPar: number; dPerp: number; msdWall: number } | null = null;\n if (i.h_m !== undefined) {\n const h = i.h_m;\n if (!Number.isFinite(h) || !(h > a)) throw new Error(`${ID}: h_m must be a finite distance > a_m, centre to wall (got ${h})`);\n const faxen = faxenParallel(a / h);\n const lambda = brennerPerpendicular(h / a);\n const dPar = D * faxen;\n const dPerp = D / lambda;\n const msdWall = 2 * t * (Math.min(d, 2) * dPar + (d === 3 ? dPerp : 0));\n wall = { dPar, dPerp, msdWall };\n const excursion = Math.sqrt(2 * dPerp * t) + (Math.abs(vSed) * t) / lambda;\n checks.push(\n check('faxen-range', 'the Faxén series in a/h holds for D_∥', '(a/h)⁵/16 ÷ (D_∥/D)', (a / h) ** 5 / 16 / faxen, '<=', MAX_FAXEN_LAST_TERM,\n 'chosen threshold: the last retained term is ≤ 1% of the series — a size estimate of the truncation, not a bound; D_⊥ (Brenner) is exact at any h > a'),\n check('wall', 'the wall correction to the tracked MSD is negligible', '|MSD/MSD_w − 1|', Math.abs(msd / msdWall - 1), '<=', MAX_WALL_CORRECTION,\n 'chosen threshold: the unbounded-fluid D is then within 1% for the tracked axes; otherwise read MSD_wall_m2'),\n check('wall-static', 'the height barely changes over t', '(√(2 D_⊥ t) + |v_s| t/λ)/(h − a)', excursion / (h - a), '<=', MAX_WALL_EXCURSION,\n 'chosen threshold: diffusion plus wall-slowed sedimentation normal to the wall move the sphere by ≤ 10% of the gap, so D_∥, D_⊥ taken at h hold over t'),\n );\n unchecked.push(\n 'the wall is plane, rigid, no-slip and horizontal, and the gap h − a is many molecular sizes and roughness heights (no surface forces, no lubrication-scale slip)',\n );\n }\n if (d === 3) {\n checks.push(\n check('drift', 'sedimentation drift negligible along gravity over t', '(v_s t)²/(2 D t)', (vSed * t) ** 2 / (2 * D * t), '<=',\n MAX_DRIFT_RATIO, 'chosen threshold: the vertical MSD then carries ≤ 1% from the deterministic drift'),\n );\n } else {\n unchecked.push(\n `the ${d === 1 ? 'tracked axis is' : 'tracked axes are'} horizontal, so sedimentation (${Number(Math.abs(vSed * t).toPrecision(3))} m over t) moves the sphere out of the plane but not along ${d === 1 ? 'it' : 'them'}`,\n );\n }\n return {\n outputs: {\n gamma_kg_per_s: gamma,\n D_m2_per_s: D,\n MSD_m2: msd,\n rms_displacement_m: Math.sqrt(msd),\n m_kg: m,\n tau_p_s: tauP,\n tau_f_s: tauF,\n v_sed_m_per_s: vSed,\n Re: re,\n MSD_langevin_m2: msdLangevin,\n langevin_deviation: msd / msdLangevin - 1,\n MSD_hydro_m2: msdHydro,\n hydro_correction_m2: msdHydro - msd,\n hydro_deviation: msd / msdHydro - 1,\n memory_correction: memory,\n D_parallel_m2_per_s: wall?.dPar ?? null,\n D_perp_m2_per_s: wall?.dPerp ?? null,\n MSD_wall_m2: wall?.msdWall ?? null,\n wall_deviation: wall === null ? null : msd / wall.msdWall - 1,\n },\n checks,\n unchecked,\n };\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"damped-resonator.d.ts","sourceRoot":"","sources":["../../src/cases/damped-resonator.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAItE,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAoBpE;AAED,eAAO,MAAM,qBAAqB,EAAE,WAqKnC,CAAC"}
1
+ {"version":3,"file":"damped-resonator.d.ts","sourceRoot":"","sources":["../../src/cases/damped-resonator.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAItE,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBpE;AAED,eAAO,MAAM,qBAAqB,EAAE,WAqKnC,CAAC"}
@@ -14,6 +14,7 @@
14
14
  *
15
15
  * @module cases/damped-resonator
16
16
  */
17
+ import { findRoot } from '@danielsimonjr/mathts-functions';
17
18
  import { K_B_SI } from '../core/constants.js';
18
19
  import { check, requirePositive } from './types.js';
19
20
  const ID = 'case-damped-resonator';
@@ -51,14 +52,10 @@ export function windowedLinewidthHz(alpha, T) {
51
52
  lo = hi;
52
53
  hi += h;
53
54
  }
54
- for (let k = 0; k < 80; k++) {
55
- const mid = (lo + hi) / 2;
56
- if (power(mid) > half)
57
- lo = mid;
58
- else
59
- hi = mid;
60
- }
61
- return (lo + hi) / 2 / Math.PI;
55
+ // The crossing inside the first step past half power, by MathTS `findRoot` (Brent) on the
56
+ // order-one residual power/half − 1, to the bracket's floating-point resolution.
57
+ const crossing = findRoot((dw) => power(dw) / half - 1, lo, hi, { tol: 4 * Number.EPSILON * hi, maxIter: 200 });
58
+ return crossing / Math.PI;
62
59
  }
63
60
  export const DAMPED_RESONATOR_CASE = {
64
61
  id: ID,
@@ -122,7 +119,7 @@ export const DAMPED_RESONATOR_CASE = {
122
119
  valueKey: 'linewidth_windowed_Hz',
123
120
  referenceKey: 'linewidth_Hz',
124
121
  deviationKey: 'windowed_excess',
125
- method: 'closed-form transform of the truncated ring-down, half-power point by bisection',
122
+ method: 'closed-form transform of the truncated ring-down, half-power point by MathTS findRoot (Brent) inside the first step past half power',
126
123
  },
127
124
  notIncluded: [
128
125
  'the detector noise floor; and the thermal drive of the resonator unless T_K and k_N_per_m are given (its equilibrium amplitude √(k_BT/k) is the fluctuation–dissipation partner of its damping; compare case-resistor-noise)',
@@ -1 +1 @@
1
- {"version":3,"file":"damped-resonator.js","sourceRoot":"","sources":["../../src/cases/damped-resonator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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E,SAAS;gBACvB,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI;gBACtC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC3F,UAAU,EAAE,QAAQ;gBACpB,aAAa,EAAE,CAAC,GAAG,IAAI;gBACvB,qBAAqB,EAAE,QAAQ;gBAC/B,eAAe,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,GAAG,CAAC;gBACpE,UAAU,EAAE,GAAG;gBACf,cAAc,EAAE,GAAG,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;aAC1G;YACD,MAAM;YACN,SAAS;SACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: the free ring-down of a damped resonator, read out over a\n * finite record — the envelope and displacement at a chosen time, the\n * linewidth, and what a record of length t_obs can resolve of it.\n *\n * The atlas holds the damped spring (`model-damped-spring`), its exact RLC\n * equivalent (`ab-damped-rlc`) and its overdamped reduction\n * (`ab-damped-massless`). This case evaluates the underdamped solution for a\n * given f0 and Q, refuses it when the resonator is not underdamped, and checks\n * the record length against the linewidth it is meant to resolve. The\n * rectangular-window spectrum of the truncated ring-down is computed in\n * closed form, near resonance, for comparison. Given the temperature and the\n * mode's stiffness, it checks the envelope against the thermal motion.\n *\n * @module cases/damped-resonator\n */\nimport { K_B_SI } from '../core/constants.js';\nimport { check, requirePositive, type AppliedCase } from './types.js';\n\nconst ID = 'case-damped-resonator';\n\n/** Q floor for the single-Lorentzian (near-resonance) form of the spectrum. @internal */\nexport const MIN_Q_LORENTZIAN = 10;\n\n/** (1/t_obs)/linewidth ceiling: the record resolves the line. @internal */\nexport const MAX_RESOLUTION_RATIO = 0.1;\n\n/**\n * √(k_BT/k)/A ceiling. Thermal motion of one mode is x = X cos ω_d t + Y sin ω_d t\n * with ⟨X²⟩ = ⟨Y²⟩ = k_BT/k (equipartition), so the envelope of the ring-down\n * plus it is Rician with ⟨A_obs²⟩ = A² + 2k_BT/k (Rice 1944); at the ceiling\n * √(1 + 2·0.01) − 1 ≈ 0.0100.\n * @internal\n */\nexport const MAX_THERMAL_RATIO = 0.1;\n\n/**\n * FWHM in Hz of |∫₀ᵀ e^{−(α + iΔω)t} dt|², the near-resonance power spectrum of\n * a ring-down x0 e^{−αt} cos(ω_d t) recorded for T. The negative-frequency\n * pole is dropped, which is the Q ≫ 1 approximation. The peak is at Δω = 0:\n * the integrand is positive, so |X(Δω)| ≤ X(0).\n * @internal\n */\nexport function windowedLinewidthHz(alpha: number, T: number): number {\n const oneMinusE = -Math.expm1(-alpha * T);\n const E = 1 - oneMinusE;\n // (1 − E)² + 4E sin²(ΔωT/2) is 1 − 2E cos(ΔωT) + E² without its cancellation near Δω = 0.\n const power = (dw: number) => (oneMinusE ** 2 + 4 * E * Math.sin((dw * T) / 2) ** 2) / (alpha * alpha + dw * dw);\n const half = power(0) / 2;\n const h = (alpha + 1 / T) / 200;\n let lo = 0;\n let hi = h;\n for (let k = 1; power(hi) > half; k++) {\n if (k > 1e6) throw new Error(`${ID}: no half-power point found (α = ${alpha}, T = ${T})`);\n lo = hi;\n hi += h;\n }\n for (let k = 0; k < 80; k++) {\n const mid = (lo + hi) / 2;\n if (power(mid) > half) lo = mid;\n else hi = mid;\n }\n return (lo + hi) / 2 / Math.PI;\n}\n\nexport const DAMPED_RESONATOR_CASE: AppliedCase = {\n id: ID,\n title: 'Damped resonator ring-down (damping, finite observation time)',\n parameters: [\n { key: 'f0_Hz', quantity: 'natural frequency', symbol: 'f0', unit: 'Hz', meaning: 'undamped natural frequency ω0/2π = √(k/m)/2π, > 0' },\n { key: 'Q', quantity: 'quality factor', symbol: 'Q', unit: '', meaning: 'Q = ω0 m/b (for an RLC: √(L/C)/R), > 0' },\n { key: 'x0_m', quantity: 'initial displacement', symbol: 'x0', unit: 'm', meaning: 'displacement at release, from rest' },\n { key: 't_s', quantity: 'read-out time', symbol: 't', unit: 's', meaning: 'time after release at which x and the envelope are read, ≥ 0' },\n { key: 't_obs_s', quantity: 'record length', symbol: 't_obs', unit: 's', meaning: 'length of the recorded ring-down, starting at release, > 0' },\n { key: 'T_K', quantity: 'temperature', symbol: 'T', unit: 'K', meaning: 'temperature of the damping bath, > 0 K; give with k_N_per_m for the thermal floor', temperature: 'absolute', optional: true },\n {\n key: 'k_N_per_m',\n quantity: 'mode stiffness',\n symbol: 'k',\n unit: 'N/m',\n meaning: 'effective stiffness of the mode at the read-out point, > 0 (for an RLC read as charge: 1/C in 1/F, not N/m); give with T_K',\n optional: true,\n },\n ],\n governing: {\n parent: [\n 'ρA ∂²w/∂t² + c ∂w/∂t + EI ∂⁴w/∂z⁴ = 0 with the structure\\'s boundary conditions (e.g. a cantilever: a field w(z, t) with many modes)',\n 'one mode, w = φ(z) x(t), read at one point: m x″ + b x′ + k x = 0 (model-damped-spring; for a circuit L q″ + R q′ + q/C = 0, ab-damped-rlc)',\n ],\n scalar: [\n 'x(t) = x0 e^{−αt} [cos ω_d t + (α/ω_d) sin ω_d t], α = ω0/(2Q), ω_d = ω0 √(1 − 1/(4Q²)) (Q > 1/2)',\n 'envelope x0 e^{−αt}/√(1 − 1/(4Q²)); linewidth Δf = f0/Q; resolution of a record 1/t_obs',\n ],\n distinction:\n 'The parent is a field w(z, t) with infinitely many modes and a mode shape; the scalar keeps one mode\\'s amplitude ' +\n 'x(t) at the read-out point, with all loss lumped into a viscous (velocity-proportional) Q. Dropped: the other modes ' +\n 'and their coupling, the mode shape, and any frequency or amplitude dependence of the damping (structural damping ' +\n 'gives a different Q(f)).',\n },\n observable: 'envelope_m',\n outputs: [\n { key: 'alpha_per_s', symbol: 'α', unit: 's^-1', meaning: 'amplitude decay rate ω0/(2Q) = b/(2m)' },\n { key: 'tau_s', symbol: 'τ', unit: 's', meaning: 'amplitude ring-down time 1/α = Q/(πf0)' },\n { key: 'linewidth_Hz', symbol: 'Δf', unit: 'Hz', meaning: 'f0/Q: FWHM of the velocity (absorbed-power) response, exact at any Q; the displacement response approaches it for Q ≫ 1' },\n { key: 'f_d_Hz', symbol: 'f_d', unit: 'Hz', meaning: 'damped oscillation frequency f0 √(1 − 1/(4Q²))' },\n { key: 'x_m', symbol: 'x(t)', unit: 'm', meaning: 'displacement at t, released from rest at x0' },\n { key: 'envelope_m', symbol: 'A(t)', unit: 'm', meaning: 'ring-down envelope at t: the amplitude a peak-detecting read-out sees' },\n { key: 'resolution_Hz', symbol: '1/t_obs', unit: 'Hz', meaning: 'frequency resolution of the record' },\n { key: 'linewidth_windowed_Hz', symbol: 'Δf_T', unit: 'Hz', meaning: 'FWHM of the power spectrum of the truncated ring-down (rectangular window, near resonance)' },\n { key: 'windowed_excess', symbol: 'Δf_T/Δf − 1', unit: '', meaning: 'how much the finite record broadens the measured line' },\n { key: 'x_th_rms_m', symbol: '√⟨x²⟩_th', unit: 'm', meaning: 'thermal RMS displacement √(k_BT/k) of the mode (equipartition); not defined without T_K and k_N_per_m' },\n {\n key: 'envelope_rms_m',\n symbol: '√⟨A²⟩',\n unit: 'm',\n meaning: 'RMS envelope with the thermal motion added: √(A² + 2k_BT/k), the Rice second moment; not defined without T_K and k_N_per_m',\n },\n ],\n conditions: [\n 'released from rest: x(0) = x0, x′(0) = 0; free ring-down, no drive after release',\n 'linear restoring force: the amplitude is small enough that f0 does not depend on it (ax-cubic-spring-lc records why a hardening spring is not this model)',\n 'the record starts at release and lasts t_obs; its spectrum is that of a rectangular window',\n ],\n comparison: {\n reference: 'the linewidth an infinitely long record would show, f0/Q',\n valueKey: 'linewidth_windowed_Hz',\n referenceKey: 'linewidth_Hz',\n deviationKey: 'windowed_excess',\n method: 'closed-form transform of the truncated ring-down, half-power point by bisection',\n },\n notIncluded: [\n 'the detector noise floor; and the thermal drive of the resonator unless T_K and k_N_per_m are given (its equilibrium amplitude √(k_BT/k) is the fluctuation–dissipation partner of its damping; compare case-resistor-noise)',\n 'frequency drift of f0 over the record',\n 'window shapes other than rectangular, and the negative-frequency image of the line (the Q ≫ 1 approximation)',\n 'the other modes of the structure',\n ],\n measurement: [\n 'ring-down: fit ln A(t) against t; the slope −α gives Q = πf0/α; compare the measured envelope at t with envelope_m',\n 'spectrum: the FWHM of the recorded line is linewidth_windowed_Hz, which approaches linewidth_Hz only when the record resolves it',\n 'for an RLC circuit read the capacitor voltage: f0 = 1/(2π√(LC)), Q = √(L/C)/R (ab-damped-rlc)',\n ],\n links: [\n { id: 'model-damped-spring', role: 'm x″ + b x′ + k x = 0, the single-mode equation evaluated here' },\n { id: 'ab-damped-rlc', role: 'the same equation for an RLC circuit, an exact equivalence' },\n { id: 'ab-damped-massless', role: 'the overdamped reduction, for the regime where this case refuses (Q ≤ 1/2)' },\n { id: 'ax-cubic-spring-lc', role: 'the refuted claim that a nonlinear (cubic) spring maps onto the linear circuit' },\n ],\n examples: {\n valid: {\n args: ['f0_Hz=1kHz', 'Q=1000', 'x0_m=1um', 't_s=0.1', 't_obs_s=20', 'T_K=300', 'k_N_per_m=1'],\n note: 'a 1 kHz, Q = 1000 resonator (1 Hz line), 1 N/m at 300 K, read 0.1 s after release, recorded for 20 s',\n fails: [],\n },\n failures: [\n {\n args: ['f0_Hz=1kHz', 'Q=1000', 'x0_m=1um', 't_s=0.1', 't_obs_s=1'],\n note: 'the same resonator recorded for 1 s: the 1 Hz resolution cannot resolve the 1 Hz line',\n fails: ['resolved'],\n },\n {\n args: ['f0_Hz=1kHz', 'Q=0.3', 'x0_m=1um', 't_s=0.1', 't_obs_s=20'],\n note: 'Q = 0.3 is overdamped: there is no ring-down, and the underdamped formulas are refused',\n fails: ['underdamped', 'single-lorentzian'],\n },\n {\n args: ['f0_Hz=1kHz', 'Q=1000', 'x0_m=100pm', 't_s=1', 't_obs_s=20', 'T_K=300', 'k_N_per_m=1'],\n note: 'released from 100 pm and read after 1 s (≈ 3 ring-down times): the envelope, ≈ 4 pm, sits below the 64 pm thermal motion',\n fails: ['above-thermal'],\n },\n ],\n },\n /** Evaluate the underdamped ring-down outputs and checks for the supplied resonator inputs. */\n run(i) {\n requirePositive(ID, i, ['f0_Hz', 'Q', 't_obs_s']);\n const { f0_Hz: f0, Q, x0_m: x0, t_s: t, t_obs_s: tObs } = i as Record<string, number>;\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 const w0 = 2 * Math.PI * f0;\n const alpha = w0 / (2 * Q);\n const linewidth = f0 / Q;\n const underdamped = Q > 0.5;\n const root = underdamped ? Math.sqrt(1 - 1 / (4 * Q * Q)) : NaN;\n const wd = w0 * root;\n const decay = Math.exp(-alpha * t);\n const windowed = underdamped ? windowedLinewidthHz(alpha, tObs) : null;\n const envelope = underdamped ? (Math.abs(x0) * decay) / root : null;\n const checks = [\n check('underdamped', 'underdamped: the solution rings (Q > 1/2)', 'Q', Q, '>', 0.5,\n 'exact: at Q ≤ 1/2 the solution is a sum of real exponentials, with no ring-down, f_d or envelope'),\n check('single-lorentzian', 'high Q: the line near f0 is one Lorentzian', 'Q', Q, '>=', MIN_Q_LORENTZIAN,\n 'chosen threshold for Q ≫ 1: the windowed spectrum drops the negative-frequency pole'),\n check('resolved', 'the record resolves the line: 1/t_obs ≪ f0/Q', '(1/t_obs)/(f0/Q)', 1 / tObs / linewidth, '<=', MAX_RESOLUTION_RATIO,\n 'chosen threshold for ≪ 1; see windowed_excess for the broadening it allows'),\n check('in-record', 'the read-out time lies inside the record', 't/t_obs', t / tObs, '<=', 1,\n 'exact: an envelope read after the record ends was not measured'),\n ];\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 ((i.T_K === undefined) !== (i.k_N_per_m === undefined)) throw new Error(`${ID}: give T_K and k_N_per_m together, or neither`);\n let xTh: number | null = null;\n if (i.T_K !== undefined) {\n requirePositive(ID, i, ['T_K', 'k_N_per_m']);\n xTh = Math.sqrt((K_B_SI * i.T_K) / i.k_N_per_m!);\n if (envelope !== null) {\n checks.push(\n check('above-thermal', 'the ring-down stands above the thermal motion at t', '√(k_BT/k)/A(t)', xTh / envelope, '<=', MAX_THERMAL_RATIO,\n 'chosen threshold: the RMS envelope √(A² + 2k_BT/k) then exceeds A by ≤ 1%'),\n );\n }\n 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');\n }\n return {\n outputs: {\n alpha_per_s: alpha,\n tau_s: 1 / alpha,\n linewidth_Hz: linewidth,\n f_d_Hz: underdamped ? f0 * root : null,\n x_m: underdamped ? x0 * decay * (Math.cos(wd * t) + (alpha / wd) * Math.sin(wd * t)) : null,\n envelope_m: envelope,\n resolution_Hz: 1 / tObs,\n linewidth_windowed_Hz: windowed,\n windowed_excess: windowed === null ? null : windowed / linewidth - 1,\n x_th_rms_m: xTh,\n envelope_rms_m: xTh === null || envelope === null ? null : Math.sqrt(envelope * envelope + 2 * xTh * xTh),\n },\n checks,\n unchecked,\n };\n },\n};\n"]}
1
+ {"version":3,"file":"damped-resonator.js","sourceRoot":"","sources":["../../src/cases/damped-resonator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D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E,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI;gBACtC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC3F,UAAU,EAAE,QAAQ;gBACpB,aAAa,EAAE,CAAC,GAAG,IAAI;gBACvB,qBAAqB,EAAE,QAAQ;gBAC/B,eAAe,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,GAAG,CAAC;gBACpE,UAAU,EAAE,GAAG;gBACf,cAAc,EAAE,GAAG,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;aAC1G;YACD,MAAM;YACN,SAAS;SACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: the free ring-down of a damped resonator, read out over a\n * finite record — the envelope and displacement at a chosen time, the\n * linewidth, and what a record of length t_obs can resolve of it.\n *\n * The atlas holds the damped spring (`model-damped-spring`), its exact RLC\n * equivalent (`ab-damped-rlc`) and its overdamped reduction\n * (`ab-damped-massless`). This case evaluates the underdamped solution for a\n * given f0 and Q, refuses it when the resonator is not underdamped, and checks\n * the record length against the linewidth it is meant to resolve. The\n * rectangular-window spectrum of the truncated ring-down is computed in\n * closed form, near resonance, for comparison. Given the temperature and the\n * mode's stiffness, it checks the envelope against the thermal motion.\n *\n * @module cases/damped-resonator\n */\nimport { findRoot } from '@danielsimonjr/mathts-functions';\nimport { K_B_SI } from '../core/constants.js';\nimport { check, requirePositive, type AppliedCase } from './types.js';\n\nconst ID = 'case-damped-resonator';\n\n/** Q floor for the single-Lorentzian (near-resonance) form of the spectrum. @internal */\nexport const MIN_Q_LORENTZIAN = 10;\n\n/** (1/t_obs)/linewidth ceiling: the record resolves the line. @internal */\nexport const MAX_RESOLUTION_RATIO = 0.1;\n\n/**\n * √(k_BT/k)/A ceiling. Thermal motion of one mode is x = X cos ω_d t + Y sin ω_d t\n * with ⟨X²⟩ = ⟨Y²⟩ = k_BT/k (equipartition), so the envelope of the ring-down\n * plus it is Rician with ⟨A_obs²⟩ = A² + 2k_BT/k (Rice 1944); at the ceiling\n * √(1 + 2·0.01) − 1 ≈ 0.0100.\n * @internal\n */\nexport const MAX_THERMAL_RATIO = 0.1;\n\n/**\n * FWHM in Hz of |∫₀ᵀ e^{−(α + iΔω)t} dt|², the near-resonance power spectrum of\n * a ring-down x0 e^{−αt} cos(ω_d t) recorded for T. The negative-frequency\n * pole is dropped, which is the Q ≫ 1 approximation. The peak is at Δω = 0:\n * the integrand is positive, so |X(Δω)| ≤ X(0).\n * @internal\n */\nexport function windowedLinewidthHz(alpha: number, T: number): number {\n const oneMinusE = -Math.expm1(-alpha * T);\n const E = 1 - oneMinusE;\n // (1 − E)² + 4E sin²(ΔωT/2) is 1 − 2E cos(ΔωT) + E² without its cancellation near Δω = 0.\n const power = (dw: number) => (oneMinusE ** 2 + 4 * E * Math.sin((dw * T) / 2) ** 2) / (alpha * alpha + dw * dw);\n const half = power(0) / 2;\n const h = (alpha + 1 / T) / 200;\n let lo = 0;\n let hi = h;\n for (let k = 1; power(hi) > half; k++) {\n if (k > 1e6) throw new Error(`${ID}: no half-power point found (α = ${alpha}, T = ${T})`);\n lo = hi;\n hi += h;\n }\n // The crossing inside the first step past half power, by MathTS `findRoot` (Brent) on the\n // order-one residual power/half − 1, to the bracket's floating-point resolution.\n const crossing = findRoot((dw) => power(dw) / half - 1, lo, hi, { tol: 4 * Number.EPSILON * hi, maxIter: 200 });\n return crossing / Math.PI;\n}\n\nexport const DAMPED_RESONATOR_CASE: AppliedCase = {\n id: ID,\n title: 'Damped resonator ring-down (damping, finite observation time)',\n parameters: [\n { key: 'f0_Hz', quantity: 'natural frequency', symbol: 'f0', unit: 'Hz', meaning: 'undamped natural frequency ω0/2π = √(k/m)/2π, > 0' },\n { key: 'Q', quantity: 'quality factor', symbol: 'Q', unit: '', meaning: 'Q = ω0 m/b (for an RLC: √(L/C)/R), > 0' },\n { key: 'x0_m', quantity: 'initial displacement', symbol: 'x0', unit: 'm', meaning: 'displacement at release, from rest' },\n { key: 't_s', quantity: 'read-out time', symbol: 't', unit: 's', meaning: 'time after release at which x and the envelope are read, ≥ 0' },\n { key: 't_obs_s', quantity: 'record length', symbol: 't_obs', unit: 's', meaning: 'length of the recorded ring-down, starting at release, > 0' },\n { key: 'T_K', quantity: 'temperature', symbol: 'T', unit: 'K', meaning: 'temperature of the damping bath, > 0 K; give with k_N_per_m for the thermal floor', temperature: 'absolute', optional: true },\n {\n key: 'k_N_per_m',\n quantity: 'mode stiffness',\n symbol: 'k',\n unit: 'N/m',\n meaning: 'effective stiffness of the mode at the read-out point, > 0 (for an RLC read as charge: 1/C in 1/F, not N/m); give with T_K',\n optional: true,\n },\n ],\n governing: {\n parent: [\n 'ρA ∂²w/∂t² + c ∂w/∂t + EI ∂⁴w/∂z⁴ = 0 with the structure\\'s boundary conditions (e.g. a cantilever: a field w(z, t) with many modes)',\n 'one mode, w = φ(z) x(t), read at one point: m x″ + b x′ + k x = 0 (model-damped-spring; for a circuit L q″ + R q′ + q/C = 0, ab-damped-rlc)',\n ],\n scalar: [\n 'x(t) = x0 e^{−αt} [cos ω_d t + (α/ω_d) sin ω_d t], α = ω0/(2Q), ω_d = ω0 √(1 − 1/(4Q²)) (Q > 1/2)',\n 'envelope x0 e^{−αt}/√(1 − 1/(4Q²)); linewidth Δf = f0/Q; resolution of a record 1/t_obs',\n ],\n distinction:\n 'The parent is a field w(z, t) with infinitely many modes and a mode shape; the scalar keeps one mode\\'s amplitude ' +\n 'x(t) at the read-out point, with all loss lumped into a viscous (velocity-proportional) Q. Dropped: the other modes ' +\n 'and their coupling, the mode shape, and any frequency or amplitude dependence of the damping (structural damping ' +\n 'gives a different Q(f)).',\n },\n observable: 'envelope_m',\n outputs: [\n { key: 'alpha_per_s', symbol: 'α', unit: 's^-1', meaning: 'amplitude decay rate ω0/(2Q) = b/(2m)' },\n { key: 'tau_s', symbol: 'τ', unit: 's', meaning: 'amplitude ring-down time 1/α = Q/(πf0)' },\n { key: 'linewidth_Hz', symbol: 'Δf', unit: 'Hz', meaning: 'f0/Q: FWHM of the velocity (absorbed-power) response, exact at any Q; the displacement response approaches it for Q ≫ 1' },\n { key: 'f_d_Hz', symbol: 'f_d', unit: 'Hz', meaning: 'damped oscillation frequency f0 √(1 − 1/(4Q²))' },\n { key: 'x_m', symbol: 'x(t)', unit: 'm', meaning: 'displacement at t, released from rest at x0' },\n { key: 'envelope_m', symbol: 'A(t)', unit: 'm', meaning: 'ring-down envelope at t: the amplitude a peak-detecting read-out sees' },\n { key: 'resolution_Hz', symbol: '1/t_obs', unit: 'Hz', meaning: 'frequency resolution of the record' },\n { key: 'linewidth_windowed_Hz', symbol: 'Δf_T', unit: 'Hz', meaning: 'FWHM of the power spectrum of the truncated ring-down (rectangular window, near resonance)' },\n { key: 'windowed_excess', symbol: 'Δf_T/Δf − 1', unit: '', meaning: 'how much the finite record broadens the measured line' },\n { key: 'x_th_rms_m', symbol: '√⟨x²⟩_th', unit: 'm', meaning: 'thermal RMS displacement √(k_BT/k) of the mode (equipartition); not defined without T_K and k_N_per_m' },\n {\n key: 'envelope_rms_m',\n symbol: '√⟨A²⟩',\n unit: 'm',\n meaning: 'RMS envelope with the thermal motion added: √(A² + 2k_BT/k), the Rice second moment; not defined without T_K and k_N_per_m',\n },\n ],\n conditions: [\n 'released from rest: x(0) = x0, x′(0) = 0; free ring-down, no drive after release',\n 'linear restoring force: the amplitude is small enough that f0 does not depend on it (ax-cubic-spring-lc records why a hardening spring is not this model)',\n 'the record starts at release and lasts t_obs; its spectrum is that of a rectangular window',\n ],\n comparison: {\n reference: 'the linewidth an infinitely long record would show, f0/Q',\n valueKey: 'linewidth_windowed_Hz',\n referenceKey: 'linewidth_Hz',\n deviationKey: 'windowed_excess',\n method: 'closed-form transform of the truncated ring-down, half-power point by MathTS findRoot (Brent) inside the first step past half power',\n },\n notIncluded: [\n 'the detector noise floor; and the thermal drive of the resonator unless T_K and k_N_per_m are given (its equilibrium amplitude √(k_BT/k) is the fluctuation–dissipation partner of its damping; compare case-resistor-noise)',\n 'frequency drift of f0 over the record',\n 'window shapes other than rectangular, and the negative-frequency image of the line (the Q ≫ 1 approximation)',\n 'the other modes of the structure',\n ],\n measurement: [\n 'ring-down: fit ln A(t) against t; the slope −α gives Q = πf0/α; compare the measured envelope at t with envelope_m',\n 'spectrum: the FWHM of the recorded line is linewidth_windowed_Hz, which approaches linewidth_Hz only when the record resolves it',\n 'for an RLC circuit read the capacitor voltage: f0 = 1/(2π√(LC)), Q = √(L/C)/R (ab-damped-rlc)',\n ],\n links: [\n { id: 'model-damped-spring', role: 'm x″ + b x′ + k x = 0, the single-mode equation evaluated here' },\n { id: 'ab-damped-rlc', role: 'the same equation for an RLC circuit, an exact equivalence' },\n { id: 'ab-damped-massless', role: 'the overdamped reduction, for the regime where this case refuses (Q ≤ 1/2)' },\n { id: 'ax-cubic-spring-lc', role: 'the refuted claim that a nonlinear (cubic) spring maps onto the linear circuit' },\n ],\n examples: {\n valid: {\n args: ['f0_Hz=1kHz', 'Q=1000', 'x0_m=1um', 't_s=0.1', 't_obs_s=20', 'T_K=300', 'k_N_per_m=1'],\n note: 'a 1 kHz, Q = 1000 resonator (1 Hz line), 1 N/m at 300 K, read 0.1 s after release, recorded for 20 s',\n fails: [],\n },\n failures: [\n {\n args: ['f0_Hz=1kHz', 'Q=1000', 'x0_m=1um', 't_s=0.1', 't_obs_s=1'],\n note: 'the same resonator recorded for 1 s: the 1 Hz resolution cannot resolve the 1 Hz line',\n fails: ['resolved'],\n },\n {\n args: ['f0_Hz=1kHz', 'Q=0.3', 'x0_m=1um', 't_s=0.1', 't_obs_s=20'],\n note: 'Q = 0.3 is overdamped: there is no ring-down, and the underdamped formulas are refused',\n fails: ['underdamped', 'single-lorentzian'],\n },\n {\n args: ['f0_Hz=1kHz', 'Q=1000', 'x0_m=100pm', 't_s=1', 't_obs_s=20', 'T_K=300', 'k_N_per_m=1'],\n note: 'released from 100 pm and read after 1 s (≈ 3 ring-down times): the envelope, ≈ 4 pm, sits below the 64 pm thermal motion',\n fails: ['above-thermal'],\n },\n ],\n },\n /** Evaluate the underdamped ring-down outputs and checks for the supplied resonator inputs. */\n run(i) {\n requirePositive(ID, i, ['f0_Hz', 'Q', 't_obs_s']);\n const { f0_Hz: f0, Q, x0_m: x0, t_s: t, t_obs_s: tObs } = i as Record<string, number>;\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 const w0 = 2 * Math.PI * f0;\n const alpha = w0 / (2 * Q);\n const linewidth = f0 / Q;\n const underdamped = Q > 0.5;\n const root = underdamped ? Math.sqrt(1 - 1 / (4 * Q * Q)) : NaN;\n const wd = w0 * root;\n const decay = Math.exp(-alpha * t);\n const windowed = underdamped ? windowedLinewidthHz(alpha, tObs) : null;\n const envelope = underdamped ? (Math.abs(x0) * decay) / root : null;\n const checks = [\n check('underdamped', 'underdamped: the solution rings (Q > 1/2)', 'Q', Q, '>', 0.5,\n 'exact: at Q ≤ 1/2 the solution is a sum of real exponentials, with no ring-down, f_d or envelope'),\n check('single-lorentzian', 'high Q: the line near f0 is one Lorentzian', 'Q', Q, '>=', MIN_Q_LORENTZIAN,\n 'chosen threshold for Q ≫ 1: the windowed spectrum drops the negative-frequency pole'),\n check('resolved', 'the record resolves the line: 1/t_obs ≪ f0/Q', '(1/t_obs)/(f0/Q)', 1 / tObs / linewidth, '<=', MAX_RESOLUTION_RATIO,\n 'chosen threshold for ≪ 1; see windowed_excess for the broadening it allows'),\n check('in-record', 'the read-out time lies inside the record', 't/t_obs', t / tObs, '<=', 1,\n 'exact: an envelope read after the record ends was not measured'),\n ];\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 ((i.T_K === undefined) !== (i.k_N_per_m === undefined)) throw new Error(`${ID}: give T_K and k_N_per_m together, or neither`);\n let xTh: number | null = null;\n if (i.T_K !== undefined) {\n requirePositive(ID, i, ['T_K', 'k_N_per_m']);\n xTh = Math.sqrt((K_B_SI * i.T_K) / i.k_N_per_m!);\n if (envelope !== null) {\n checks.push(\n check('above-thermal', 'the ring-down stands above the thermal motion at t', '√(k_BT/k)/A(t)', xTh / envelope, '<=', MAX_THERMAL_RATIO,\n 'chosen threshold: the RMS envelope √(A² + 2k_BT/k) then exceeds A by ≤ 1%'),\n );\n }\n 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');\n }\n return {\n outputs: {\n alpha_per_s: alpha,\n tau_s: 1 / alpha,\n linewidth_Hz: linewidth,\n f_d_Hz: underdamped ? f0 * root : null,\n x_m: underdamped ? x0 * decay * (Math.cos(wd * t) + (alpha / wd) * Math.sin(wd * t)) : null,\n envelope_m: envelope,\n resolution_Hz: 1 / tObs,\n linewidth_windowed_Hz: windowed,\n windowed_excess: windowed === null ? null : windowed / linewidth - 1,\n x_th_rms_m: xTh,\n envelope_rms_m: xTh === null || envelope === null ? null : Math.sqrt(envelope * envelope + 2 * xTh * xTh),\n },\n checks,\n unchecked,\n };\n },\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type AppliedCase } from './types.js';
2
- /** The Julian year, the year BE-52 takes (s). @internal */
2
+ /** The Julian year, the year BE-52 takes (s): the unit table's `julian_year` row (`yr`). @internal */
3
3
  export declare const JULIAN_YEAR_S: number;
4
4
  /** m_p/M_* ceiling: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%. @internal */
5
5
  export declare const MAX_MASS_RATIO = 0.01;
@@ -1 +1 @@
1
- {"version":3,"file":"kepler-rv.d.ts","sourceRoot":"","sources":["../../src/cases/kepler-rv.ts"],"names":[],"mappings":"AAoBA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAItE,2DAA2D;AAC3D,eAAO,MAAM,aAAa,QAAiB,CAAC;AAE5C,2GAA2G;AAC3G,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,mEAAmE;AACnE,eAAO,MAAM,cAAc,SAAO,CAAC;AAEnC,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,cAAc,EAAE,WA4I5B,CAAC"}
1
+ {"version":3,"file":"kepler-rv.d.ts","sourceRoot":"","sources":["../../src/cases/kepler-rv.ts"],"names":[],"mappings":"AAqBA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAItE,sGAAsG;AACtG,eAAO,MAAM,aAAa,QAAkC,CAAC;AAE7D,2GAA2G;AAC3G,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,mEAAmE;AACnE,eAAO,MAAM,cAAc,SAAO,CAAC;AAEnC,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,cAAc,EAAE,WA4I5B,CAAC"}
@@ -16,12 +16,13 @@
16
16
  * @module cases/kepler-rv
17
17
  */
18
18
  import { C_SI, G_SI } from '../core/constants.js';
19
+ import { convertValue } from '../dimensional/units.js';
19
20
  import { catalogRelations } from '../bridges/catalog-load.js';
20
21
  import { evaluateCatalogRelation } from '../bridges/relation-eval.js';
21
22
  import { check, requirePositive } from './types.js';
22
23
  const ID = 'case-kepler-rv';
23
- /** The Julian year, the year BE-52 takes (s). @internal */
24
- export const JULIAN_YEAR_S = 365.25 * 86400;
24
+ /** The Julian year, the year BE-52 takes (s): the unit table's `julian_year` row (`yr`). @internal */
25
+ export const JULIAN_YEAR_S = convertValue('1 yr', 's').value;
25
26
  /** m_p/M_* ceiling: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%. @internal */
26
27
  export const MAX_MASS_RATIO = 0.01;
27
28
  /** Ceiling on the stellar radius over the periastron separation, for point masses. @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"kepler-rv.js","sourceRoot":"","sources":["../../src/cases/kepler-rv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAoB,MAAM,YAAY,CAAC;AAEtE,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAE5B,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,CAAC;AAE5C,2GAA2G;AAC3G,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,oFAAoF;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,EAAE,EAAE,EAAE;IACN,KAAK,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BAChB,kBAAkB,EAAE,IAAI;gBACxB,oBAAoB,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,aAAa,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE;gBAClE,cAAc,EAAE,MAAM;aACvB;YACD,MAAM,EAAE;gBACN,KAAK,CAAC,WAAW,EAAE,mDAAmD,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,cAAc,EAC5G,4FAA4F,CAAC;gBAC/F,KAAK,CAAC,YAAY,EAAE,wEAAwE,EAAE,gBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAC/I,2HAA2H,CAAC;gBAC9H,KAAK,CAAC,YAAY,EAAE,2CAA2C,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAChH,kHAAkH,CAAC;gBACrH,KAAK,CAAC,SAAS,EAAE,uFAAuF,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EACxJ,yLAAyL,CAAC;aAC7L;YACD,SAAS,EAAE;gBACT,mFAAmF;gBACnF,gFAAgF;aACjF;SACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: the radial-velocity semi-amplitude of a star orbited by a\n * companion — what a spectrograph reads as the star's reflex motion, from the\n * two masses, the period, the eccentricity and the inclination.\n *\n * The scalar is the test-mass form of the Keplerian RV curve used to infer\n * m_p sin i (Lovis & Fischer, \"Radial Velocity Techniques for Exoplanets\", in\n * Seager (ed.), Exoplanets, 2010, eq. 1; Murray & Dermott, Solar System\n * Dynamics, 1999, §2.7). The parent is the two-body problem of two extended\n * bodies in general relativity. The case compares the test-mass K with the\n * exact Newtonian two-body K, and checks the three premises that make a fixed\n * Keplerian ellipse the right curve: a companion light beside the star, point\n * masses (no tides), and a weak field whose apsidal advance (BE-52, with the\n * total mass; Robertson 1938) does not reshape the curve over the record.\n *\n * @module cases/kepler-rv\n */\nimport { C_SI, G_SI } from '../core/constants.js';\nimport { catalogRelations } from '../bridges/catalog-load.js';\nimport { evaluateCatalogRelation } from '../bridges/relation-eval.js';\nimport { check, requirePositive, type AppliedCase } from './types.js';\n\nconst ID = 'case-kepler-rv';\n\n/** The Julian year, the year BE-52 takes (s). @internal */\nexport const JULIAN_YEAR_S = 365.25 * 86400;\n\n/** m_p/M_* ceiling: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%. @internal */\nexport const MAX_MASS_RATIO = 0.01;\n\n/** Ceiling on the stellar radius over the periastron separation, for point masses. @internal */\nexport const MAX_RADIUS_RATIO = 0.1;\n\n/** G(M_* + m_p)/(c² a) ceiling for Newtonian gravity. @internal */\nexport const MAX_WEAK_FIELD = 1e-4;\n\n/** e·Δω accumulated over the record (rad) ceiling for a fixed ellipse. @internal */\nexport const MAX_APSIDAL_MISFIT = 0.01;\n\nexport const KEPLER_RV_CASE: AppliedCase = {\n id: ID,\n title: 'Radial-velocity semi-amplitude of a star with a companion (mass ratio, tides, GR apsidal advance)',\n parameters: [\n { key: 'M_star_kg', quantity: 'stellar mass', symbol: 'M_*', unit: 'kg', meaning: 'mass of the star whose radial velocity is measured (1Msun = 1.989e30 kg), > 0' },\n { key: 'm_p_kg', quantity: 'companion mass', symbol: 'm_p', unit: 'kg', meaning: 'true mass of the companion (Jupiter ≈ 1.898e27 kg), > 0' },\n { key: 'P_s', quantity: 'orbital period', symbol: 'P', unit: 's', meaning: 'the orbital period the RV curve repeats with, > 0' },\n { key: 'eccentricity', quantity: 'eccentricity', symbol: 'e', unit: '', meaning: 'orbital eccentricity e, 0 ≤ e < 1 (a bare e is the elementary charge, so the key is spelled out)' },\n { key: 'sin_i', quantity: 'sine of the inclination', symbol: 'sin i', unit: '', meaning: 'sin of the angle between the orbit normal and the line of sight, 0 < sin i ≤ 1 (1 is edge-on)' },\n { key: 'R_star_m', quantity: 'stellar radius', symbol: 'R_*', unit: 'm', meaning: 'radius of the star (the Sun ≈ 6.957e8 m), > 0' },\n { key: 'T_obs_s', quantity: 'observing baseline', symbol: 'T_obs', unit: 's', meaning: 'time span of the RV record fitted with one fixed ellipse, > 0' },\n ],\n governing: {\n parent: [\n 'r̈ = −G(M_* + m_p) r/r³ + O(G(M_* + m_p)/(c² r)) · (G(M_* + m_p)/r²) (relative orbit, Newtonian term plus the 1PN Einstein–Infeld–Hoffmann terms)',\n 'M_* r_* + m_p r_p = 0 about the barycentre; the measured v_r is the line-of-sight component of ṙ_*',\n 'extended bodies: each is a point mass only if spherical and undeformed; tides and spin add quadrupole terms ∝ (R/r)²',\n ],\n scalar: [\n 'K = (2πG/P)^{1/3} m_p sin i / M_*^{2/3} / √(1 − e²) (test-mass form, m_p ≪ M_*)',\n 'v_r(t) = K [cos(ν(t) + ω) + e cos ω], ω fixed over the record',\n 'a³ = G(M_* + m_p) P²/(4π²) (Kepler III for the relative orbit; CE-kepler-third)',\n ],\n distinction:\n 'The parent is a coupled vector problem for two finite, deformable bodies in curved spacetime; the scalar keeps one ' +\n 'number K for a fixed Keplerian ellipse of the star about the barycentre and puts the whole mass in the star. Dropped: ' +\n 'the companion\\'s share of the total mass (O(q)), the apsidal advance and the other 1PN terms (O(GM/(c²a))), and ' +\n 'the tidal and rotational quadrupoles (O((R_*/r)²)).',\n },\n observable: 'K_m_per_s',\n outputs: [\n { key: 'q', symbol: 'q', unit: '', meaning: 'mass ratio m_p/M_*' },\n { key: 'a_m', symbol: 'a', unit: 'm', meaning: 'semi-major axis of the relative orbit, from Kepler III with the total mass' },\n { key: 'a_star_m', symbol: 'a_*', unit: 'm', meaning: 'semi-major axis of the star\\'s own orbit about the barycentre, a m_p/(M_* + m_p)' },\n { key: 'K_m_per_s', symbol: 'K', unit: 'm/s', meaning: 'RV semi-amplitude of the star, test-mass form (the scalar result)' },\n { key: 'K_two_body_m_per_s', symbol: 'K_2b', unit: 'm/s', meaning: 'the exact Newtonian two-body semi-amplitude (2πG/P)^{1/3} m_p sin i/(M_* + m_p)^{2/3}/√(1 − e²)' },\n { key: 'two_body_deviation', symbol: 'K/K_2b − 1', unit: '', meaning: 'relative excess of the test-mass K over the two-body K: (1 + q)^{2/3} − 1' },\n { key: 'r_peri_m', symbol: 'r_p', unit: 'm', meaning: 'periastron separation a(1 − e)' },\n { key: 'weak_field', symbol: 'G(M_* + m_p)/(c²a)', unit: '', meaning: 'the 1PN expansion parameter (half the Schwarzschild radius of the total mass, over a)' },\n { key: 'dphi_rad_per_orbit', symbol: 'Δω', unit: 'rad', meaning: 'GR apsidal advance per orbit 6πG(M_* + m_p)/(c²a(1 − e²)) (BE-52 with the total mass)' },\n { key: 'omega_dot_deg_per_yr', symbol: 'ω̇', unit: 'deg/yr', meaning: 'the same advance as a rate, degrees per Julian year' },\n { key: 'apsidal_misfit', symbol: 'e Δω T_obs/P', unit: '', meaning: 'eccentricity times the apsidal advance accumulated over the record (rad)' },\n ],\n conditions: [\n 'an isolated binary: no third body within the record, the systemic velocity constant (it is fitted out as an offset)',\n 'initial condition: the orbital elements (P, e, ω, time of periastron) are those at the start of the record',\n 'the line of sight is fixed; the star\\'s light traces its centre of mass (no spots, no convective blueshift variation)',\n ],\n comparison: {\n reference: 'the parent\\'s Newtonian limit: the exact two-body semi-amplitude with the companion\\'s mass in the total',\n valueKey: 'K_m_per_s',\n referenceKey: 'K_two_body_m_per_s',\n deviationKey: 'two_body_deviation',\n method: 'closed form of the two-body Keplerian semi-amplitude',\n },\n notIncluded: [\n 'stellar activity (jitter), instrumental drift and the gravitational redshift and light-travel-time terms of the RV itself',\n 'the other 1PN terms beside the apsidal advance (O(GM/(c²a)) in the P–a relation and in K), bounded by the weak-field check but not applied',\n 'tidal orbital decay (dP/dt) and the tidal and rotational quadrupole precession, which the point-mass check bounds only by R_*/r_p',\n 'the inclination itself: RV alone gives m_p sin i; sin i must come from a transit or astrometry',\n ],\n measurement: [\n 'fit a Keplerian (P, K, e, ω, time of periastron, systemic offset) to the RV time series and compare the fitted K with K_m_per_s; ' +\n 'with P and e fixed, the fitted K inverts to the minimum mass m_p sin i through the same relation',\n 'where the two-body check fails, compare with K_two_body_m_per_s, which is the Newtonian parent',\n '`upt confront --bridge=be-52`: Mercury\\'s anomalous perihelion advance, which tests the Δω formula the apsidal check uses',\n ],\n links: [\n { id: 'CE-kepler-third', role: 'T² = 4π²a³/(GM), with the assumptions two-body and M ≫ m; here with M → M_* + m_p' },\n { id: `be-${52}`, role: 'the GR perihelion advance Δφ = 6πGM/(c²a(1 − e²)), evaluated with the total mass (`upt evaluate be-52`)' },\n { id: 'CE-perihelion-precession', role: 'the canonical entry restating BE-52' },\n { id: 'CE-schwarzschild-radius', role: 'r_s = 2GM/c², whose ratio to a (halved) is the weak-field check\\'s quantity' },\n ],\n examples: {\n valid: {\n args: ['M_star_kg=1Msun', 'm_p_kg=1.898e27', 'P_s=4332.59d', 'eccentricity=0.0489', 'sin_i=1', 'R_star_m=6.957e8', 'T_obs_s=12yr'],\n note: 'the Sun\\'s reflex motion from Jupiter, seen edge-on over one orbit: K ≈ 12.5 m/s',\n fails: [],\n },\n failures: [\n {\n args: ['M_star_kg=1.434Msun', 'm_p_kg=2.79e27', 'P_s=1.09142d', 'eccentricity=0', 'sin_i=0.993', 'R_star_m=1.153e9', 'T_obs_s=10yr'],\n note: 'WASP-12 b, a 1.47 M_J planet on a 1.09 d orbit: the star\\'s radius is a third of the separation, and the orbit is observed to decay by tides',\n fails: ['point-mass'],\n },\n {\n args: ['M_star_kg=1.3381Msun', 'm_p_kg=1.2489Msun', 'P_s=0.10225156248d', 'eccentricity=0.0877775', 'sin_i=0.99974', 'R_star_m=12km', 'T_obs_s=1yr'],\n note: 'the double pulsar PSR J0737−3039A/B timed for a year: equal masses, and a GR apsidal advance of ≈ 17°/yr',\n fails: ['test-mass', 'apsidal'],\n },\n ],\n },\n /** Evaluate the test-mass radial-velocity amplitude and checks for the supplied binary inputs. */\n run(i) {\n requirePositive(ID, i, ['M_star_kg', 'm_p_kg', 'P_s', 'sin_i', 'R_star_m', 'T_obs_s']);\n const { M_star_kg: M, m_p_kg: m, P_s: P, eccentricity: e, sin_i: sinI, R_star_m: R, T_obs_s: tObs } = i as Record<string, number>;\n if (!Number.isFinite(e) || e < 0 || e >= 1) throw new Error(`${ID}: eccentricity must be in [0, 1) (got ${e})`);\n if (sinI > 1) throw new Error(`${ID}: sin_i must be in (0, 1] (got ${sinI})`);\n const total = M + m;\n const a = Math.cbrt((G_SI * total * P * P) / (4 * Math.PI * Math.PI));\n const root = Math.sqrt(1 - e * e);\n const n13 = Math.cbrt((2 * Math.PI * G_SI) / P);\n const K = (n13 * m * sinI) / Math.cbrt(M * M) / root;\n const K2b = (n13 * m * sinI) / Math.cbrt(total * total) / root;\n const rPeri = a * (1 - e);\n const weak = (G_SI * total) / (C_SI * C_SI * a);\n const advance = catalogRelations().find((row) => row.target === 'perihelion-advance');\n if (advance === undefined) throw new Error(`${ID}: the perihelion relation is not in the catalog`);\n const dphi = evaluateCatalogRelation(advance, { mass: total, 'semi-major-axis': a, eccentricity: e });\n const misfit = (e * dphi * tObs) / P;\n return {\n outputs: {\n q: m / M,\n a_m: a,\n a_star_m: (a * m) / total,\n K_m_per_s: K,\n K_two_body_m_per_s: K2b,\n two_body_deviation: K / K2b - 1,\n r_peri_m: rPeri,\n weak_field: weak,\n dphi_rad_per_orbit: dphi,\n omega_dot_deg_per_yr: ((dphi / P) * JULIAN_YEAR_S * 180) / Math.PI,\n apsidal_misfit: misfit,\n },\n checks: [\n check('test-mass', 'the companion is light beside the star, m_p ≪ M_*', 'm_p/M_*', m / M, '<=', MAX_MASS_RATIO,\n 'chosen threshold: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%'),\n check('point-mass', 'point masses: the star is small beside the closest approach, R_* ≪ r_p', 'R_*/(a(1 − e))', R / rPeri, '<=', MAX_RADIUS_RATIO,\n 'chosen threshold: tidal and rotational quadrupole terms scale as (R_*/r)² times a Love number or J2 (each < 1), kept ≤ 1%'),\n check('weak-field', 'Newtonian gravity: G(M_* + m_p)/(c²a) ≪ 1', 'G(M_* + m_p)/(c² a)', weak, '<=', MAX_WEAK_FIELD,\n 'chosen threshold: the 1PN corrections to the P–a relation and to the orbital velocity are of this relative order'),\n check('apsidal', 'a fixed ellipse over the record: the GR apsidal advance does not reshape the RV curve', 'e Δω T_obs/P', misfit, '<=', MAX_APSIDAL_MISFIT,\n 'chosen threshold: beyond the mean longitude (absorbed by the fitted phase), v_r depends on ω only at O(e), so the misfit is of order e Δω K; its coefficient (order one) is not encoded'),\n ],\n 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 ],\n };\n },\n};\n"]}
1
+ {"version":3,"file":"kepler-rv.js","sourceRoot":"","sources":["../../src/cases/kepler-rv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAoB,MAAM,YAAY,CAAC;AAEtE,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAE5B,sGAAsG;AACtG,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC;AAE7D,2GAA2G;AAC3G,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,oFAAoF;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,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C,GAAG,GAAG,GAAG,CAAC;gBAC/B,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,IAAI;gBAChB,kBAAkB,EAAE,IAAI;gBACxB,oBAAoB,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,aAAa,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE;gBAClE,cAAc,EAAE,MAAM;aACvB;YACD,MAAM,EAAE;gBACN,KAAK,CAAC,WAAW,EAAE,mDAAmD,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,cAAc,EAC5G,4FAA4F,CAAC;gBAC/F,KAAK,CAAC,YAAY,EAAE,wEAAwE,EAAE,gBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAC/I,2HAA2H,CAAC;gBAC9H,KAAK,CAAC,YAAY,EAAE,2CAA2C,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAChH,kHAAkH,CAAC;gBACrH,KAAK,CAAC,SAAS,EAAE,uFAAuF,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EACxJ,yLAAyL,CAAC;aAC7L;YACD,SAAS,EAAE;gBACT,mFAAmF;gBACnF,gFAAgF;aACjF;SACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/**\n * Applied case: the radial-velocity semi-amplitude of a star orbited by a\n * companion — what a spectrograph reads as the star's reflex motion, from the\n * two masses, the period, the eccentricity and the inclination.\n *\n * The scalar is the test-mass form of the Keplerian RV curve used to infer\n * m_p sin i (Lovis & Fischer, \"Radial Velocity Techniques for Exoplanets\", in\n * Seager (ed.), Exoplanets, 2010, eq. 1; Murray & Dermott, Solar System\n * Dynamics, 1999, §2.7). The parent is the two-body problem of two extended\n * bodies in general relativity. The case compares the test-mass K with the\n * exact Newtonian two-body K, and checks the three premises that make a fixed\n * Keplerian ellipse the right curve: a companion light beside the star, point\n * masses (no tides), and a weak field whose apsidal advance (BE-52, with the\n * total mass; Robertson 1938) does not reshape the curve over the record.\n *\n * @module cases/kepler-rv\n */\nimport { C_SI, G_SI } from '../core/constants.js';\nimport { convertValue } from '../dimensional/units.js';\nimport { catalogRelations } from '../bridges/catalog-load.js';\nimport { evaluateCatalogRelation } from '../bridges/relation-eval.js';\nimport { check, requirePositive, type AppliedCase } from './types.js';\n\nconst ID = 'case-kepler-rv';\n\n/** The Julian year, the year BE-52 takes (s): the unit table's `julian_year` row (`yr`). @internal */\nexport const JULIAN_YEAR_S = convertValue('1 yr', 's').value;\n\n/** m_p/M_* ceiling: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%. @internal */\nexport const MAX_MASS_RATIO = 0.01;\n\n/** Ceiling on the stellar radius over the periastron separation, for point masses. @internal */\nexport const MAX_RADIUS_RATIO = 0.1;\n\n/** G(M_* + m_p)/(c² a) ceiling for Newtonian gravity. @internal */\nexport const MAX_WEAK_FIELD = 1e-4;\n\n/** e·Δω accumulated over the record (rad) ceiling for a fixed ellipse. @internal */\nexport const MAX_APSIDAL_MISFIT = 0.01;\n\nexport const KEPLER_RV_CASE: AppliedCase = {\n id: ID,\n title: 'Radial-velocity semi-amplitude of a star with a companion (mass ratio, tides, GR apsidal advance)',\n parameters: [\n { key: 'M_star_kg', quantity: 'stellar mass', symbol: 'M_*', unit: 'kg', meaning: 'mass of the star whose radial velocity is measured (1Msun = 1.989e30 kg), > 0' },\n { key: 'm_p_kg', quantity: 'companion mass', symbol: 'm_p', unit: 'kg', meaning: 'true mass of the companion (Jupiter ≈ 1.898e27 kg), > 0' },\n { key: 'P_s', quantity: 'orbital period', symbol: 'P', unit: 's', meaning: 'the orbital period the RV curve repeats with, > 0' },\n { key: 'eccentricity', quantity: 'eccentricity', symbol: 'e', unit: '', meaning: 'orbital eccentricity e, 0 ≤ e < 1 (a bare e is the elementary charge, so the key is spelled out)' },\n { key: 'sin_i', quantity: 'sine of the inclination', symbol: 'sin i', unit: '', meaning: 'sin of the angle between the orbit normal and the line of sight, 0 < sin i ≤ 1 (1 is edge-on)' },\n { key: 'R_star_m', quantity: 'stellar radius', symbol: 'R_*', unit: 'm', meaning: 'radius of the star (the Sun ≈ 6.957e8 m), > 0' },\n { key: 'T_obs_s', quantity: 'observing baseline', symbol: 'T_obs', unit: 's', meaning: 'time span of the RV record fitted with one fixed ellipse, > 0' },\n ],\n governing: {\n parent: [\n 'r̈ = −G(M_* + m_p) r/r³ + O(G(M_* + m_p)/(c² r)) · (G(M_* + m_p)/r²) (relative orbit, Newtonian term plus the 1PN Einstein–Infeld–Hoffmann terms)',\n 'M_* r_* + m_p r_p = 0 about the barycentre; the measured v_r is the line-of-sight component of ṙ_*',\n 'extended bodies: each is a point mass only if spherical and undeformed; tides and spin add quadrupole terms ∝ (R/r)²',\n ],\n scalar: [\n 'K = (2πG/P)^{1/3} m_p sin i / M_*^{2/3} / √(1 − e²) (test-mass form, m_p ≪ M_*)',\n 'v_r(t) = K [cos(ν(t) + ω) + e cos ω], ω fixed over the record',\n 'a³ = G(M_* + m_p) P²/(4π²) (Kepler III for the relative orbit; CE-kepler-third)',\n ],\n distinction:\n 'The parent is a coupled vector problem for two finite, deformable bodies in curved spacetime; the scalar keeps one ' +\n 'number K for a fixed Keplerian ellipse of the star about the barycentre and puts the whole mass in the star. Dropped: ' +\n 'the companion\\'s share of the total mass (O(q)), the apsidal advance and the other 1PN terms (O(GM/(c²a))), and ' +\n 'the tidal and rotational quadrupoles (O((R_*/r)²)).',\n },\n observable: 'K_m_per_s',\n outputs: [\n { key: 'q', symbol: 'q', unit: '', meaning: 'mass ratio m_p/M_*' },\n { key: 'a_m', symbol: 'a', unit: 'm', meaning: 'semi-major axis of the relative orbit, from Kepler III with the total mass' },\n { key: 'a_star_m', symbol: 'a_*', unit: 'm', meaning: 'semi-major axis of the star\\'s own orbit about the barycentre, a m_p/(M_* + m_p)' },\n { key: 'K_m_per_s', symbol: 'K', unit: 'm/s', meaning: 'RV semi-amplitude of the star, test-mass form (the scalar result)' },\n { key: 'K_two_body_m_per_s', symbol: 'K_2b', unit: 'm/s', meaning: 'the exact Newtonian two-body semi-amplitude (2πG/P)^{1/3} m_p sin i/(M_* + m_p)^{2/3}/√(1 − e²)' },\n { key: 'two_body_deviation', symbol: 'K/K_2b − 1', unit: '', meaning: 'relative excess of the test-mass K over the two-body K: (1 + q)^{2/3} − 1' },\n { key: 'r_peri_m', symbol: 'r_p', unit: 'm', meaning: 'periastron separation a(1 − e)' },\n { key: 'weak_field', symbol: 'G(M_* + m_p)/(c²a)', unit: '', meaning: 'the 1PN expansion parameter (half the Schwarzschild radius of the total mass, over a)' },\n { key: 'dphi_rad_per_orbit', symbol: 'Δω', unit: 'rad', meaning: 'GR apsidal advance per orbit 6πG(M_* + m_p)/(c²a(1 − e²)) (BE-52 with the total mass)' },\n { key: 'omega_dot_deg_per_yr', symbol: 'ω̇', unit: 'deg/yr', meaning: 'the same advance as a rate, degrees per Julian year' },\n { key: 'apsidal_misfit', symbol: 'e Δω T_obs/P', unit: '', meaning: 'eccentricity times the apsidal advance accumulated over the record (rad)' },\n ],\n conditions: [\n 'an isolated binary: no third body within the record, the systemic velocity constant (it is fitted out as an offset)',\n 'initial condition: the orbital elements (P, e, ω, time of periastron) are those at the start of the record',\n 'the line of sight is fixed; the star\\'s light traces its centre of mass (no spots, no convective blueshift variation)',\n ],\n comparison: {\n reference: 'the parent\\'s Newtonian limit: the exact two-body semi-amplitude with the companion\\'s mass in the total',\n valueKey: 'K_m_per_s',\n referenceKey: 'K_two_body_m_per_s',\n deviationKey: 'two_body_deviation',\n method: 'closed form of the two-body Keplerian semi-amplitude',\n },\n notIncluded: [\n 'stellar activity (jitter), instrumental drift and the gravitational redshift and light-travel-time terms of the RV itself',\n 'the other 1PN terms beside the apsidal advance (O(GM/(c²a)) in the P–a relation and in K), bounded by the weak-field check but not applied',\n 'tidal orbital decay (dP/dt) and the tidal and rotational quadrupole precession, which the point-mass check bounds only by R_*/r_p',\n 'the inclination itself: RV alone gives m_p sin i; sin i must come from a transit or astrometry',\n ],\n measurement: [\n 'fit a Keplerian (P, K, e, ω, time of periastron, systemic offset) to the RV time series and compare the fitted K with K_m_per_s; ' +\n 'with P and e fixed, the fitted K inverts to the minimum mass m_p sin i through the same relation',\n 'where the two-body check fails, compare with K_two_body_m_per_s, which is the Newtonian parent',\n '`upt confront --bridge=be-52`: Mercury\\'s anomalous perihelion advance, which tests the Δω formula the apsidal check uses',\n ],\n links: [\n { id: 'CE-kepler-third', role: 'T² = 4π²a³/(GM), with the assumptions two-body and M ≫ m; here with M → M_* + m_p' },\n { id: `be-${52}`, role: 'the GR perihelion advance Δφ = 6πGM/(c²a(1 − e²)), evaluated with the total mass (`upt evaluate be-52`)' },\n { id: 'CE-perihelion-precession', role: 'the canonical entry restating BE-52' },\n { id: 'CE-schwarzschild-radius', role: 'r_s = 2GM/c², whose ratio to a (halved) is the weak-field check\\'s quantity' },\n ],\n examples: {\n valid: {\n args: ['M_star_kg=1Msun', 'm_p_kg=1.898e27', 'P_s=4332.59d', 'eccentricity=0.0489', 'sin_i=1', 'R_star_m=6.957e8', 'T_obs_s=12yr'],\n note: 'the Sun\\'s reflex motion from Jupiter, seen edge-on over one orbit: K ≈ 12.5 m/s',\n fails: [],\n },\n failures: [\n {\n args: ['M_star_kg=1.434Msun', 'm_p_kg=2.79e27', 'P_s=1.09142d', 'eccentricity=0', 'sin_i=0.993', 'R_star_m=1.153e9', 'T_obs_s=10yr'],\n note: 'WASP-12 b, a 1.47 M_J planet on a 1.09 d orbit: the star\\'s radius is a third of the separation, and the orbit is observed to decay by tides',\n fails: ['point-mass'],\n },\n {\n args: ['M_star_kg=1.3381Msun', 'm_p_kg=1.2489Msun', 'P_s=0.10225156248d', 'eccentricity=0.0877775', 'sin_i=0.99974', 'R_star_m=12km', 'T_obs_s=1yr'],\n note: 'the double pulsar PSR J0737−3039A/B timed for a year: equal masses, and a GR apsidal advance of ≈ 17°/yr',\n fails: ['test-mass', 'apsidal'],\n },\n ],\n },\n /** Evaluate the test-mass radial-velocity amplitude and checks for the supplied binary inputs. */\n run(i) {\n requirePositive(ID, i, ['M_star_kg', 'm_p_kg', 'P_s', 'sin_i', 'R_star_m', 'T_obs_s']);\n const { M_star_kg: M, m_p_kg: m, P_s: P, eccentricity: e, sin_i: sinI, R_star_m: R, T_obs_s: tObs } = i as Record<string, number>;\n if (!Number.isFinite(e) || e < 0 || e >= 1) throw new Error(`${ID}: eccentricity must be in [0, 1) (got ${e})`);\n if (sinI > 1) throw new Error(`${ID}: sin_i must be in (0, 1] (got ${sinI})`);\n const total = M + m;\n const a = Math.cbrt((G_SI * total * P * P) / (4 * Math.PI * Math.PI));\n const root = Math.sqrt(1 - e * e);\n const n13 = Math.cbrt((2 * Math.PI * G_SI) / P);\n const K = (n13 * m * sinI) / Math.cbrt(M * M) / root;\n const K2b = (n13 * m * sinI) / Math.cbrt(total * total) / root;\n const rPeri = a * (1 - e);\n const weak = (G_SI * total) / (C_SI * C_SI * a);\n const advance = catalogRelations().find((row) => row.target === 'perihelion-advance');\n if (advance === undefined) throw new Error(`${ID}: the perihelion relation is not in the catalog`);\n const dphi = evaluateCatalogRelation(advance, { mass: total, 'semi-major-axis': a, eccentricity: e });\n const misfit = (e * dphi * tObs) / P;\n return {\n outputs: {\n q: m / M,\n a_m: a,\n a_star_m: (a * m) / total,\n K_m_per_s: K,\n K_two_body_m_per_s: K2b,\n two_body_deviation: K / K2b - 1,\n r_peri_m: rPeri,\n weak_field: weak,\n dphi_rad_per_orbit: dphi,\n omega_dot_deg_per_yr: ((dphi / P) * JULIAN_YEAR_S * 180) / Math.PI,\n apsidal_misfit: misfit,\n },\n checks: [\n check('test-mass', 'the companion is light beside the star, m_p ≪ M_*', 'm_p/M_*', m / M, '<=', MAX_MASS_RATIO,\n 'chosen threshold: the test-mass K then exceeds the two-body K by (1 + q)^{2/3} − 1 ≤ 0.67%'),\n check('point-mass', 'point masses: the star is small beside the closest approach, R_* ≪ r_p', 'R_*/(a(1 − e))', R / rPeri, '<=', MAX_RADIUS_RATIO,\n 'chosen threshold: tidal and rotational quadrupole terms scale as (R_*/r)² times a Love number or J2 (each < 1), kept ≤ 1%'),\n check('weak-field', 'Newtonian gravity: G(M_* + m_p)/(c²a) ≪ 1', 'G(M_* + m_p)/(c² a)', weak, '<=', MAX_WEAK_FIELD,\n 'chosen threshold: the 1PN corrections to the P–a relation and to the orbital velocity are of this relative order'),\n check('apsidal', 'a fixed ellipse over the record: the GR apsidal advance does not reshape the RV curve', 'e Δω T_obs/P', misfit, '<=', MAX_APSIDAL_MISFIT,\n 'chosen threshold: beyond the mean longitude (absorbed by the fitted phase), v_r depends on ω only at O(e), so the misfit is of order e Δω K; its coefficient (order one) is not encoded'),\n ],\n 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 ],\n };\n },\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type AppliedCase } from './types.js';
2
- /** Stefan–Boltzmann constant 2π⁵k_B⁴/(15h³c²), from the exact SI constants (W m⁻² K⁻⁴). @internal */
3
- export declare const SIGMA_SB_SI: number;
2
+ /** The Stefan–Boltzmann constant (W m⁻² K⁻⁴) is `core/constants`'s; re-exported so the record's module-export table keeps its row. @internal */
3
+ export { SIGMA_SB_SI } from '../core/constants.js';
4
4
  /** Bi = h L_c/k ceiling, L_c = V/A (Incropera §5.2, eq. 5.10). @internal */
5
5
  export declare const MAX_BIOT = 0.1;
6
6
  /** h_rad,max/h ceiling for a loss linear in T − T∞. @internal */
@@ -19,7 +19,8 @@ export interface LumpedRadiating {
19
19
  }
20
20
  /**
21
21
  * T(t) of ρcV dT/dt = −A[h(T − T∞) + εσ_SB(T⁴ − T∞⁴)] for a sphere (V/A =
22
- * a/3), by RK4 with each step 1/100 of the local relaxation time
22
+ * a/3), by classical RK4 (`integrateRK4`, MathTS `solveODESystem` with `dt`,
23
+ * one call per step) with each step 1/100 of the local relaxation time
23
24
  * ρca/(3(h + 4εσ_SB T³)). Stops early once |T − T∞| is below 1e-15 |T0 − T∞|.
24
25
  * @internal
25
26
  */
@@ -27,6 +28,10 @@ export declare function lumpedRadiatingTemperature(p: LumpedRadiating): number;
27
28
  /**
28
29
  * The first n roots of 1 − ζ cot ζ = Bi (Bi = h a/k, radius-based): the n-th
29
30
  * lies in ((n−1)π, nπ), where the left side runs from −∞ (0 for n = 1) to +∞.
31
+ * Each is MathTS `findRoot` (Brent) on that interval, pulled in from the
32
+ * poles by a few ulps of kπ, since the solver evaluates both ends: at 0 the
33
+ * function is 0/0, and at an exact multiple of π `Math.tan` has no sign to
34
+ * trust. The tolerance is the bracket's own floating-point resolution.
30
35
  * @internal
31
36
  */
32
37
  export declare function sphereEigenvalues(biRadius: number, n: number): number[];
@@ -1 +1 @@
1
- {"version":3,"file":"lumped-cooling.d.ts","sourceRoot":"","sources":["../../src/cases/lumped-cooling.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAoD,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAIhG,qGAAqG;AACrG,eAAO,MAAM,WAAW,QAAkE,CAAC;AAE3F,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,6FAA6F;AAC7F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;G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