universal-physics-tensor 10.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (835) hide show
  1. package/README.md +39 -36
  2. package/bin/upt.mjs +13 -1
  3. package/data/applied-cases.json +1892 -0
  4. package/data/applied-cases.schema.json +194 -0
  5. package/data/atlas/atlas.json +25 -25
  6. package/data/atlas/atlas.jsonld +1 -1
  7. package/data/atlas/diffusion.json +6 -6
  8. package/data/atlas/oscillators.json +7 -7
  9. package/data/atlas/waves.json +14 -14
  10. package/data/atlas/witness-results.json +11 -11
  11. package/data/bridge-catalog.json +389 -230
  12. package/data/bridge-catalog.schema.json +45 -7
  13. package/data/units.json +6 -25
  14. package/dist/atlas/applicability.d.ts.map +1 -1
  15. package/dist/atlas/applicability.js +21 -15
  16. package/dist/atlas/applicability.js.map +1 -1
  17. package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
  18. package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
  19. package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
  20. package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
  21. package/dist/atlas/benchmark/loader.js +2 -2
  22. package/dist/atlas/benchmark/loader.js.map +1 -1
  23. package/dist/atlas/benchmark/stats.d.ts +2 -2
  24. package/dist/atlas/benchmark/stats.d.ts.map +1 -1
  25. package/dist/atlas/benchmark/stats.js +9 -15
  26. package/dist/atlas/benchmark/stats.js.map +1 -1
  27. package/dist/atlas/catalog-formal-ref.d.ts +26 -3
  28. package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
  29. package/dist/atlas/catalog-formal-ref.js +52 -5
  30. package/dist/atlas/catalog-formal-ref.js.map +1 -1
  31. package/dist/atlas/chain-pipeline.d.ts.map +1 -1
  32. package/dist/atlas/chain-pipeline.js +7 -8
  33. package/dist/atlas/chain-pipeline.js.map +1 -1
  34. package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
  35. package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
  36. package/dist/atlas/diffusion/bridges-closure.js +8 -12
  37. package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
  38. package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
  39. package/dist/atlas/diffusion/bridges.js +27 -39
  40. package/dist/atlas/diffusion/bridges.js.map +1 -1
  41. package/dist/atlas/diffusion/dimensions.d.ts +6 -14
  42. package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
  43. package/dist/atlas/diffusion/dimensions.js +8 -16
  44. package/dist/atlas/diffusion/dimensions.js.map +1 -1
  45. package/dist/atlas/diffusion/models.d.ts +3 -3
  46. package/dist/atlas/diffusion/models.d.ts.map +1 -1
  47. package/dist/atlas/diffusion/models.js +5 -10
  48. package/dist/atlas/diffusion/models.js.map +1 -1
  49. package/dist/atlas/diffusion/numerics.d.ts +16 -4
  50. package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
  51. package/dist/atlas/diffusion/numerics.js +38 -24
  52. package/dist/atlas/diffusion/numerics.js.map +1 -1
  53. package/dist/atlas/link-prediction.d.ts +106 -3
  54. package/dist/atlas/link-prediction.d.ts.map +1 -1
  55. package/dist/atlas/link-prediction.js +212 -66
  56. package/dist/atlas/link-prediction.js.map +1 -1
  57. package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
  58. package/dist/atlas/oscillators/bridges-coarse.js +7 -11
  59. package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
  60. package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
  61. package/dist/atlas/oscillators/bridges-exact.js +6 -7
  62. package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
  63. package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
  64. package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
  65. package/dist/atlas/oscillators/bridges-limits.js +23 -34
  66. package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
  67. package/dist/atlas/oscillators/dimensions.d.ts +9 -21
  68. package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
  69. package/dist/atlas/oscillators/dimensions.js +9 -21
  70. package/dist/atlas/oscillators/dimensions.js.map +1 -1
  71. package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
  72. package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
  73. package/dist/atlas/oscillators/limit-witnesses.js +17 -15
  74. package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
  75. package/dist/atlas/oscillators/models.d.ts.map +1 -1
  76. package/dist/atlas/oscillators/models.js +2 -6
  77. package/dist/atlas/oscillators/models.js.map +1 -1
  78. package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
  79. package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
  80. package/dist/atlas/oscillators/pendulum-motion.js +60 -40
  81. package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
  82. package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
  83. package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
  84. package/dist/atlas/oscillators/phase-translation.js +3 -4
  85. package/dist/atlas/oscillators/phase-translation.js.map +1 -1
  86. package/dist/atlas/oscillators/position-translation.d.ts +68 -7
  87. package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
  88. package/dist/atlas/oscillators/position-translation.js +123 -12
  89. package/dist/atlas/oscillators/position-translation.js.map +1 -1
  90. package/dist/atlas/oscillators/rejections.d.ts +0 -2
  91. package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
  92. package/dist/atlas/oscillators/rejections.js +0 -7
  93. package/dist/atlas/oscillators/rejections.js.map +1 -1
  94. package/dist/atlas/physjs-entries.generated.d.ts +35 -25
  95. package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
  96. package/dist/atlas/physjs-entries.generated.js +37 -25
  97. package/dist/atlas/physjs-entries.generated.js.map +1 -1
  98. package/dist/atlas/physjs-ref.d.ts +34 -31
  99. package/dist/atlas/physjs-ref.d.ts.map +1 -1
  100. package/dist/atlas/physjs-ref.js +55 -53
  101. package/dist/atlas/physjs-ref.js.map +1 -1
  102. package/dist/atlas/physjs-reviewed.d.ts +1 -1
  103. package/dist/atlas/physjs-reviewed.js +15 -15
  104. package/dist/atlas/physjs-reviewed.js.map +1 -1
  105. package/dist/atlas/poster/statements.d.ts +0 -19
  106. package/dist/atlas/poster/statements.d.ts.map +1 -1
  107. package/dist/atlas/poster/statements.js +1 -1
  108. package/dist/atlas/poster/statements.js.map +1 -1
  109. package/dist/atlas/proof-target.d.ts +1 -1
  110. package/dist/atlas/proof-target.js +1 -1
  111. package/dist/atlas/proof-target.js.map +1 -1
  112. package/dist/atlas/regime.d.ts +1 -1
  113. package/dist/atlas/regime.d.ts.map +1 -1
  114. package/dist/atlas/regime.js +1 -1
  115. package/dist/atlas/regime.js.map +1 -1
  116. package/dist/atlas/text-overlap.d.ts +23 -0
  117. package/dist/atlas/text-overlap.d.ts.map +1 -0
  118. package/dist/atlas/text-overlap.js +41 -0
  119. package/dist/atlas/text-overlap.js.map +1 -0
  120. package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
  121. package/dist/atlas/waves/bridges-closure.js +2 -6
  122. package/dist/atlas/waves/bridges-closure.js.map +1 -1
  123. package/dist/atlas/waves/bridges.d.ts.map +1 -1
  124. package/dist/atlas/waves/bridges.js +32 -48
  125. package/dist/atlas/waves/bridges.js.map +1 -1
  126. package/dist/atlas/waves/models.d.ts +5 -6
  127. package/dist/atlas/waves/models.d.ts.map +1 -1
  128. package/dist/atlas/waves/models.js +7 -13
  129. package/dist/atlas/waves/models.js.map +1 -1
  130. package/dist/atlas/waves/numerics.d.ts.map +1 -1
  131. package/dist/atlas/waves/numerics.js +10 -3
  132. package/dist/atlas/waves/numerics.js.map +1 -1
  133. package/dist/atlas/witness-numeric.d.ts +30 -0
  134. package/dist/atlas/witness-numeric.d.ts.map +1 -1
  135. package/dist/atlas/witness-numeric.js +53 -0
  136. package/dist/atlas/witness-numeric.js.map +1 -1
  137. package/dist/atlas/witness-specs.d.ts.map +1 -1
  138. package/dist/atlas/witness-specs.js +19 -0
  139. package/dist/atlas/witness-specs.js.map +1 -1
  140. package/dist/atlas/witness-symbolic.d.ts +75 -3
  141. package/dist/atlas/witness-symbolic.d.ts.map +1 -1
  142. package/dist/atlas/witness-symbolic.js +116 -10
  143. package/dist/atlas/witness-symbolic.js.map +1 -1
  144. package/dist/bridges/catalog-load.d.ts.map +1 -1
  145. package/dist/bridges/catalog-load.js +13 -8
  146. package/dist/bridges/catalog-load.js.map +1 -1
  147. package/dist/bridges/catalog-types.d.ts +26 -2
  148. package/dist/bridges/catalog-types.d.ts.map +1 -1
  149. package/dist/bridges/catalog-types.js +11 -1
  150. package/dist/bridges/catalog-types.js.map +1 -1
  151. package/dist/bridges/evaluation-errors.d.ts +31 -1
  152. package/dist/bridges/evaluation-errors.d.ts.map +1 -1
  153. package/dist/bridges/evaluation-errors.js +20 -2
  154. package/dist/bridges/evaluation-errors.js.map +1 -1
  155. package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
  156. package/dist/bridges/evaluator-inputs.js +7 -5
  157. package/dist/bridges/evaluator-inputs.js.map +1 -1
  158. package/dist/bridges/evaluators.d.ts.map +1 -1
  159. package/dist/bridges/evaluators.js +27 -12
  160. package/dist/bridges/evaluators.js.map +1 -1
  161. package/dist/bridges/expr-parse.d.ts +11 -0
  162. package/dist/bridges/expr-parse.d.ts.map +1 -1
  163. package/dist/bridges/expr-parse.js +14 -5
  164. package/dist/bridges/expr-parse.js.map +1 -1
  165. package/dist/bridges/holds.d.ts +35 -3
  166. package/dist/bridges/holds.d.ts.map +1 -1
  167. package/dist/bridges/holds.js +117 -23
  168. package/dist/bridges/holds.js.map +1 -1
  169. package/dist/bridges/notices.d.ts.map +1 -1
  170. package/dist/bridges/notices.js +5 -5
  171. package/dist/bridges/notices.js.map +1 -1
  172. package/dist/bridges/relation-eval.d.ts +4 -4
  173. package/dist/bridges/relation-eval.d.ts.map +1 -1
  174. package/dist/bridges/relation-eval.js +15 -16
  175. package/dist/bridges/relation-eval.js.map +1 -1
  176. package/dist/bridges/sensitivity.d.ts.map +1 -1
  177. package/dist/bridges/sensitivity.js +3 -3
  178. package/dist/bridges/sensitivity.js.map +1 -1
  179. package/dist/bridges/validity.d.ts +33 -0
  180. package/dist/bridges/validity.d.ts.map +1 -0
  181. package/dist/bridges/validity.js +67 -0
  182. package/dist/bridges/validity.js.map +1 -0
  183. package/dist/canonical/entries/atomic.js +1 -3
  184. package/dist/canonical/entries/atomic.js.map +1 -1
  185. package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
  186. package/dist/canonical/entries/condensed-matter.js +4 -5
  187. package/dist/canonical/entries/condensed-matter.js.map +1 -1
  188. package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
  189. package/dist/canonical/entries/dimensional-classics.js +3 -4
  190. package/dist/canonical/entries/dimensional-classics.js.map +1 -1
  191. package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
  192. package/dist/canonical/entries/electromagnetism.js +4 -10
  193. package/dist/canonical/entries/electromagnetism.js.map +1 -1
  194. package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
  195. package/dist/canonical/entries/fluids-waves.js +3 -7
  196. package/dist/canonical/entries/fluids-waves.js.map +1 -1
  197. package/dist/canonical/entries/mechanics.d.ts.map +1 -1
  198. package/dist/canonical/entries/mechanics.js +4 -6
  199. package/dist/canonical/entries/mechanics.js.map +1 -1
  200. package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
  201. package/dist/canonical/entries/nonmonomial.js +9 -17
  202. package/dist/canonical/entries/nonmonomial.js.map +1 -1
  203. package/dist/canonical/entries/relativity.d.ts.map +1 -1
  204. package/dist/canonical/entries/relativity.js +6 -6
  205. package/dist/canonical/entries/relativity.js.map +1 -1
  206. package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
  207. package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
  208. package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
  209. package/dist/canonical/fixed-points.d.ts +94 -0
  210. package/dist/canonical/fixed-points.d.ts.map +1 -0
  211. package/dist/canonical/fixed-points.js +81 -0
  212. package/dist/canonical/fixed-points.js.map +1 -0
  213. package/dist/canonical/linkage.d.ts.map +1 -1
  214. package/dist/canonical/linkage.js +25 -44
  215. package/dist/canonical/linkage.js.map +1 -1
  216. package/dist/canonical/normal-form.d.ts.map +1 -1
  217. package/dist/canonical/normal-form.js +5 -11
  218. package/dist/canonical/normal-form.js.map +1 -1
  219. package/dist/canonical/structural.d.ts +21 -21
  220. package/dist/canonical/structural.d.ts.map +1 -1
  221. package/dist/canonical/structural.js +40 -19
  222. package/dist/canonical/structural.js.map +1 -1
  223. package/dist/cases/catalog-checks.d.ts +10 -0
  224. package/dist/cases/catalog-checks.d.ts.map +1 -0
  225. package/dist/cases/catalog-checks.js +241 -0
  226. package/dist/cases/catalog-checks.js.map +1 -0
  227. package/dist/cases/catalog.d.ts +83 -0
  228. package/dist/cases/catalog.d.ts.map +1 -0
  229. package/dist/cases/catalog.js +118 -0
  230. package/dist/cases/catalog.js.map +1 -0
  231. package/dist/cases/engine.d.ts +13 -0
  232. package/dist/cases/engine.d.ts.map +1 -0
  233. package/dist/cases/engine.js +179 -0
  234. package/dist/cases/engine.js.map +1 -0
  235. package/dist/cases/index.d.ts.map +1 -1
  236. package/dist/cases/index.js +5 -7
  237. package/dist/cases/index.js.map +1 -1
  238. package/dist/cases/methods.d.ts +215 -0
  239. package/dist/cases/methods.d.ts.map +1 -0
  240. package/dist/cases/methods.js +743 -0
  241. package/dist/cases/methods.js.map +1 -0
  242. package/dist/cases/quadrature.d.ts +7 -9
  243. package/dist/cases/quadrature.d.ts.map +1 -1
  244. package/dist/cases/quadrature.js +28 -32
  245. package/dist/cases/quadrature.js.map +1 -1
  246. package/dist/cases/types.d.ts +12 -0
  247. package/dist/cases/types.d.ts.map +1 -1
  248. package/dist/cases/types.js.map +1 -1
  249. package/dist/cli/args.d.ts +25 -1
  250. package/dist/cli/args.d.ts.map +1 -1
  251. package/dist/cli/args.js +30 -8
  252. package/dist/cli/args.js.map +1 -1
  253. package/dist/cli/bindings.d.ts.map +1 -1
  254. package/dist/cli/bindings.js +5 -4
  255. package/dist/cli/bindings.js.map +1 -1
  256. package/dist/cli/command.d.ts +11 -1
  257. package/dist/cli/command.d.ts.map +1 -1
  258. package/dist/cli/command.js.map +1 -1
  259. package/dist/cli/commands/_atlas-map.d.ts +0 -9
  260. package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
  261. package/dist/cli/commands/_atlas-map.js +8 -18
  262. package/dist/cli/commands/_atlas-map.js.map +1 -1
  263. package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
  264. package/dist/cli/commands/_atlas-route.js +6 -2
  265. package/dist/cli/commands/_atlas-route.js.map +1 -1
  266. package/dist/cli/commands/_discovery-opts.d.ts +1 -0
  267. package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
  268. package/dist/cli/commands/_discovery-opts.js +9 -9
  269. package/dist/cli/commands/_discovery-opts.js.map +1 -1
  270. package/dist/cli/commands/atlas.d.ts.map +1 -1
  271. package/dist/cli/commands/atlas.js +8 -5
  272. package/dist/cli/commands/atlas.js.map +1 -1
  273. package/dist/cli/commands/audit.d.ts.map +1 -1
  274. package/dist/cli/commands/audit.js +8 -1
  275. package/dist/cli/commands/audit.js.map +1 -1
  276. package/dist/cli/commands/axes.d.ts.map +1 -1
  277. package/dist/cli/commands/axes.js +20 -1
  278. package/dist/cli/commands/axes.js.map +1 -1
  279. package/dist/cli/commands/confront.d.ts.map +1 -1
  280. package/dist/cli/commands/confront.js +8 -14
  281. package/dist/cli/commands/confront.js.map +1 -1
  282. package/dist/cli/commands/derive.d.ts.map +1 -1
  283. package/dist/cli/commands/derive.js +22 -22
  284. package/dist/cli/commands/derive.js.map +1 -1
  285. package/dist/cli/commands/discover.d.ts.map +1 -1
  286. package/dist/cli/commands/discover.js +122 -73
  287. package/dist/cli/commands/discover.js.map +1 -1
  288. package/dist/cli/commands/eval.d.ts.map +1 -1
  289. package/dist/cli/commands/eval.js +1 -0
  290. package/dist/cli/commands/eval.js.map +1 -1
  291. package/dist/cli/commands/evaluate.d.ts.map +1 -1
  292. package/dist/cli/commands/evaluate.js +67 -39
  293. package/dist/cli/commands/evaluate.js.map +1 -1
  294. package/dist/cli/commands/explain.d.ts.map +1 -1
  295. package/dist/cli/commands/explain.js +24 -3
  296. package/dist/cli/commands/explain.js.map +1 -1
  297. package/dist/cli/commands/ground.d.ts.map +1 -1
  298. package/dist/cli/commands/ground.js +7 -1
  299. package/dist/cli/commands/ground.js.map +1 -1
  300. package/dist/cli/commands/map.d.ts.map +1 -1
  301. package/dist/cli/commands/map.js +84 -11
  302. package/dist/cli/commands/map.js.map +1 -1
  303. package/dist/cli/commands/metric.d.ts.map +1 -1
  304. package/dist/cli/commands/metric.js +12 -9
  305. package/dist/cli/commands/metric.js.map +1 -1
  306. package/dist/cli/commands/path.d.ts +10 -0
  307. package/dist/cli/commands/path.d.ts.map +1 -1
  308. package/dist/cli/commands/path.js +25 -3
  309. package/dist/cli/commands/path.js.map +1 -1
  310. package/dist/cli/commands/probe.d.ts.map +1 -1
  311. package/dist/cli/commands/probe.js +59 -16
  312. package/dist/cli/commands/probe.js.map +1 -1
  313. package/dist/cli/commands/regime.d.ts.map +1 -1
  314. package/dist/cli/commands/regime.js +1 -0
  315. package/dist/cli/commands/regime.js.map +1 -1
  316. package/dist/cli/commands/retrieve.d.ts.map +1 -1
  317. package/dist/cli/commands/retrieve.js +1 -0
  318. package/dist/cli/commands/retrieve.js.map +1 -1
  319. package/dist/cli/commands/search.d.ts.map +1 -1
  320. package/dist/cli/commands/search.js +1 -0
  321. package/dist/cli/commands/search.js.map +1 -1
  322. package/dist/cli/commands/symbolic.d.ts.map +1 -1
  323. package/dist/cli/commands/symbolic.js +19 -28
  324. package/dist/cli/commands/symbolic.js.map +1 -1
  325. package/dist/cli/commands/testplan.d.ts.map +1 -1
  326. package/dist/cli/commands/testplan.js +4 -2
  327. package/dist/cli/commands/testplan.js.map +1 -1
  328. package/dist/cli/determination.d.ts +1 -0
  329. package/dist/cli/determination.d.ts.map +1 -1
  330. package/dist/cli/determination.js.map +1 -1
  331. package/dist/cli/expr-print.d.ts +0 -2
  332. package/dist/cli/expr-print.d.ts.map +1 -1
  333. package/dist/cli/expr-print.js +7 -31
  334. package/dist/cli/expr-print.js.map +1 -1
  335. package/dist/cli/flag-help.d.ts +1 -0
  336. package/dist/cli/flag-help.d.ts.map +1 -1
  337. package/dist/cli/flag-help.js +1 -0
  338. package/dist/cli/flag-help.js.map +1 -1
  339. package/dist/cli/graphs.d.ts +2 -0
  340. package/dist/cli/graphs.d.ts.map +1 -1
  341. package/dist/cli/graphs.js +1 -0
  342. package/dist/cli/graphs.js.map +1 -1
  343. package/dist/cli/main.d.ts +8 -0
  344. package/dist/cli/main.d.ts.map +1 -1
  345. package/dist/cli/main.js +19 -3
  346. package/dist/cli/main.js.map +1 -1
  347. package/dist/cli/numeric-flag.d.ts +12 -0
  348. package/dist/cli/numeric-flag.d.ts.map +1 -0
  349. package/dist/cli/numeric-flag.js +44 -0
  350. package/dist/cli/numeric-flag.js.map +1 -0
  351. package/dist/cli/output.d.ts +28 -0
  352. package/dist/cli/output.d.ts.map +1 -1
  353. package/dist/cli/output.js +23 -0
  354. package/dist/cli/output.js.map +1 -1
  355. package/dist/cli/record-reach.js +2 -2
  356. package/dist/cli/record-reach.js.map +1 -1
  357. package/dist/cli/record-tables.d.ts.map +1 -1
  358. package/dist/cli/record-tables.js +6 -5
  359. package/dist/cli/record-tables.js.map +1 -1
  360. package/dist/cli/record.d.ts +1 -5
  361. package/dist/cli/record.d.ts.map +1 -1
  362. package/dist/cli/record.js +9 -8
  363. package/dist/cli/record.js.map +1 -1
  364. package/dist/cli/search-index.d.ts.map +1 -1
  365. package/dist/cli/search-index.js +7 -6
  366. package/dist/cli/search-index.js.map +1 -1
  367. package/dist/cli/statuses.d.ts +0 -2
  368. package/dist/cli/statuses.d.ts.map +1 -1
  369. package/dist/cli/statuses.js +12 -9
  370. package/dist/cli/statuses.js.map +1 -1
  371. package/dist/cli/stored-results.d.ts +7 -0
  372. package/dist/cli/stored-results.d.ts.map +1 -0
  373. package/dist/cli/stored-results.js +23 -0
  374. package/dist/cli/stored-results.js.map +1 -0
  375. package/dist/cli/version.d.ts +1 -0
  376. package/dist/cli/version.d.ts.map +1 -1
  377. package/dist/cli/version.js +8 -5
  378. package/dist/cli/version.js.map +1 -1
  379. package/dist/cli-api.d.ts +36 -5
  380. package/dist/cli-api.d.ts.map +1 -1
  381. package/dist/cli-api.js +30 -4
  382. package/dist/cli-api.js.map +1 -1
  383. package/dist/composition/algebraic-equivalence.d.ts +43 -0
  384. package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
  385. package/dist/composition/algebraic-equivalence.js +115 -0
  386. package/dist/composition/algebraic-equivalence.js.map +1 -0
  387. package/dist/composition/axes.d.ts +0 -6
  388. package/dist/composition/axes.d.ts.map +1 -1
  389. package/dist/composition/axes.js +6 -6
  390. package/dist/composition/axes.js.map +1 -1
  391. package/dist/composition/axis-audit.d.ts +47 -20
  392. package/dist/composition/axis-audit.d.ts.map +1 -1
  393. package/dist/composition/axis-audit.js +82 -9
  394. package/dist/composition/axis-audit.js.map +1 -1
  395. package/dist/composition/bridge-analysis.d.ts +17 -0
  396. package/dist/composition/bridge-analysis.d.ts.map +1 -1
  397. package/dist/composition/bridge-analysis.js +102 -55
  398. package/dist/composition/bridge-analysis.js.map +1 -1
  399. package/dist/composition/canonical-compare.d.ts +40 -0
  400. package/dist/composition/canonical-compare.d.ts.map +1 -1
  401. package/dist/composition/canonical-compare.js +122 -24
  402. package/dist/composition/canonical-compare.js.map +1 -1
  403. package/dist/composition/canonical-graph.d.ts +3 -3
  404. package/dist/composition/canonical-graph.d.ts.map +1 -1
  405. package/dist/composition/canonical-graph.js +11 -38
  406. package/dist/composition/canonical-graph.js.map +1 -1
  407. package/dist/composition/canonical-json.js +2 -2
  408. package/dist/composition/canonical-json.js.map +1 -1
  409. package/dist/composition/catalog-graph.d.ts.map +1 -1
  410. package/dist/composition/catalog-graph.js +2 -5
  411. package/dist/composition/catalog-graph.js.map +1 -1
  412. package/dist/composition/chain-candidate.d.ts +8 -0
  413. package/dist/composition/chain-candidate.d.ts.map +1 -1
  414. package/dist/composition/chain-candidate.js +9 -2
  415. package/dist/composition/chain-candidate.js.map +1 -1
  416. package/dist/composition/chain-match.d.ts +6 -3
  417. package/dist/composition/chain-match.d.ts.map +1 -1
  418. package/dist/composition/chain-match.js +4 -1
  419. package/dist/composition/chain-match.js.map +1 -1
  420. package/dist/composition/chain-result.d.ts.map +1 -1
  421. package/dist/composition/chain-result.js +2 -14
  422. package/dist/composition/chain-result.js.map +1 -1
  423. package/dist/composition/compose-symbolic.d.ts.map +1 -1
  424. package/dist/composition/compose-symbolic.js +3 -2
  425. package/dist/composition/compose-symbolic.js.map +1 -1
  426. package/dist/composition/compose.d.ts.map +1 -1
  427. package/dist/composition/compose.js +13 -5
  428. package/dist/composition/compose.js.map +1 -1
  429. package/dist/composition/composition-recovery.d.ts.map +1 -1
  430. package/dist/composition/composition-recovery.js +4 -7
  431. package/dist/composition/composition-recovery.js.map +1 -1
  432. package/dist/composition/consequence.d.ts +15 -5
  433. package/dist/composition/consequence.d.ts.map +1 -1
  434. package/dist/composition/consequence.js +6 -4
  435. package/dist/composition/consequence.js.map +1 -1
  436. package/dist/composition/discovery.d.ts +129 -9
  437. package/dist/composition/discovery.d.ts.map +1 -1
  438. package/dist/composition/discovery.js +171 -67
  439. package/dist/composition/discovery.js.map +1 -1
  440. package/dist/composition/edge.d.ts +21 -2
  441. package/dist/composition/edge.d.ts.map +1 -1
  442. package/dist/composition/edge.js +23 -1
  443. package/dist/composition/edge.js.map +1 -1
  444. package/dist/composition/enumerate.d.ts.map +1 -1
  445. package/dist/composition/enumerate.js +18 -3
  446. package/dist/composition/enumerate.js.map +1 -1
  447. package/dist/composition/evaluate-relation.d.ts +35 -11
  448. package/dist/composition/evaluate-relation.d.ts.map +1 -1
  449. package/dist/composition/evaluate-relation.js +60 -39
  450. package/dist/composition/evaluate-relation.js.map +1 -1
  451. package/dist/composition/explain.d.ts +3 -12
  452. package/dist/composition/explain.d.ts.map +1 -1
  453. package/dist/composition/explain.js +7 -20
  454. package/dist/composition/explain.js.map +1 -1
  455. package/dist/composition/expr-eval.d.ts +1 -1
  456. package/dist/composition/expr-eval.d.ts.map +1 -1
  457. package/dist/composition/expr-eval.js +6 -15
  458. package/dist/composition/expr-eval.js.map +1 -1
  459. package/dist/composition/expr-simplify.d.ts +26 -14
  460. package/dist/composition/expr-simplify.d.ts.map +1 -1
  461. package/dist/composition/expr-simplify.js +64 -72
  462. package/dist/composition/expr-simplify.js.map +1 -1
  463. package/dist/composition/formula-shape.d.ts +23 -4
  464. package/dist/composition/formula-shape.d.ts.map +1 -1
  465. package/dist/composition/formula-shape.js +57 -17
  466. package/dist/composition/formula-shape.js.map +1 -1
  467. package/dist/composition/graph-structure.d.ts +98 -0
  468. package/dist/composition/graph-structure.d.ts.map +1 -0
  469. package/dist/composition/graph-structure.js +167 -0
  470. package/dist/composition/graph-structure.js.map +1 -0
  471. package/dist/composition/graph-viz-svg.d.ts.map +1 -1
  472. package/dist/composition/graph-viz-svg.js +1 -1
  473. package/dist/composition/graph-viz-svg.js.map +1 -1
  474. package/dist/composition/graph-viz.d.ts.map +1 -1
  475. package/dist/composition/graph-viz.js +8 -37
  476. package/dist/composition/graph-viz.js.map +1 -1
  477. package/dist/composition/grounding.d.ts.map +1 -1
  478. package/dist/composition/grounding.js +19 -7
  479. package/dist/composition/grounding.js.map +1 -1
  480. package/dist/composition/identifiability.d.ts +91 -4
  481. package/dist/composition/identifiability.d.ts.map +1 -1
  482. package/dist/composition/identifiability.js +363 -6
  483. package/dist/composition/identifiability.js.map +1 -1
  484. package/dist/composition/index.d.ts +8 -4
  485. package/dist/composition/index.d.ts.map +1 -1
  486. package/dist/composition/index.js +3 -2
  487. package/dist/composition/index.js.map +1 -1
  488. package/dist/composition/mathts-quiet.d.ts +7 -8
  489. package/dist/composition/mathts-quiet.d.ts.map +1 -1
  490. package/dist/composition/mathts-quiet.js +7 -16
  491. package/dist/composition/mathts-quiet.js.map +1 -1
  492. package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
  493. package/dist/composition/mathts-scalar-symbols.js +2 -1
  494. package/dist/composition/mathts-scalar-symbols.js.map +1 -1
  495. package/dist/composition/own-equation-magnitude.d.ts +95 -0
  496. package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
  497. package/dist/composition/own-equation-magnitude.js +270 -0
  498. package/dist/composition/own-equation-magnitude.js.map +1 -0
  499. package/dist/composition/probe/backend-protocol.d.ts +3 -0
  500. package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
  501. package/dist/composition/probe/backend-protocol.js.map +1 -1
  502. package/dist/composition/probe/candidate-store.d.ts +1 -0
  503. package/dist/composition/probe/candidate-store.d.ts.map +1 -1
  504. package/dist/composition/probe/candidate-store.js +1 -0
  505. package/dist/composition/probe/candidate-store.js.map +1 -1
  506. package/dist/composition/probe/corpus.d.ts +8 -4
  507. package/dist/composition/probe/corpus.d.ts.map +1 -1
  508. package/dist/composition/probe/corpus.js +23 -12
  509. package/dist/composition/probe/corpus.js.map +1 -1
  510. package/dist/composition/probe/dataset.d.ts +18 -0
  511. package/dist/composition/probe/dataset.d.ts.map +1 -1
  512. package/dist/composition/probe/dataset.js +95 -50
  513. package/dist/composition/probe/dataset.js.map +1 -1
  514. package/dist/composition/probe/experiment-design.d.ts +7 -1
  515. package/dist/composition/probe/experiment-design.d.ts.map +1 -1
  516. package/dist/composition/probe/experiment-design.js +44 -24
  517. package/dist/composition/probe/experiment-design.js.map +1 -1
  518. package/dist/composition/probe/falsify.d.ts +2 -0
  519. package/dist/composition/probe/falsify.d.ts.map +1 -1
  520. package/dist/composition/probe/falsify.js +2 -0
  521. package/dist/composition/probe/falsify.js.map +1 -1
  522. package/dist/composition/probe/fit.d.ts +7 -0
  523. package/dist/composition/probe/fit.d.ts.map +1 -1
  524. package/dist/composition/probe/fit.js +46 -22
  525. package/dist/composition/probe/fit.js.map +1 -1
  526. package/dist/composition/probe/frontier.d.ts.map +1 -1
  527. package/dist/composition/probe/frontier.js +33 -15
  528. package/dist/composition/probe/frontier.js.map +1 -1
  529. package/dist/composition/probe/generator.d.ts +30 -1
  530. package/dist/composition/probe/generator.d.ts.map +1 -1
  531. package/dist/composition/probe/generator.js +58 -36
  532. package/dist/composition/probe/generator.js.map +1 -1
  533. package/dist/composition/probe/index.d.ts +14 -0
  534. package/dist/composition/probe/index.d.ts.map +1 -1
  535. package/dist/composition/probe/index.js +6 -0
  536. package/dist/composition/probe/index.js.map +1 -1
  537. package/dist/composition/probe/limits.d.ts +25 -1
  538. package/dist/composition/probe/limits.d.ts.map +1 -1
  539. package/dist/composition/probe/limits.js +53 -11
  540. package/dist/composition/probe/limits.js.map +1 -1
  541. package/dist/composition/probe/pipeline.d.ts +5 -0
  542. package/dist/composition/probe/pipeline.d.ts.map +1 -1
  543. package/dist/composition/probe/pipeline.js +73 -24
  544. package/dist/composition/probe/pipeline.js.map +1 -1
  545. package/dist/composition/probe/power-law.d.ts +121 -0
  546. package/dist/composition/probe/power-law.d.ts.map +1 -0
  547. package/dist/composition/probe/power-law.js +251 -0
  548. package/dist/composition/probe/power-law.js.map +1 -0
  549. package/dist/composition/probe/problem.d.ts +8 -4
  550. package/dist/composition/probe/problem.d.ts.map +1 -1
  551. package/dist/composition/probe/problem.js +177 -49
  552. package/dist/composition/probe/problem.js.map +1 -1
  553. package/dist/composition/probe/report.js +1 -1
  554. package/dist/composition/probe/report.js.map +1 -1
  555. package/dist/composition/probe/residual.d.ts +7 -1
  556. package/dist/composition/probe/residual.d.ts.map +1 -1
  557. package/dist/composition/probe/residual.js +10 -7
  558. package/dist/composition/probe/residual.js.map +1 -1
  559. package/dist/composition/probe/run-manifest.d.ts +1 -0
  560. package/dist/composition/probe/run-manifest.d.ts.map +1 -1
  561. package/dist/composition/probe/run-manifest.js.map +1 -1
  562. package/dist/composition/probe/scalar-search.d.ts +50 -0
  563. package/dist/composition/probe/scalar-search.d.ts.map +1 -0
  564. package/dist/composition/probe/scalar-search.js +169 -0
  565. package/dist/composition/probe/scalar-search.js.map +1 -0
  566. package/dist/composition/probe/scoring.d.ts +1 -0
  567. package/dist/composition/probe/scoring.d.ts.map +1 -1
  568. package/dist/composition/probe/scoring.js.map +1 -1
  569. package/dist/composition/probe/structure.d.ts +82 -17
  570. package/dist/composition/probe/structure.d.ts.map +1 -1
  571. package/dist/composition/probe/structure.js +129 -55
  572. package/dist/composition/probe/structure.js.map +1 -1
  573. package/dist/composition/probe/study.d.ts +31 -9
  574. package/dist/composition/probe/study.d.ts.map +1 -1
  575. package/dist/composition/probe/study.js +235 -184
  576. package/dist/composition/probe/study.js.map +1 -1
  577. package/dist/composition/probe/t-tail.d.ts +16 -0
  578. package/dist/composition/probe/t-tail.d.ts.map +1 -0
  579. package/dist/composition/probe/t-tail.js +29 -0
  580. package/dist/composition/probe/t-tail.js.map +1 -0
  581. package/dist/composition/probe/types.d.ts +3 -0
  582. package/dist/composition/probe/types.d.ts.map +1 -1
  583. package/dist/composition/probe/types.js.map +1 -1
  584. package/dist/composition/proposed-bridges.d.ts +52 -12
  585. package/dist/composition/proposed-bridges.d.ts.map +1 -1
  586. package/dist/composition/proposed-bridges.js +107 -60
  587. package/dist/composition/proposed-bridges.js.map +1 -1
  588. package/dist/composition/quantity-clusters.d.ts +48 -0
  589. package/dist/composition/quantity-clusters.d.ts.map +1 -0
  590. package/dist/composition/quantity-clusters.js +98 -0
  591. package/dist/composition/quantity-clusters.js.map +1 -0
  592. package/dist/composition/rational-exponent.d.ts +40 -0
  593. package/dist/composition/rational-exponent.d.ts.map +1 -0
  594. package/dist/composition/rational-exponent.js +65 -0
  595. package/dist/composition/rational-exponent.js.map +1 -0
  596. package/dist/composition/representative-values.d.ts +22 -0
  597. package/dist/composition/representative-values.d.ts.map +1 -1
  598. package/dist/composition/representative-values.js +29 -0
  599. package/dist/composition/representative-values.js.map +1 -1
  600. package/dist/composition/retrodiction.d.ts +15 -0
  601. package/dist/composition/retrodiction.d.ts.map +1 -1
  602. package/dist/composition/retrodiction.js +12 -4
  603. package/dist/composition/retrodiction.js.map +1 -1
  604. package/dist/composition/user-equation.d.ts +1 -0
  605. package/dist/composition/user-equation.d.ts.map +1 -1
  606. package/dist/composition/user-equation.js +3 -2
  607. package/dist/composition/user-equation.js.map +1 -1
  608. package/dist/core/assignment.d.ts +19 -0
  609. package/dist/core/assignment.d.ts.map +1 -0
  610. package/dist/core/assignment.js +19 -0
  611. package/dist/core/assignment.js.map +1 -0
  612. package/dist/core/compare.d.ts +32 -0
  613. package/dist/core/compare.d.ts.map +1 -0
  614. package/dist/core/compare.js +46 -0
  615. package/dist/core/compare.js.map +1 -0
  616. package/dist/core/constants.d.ts +42 -41
  617. package/dist/core/constants.d.ts.map +1 -1
  618. package/dist/core/constants.js +71 -51
  619. package/dist/core/constants.js.map +1 -1
  620. package/dist/core/data-file.d.ts +7 -0
  621. package/dist/core/data-file.d.ts.map +1 -1
  622. package/dist/core/data-file.js +17 -0
  623. package/dist/core/data-file.js.map +1 -1
  624. package/dist/core/format.d.ts +36 -0
  625. package/dist/core/format.d.ts.map +1 -0
  626. package/dist/core/format.js +39 -0
  627. package/dist/core/format.js.map +1 -0
  628. package/dist/core/hash.d.ts +14 -0
  629. package/dist/core/hash.d.ts.map +1 -0
  630. package/dist/core/hash.js +17 -0
  631. package/dist/core/hash.js.map +1 -0
  632. package/dist/core/json-schema.d.ts +2 -0
  633. package/dist/core/json-schema.d.ts.map +1 -1
  634. package/dist/core/json-schema.js +14 -13
  635. package/dist/core/json-schema.js.map +1 -1
  636. package/dist/core/labeled-tensor.d.ts.map +1 -1
  637. package/dist/core/labeled-tensor.js +0 -8
  638. package/dist/core/labeled-tensor.js.map +1 -1
  639. package/dist/core/mathts-read.d.ts +25 -0
  640. package/dist/core/mathts-read.d.ts.map +1 -0
  641. package/dist/core/mathts-read.js +51 -0
  642. package/dist/core/mathts-read.js.map +1 -0
  643. package/dist/core/tensor.d.ts.map +1 -1
  644. package/dist/core/tensor.js +24 -0
  645. package/dist/core/tensor.js.map +1 -1
  646. package/dist/core/types.d.ts +5 -5
  647. package/dist/diff/bridge-ast-gradient.d.ts +27 -23
  648. package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
  649. package/dist/diff/bridge-ast-gradient.js +75 -173
  650. package/dist/diff/bridge-ast-gradient.js.map +1 -1
  651. package/dist/diff/bridge-gradient.d.ts +19 -6
  652. package/dist/diff/bridge-gradient.d.ts.map +1 -1
  653. package/dist/diff/bridge-gradient.js +19 -11
  654. package/dist/diff/bridge-gradient.js.map +1 -1
  655. package/dist/diff/bridge-specs.d.ts.map +1 -1
  656. package/dist/diff/bridge-specs.js +3 -0
  657. package/dist/diff/bridge-specs.js.map +1 -1
  658. package/dist/dimensional/algebra.d.ts +18 -0
  659. package/dist/dimensional/algebra.d.ts.map +1 -1
  660. package/dist/dimensional/algebra.js +41 -1
  661. package/dist/dimensional/algebra.js.map +1 -1
  662. package/dist/dimensional/ast-builders.d.ts +7 -0
  663. package/dist/dimensional/ast-builders.d.ts.map +1 -1
  664. package/dist/dimensional/ast-builders.js +11 -0
  665. package/dist/dimensional/ast-builders.js.map +1 -1
  666. package/dist/dimensional/ast-leaves.d.ts +81 -0
  667. package/dist/dimensional/ast-leaves.d.ts.map +1 -0
  668. package/dist/dimensional/ast-leaves.js +146 -0
  669. package/dist/dimensional/ast-leaves.js.map +1 -0
  670. package/dist/dimensional/ast-types.d.ts +15 -0
  671. package/dist/dimensional/ast-types.d.ts.map +1 -1
  672. package/dist/dimensional/ast-types.js.map +1 -1
  673. package/dist/dimensional/buckingham.d.ts.map +1 -1
  674. package/dist/dimensional/buckingham.js +15 -27
  675. package/dist/dimensional/buckingham.js.map +1 -1
  676. package/dist/dimensional/constant-rows.js +9 -9
  677. package/dist/dimensional/constant-rows.js.map +1 -1
  678. package/dist/dimensional/curvature-composite.d.ts +1 -1
  679. package/dist/dimensional/curvature-composite.js.map +1 -1
  680. package/dist/dimensional/dimension-inference.d.ts.map +1 -1
  681. package/dist/dimensional/dimension-inference.js +1 -2
  682. package/dist/dimensional/dimension-inference.js.map +1 -1
  683. package/dist/dimensional/errors.d.ts +1 -1
  684. package/dist/dimensional/errors.d.ts.map +1 -1
  685. package/dist/dimensional/errors.js +1 -15
  686. package/dist/dimensional/errors.js.map +1 -1
  687. package/dist/dimensional/exact-scale.d.ts +24 -11
  688. package/dist/dimensional/exact-scale.d.ts.map +1 -1
  689. package/dist/dimensional/exact-scale.js +122 -130
  690. package/dist/dimensional/exact-scale.js.map +1 -1
  691. package/dist/dimensional/gauge-field.d.ts.map +1 -1
  692. package/dist/dimensional/gauge-field.js +2 -2
  693. package/dist/dimensional/gauge-field.js.map +1 -1
  694. package/dist/dimensional/hyphen-names.d.ts +12 -2
  695. package/dist/dimensional/hyphen-names.d.ts.map +1 -1
  696. package/dist/dimensional/hyphen-names.js +44 -19
  697. package/dist/dimensional/hyphen-names.js.map +1 -1
  698. package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
  699. package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
  700. package/dist/dimensional/mathts-unit-delegation.js +187 -0
  701. package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
  702. package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
  703. package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
  704. package/dist/dimensional/mathts-unit-wrapper.js +190 -0
  705. package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
  706. package/dist/dimensional/metric.d.ts.map +1 -1
  707. package/dist/dimensional/metric.js +0 -1
  708. package/dist/dimensional/metric.js.map +1 -1
  709. package/dist/dimensional/scalar-lowering.d.ts +21 -0
  710. package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
  711. package/dist/dimensional/scalar-lowering.js +45 -0
  712. package/dist/dimensional/scalar-lowering.js.map +1 -0
  713. package/dist/dimensional/symbolic-constants.d.ts +9 -0
  714. package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
  715. package/dist/dimensional/symbolic-constants.js +13 -1
  716. package/dist/dimensional/symbolic-constants.js.map +1 -1
  717. package/dist/dimensional/types.d.ts +36 -0
  718. package/dist/dimensional/types.d.ts.map +1 -1
  719. package/dist/dimensional/types.js +45 -7
  720. package/dist/dimensional/types.js.map +1 -1
  721. package/dist/dimensional/unit-data.d.ts +5 -1
  722. package/dist/dimensional/unit-data.d.ts.map +1 -1
  723. package/dist/dimensional/unit-data.js +30 -6
  724. package/dist/dimensional/unit-data.js.map +1 -1
  725. package/dist/dimensional/units.d.ts +2 -0
  726. package/dist/dimensional/units.d.ts.map +1 -1
  727. package/dist/dimensional/units.js +59 -3
  728. package/dist/dimensional/units.js.map +1 -1
  729. package/dist/dimensional/validator.d.ts +2 -0
  730. package/dist/dimensional/validator.d.ts.map +1 -1
  731. package/dist/dimensional/validator.js.map +1 -1
  732. package/dist/index.d.ts +9 -3
  733. package/dist/index.d.ts.map +1 -1
  734. package/dist/index.js +10 -4
  735. package/dist/index.js.map +1 -1
  736. package/dist/numerical/christoffel-flat.d.ts.map +1 -1
  737. package/dist/numerical/christoffel-flat.js +3 -2
  738. package/dist/numerical/christoffel-flat.js.map +1 -1
  739. package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
  740. package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
  741. package/dist/numerical/connection-lowering-helpers.js +11 -15
  742. package/dist/numerical/connection-lowering-helpers.js.map +1 -1
  743. package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
  744. package/dist/numerical/covariant-eikonal.js +34 -11
  745. package/dist/numerical/covariant-eikonal.js.map +1 -1
  746. package/dist/numerical/curvature-lowering-helpers.js +3 -2
  747. package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
  748. package/dist/numerical/errors.d.ts.map +1 -1
  749. package/dist/numerical/errors.js +0 -3
  750. package/dist/numerical/errors.js.map +1 -1
  751. package/dist/numerical/finite-difference.d.ts +22 -0
  752. package/dist/numerical/finite-difference.d.ts.map +1 -0
  753. package/dist/numerical/finite-difference.js +27 -0
  754. package/dist/numerical/finite-difference.js.map +1 -0
  755. package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
  756. package/dist/numerical/geodesic-integrator.js +22 -14
  757. package/dist/numerical/geodesic-integrator.js.map +1 -1
  758. package/dist/numerical/geometrized.d.ts.map +1 -1
  759. package/dist/numerical/geometrized.js +0 -1
  760. package/dist/numerical/geometrized.js.map +1 -1
  761. package/dist/numerical/mathts-engine.d.ts.map +1 -1
  762. package/dist/numerical/mathts-engine.js +10 -24
  763. package/dist/numerical/mathts-engine.js.map +1 -1
  764. package/dist/numerical/metric-inverse.d.ts.map +1 -1
  765. package/dist/numerical/metric-inverse.js +83 -46
  766. package/dist/numerical/metric-inverse.js.map +1 -1
  767. package/dist/numerical/null-ray-integrator.d.ts +2 -1
  768. package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
  769. package/dist/numerical/null-ray-integrator.js +12 -12
  770. package/dist/numerical/null-ray-integrator.js.map +1 -1
  771. package/dist/numerical/painleve-gullstrand-metric.js +2 -2
  772. package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
  773. package/dist/numerical/pderiv.d.ts.map +1 -1
  774. package/dist/numerical/pderiv.js +2 -6
  775. package/dist/numerical/pderiv.js.map +1 -1
  776. package/dist/numerical/perihelion-finder.d.ts +0 -36
  777. package/dist/numerical/perihelion-finder.d.ts.map +1 -1
  778. package/dist/numerical/perihelion-finder.js +41 -87
  779. package/dist/numerical/perihelion-finder.js.map +1 -1
  780. package/dist/numerical/quadrature.d.ts.map +1 -1
  781. package/dist/numerical/quadrature.js +11 -13
  782. package/dist/numerical/quadrature.js.map +1 -1
  783. package/dist/numerical/rk4-trajectory.d.ts +10 -0
  784. package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
  785. package/dist/numerical/rk4-trajectory.js +37 -0
  786. package/dist/numerical/rk4-trajectory.js.map +1 -0
  787. package/dist/numerical/schwarzschild.d.ts +14 -0
  788. package/dist/numerical/schwarzschild.d.ts.map +1 -0
  789. package/dist/numerical/schwarzschild.js +17 -0
  790. package/dist/numerical/schwarzschild.js.map +1 -0
  791. package/dist/numerical/spacetime-metrics.d.ts +12 -0
  792. package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
  793. package/dist/numerical/spacetime-metrics.js +72 -56
  794. package/dist/numerical/spacetime-metrics.js.map +1 -1
  795. package/dist/numerical/statistics.d.ts +24 -0
  796. package/dist/numerical/statistics.d.ts.map +1 -0
  797. package/dist/numerical/statistics.js +52 -0
  798. package/dist/numerical/statistics.js.map +1 -0
  799. package/dist/numerical/strides.d.ts +3 -2
  800. package/dist/numerical/strides.d.ts.map +1 -1
  801. package/dist/numerical/strides.js +3 -10
  802. package/dist/numerical/strides.js.map +1 -1
  803. package/dist/numerical/tensor-engine.d.ts +21 -0
  804. package/dist/numerical/tensor-engine.d.ts.map +1 -1
  805. package/dist/numerical/tensor-engine.js +12 -0
  806. package/dist/numerical/tensor-engine.js.map +1 -1
  807. package/dist/relations/regime.d.ts +10 -0
  808. package/dist/relations/regime.d.ts.map +1 -1
  809. package/dist/relations/regime.js +18 -1
  810. package/dist/relations/regime.js.map +1 -1
  811. package/package.json +9 -12
  812. package/dist/cases/brownian-sphere.d.ts +0 -68
  813. package/dist/cases/brownian-sphere.d.ts.map +0 -1
  814. package/dist/cases/brownian-sphere.js +0 -354
  815. package/dist/cases/brownian-sphere.js.map +0 -1
  816. package/dist/cases/damped-resonator.d.ts +0 -23
  817. package/dist/cases/damped-resonator.d.ts.map +0 -1
  818. package/dist/cases/damped-resonator.js +0 -224
  819. package/dist/cases/damped-resonator.js.map +0 -1
  820. package/dist/cases/kepler-rv.d.ts +0 -13
  821. package/dist/cases/kepler-rv.d.ts.map +0 -1
  822. package/dist/cases/kepler-rv.js +0 -172
  823. package/dist/cases/kepler-rv.js.map +0 -1
  824. package/dist/cases/lumped-cooling.d.ts +0 -46
  825. package/dist/cases/lumped-cooling.d.ts.map +0 -1
  826. package/dist/cases/lumped-cooling.js +0 -261
  827. package/dist/cases/lumped-cooling.js.map +0 -1
  828. package/dist/cases/resistor-noise.d.ts +0 -14
  829. package/dist/cases/resistor-noise.d.ts.map +0 -1
  830. package/dist/cases/resistor-noise.js +0 -215
  831. package/dist/cases/resistor-noise.js.map +0 -1
  832. package/dist/cases/skin-depth.d.ts +0 -21
  833. package/dist/cases/skin-depth.d.ts.map +0 -1
  834. package/dist/cases/skin-depth.js +0 -174
  835. package/dist/cases/skin-depth.js.map +0 -1
@@ -28,17 +28,6 @@
28
28
  * @internal
29
29
  */
30
30
  import type { ObservableTranslation } from '../translation.js';
31
- /**
32
- * The time, in units of T0, at which the MEASURED phase lead of the linear
33
- * oscillator over the pendulum first reaches `tolerance` rad, both integrated
34
- * by RK4 at `stepsPerPeriod` steps of T0.
35
- *
36
- * @returns NaN if the drift does not reach `tolerance` within 2^16 periods.
37
- * @internal
38
- */
39
- export declare function measurePhaseHorizon(theta0: number, tolerance: number, stepsPerPeriod: number): number;
40
- /** As `measurePhaseHorizon`, over exactly `periods` of T0; NaN if the drift does not reach `tolerance` in them. @internal */
41
- export declare function measurePhaseHorizonWithin(theta0: number, tolerance: number, stepsPerPeriod: number, periods: number): number;
42
31
  /** The point witness integrates at most this many periods of T0, so its cost is bounded. */
43
32
  export declare const PHASE_POINT_MAX_PERIODS = 512;
44
33
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"phase-translation.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/phase-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAM/D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAMrG;AAED,6HAA6H;AAC7H,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAc5H;AAWD,4FAA4F;AAC5F,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAyD3C,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,qBA+CxC,CAAC"}
1
+ {"version":3,"file":"phase-translation.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/phase-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AA8C/D,4FAA4F;AAC5F,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAyD3C,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,qBA+CxC,CAAC"}
@@ -28,8 +28,7 @@
28
28
  * @internal
29
29
  */
30
30
  import { pendulumPeriodErrorAt } from './bridges-limits.js';
31
- import { crossingTimes, linearAccel, pendulumAccel, phaseAt, theta0OfPeriodError } from './pendulum-motion.js';
32
- const TWO_PI = 2 * Math.PI;
31
+ import { crossingTimes, linearAccel, pendulumAccel, phaseAt, theta0OfPeriodError, TWO_PI } from './pendulum-motion.js';
33
32
  /**
34
33
  * The time, in units of T0, at which the MEASURED phase lead of the linear
35
34
  * oscillator over the pendulum first reaches `tolerance` rad, both integrated
@@ -38,7 +37,7 @@ const TWO_PI = 2 * Math.PI;
38
37
  * @returns NaN if the drift does not reach `tolerance` within 2^16 periods.
39
38
  * @internal
40
39
  */
41
- export function measurePhaseHorizon(theta0, tolerance, stepsPerPeriod) {
40
+ function measurePhaseHorizon(theta0, tolerance, stepsPerPeriod) {
42
41
  for (let periods = 16; periods <= 2 ** 16; periods *= 2) {
43
42
  const t = measurePhaseHorizonWithin(theta0, tolerance, stepsPerPeriod, periods);
44
43
  if (!Number.isNaN(t))
@@ -47,7 +46,7 @@ export function measurePhaseHorizon(theta0, tolerance, stepsPerPeriod) {
47
46
  return Number.NaN;
48
47
  }
49
48
  /** As `measurePhaseHorizon`, over exactly `periods` of T0; NaN if the drift does not reach `tolerance` in them. @internal */
50
- export function measurePhaseHorizonWithin(theta0, tolerance, stepsPerPeriod, periods) {
49
+ function measurePhaseHorizonWithin(theta0, tolerance, stepsPerPeriod, periods) {
51
50
  const pend = crossingTimes(pendulumAccel, theta0, stepsPerPeriod, periods);
52
51
  const lin = crossingTimes(linearAccel, theta0, stepsPerPeriod, periods);
53
52
  let prevT = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"phase-translation.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/phase-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE/G,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,SAAiB,EAAE,cAAsB;IAC3F,KAAK,IAAI,OAAO,GAAG,EAAE,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QACxD,MAAM,CAAC,GAAG,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;QAChF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAA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,cAAc,EAAE,GAAG;YACnB,SAAS,EAAE,IAAI;SAChB;KACF;IACD,UAAU,EAAE,eAAe;CAC5B,CAAC","sourcesContent":["/**\n * `ab-pendulum-linear`'s declared translation from its bound's quantity, the\n * relative period error, into the accumulated PHASE error.\n *\n * Both motions start from rest at θ0 at t = 0. The phase is the angle\n * variable: 0 at release and advancing by 2π per period, uniformly in time,\n * so the pendulum's is 2π t/T and the linear oscillator's 2π t/T0. With the\n * bound's `ε = T/T0 − 1` (normalised by the reduced model's period),\n *\n * Δφ(t) = 2π t/T0 − 2π t/T = 2π (t/T0) · ε/(1 + ε),\n *\n * which reaches a tolerance Δ at `t* = Δ · T0 · (1 + ε)/(2π ε)`. Nothing is\n * truncated: the map is exact in ε, and ε itself is the bound's closed form.\n *\n * It is NOT a bound on the pointwise position error |θ(t) − θ_lin(t)|: the\n * pendulum's waveform carries a third harmonic of amplitude ≈ θ0³/192, which\n * is not a phase, and the position error at a given phase error depends on\n * where in the cycle the observation falls.\n *\n * The witness W7p integrates BOTH equations of motion and reads each phase off\n * its zero crossings — crossing k is at phase π/2 + kπ by the symmetry of a\n * release from rest, and the angle variable is linear in time between them —\n * so it measures the drift without using ε or the elliptic integral. It runs\n * at the fixture θ0 = 0.2 as the regression anchor, and again at the caller's\n * point, bounded to 512 T0 of integration (`phasePointCheck`).\n *\n * @module atlas/oscillators/phase-translation\n * @internal\n */\n\nimport type { ObservableTranslation } from '../translation.js';\nimport { pendulumPeriodErrorAt } from './bridges-limits.js';\nimport { crossingTimes, linearAccel, pendulumAccel, phaseAt, theta0OfPeriodError } from './pendulum-motion.js';\n\nconst TWO_PI = 2 * Math.PI;\n\n/**\n * The time, in units of T0, at which the MEASURED phase lead of the linear\n * oscillator over the pendulum first reaches `tolerance` rad, both integrated\n * by RK4 at `stepsPerPeriod` steps of T0.\n *\n * @returns NaN if the drift does not reach `tolerance` within 2^16 periods.\n * @internal\n */\nexport function measurePhaseHorizon(theta0: number, tolerance: number, stepsPerPeriod: number): number {\n for (let periods = 16; periods <= 2 ** 16; periods *= 2) {\n const t = measurePhaseHorizonWithin(theta0, tolerance, stepsPerPeriod, periods);\n if (!Number.isNaN(t)) return t;\n }\n return Number.NaN;\n}\n\n/** As `measurePhaseHorizon`, over exactly `periods` of T0; NaN if the drift does not reach `tolerance` in them. @internal */\nexport function measurePhaseHorizonWithin(theta0: number, tolerance: number, stepsPerPeriod: number, periods: number): number {\n const pend = crossingTimes(pendulumAccel, theta0, stepsPerPeriod, periods);\n const lin = crossingTimes(linearAccel, theta0, stepsPerPeriod, periods);\n let prevT = 0;\n let prevDrift = 0;\n for (let k = 0; k < pend.length; k++) {\n const c = pend[k]!;\n const drift = phaseAt(lin, c) - (Math.PI / 2 + k * Math.PI);\n if (!Number.isFinite(drift)) break;\n if (drift >= tolerance) return prevT + ((tolerance - prevDrift) * (c - prevT)) / (drift - prevDrift);\n prevT = c;\n prevDrift = drift;\n }\n return Number.NaN;\n}\n\n/** `t* = Δ T0 (1+ε)/(2π ε)`; `Infinity` at ε = 0, where no phase accumulates. */\nfunction phaseHorizon(eps: number, tolerance: number, T0: number | undefined): number {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || eps < 0) return Number.NaN;\n return eps === 0 ? Infinity : (tolerance * T0 * (1 + eps)) / (TWO_PI * eps);\n}\n\nconst W7P_THETA0 = 0.2;\nconst W7P_TOLERANCE = 1;\n\n/** The point witness integrates at most this many periods of T0, so its cost is bounded. */\nexport const PHASE_POINT_MAX_PERIODS = 512;\n/**\n * The point witness measures the time to this much drift, or to the drift\n * reached at the cap if less: the map is linear in t, so its slope is what is\n * checked, whatever tolerance the caller asked about.\n */\nconst PHASE_POINT_DRIFT = 1;\n/**\n * Below this measured drift the rounding noise of the two motions' crossing\n * times comes within a factor of ten of the witness tolerance. With the\n * crossings located by `crossingTimes`' secant refinement, the fine error was\n * measured at 800 steps per T0 as 1.5e-8 relative at 1.1e-5 rad of drift,\n * 7.4e-9 at 7.2e-5 rad, 2.5e-9 at 2.0e-4 rad and 2.4e-10 to 9.2e-10 from\n * 2e-2 rad up. With the straight-line crossings it replaced, the same error\n * was 9.5e-6 relative at 2e-4 rad and 1.2e-7 at 2e-2 rad.\n */\nconst PHASE_POINT_MIN_DRIFT = 1e-4;\n/**\n * The (1+ε) control differs from the target by ε/(1+ε) relative, so it can be\n * refuted only where ε exceeds this tolerance (θ0 above about 9e-4).\n */\nconst PHASE_POINT_RELATIVE_TOLERANCE = 5e-8;\n\n/**\n * W7p at the caller's θ0 (recovered from ε) instead of the fixture: the time\n * the measured drift reaches min(1 rad, the drift at the cap), within\n * PHASE_POINT_RELATIVE_TOLERANCE of the closed form. Its control is the same measurement against\n * the horizon without the (1+ε) factor, which differs from the target by\n * ε/(1+ε) relative — so the control can fail only where that exceeds the\n * witness tolerance, and the caller is told when it does not.\n */\nfunction phasePointCheck(eps: number): ReturnType<ObservableTranslation['pointCheck']> {\n if (!Number.isFinite(eps) || eps <= 0) return { unavailable: `no phase drift accumulates at ε = ${eps}` };\n const theta0 = theta0OfPeriodError(eps);\n const measured = Math.min(PHASE_POINT_DRIFT, (TWO_PI * PHASE_POINT_MAX_PERIODS * eps) / (1 + eps));\n if (measured < PHASE_POINT_MIN_DRIFT) {\n return {\n unavailable:\n `the drift within ${PHASE_POINT_MAX_PERIODS} T0 at θ0 = ${Number(theta0.toPrecision(8))} is ${measured} rad, below the ` +\n `${PHASE_POINT_MIN_DRIFT} rad this witness resolves; not run`,\n };\n }\n const target = phaseHorizon(eps, measured, 1);\n const periods = Math.ceil(target) + 2;\n const evaluate = (stepsPerPeriod: number): number => measurePhaseHorizonWithin(theta0, measured, stepsPerPeriod, periods);\n const spec = { evaluate, coarseResolution: 200, fineResolution: 800, tolerance: PHASE_POINT_RELATIVE_TOLERANCE * target };\n const capped = measured < PHASE_POINT_DRIFT ? ` (the drift reached in ${PHASE_POINT_MAX_PERIODS} T0)` : '';\n return {\n claim:\n `RK4-measured time to ${measured} rad${capped} of phase drift at θ0 = ${Number(theta0.toPrecision(8))} (recovered from ε) ` +\n `within ${PHASE_POINT_RELATIVE_TOLERANCE} relative of t* = ${target} T0; 200 and 800 steps per T0, ${periods} T0 integrated`,\n check: { id: 'W7p@point', ...spec, target },\n control: { id: 'W7p@point-control', ...spec, target: measured / (TWO_PI * eps) },\n controlClaim: 'the same measurement against the horizon without the (1+ε) factor, Δ T0/(2π ε)',\n };\n}\n\n/** @internal */\nexport const PENDULUM_PHASE_TRANSLATION: ObservableTranslation = {\n bridgeId: 'ab-pendulum-linear',\n observable: 'phase',\n unit: 'rad',\n fromNorm: 'relative period error, normalized by the value of the reduced model',\n errorKind: 'exact',\n definition:\n 'the angle variable of each motion (0 at release from rest at θ0, 2π per period); the error is the ' +\n \"linear oscillator's lead over the pendulum, Δφ(t) = 2πt/T0 − 2πt/T\",\n derivation:\n 'with ε = T/T0 − 1, Δφ(t) = 2π (t/T0) ε/(1+ε), exact in ε; it reaches Δ at t* = Δ T0 (1+ε)/(2π ε). ' +\n 'ε/(1+ε) increases with ε, so the domain supremum of ε gives the shortest horizon over the domain',\n premises: [\n 'both motions are released from rest at the same θ0 at t = 0',\n 'T0 = 2π √(ℓ/g) is the linear period, in the unit t is given in',\n ],\n parameters: ['T0'],\n timeUnit: 'the unit of T0',\n errorAt: (eps, t, { T0 }) => {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || !Number.isFinite(t)) return Number.NaN;\n return (TWO_PI * (t / T0) * eps) / (1 + eps);\n },\n horizonFor: (eps, tolerance, { T0 }) => phaseHorizon(eps, tolerance, T0),\n boundary: 'inclusive: adequate iff t ≤ t*, i.e. Δφ(t) ≤ the tolerance',\n notCovered: [\n 'the pointwise position error |θ(t) − θ_lin(t)| (the waveform carries a third harmonic ≈ θ0³/192 that is not a phase)',\n 'the amplitude',\n ],\n witnesses: [\n {\n id: 'W7p',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-phase-translation.test.ts',\n tolerance: `RK4-measured time to ${W7P_TOLERANCE} rad of phase drift at θ0 = ${W7P_THETA0} within 1e-4 T0 of t*`,\n },\n ],\n checks: [\n {\n id: 'W7p',\n evaluate: (stepsPerPeriod) => measurePhaseHorizon(W7P_THETA0, W7P_TOLERANCE, stepsPerPeriod),\n target: phaseHorizon(pendulumPeriodErrorAt({ theta0: W7P_THETA0 }), W7P_TOLERANCE, 1),\n coarseResolution: 50,\n fineResolution: 200,\n tolerance: 1e-4,\n },\n ],\n pointCheck: phasePointCheck,\n};\n"]}
1
+ {"version":3,"file":"phase-translation.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/phase-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEvH;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,MAAc,EAAE,SAAiB,EAAE,cAAsB;IACpF,KAAK,IAAI,OAAO,GAAG,EAAE,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QACxD,MAAM,CAAC,GAAG,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;QAChF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC;AAED,6HAA6H;AAC7H,SAAS,yBAAyB,CAAC,MAAc,EAAE,SAAiB,EAAE,cAAsB,EAAE,OAAe;IAC3G,MAAM,IAAI,GAAG,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,GA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KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC;QAC3H,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC/C,CAAC;IACD,UAAU,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC;IACxE,QAAQ,EAAE,4DAA4D;IACtE,UAAU,EAAE;QACV,sHAAsH;QACtH,eAAe;KAChB;IACD,SAAS,EAAE;QACT;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,gDAAgD;YACtD,SAAS,EAAE,wBAAwB,aAAa,+BAA+B,UAAU,uBAAuB;SACjH;KACF;IACD,MAAM,EAAE;QACN;YACE,EAAE,EAAE,KAAK;YACT,QAAQ,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc,CAAC;YAC5F,MAAM,EAAE,YAAY,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC;YACrF,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,GAAG;YACnB,SAAS,EAAE,IAAI;SAChB;KACF;IACD,UAAU,EAAE,eAAe;CAC5B,CAAC","sourcesContent":["/**\n * `ab-pendulum-linear`'s declared translation from its bound's quantity, the\n * relative period error, into the accumulated PHASE error.\n *\n * Both motions start from rest at θ0 at t = 0. The phase is the angle\n * variable: 0 at release and advancing by 2π per period, uniformly in time,\n * so the pendulum's is 2π t/T and the linear oscillator's 2π t/T0. With the\n * bound's `ε = T/T0 − 1` (normalised by the reduced model's period),\n *\n * Δφ(t) = 2π t/T0 − 2π t/T = 2π (t/T0) · ε/(1 + ε),\n *\n * which reaches a tolerance Δ at `t* = Δ · T0 · (1 + ε)/(2π ε)`. Nothing is\n * truncated: the map is exact in ε, and ε itself is the bound's closed form.\n *\n * It is NOT a bound on the pointwise position error |θ(t) − θ_lin(t)|: the\n * pendulum's waveform carries a third harmonic of amplitude ≈ θ0³/192, which\n * is not a phase, and the position error at a given phase error depends on\n * where in the cycle the observation falls.\n *\n * The witness W7p integrates BOTH equations of motion and reads each phase off\n * its zero crossings — crossing k is at phase π/2 + kπ by the symmetry of a\n * release from rest, and the angle variable is linear in time between them —\n * so it measures the drift without using ε or the elliptic integral. It runs\n * at the fixture θ0 = 0.2 as the regression anchor, and again at the caller's\n * point, bounded to 512 T0 of integration (`phasePointCheck`).\n *\n * @module atlas/oscillators/phase-translation\n * @internal\n */\n\nimport type { ObservableTranslation } from '../translation.js';\nimport { pendulumPeriodErrorAt } from './bridges-limits.js';\nimport { crossingTimes, linearAccel, pendulumAccel, phaseAt, theta0OfPeriodError, TWO_PI } from './pendulum-motion.js';\n\n/**\n * The time, in units of T0, at which the MEASURED phase lead of the linear\n * oscillator over the pendulum first reaches `tolerance` rad, both integrated\n * by RK4 at `stepsPerPeriod` steps of T0.\n *\n * @returns NaN if the drift does not reach `tolerance` within 2^16 periods.\n * @internal\n */\nfunction measurePhaseHorizon(theta0: number, tolerance: number, stepsPerPeriod: number): number {\n for (let periods = 16; periods <= 2 ** 16; periods *= 2) {\n const t = measurePhaseHorizonWithin(theta0, tolerance, stepsPerPeriod, periods);\n if (!Number.isNaN(t)) return t;\n }\n return Number.NaN;\n}\n\n/** As `measurePhaseHorizon`, over exactly `periods` of T0; NaN if the drift does not reach `tolerance` in them. @internal */\nfunction measurePhaseHorizonWithin(theta0: number, tolerance: number, stepsPerPeriod: number, periods: number): number {\n const pend = crossingTimes(pendulumAccel, theta0, stepsPerPeriod, periods);\n const lin = crossingTimes(linearAccel, theta0, stepsPerPeriod, periods);\n let prevT = 0;\n let prevDrift = 0;\n for (let k = 0; k < pend.length; k++) {\n const c = pend[k]!;\n const drift = phaseAt(lin, c) - (Math.PI / 2 + k * Math.PI);\n if (!Number.isFinite(drift)) break;\n if (drift >= tolerance) return prevT + ((tolerance - prevDrift) * (c - prevT)) / (drift - prevDrift);\n prevT = c;\n prevDrift = drift;\n }\n return Number.NaN;\n}\n\n/** `t* = Δ T0 (1+ε)/(2π ε)`; `Infinity` at ε = 0, where no phase accumulates. */\nfunction phaseHorizon(eps: number, tolerance: number, T0: number | undefined): number {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || eps < 0) return Number.NaN;\n return eps === 0 ? Infinity : (tolerance * T0 * (1 + eps)) / (TWO_PI * eps);\n}\n\nconst W7P_THETA0 = 0.2;\nconst W7P_TOLERANCE = 1;\n\n/** The point witness integrates at most this many periods of T0, so its cost is bounded. */\nexport const PHASE_POINT_MAX_PERIODS = 512;\n/**\n * The point witness measures the time to this much drift, or to the drift\n * reached at the cap if less: the map is linear in t, so its slope is what is\n * checked, whatever tolerance the caller asked about.\n */\nconst PHASE_POINT_DRIFT = 1;\n/**\n * Below this measured drift the rounding noise of the two motions' crossing\n * times comes within a factor of ten of the witness tolerance. With the\n * crossings located by `crossingTimes`' secant refinement, the fine error was\n * measured at 800 steps per T0 as 1.5e-8 relative at 1.1e-5 rad of drift,\n * 7.4e-9 at 7.2e-5 rad, 2.5e-9 at 2.0e-4 rad and 2.4e-10 to 9.2e-10 from\n * 2e-2 rad up. With the straight-line crossings it replaced, the same error\n * was 9.5e-6 relative at 2e-4 rad and 1.2e-7 at 2e-2 rad.\n */\nconst PHASE_POINT_MIN_DRIFT = 1e-4;\n/**\n * The (1+ε) control differs from the target by ε/(1+ε) relative, so it can be\n * refuted only where ε exceeds this tolerance (θ0 above about 9e-4).\n */\nconst PHASE_POINT_RELATIVE_TOLERANCE = 5e-8;\n\n/**\n * W7p at the caller's θ0 (recovered from ε) instead of the fixture: the time\n * the measured drift reaches min(1 rad, the drift at the cap), within\n * PHASE_POINT_RELATIVE_TOLERANCE of the closed form. Its control is the same measurement against\n * the horizon without the (1+ε) factor, which differs from the target by\n * ε/(1+ε) relative — so the control can fail only where that exceeds the\n * witness tolerance, and the caller is told when it does not.\n */\nfunction phasePointCheck(eps: number): ReturnType<ObservableTranslation['pointCheck']> {\n if (!Number.isFinite(eps) || eps <= 0) return { unavailable: `no phase drift accumulates at ε = ${eps}` };\n const theta0 = theta0OfPeriodError(eps);\n const measured = Math.min(PHASE_POINT_DRIFT, (TWO_PI * PHASE_POINT_MAX_PERIODS * eps) / (1 + eps));\n if (measured < PHASE_POINT_MIN_DRIFT) {\n return {\n unavailable:\n `the drift within ${PHASE_POINT_MAX_PERIODS} T0 at θ0 = ${Number(theta0.toPrecision(8))} is ${measured} rad, below the ` +\n `${PHASE_POINT_MIN_DRIFT} rad this witness resolves; not run`,\n };\n }\n const target = phaseHorizon(eps, measured, 1);\n const periods = Math.ceil(target) + 2;\n const evaluate = (stepsPerPeriod: number): number => measurePhaseHorizonWithin(theta0, measured, stepsPerPeriod, periods);\n const spec = { evaluate, coarseResolution: 200, fineResolution: 800, tolerance: PHASE_POINT_RELATIVE_TOLERANCE * target };\n const capped = measured < PHASE_POINT_DRIFT ? ` (the drift reached in ${PHASE_POINT_MAX_PERIODS} T0)` : '';\n return {\n claim:\n `RK4-measured time to ${measured} rad${capped} of phase drift at θ0 = ${Number(theta0.toPrecision(8))} (recovered from ε) ` +\n `within ${PHASE_POINT_RELATIVE_TOLERANCE} relative of t* = ${target} T0; 200 and 800 steps per T0, ${periods} T0 integrated`,\n check: { id: 'W7p@point', ...spec, target },\n control: { id: 'W7p@point-control', ...spec, target: measured / (TWO_PI * eps) },\n controlClaim: 'the same measurement against the horizon without the (1+ε) factor, Δ T0/(2π ε)',\n };\n}\n\n/** @internal */\nexport const PENDULUM_PHASE_TRANSLATION: ObservableTranslation = {\n bridgeId: 'ab-pendulum-linear',\n observable: 'phase',\n unit: 'rad',\n fromNorm: 'relative period error, normalized by the value of the reduced model',\n errorKind: 'exact',\n definition:\n 'the angle variable of each motion (0 at release from rest at θ0, 2π per period); the error is the ' +\n \"linear oscillator's lead over the pendulum, Δφ(t) = 2πt/T0 − 2πt/T\",\n derivation:\n 'with ε = T/T0 − 1, Δφ(t) = 2π (t/T0) ε/(1+ε), exact in ε; it reaches Δ at t* = Δ T0 (1+ε)/(2π ε). ' +\n 'ε/(1+ε) increases with ε, so the domain supremum of ε gives the shortest horizon over the domain',\n premises: [\n 'both motions are released from rest at the same θ0 at t = 0',\n 'T0 = 2π √(ℓ/g) is the linear period, in the unit t is given in',\n ],\n parameters: ['T0'],\n timeUnit: 'the unit of T0',\n errorAt: (eps, t, { T0 }) => {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || !Number.isFinite(t)) return Number.NaN;\n return (TWO_PI * (t / T0) * eps) / (1 + eps);\n },\n horizonFor: (eps, tolerance, { T0 }) => phaseHorizon(eps, tolerance, T0),\n boundary: 'inclusive: adequate iff t ≤ t*, i.e. Δφ(t) ≤ the tolerance',\n notCovered: [\n 'the pointwise position error |θ(t) − θ_lin(t)| (the waveform carries a third harmonic ≈ θ0³/192 that is not a phase)',\n 'the amplitude',\n ],\n witnesses: [\n {\n id: 'W7p',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-phase-translation.test.ts',\n tolerance: `RK4-measured time to ${W7P_TOLERANCE} rad of phase drift at θ0 = ${W7P_THETA0} within 1e-4 T0 of t*`,\n },\n ],\n checks: [\n {\n id: 'W7p',\n evaluate: (stepsPerPeriod) => measurePhaseHorizon(W7P_THETA0, W7P_TOLERANCE, stepsPerPeriod),\n target: phaseHorizon(pendulumPeriodErrorAt({ theta0: W7P_THETA0 }), W7P_TOLERANCE, 1),\n coarseResolution: 50,\n fineResolution: 200,\n tolerance: 1e-4,\n },\n ],\n pointCheck: phasePointCheck,\n};\n"]}
@@ -23,9 +23,16 @@
23
23
  *
24
24
  * bounds the error at every t; the clamp at π keeps B non-decreasing in t and
25
25
  * is still a bound, since |cos a − cos b| ≤ 2. It is rigorous GIVEN the
26
- * Fourier series, which is quoted, not derived here. Witness W7xs checks the
27
- * series against RK4 over one period at each θ0 of a grid across the domain;
28
- * that is a check at those points, not a derivation.
26
+ * Fourier series, which is quoted, not derived here. The exact check
27
+ * (`fourierSeriesExactDeviation`, run by `tests/atlas/pendulum-exact.test.ts`;
28
+ * not a registered witness, because it has no resolution for a runner to
29
+ * refine) compares the series with the EXACT solution θ = 2 asin(k sn(K − ω0t, k²))
30
+ * (`exactPendulumAngle`) over a dense grid of amplitudes and phases at
31
+ * 1e-12 rad (1e-13 above θ0 = 0.002; the floor below that is the nome's, see
32
+ * `FOURIER_SERIES_EXACT_TOLERANCE`), and W7xs against RK4 over one period at
33
+ * six amplitudes at 1e-9;
34
+ * both are checks at grid points, not a derivation. The coefficients also
35
+ * have a second route, the FFT of one exact period (`fourierCoefficientsByFft`).
29
36
  *
30
37
  * B is an upper bound, not the error: past its horizon the BOUND exceeds the
31
38
  * tolerance, and the error may not. It is near-sharp where Δφ → π (the
@@ -37,17 +44,71 @@
37
44
  * @internal
38
45
  */
39
46
  import type { ObservableTranslation } from '../translation.js';
47
+ import type { DominanceWitnessSpec } from '../witness-dominance.js';
40
48
  import type { NumericWitnessSpec } from '../witness-numeric.js';
41
49
  /** W̄ = (16/3) q^{3/2}/(1 − q): the bound on the waveform distortion |F(φ) − θ0 cos φ|. @internal */
42
50
  export declare function waveformBound(theta0: number): number;
43
51
  /** The pendulum's fundamental Fourier coefficient a₀ = 8√q/(1 + q). @internal */
44
52
  export declare function fundamentalCoefficient(theta0: number): number;
45
- /** The point witness integrates at most this many periods of T0. */
46
- export declare const POSITION_POINT_MAX_PERIODS = 512;
47
- /** a₀ measured by projecting one RK4 pendulum period onto cos φ (trapezoid, exact for a periodic integrand). */
48
- export declare function measureFundamental(theta0: number, stepsPerPeriod: number): number;
53
+ /**
54
+ * The exact route to W7x's measured value: |θ_exact(t) − θ0 cos(2πt)| from the
55
+ * closed forms, at the same 200 samples per T0 as {@link dominanceSamples},
56
+ * against B(t) at θ0 recovered from `eps`. The resolution is ignored, so the
57
+ * runner's coarse-to-fine uncertainty u is exactly 0 here and its rule
58
+ * `bound − measured > u` is `bound > measured`: u is a property of the RK4
59
+ * route, not of the claim. The registered W7x keeps the RK4 route.
60
+ *
61
+ * @internal
62
+ */
63
+ export declare function exactDominanceSpec(id: string, eps: number): DominanceWitnessSpec;
49
64
  /** The θ0 at which W7xs checks the Fourier series: a grid across the bridge's domain θ0 ≤ 0.5. @internal */
50
65
  export declare const FOURIER_SERIES_THETA0S: readonly number[];
66
+ /** The pendulum's Fourier coefficient aₙ at amplitude θ0 (the closed form, from the nome). @internal */
67
+ export declare function fourierCoefficient(theta0: number, n: number, variant?: 'plus' | 'minus'): number;
68
+ /** The grid the exact check runs on: amplitudes θ0 = 0.5 j/500, j = 1..500, and phases φ = 2π i/256. @internal */
69
+ export declare const FOURIER_SERIES_EXACT_GRID: {
70
+ readonly amplitudes: 500;
71
+ readonly phases: 256;
72
+ };
73
+ /**
74
+ * The exact check's tolerance over the whole grid, in rad. The measured deviation is
75
+ * 2.3e-13, all of it at the smallest amplitude θ0 = 0.001 and on the SERIES
76
+ * side: the nome's K′ = K(cos²(θ0/2)) is read from a complementary parameter
77
+ * that rounds at 1e-16 absolute, 4e-10 relative at m = 2.5e-7, so a₀ is low
78
+ * by 2.3e-10 of θ0 there. The exact solution agrees with an independent AGM
79
+ * sn to the bit at that point.
80
+ * @internal
81
+ */
82
+ export declare const FOURIER_SERIES_EXACT_TOLERANCE = 1e-12;
83
+ /** Above θ0 = 0.002 the same check holds at 1e-13 rad (measured 3.8e-14 at θ0 = 0.002, below 1.5e-14 from θ0 = 0.01). @internal */
84
+ export declare const FOURIER_SERIES_EXACT_TIGHT: {
85
+ readonly theta0Min: 0.002;
86
+ readonly tolerance: 1e-13;
87
+ };
88
+ /**
89
+ * The exact check, or its control: max over the grid of |θ_exact(t) − F(φ)|, t = φT/2π,
90
+ * with θ_exact the elliptic solution (`exactPendulumAngle`) and F the 20-term
91
+ * series, over the amplitudes at or above `theta0Min`. A closed form against
92
+ * a closed form, so no resolution and no convergence ratio: the number is the
93
+ * deviation itself, held to {@link FOURIER_SERIES_EXACT_TOLERANCE} over the
94
+ * whole grid and to {@link FOURIER_SERIES_EXACT_TIGHT} above its floor by the
95
+ * test.
96
+ *
97
+ * @internal
98
+ */
99
+ export declare function fourierSeriesExactDeviation(variant?: 'plus' | 'minus', grid?: {
100
+ readonly amplitudes: number;
101
+ readonly phases: number;
102
+ }, theta0Min?: number): number;
103
+ /**
104
+ * The first `count` coefficients aₙ from the FFT of one exact period sampled
105
+ * at `samples` points, MathTS `rfft`: aₙ = (−1)ⁿ 2 re[2n+1]/N. A second
106
+ * route to the series, independent of the nome. `samples` must exceed
107
+ * 2·count + 1.
108
+ *
109
+ * @internal
110
+ */
111
+ export declare function fourierCoefficientsByFft(theta0: number, samples: number, count: number): number[];
51
112
  /**
52
113
  * W7xs, or its control: the Fourier series against RK4 of the pendulum, at 200
53
114
  * and 800 steps per period, within 1e-9 rad at every step and every grid θ0.
@@ -1 +1 @@
1
- {"version":3,"file":"position-translation.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/position-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,iFAAiF;AACjF,wBAAgB,sBA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EAAE,OAAO,GAAE,MAAM,GAAG,OAAgB,GAAG,MAAM,CAExG;AAgBD,kHAAkH;AAClH,eAAO,MAAM,yBAAyB;aAAK,UAAU,EAAE,GAAG;aAAE,MAAM,EAAE,GAAG;CAAW,CAAC;AACnF;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,QAAQ,CAAC;AACpD,mIAAmI;AACnI,eAAO,MAAM,0BAA0B;aAAK,SAAS,EAAE,KAAK;aAAE,SAAS,EAAE,KAAK;CAAW,CAAC;AAE1F;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,MAAM,GAAG,OAAgB,EAClC,IAAI,GAAE;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAA8B,EAC1F,SAAS,SAAI,GACZ,MAAM,CAgBR;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAOjG;AAkBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,GAAG,OAAgB,GAAG,kBAAkB,CASrG;AA6BD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,EAAE,qBAuD3C,CAAC"}
@@ -23,9 +23,16 @@
23
23
  *
24
24
  * bounds the error at every t; the clamp at π keeps B non-decreasing in t and
25
25
  * is still a bound, since |cos a − cos b| ≤ 2. It is rigorous GIVEN the
26
- * Fourier series, which is quoted, not derived here. Witness W7xs checks the
27
- * series against RK4 over one period at each θ0 of a grid across the domain;
28
- * that is a check at those points, not a derivation.
26
+ * Fourier series, which is quoted, not derived here. The exact check
27
+ * (`fourierSeriesExactDeviation`, run by `tests/atlas/pendulum-exact.test.ts`;
28
+ * not a registered witness, because it has no resolution for a runner to
29
+ * refine) compares the series with the EXACT solution θ = 2 asin(k sn(K − ω0t, k²))
30
+ * (`exactPendulumAngle`) over a dense grid of amplitudes and phases at
31
+ * 1e-12 rad (1e-13 above θ0 = 0.002; the floor below that is the nome's, see
32
+ * `FOURIER_SERIES_EXACT_TOLERANCE`), and W7xs against RK4 over one period at
33
+ * six amplitudes at 1e-9;
34
+ * both are checks at grid points, not a derivation. The coefficients also
35
+ * have a second route, the FFT of one exact period (`fourierCoefficientsByFft`).
29
36
  *
30
37
  * B is an upper bound, not the error: past its horizon the BOUND exceeds the
31
38
  * tolerance, and the error may not. It is near-sharp where Δφ → π (the
@@ -36,9 +43,9 @@
36
43
  * @module atlas/oscillators/position-translation
37
44
  * @internal
38
45
  */
46
+ import { rfft } from '@danielsimonjr/mathts-functions';
39
47
  import { pendulumPeriodErrorAt } from './bridges-limits.js';
40
- import { linearAccel, pendulumAccel, pendulumNome, rk4Step, theta0OfPeriodError } from './pendulum-motion.js';
41
- const TWO_PI = 2 * Math.PI;
48
+ import { exactPendulumAngle, linearAccel, pendulumAccel, pendulumNome, rk4Step, theta0OfPeriodError, TWO_PI, } from './pendulum-motion.js';
42
49
  /** W̄ = (16/3) q^{3/2}/(1 − q): the bound on the waveform distortion |F(φ) − θ0 cos φ|. @internal */
43
50
  export function waveformBound(theta0) {
44
51
  const q = pendulumNome(theta0);
@@ -71,12 +78,14 @@ function positionHorizon(eps, tolerance, T0) {
71
78
  return (2 * Math.asin(r) * T0 * (1 + eps)) / (TWO_PI * eps);
72
79
  }
73
80
  /** The point witness integrates at most this many periods of T0. */
74
- export const POSITION_POINT_MAX_PERIODS = 512;
81
+ const POSITION_POINT_MAX_PERIODS = 512;
75
82
  /** Samples per T0 both resolutions report at. */
76
83
  const SAMPLES_PER_PERIOD = 200;
77
84
  /**
78
85
  * |θ(t) − θ_lin(t)| from RK4 of both motions, and B(t) at the same samples,
79
- * over `periods` of T0; `stepsPerPeriod` must be a multiple of 200.
86
+ * over `periods` of T0; `stepsPerPeriod` must be a multiple of 200. The
87
+ * exact route is {@link exactDominanceSpec}; this one is what W7x registers,
88
+ * so the integrator stays part of what the witness exercises.
80
89
  */
81
90
  function dominanceSamples(theta0, periods, stepsPerPeriod, bound) {
82
91
  const stride = stepsPerPeriod / SAMPLES_PER_PERIOD;
@@ -102,6 +111,38 @@ function dominanceSamples(theta0, periods, stepsPerPeriod, bound) {
102
111
  function dominanceWindow(eps) {
103
112
  return Math.min(POSITION_POINT_MAX_PERIODS, (1 + eps) / (2 * eps));
104
113
  }
114
+ /**
115
+ * The exact route to W7x's measured value: |θ_exact(t) − θ0 cos(2πt)| from the
116
+ * closed forms, at the same 200 samples per T0 as {@link dominanceSamples},
117
+ * against B(t) at θ0 recovered from `eps`. The resolution is ignored, so the
118
+ * runner's coarse-to-fine uncertainty u is exactly 0 here and its rule
119
+ * `bound − measured > u` is `bound > measured`: u is a property of the RK4
120
+ * route, not of the claim. The registered W7x keeps the RK4 route.
121
+ *
122
+ * @internal
123
+ */
124
+ export function exactDominanceSpec(id, eps) {
125
+ const theta0 = theta0OfPeriodError(eps);
126
+ const periods = dominanceWindow(eps);
127
+ const bound = positionBound(eps);
128
+ const samples = Math.floor(periods * SAMPLES_PER_PERIOD);
129
+ return {
130
+ id,
131
+ kind: 'dominance',
132
+ evaluate: () => {
133
+ const measured = [];
134
+ const b = [];
135
+ for (let i = 1; i <= samples; i++) {
136
+ const t = i / SAMPLES_PER_PERIOD;
137
+ measured.push(Math.abs(exactPendulumAngle(theta0, t) - theta0 * Math.cos(TWO_PI * t)));
138
+ b.push(bound(t));
139
+ }
140
+ return { measured, bound: b };
141
+ },
142
+ coarseResolution: 200,
143
+ fineResolution: 800,
144
+ };
145
+ }
105
146
  function dominanceSpec(id, eps, drift, waveform) {
106
147
  const theta0 = theta0OfPeriodError(eps);
107
148
  const periods = dominanceWindow(eps);
@@ -114,7 +155,7 @@ function dominanceSpec(id, eps, drift, waveform) {
114
155
  };
115
156
  }
116
157
  /** a₀ measured by projecting one RK4 pendulum period onto cos φ (trapezoid, exact for a periodic integrand). */
117
- export function measureFundamental(theta0, stepsPerPeriod) {
158
+ function measureFundamental(theta0, stepsPerPeriod) {
118
159
  const T = 1 + pendulumPeriodErrorAt({ theta0 });
119
160
  const h = T / stepsPerPeriod;
120
161
  let x = theta0;
@@ -130,6 +171,15 @@ export function measureFundamental(theta0, stepsPerPeriod) {
130
171
  export const FOURIER_SERIES_THETA0S = [0.01, 0.1, 0.2, 0.3, 0.4, 0.5];
131
172
  const FOURIER_SERIES_TERMS = 20;
132
173
  const FOURIER_SERIES_TOLERANCE = 1e-9;
174
+ /** aₙ = 8 q^{n+½}/((2n+1)(1 + q^{2n+1})) from the nome; `'minus'` is the (1 − q^{2n+1}) transcription error the controls use. */
175
+ function coefficientFromNome(q, n, variant) {
176
+ const odd = 2 * n + 1;
177
+ return (8 * q ** (n + 0.5)) / (odd * (variant === 'plus' ? 1 + q ** odd : 1 - q ** odd));
178
+ }
179
+ /** The pendulum's Fourier coefficient aₙ at amplitude θ0 (the closed form, from the nome). @internal */
180
+ export function fourierCoefficient(theta0, n, variant = 'plus') {
181
+ return coefficientFromNome(pendulumNome(theta0), n, variant);
182
+ }
133
183
  /**
134
184
  * F(φ) = Σ_{n<20} (−1)ⁿ aₙ cos((2n+1)φ). `'minus'` puts (1 − q^{2n+1}) in the
135
185
  * denominator of aₙ, a transcription error the control uses.
@@ -138,12 +188,71 @@ function fourierSeries(theta0, phi, variant) {
138
188
  const q = pendulumNome(theta0);
139
189
  let s = 0;
140
190
  for (let n = 0; n < FOURIER_SERIES_TERMS; n++) {
141
- const odd = 2 * n + 1;
142
- const a = (8 * q ** (n + 0.5)) / (odd * (variant === 'plus' ? 1 + q ** odd : 1 - q ** odd));
143
- s += (n % 2 === 0 ? a : -a) * Math.cos(odd * phi);
191
+ const a = coefficientFromNome(q, n, variant);
192
+ s += (n % 2 === 0 ? a : -a) * Math.cos((2 * n + 1) * phi);
144
193
  }
145
194
  return s;
146
195
  }
196
+ /** The grid the exact check runs on: amplitudes θ0 = 0.5 j/500, j = 1..500, and phases φ = 2π i/256. @internal */
197
+ export const FOURIER_SERIES_EXACT_GRID = { amplitudes: 500, phases: 256 };
198
+ /**
199
+ * The exact check's tolerance over the whole grid, in rad. The measured deviation is
200
+ * 2.3e-13, all of it at the smallest amplitude θ0 = 0.001 and on the SERIES
201
+ * side: the nome's K′ = K(cos²(θ0/2)) is read from a complementary parameter
202
+ * that rounds at 1e-16 absolute, 4e-10 relative at m = 2.5e-7, so a₀ is low
203
+ * by 2.3e-10 of θ0 there. The exact solution agrees with an independent AGM
204
+ * sn to the bit at that point.
205
+ * @internal
206
+ */
207
+ export const FOURIER_SERIES_EXACT_TOLERANCE = 1e-12;
208
+ /** Above θ0 = 0.002 the same check holds at 1e-13 rad (measured 3.8e-14 at θ0 = 0.002, below 1.5e-14 from θ0 = 0.01). @internal */
209
+ export const FOURIER_SERIES_EXACT_TIGHT = { theta0Min: 0.002, tolerance: 1e-13 };
210
+ /**
211
+ * The exact check, or its control: max over the grid of |θ_exact(t) − F(φ)|, t = φT/2π,
212
+ * with θ_exact the elliptic solution (`exactPendulumAngle`) and F the 20-term
213
+ * series, over the amplitudes at or above `theta0Min`. A closed form against
214
+ * a closed form, so no resolution and no convergence ratio: the number is the
215
+ * deviation itself, held to {@link FOURIER_SERIES_EXACT_TOLERANCE} over the
216
+ * whole grid and to {@link FOURIER_SERIES_EXACT_TIGHT} above its floor by the
217
+ * test.
218
+ *
219
+ * @internal
220
+ */
221
+ export function fourierSeriesExactDeviation(variant = 'plus', grid = FOURIER_SERIES_EXACT_GRID, theta0Min = 0) {
222
+ let worst = 0;
223
+ for (let j = 1; j <= grid.amplitudes; j++) {
224
+ const theta0 = (0.5 * j) / grid.amplitudes;
225
+ if (theta0 < theta0Min)
226
+ continue;
227
+ const T = 1 + pendulumPeriodErrorAt({ theta0 });
228
+ const q = pendulumNome(theta0);
229
+ const a = Array.from({ length: FOURIER_SERIES_TERMS }, (_, n) => coefficientFromNome(q, n, variant));
230
+ for (let i = 0; i < grid.phases; i++) {
231
+ const phi = (TWO_PI * i) / grid.phases;
232
+ let s = 0;
233
+ for (let n = 0; n < FOURIER_SERIES_TERMS; n++)
234
+ s += (n % 2 === 0 ? a[n] : -a[n]) * Math.cos((2 * n + 1) * phi);
235
+ worst = Math.max(worst, Math.abs(exactPendulumAngle(theta0, (i * T) / grid.phases) - s));
236
+ }
237
+ }
238
+ return worst;
239
+ }
240
+ /**
241
+ * The first `count` coefficients aₙ from the FFT of one exact period sampled
242
+ * at `samples` points, MathTS `rfft`: aₙ = (−1)ⁿ 2 re[2n+1]/N. A second
243
+ * route to the series, independent of the nome. `samples` must exceed
244
+ * 2·count + 1.
245
+ *
246
+ * @internal
247
+ */
248
+ export function fourierCoefficientsByFft(theta0, samples, count) {
249
+ if (!Number.isInteger(samples) || samples <= 2 * count + 1) {
250
+ throw new RangeError(`fourierCoefficientsByFft: ${samples} samples cannot resolve ${count} odd harmonics`);
251
+ }
252
+ const T = 1 + pendulumPeriodErrorAt({ theta0 });
253
+ const { re } = rfft(Array.from({ length: samples }, (_, i) => exactPendulumAngle(theta0, (i * T) / samples)));
254
+ return Array.from({ length: count }, (_, n) => ((n % 2 === 0 ? 2 : -2) * re[2 * n + 1]) / samples);
255
+ }
147
256
  /** max over the grid, and over one period T = T0(1+ε) sampled at every RK4 step, of |θ_RK4(t) − F(2πt/T)|. */
148
257
  function fourierSeriesDeviation(stepsPerPeriod, variant) {
149
258
  let worst = 0;
@@ -214,7 +323,9 @@ export const PENDULUM_POSITION_TRANSLATION = {
214
323
  'both motions are released from rest at the same θ0 at t = 0',
215
324
  'T0 = 2π √(ℓ/g) is the linear period, in the unit t is given in',
216
325
  'the classical Fourier series of the pendulum (all aₙ > 0, Σ (−1)ⁿ aₙ = θ0) — quoted, not derived here; ' +
217
- `machine-checked against RK4 at θ0 ∈ {${FOURIER_SERIES_THETA0S.join(', ')}} (W7xs), not between those points`,
326
+ `machine-checked against the elliptic solution θ = 2 asin(k sn(K − ω0t, k²)) over ${FOURIER_SERIES_EXACT_GRID.amplitudes} amplitudes in (0, 0.5] ` +
327
+ `and ${FOURIER_SERIES_EXACT_GRID.phases} phases within ${FOURIER_SERIES_EXACT_TOLERANCE} rad, and within ${FOURIER_SERIES_EXACT_TIGHT.tolerance} rad ` +
328
+ `above θ0 = ${FOURIER_SERIES_EXACT_TIGHT.theta0Min} (tests/atlas/pendulum-exact.test.ts), and against RK4 at θ0 ∈ {${FOURIER_SERIES_THETA0S.join(', ')}} (W7xs)`,
218
329
  ],
219
330
  parameters: ['T0'],
220
331
  timeUnit: 'the unit of T0',
@@ -1 +1 @@
1
- {"version":3,"file":"position-translation.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/position-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE9G,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAE3B,qGAAqG;AACrG,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,IAAI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AC,wDAAwD,EAAE,sBAAsB,EAAE,eAAe,CAAC;IAC/G,SAAS,EAAE;QACT;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mDAAmD;YACzD,SAAS,EAAE,6DAA6D,UAAU,8CAA8C;SACjI;QACD;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mDAAmD;YACzD,SAAS,EAAE,iDAAiD,UAAU,4BAA4B;SACnG;QACD;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mDAAmD;YACzD,SAAS,EACP,uBAAuB,oBAAoB,kBAAkB,wBAAwB,2CAA2C;gBAChI,YAAY,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;SACnD;KACF;IACD,MAAM,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC/E,UAAU,EAAE,kBAAkB;CAC/B,CAAC","sourcesContent":["/**\n * `ab-pendulum-linear`'s declared translation from its bound's quantity, the\n * relative period error ε, into an UPPER BOUND on the pointwise position error\n * |θ(t) − θ_lin(t)|, in rad.\n *\n * Both motions start from rest at θ0. The pendulum is θ(t) = F(φ), φ = 2πt/T,\n * with the classical Fourier series of the elliptic solution\n *\n * F(φ) = Σ_{n≥0} (−1)ⁿ aₙ cos((2n+1)φ), aₙ = 8 q^{n+½} / ((2n+1)(1 + q^{2n+1})),\n *\n * q the nome of k = sin(θ0/2); F(0) = θ0 = Σ (−1)ⁿ aₙ. The linear motion is\n * θ0 cos φ_lin, φ_lin = 2πt/T0. Splitting at θ0 cos φ,\n *\n * |θ − θ_lin| ≤ |F(φ) − θ0 cos φ| + θ0 |cos φ − cos φ_lin|\n * ≤ 2 Σ_{n≥1} aₙ + 2θ0 |sin(Δφ/2)|,\n *\n * because F(φ) − θ0 cos φ = Σ_{n≥1} (−1)ⁿ aₙ (cos((2n+1)φ) − cos φ). With\n * aₙ ≤ (8/3) q^{n+½} for n ≥ 1 the first term is at most\n * W̄ = (16/3) q^{3/2}/(1 − q) ≈ θ0³/96, and Δφ = 2π(t/T0) ε/(1+ε) is the\n * exact phase lead of `phase-translation.ts`. So\n *\n * B(t) = W̄ + 2θ0 sin(min(Δφ(t), π)/2)\n *\n * bounds the error at every t; the clamp at π keeps B non-decreasing in t and\n * is still a bound, since |cos a − cos b| ≤ 2. It is rigorous GIVEN the\n * Fourier series, which is quoted, not derived here. Witness W7xs checks the\n * series against RK4 over one period at each θ0 of a grid across the domain;\n * that is a check at those points, not a derivation.\n *\n * B is an upper bound, not the error: past its horizon the BOUND exceeds the\n * tolerance, and the error may not. It is near-sharp where Δφ → π (the\n * motions are in antiphase and the error reaches 2θ0), and the waveform term\n * cannot be dropped: without W̄, RK4 finds the error above 2θ0 sin(Δφ/2) by\n * about 3% (witness control).\n *\n * @module atlas/oscillators/position-translation\n * @internal\n */\n\nimport type { ObservableTranslation } from '../translation.js';\nimport type { DominanceWitnessSpec } from '../witness-dominance.js';\nimport type { NumericWitnessSpec } from '../witness-numeric.js';\nimport { pendulumPeriodErrorAt } from './bridges-limits.js';\nimport { linearAccel, pendulumAccel, pendulumNome, rk4Step, theta0OfPeriodError } from './pendulum-motion.js';\n\nconst TWO_PI = 2 * Math.PI;\n\n/** W̄ = (16/3) q^{3/2}/(1 − q): the bound on the waveform distortion |F(φ) − θ0 cos φ|. @internal */\nexport function waveformBound(theta0: number): number {\n const q = pendulumNome(theta0);\n return ((16 / 3) * q ** 1.5) / (1 - q);\n}\n\n/** The pendulum's fundamental Fourier coefficient a₀ = 8√q/(1 + q). @internal */\nexport function fundamentalCoefficient(theta0: number): number {\n const q = pendulumNome(theta0);\n return (8 * Math.sqrt(q)) / (1 + q);\n}\n\nconst lead = (eps: number, tOverT0: number): number => (TWO_PI * tOverT0 * eps) / (1 + eps);\n\n/** B(t/T0) at θ0 recovered from ε; `drift` and `waveform` scale its two terms (1, 1 is B itself). */\nfunction positionBound(eps: number, drift = 1, waveform = 1): (tOverT0: number) => number {\n const theta0 = theta0OfPeriodError(eps);\n const floor = waveform * waveformBound(theta0);\n return (tOverT0) => floor + drift * 2 * theta0 * Math.sin(Math.min(lead(eps, tOverT0), Math.PI) / 2);\n}\n\nfunction positionHorizon(eps: number, tolerance: number, T0: number | undefined): number {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || eps < 0) return Number.NaN;\n if (eps === 0) return Infinity;\n const theta0 = theta0OfPeriodError(eps);\n const floor = waveformBound(theta0);\n if (tolerance < floor) return Number.NaN;\n const r = (tolerance - floor) / (2 * theta0);\n if (r >= 1) return Infinity;\n return (2 * Math.asin(r) * T0 * (1 + eps)) / (TWO_PI * eps);\n}\n\n/** The point witness integrates at most this many periods of T0. */\nexport const POSITION_POINT_MAX_PERIODS = 512;\n/** Samples per T0 both resolutions report at. */\nconst SAMPLES_PER_PERIOD = 200;\n\n/**\n * |θ(t) − θ_lin(t)| from RK4 of both motions, and B(t) at the same samples,\n * over `periods` of T0; `stepsPerPeriod` must be a multiple of 200.\n */\nfunction dominanceSamples(theta0: number, periods: number, stepsPerPeriod: number, bound: (t: number) => number) {\n const stride = stepsPerPeriod / SAMPLES_PER_PERIOD;\n const h = 1 / stepsPerPeriod;\n const measured: number[] = [];\n const b: number[] = [];\n let x = theta0;\n let v = 0;\n let y = theta0;\n let u = 0;\n const steps = Math.floor(periods * SAMPLES_PER_PERIOD) * stride;\n for (let i = 1; i <= steps; i++) {\n [x, v] = rk4Step(x, v, h, pendulumAccel);\n [y, u] = rk4Step(y, u, h, linearAccel);\n if (i % stride === 0) {\n measured.push(Math.abs(x - y));\n b.push(bound(i * h));\n }\n }\n return { measured, bound: b };\n}\n\n/** The window a dominance witness covers: up to antiphase (Δφ = π), past which B ≥ 2θ0 holds trivially, capped. */\nfunction dominanceWindow(eps: number): number {\n return Math.min(POSITION_POINT_MAX_PERIODS, (1 + eps) / (2 * eps));\n}\n\nfunction dominanceSpec(id: string, eps: number, drift: number, waveform: number): DominanceWitnessSpec {\n const theta0 = theta0OfPeriodError(eps);\n const periods = dominanceWindow(eps);\n return {\n id,\n kind: 'dominance',\n evaluate: (stepsPerPeriod) => dominanceSamples(theta0, periods, stepsPerPeriod, positionBound(eps, drift, waveform)),\n coarseResolution: 200,\n fineResolution: 800,\n };\n}\n\n/** a₀ measured by projecting one RK4 pendulum period onto cos φ (trapezoid, exact for a periodic integrand). */\nexport function measureFundamental(theta0: number, stepsPerPeriod: number): number {\n const T = 1 + pendulumPeriodErrorAt({ theta0 });\n const h = T / stepsPerPeriod;\n let x = theta0;\n let v = 0;\n let sum = theta0;\n for (let i = 1; i < stepsPerPeriod; i++) {\n [x, v] = rk4Step(x, v, h, pendulumAccel);\n sum += x * Math.cos((TWO_PI * i) / stepsPerPeriod);\n }\n return (2 * sum) / stepsPerPeriod;\n}\n\n/** The θ0 at which W7xs checks the Fourier series: a grid across the bridge's domain θ0 ≤ 0.5. @internal */\nexport const FOURIER_SERIES_THETA0S: readonly number[] = [0.01, 0.1, 0.2, 0.3, 0.4, 0.5];\nconst FOURIER_SERIES_TERMS = 20;\nconst FOURIER_SERIES_TOLERANCE = 1e-9;\n\n/**\n * F(φ) = Σ_{n<20} (−1)ⁿ aₙ cos((2n+1)φ). `'minus'` puts (1 − q^{2n+1}) in the\n * denominator of aₙ, a transcription error the control uses.\n */\nfunction fourierSeries(theta0: number, phi: number, variant: 'plus' | 'minus'): number {\n const q = pendulumNome(theta0);\n let s = 0;\n for (let n = 0; n < FOURIER_SERIES_TERMS; n++) {\n const odd = 2 * n + 1;\n const a = (8 * q ** (n + 0.5)) / (odd * (variant === 'plus' ? 1 + q ** odd : 1 - q ** odd));\n s += (n % 2 === 0 ? a : -a) * Math.cos(odd * phi);\n }\n return s;\n}\n\n/** max over the grid, and over one period T = T0(1+ε) sampled at every RK4 step, of |θ_RK4(t) − F(2πt/T)|. */\nfunction fourierSeriesDeviation(stepsPerPeriod: number, variant: 'plus' | 'minus'): number {\n let worst = 0;\n for (const theta0 of FOURIER_SERIES_THETA0S) {\n const h = (1 + pendulumPeriodErrorAt({ theta0 })) / stepsPerPeriod;\n let x = theta0;\n let v = 0;\n worst = Math.max(worst, Math.abs(x - fourierSeries(theta0, 0, variant)));\n for (let i = 1; i <= stepsPerPeriod; i++) {\n [x, v] = rk4Step(x, v, h, pendulumAccel);\n worst = Math.max(worst, Math.abs(x - fourierSeries(theta0, (TWO_PI * i) / stepsPerPeriod, variant)));\n }\n }\n return worst;\n}\n\n/**\n * W7xs, or its control: the Fourier series against RK4 of the pendulum, at 200\n * and 800 steps per period, within 1e-9 rad at every step and every grid θ0.\n * @internal\n */\nexport function fourierSeriesCheck(id: string, variant: 'plus' | 'minus' = 'plus'): NumericWitnessSpec {\n return {\n id,\n evaluate: (stepsPerPeriod) => fourierSeriesDeviation(stepsPerPeriod, variant),\n target: 0,\n coarseResolution: 200,\n fineResolution: 800,\n tolerance: FOURIER_SERIES_TOLERANCE,\n };\n}\n\nconst W7X_THETA0 = 0.3;\nconst W7X_EPS = pendulumPeriodErrorAt({ theta0: W7X_THETA0 });\n\nconst W7XA: NumericWitnessSpec = {\n id: 'W7xa',\n evaluate: (stepsPerPeriod) => measureFundamental(W7X_THETA0, stepsPerPeriod),\n target: fundamentalCoefficient(W7X_THETA0),\n coarseResolution: 200,\n fineResolution: 800,\n tolerance: 1e-10,\n};\n\nfunction positionPointCheck(eps: number): ReturnType<ObservableTranslation['pointCheck']> {\n if (!Number.isFinite(eps) || eps <= 0) return { unavailable: `θ0 = 0 at ε = ${eps}: both motions are at rest and the error is 0` };\n const theta0 = theta0OfPeriodError(eps);\n const periods = dominanceWindow(eps);\n const capped = periods === POSITION_POINT_MAX_PERIODS ? `, capped at ${POSITION_POINT_MAX_PERIODS} T0 (antiphase is at ${(1 + eps) / (2 * eps)} T0)` : ' (to antiphase, Δφ = π)';\n return {\n claim:\n `RK4 |θ − θ_lin| ≤ B(t) at every sample, θ0 = ${Number(theta0.toPrecision(8))} (recovered from ε), over t ≤ ${periods} T0${capped}; ` +\n `200 and 800 steps per T0, sampled 200 per T0; the coarse-to-fine difference is the uncertainty`,\n check: dominanceSpec('W7x@point', eps, 1, 1),\n control: dominanceSpec('W7x@point-control', eps, 1, 0),\n controlClaim: 'the same bound without its waveform term W̄, 2θ0 sin(Δφ/2) alone',\n };\n}\n\n/** @internal */\nexport const PENDULUM_POSITION_TRANSLATION: ObservableTranslation = {\n bridgeId: 'ab-pendulum-linear',\n observable: 'position',\n unit: 'rad',\n fromNorm: 'relative period error, normalized by the value of the reduced model',\n errorKind: 'upper-bound',\n definition: 'the pointwise angle error |θ(t) − θ_lin(t)| of the two motions released from rest at θ0',\n derivation:\n 'an UPPER BOUND B(t) = W̄ + 2θ0 sin(min(Δφ(t), π)/2), Δφ = 2π (t/T0) ε/(1+ε) the exact phase lead and ' +\n 'W̄ = (16/3) q^{3/2}/(1−q) ≈ θ0³/96 the waveform term (q the nome of sin(θ0/2); θ0 is recovered from ε). ' +\n 'From the Fourier series θ = Σ (−1)ⁿ aₙ cos((2n+1)φ): |θ − θ0 cos φ| ≤ 2 Σ_{n≥1} aₙ ≤ W̄, and θ0|cos φ − cos φ_lin| ≤ 2θ0|sin(Δφ/2)|. ' +\n 'B increases with ε, so the domain supremum of ε gives the shortest horizon over the domain',\n premises: [\n 'both motions are released from rest at the same θ0 at t = 0',\n 'T0 = 2π √(ℓ/g) is the linear period, in the unit t is given in',\n 'the classical Fourier series of the pendulum (all aₙ > 0, Σ (−1)ⁿ aₙ = θ0) — quoted, not derived here; ' +\n `machine-checked against RK4 at θ0 ∈ {${FOURIER_SERIES_THETA0S.join(', ')}} (W7xs), not between those points`,\n ],\n parameters: ['T0'],\n timeUnit: 'the unit of T0',\n errorAt: (eps, t, { T0 }) => {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || eps < 0 || !Number.isFinite(t)) return Number.NaN;\n return positionBound(eps)(t / T0);\n },\n horizonFor: (eps, tolerance, { T0 }) => positionHorizon(eps, tolerance, T0),\n floor: (eps) => waveformBound(theta0OfPeriodError(eps)),\n boundary:\n 'inclusive: certified iff t ≤ t*, i.e. B(t) ≤ the tolerance; past t* the BOUND exceeds it and the error may not (undetermined, not inadequate)',\n notCovered: ['the phase (declared separately: --tolerance=phase:EPS)', 'the angular velocity', 'the amplitude'],\n witnesses: [\n {\n id: 'W7x',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-position-translation.test.ts',\n tolerance: `RK4 |θ − θ_lin| ≤ B(t) at every sample to antiphase, θ0 = ${W7X_THETA0}, by more than the coarse-to-fine difference`,\n },\n {\n id: 'W7xa',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-position-translation.test.ts',\n tolerance: `RK4-projected fundamental coefficient at θ0 = ${W7X_THETA0} within 1e-10 of 8√q/(1+q)`,\n },\n {\n id: 'W7xs',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-position-translation.test.ts',\n tolerance:\n `the Fourier series (${FOURIER_SERIES_TERMS} terms) within ${FOURIER_SERIES_TOLERANCE} rad of RK4 at every step of one period, ` +\n `at θ0 ∈ {${FOURIER_SERIES_THETA0S.join(', ')}}`,\n },\n ],\n checks: [dominanceSpec('W7x', W7X_EPS, 1, 1), W7XA, fourierSeriesCheck('W7xs')],\n pointCheck: positionPointCheck,\n};\n"]}
1
+ {"version":3,"file":"position-translation.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/position-translation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAIvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,OAAO,EAC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IAAI,EAAE,mDAAmD;YACzD,SAAS,EAAE,6DAA6D,UAAU,8CAA8C;SACjI;QACD;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mDAAmD;YACzD,SAAS,EAAE,iDAAiD,UAAU,4BAA4B;SACnG;QACD;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mDAAmD;YACzD,SAAS,EACP,uBAAuB,oBAAoB,kBAAkB,wBAAwB,2CAA2C;gBAChI,YAAY,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;SACnD;KACF;IACD,MAAM,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC/E,UAAU,EAAE,kBAAkB;CAC/B,CAAC","sourcesContent":["/**\n * `ab-pendulum-linear`'s declared translation from its bound's quantity, the\n * relative period error ε, into an UPPER BOUND on the pointwise position error\n * |θ(t) − θ_lin(t)|, in rad.\n *\n * Both motions start from rest at θ0. The pendulum is θ(t) = F(φ), φ = 2πt/T,\n * with the classical Fourier series of the elliptic solution\n *\n * F(φ) = Σ_{n≥0} (−1)ⁿ aₙ cos((2n+1)φ), aₙ = 8 q^{n+½} / ((2n+1)(1 + q^{2n+1})),\n *\n * q the nome of k = sin(θ0/2); F(0) = θ0 = Σ (−1)ⁿ aₙ. The linear motion is\n * θ0 cos φ_lin, φ_lin = 2πt/T0. Splitting at θ0 cos φ,\n *\n * |θ − θ_lin| ≤ |F(φ) − θ0 cos φ| + θ0 |cos φ − cos φ_lin|\n * ≤ 2 Σ_{n≥1} aₙ + 2θ0 |sin(Δφ/2)|,\n *\n * because F(φ) − θ0 cos φ = Σ_{n≥1} (−1)ⁿ aₙ (cos((2n+1)φ) − cos φ). With\n * aₙ ≤ (8/3) q^{n+½} for n ≥ 1 the first term is at most\n * W̄ = (16/3) q^{3/2}/(1 − q) ≈ θ0³/96, and Δφ = 2π(t/T0) ε/(1+ε) is the\n * exact phase lead of `phase-translation.ts`. So\n *\n * B(t) = W̄ + 2θ0 sin(min(Δφ(t), π)/2)\n *\n * bounds the error at every t; the clamp at π keeps B non-decreasing in t and\n * is still a bound, since |cos a − cos b| ≤ 2. It is rigorous GIVEN the\n * Fourier series, which is quoted, not derived here. The exact check\n * (`fourierSeriesExactDeviation`, run by `tests/atlas/pendulum-exact.test.ts`;\n * not a registered witness, because it has no resolution for a runner to\n * refine) compares the series with the EXACT solution θ = 2 asin(k sn(K − ω0t, k²))\n * (`exactPendulumAngle`) over a dense grid of amplitudes and phases at\n * 1e-12 rad (1e-13 above θ0 = 0.002; the floor below that is the nome's, see\n * `FOURIER_SERIES_EXACT_TOLERANCE`), and W7xs against RK4 over one period at\n * six amplitudes at 1e-9;\n * both are checks at grid points, not a derivation. The coefficients also\n * have a second route, the FFT of one exact period (`fourierCoefficientsByFft`).\n *\n * B is an upper bound, not the error: past its horizon the BOUND exceeds the\n * tolerance, and the error may not. It is near-sharp where Δφ → π (the\n * motions are in antiphase and the error reaches 2θ0), and the waveform term\n * cannot be dropped: without W̄, RK4 finds the error above 2θ0 sin(Δφ/2) by\n * about 3% (witness control).\n *\n * @module atlas/oscillators/position-translation\n * @internal\n */\n\nimport { rfft } from '@danielsimonjr/mathts-functions';\nimport type { ObservableTranslation } from '../translation.js';\nimport type { DominanceWitnessSpec } from '../witness-dominance.js';\nimport type { NumericWitnessSpec } from '../witness-numeric.js';\nimport { pendulumPeriodErrorAt } from './bridges-limits.js';\nimport {\n exactPendulumAngle,\n linearAccel,\n pendulumAccel,\n pendulumNome,\n rk4Step,\n theta0OfPeriodError,\n TWO_PI,\n} from './pendulum-motion.js';\n\n/** W̄ = (16/3) q^{3/2}/(1 − q): the bound on the waveform distortion |F(φ) − θ0 cos φ|. @internal */\nexport function waveformBound(theta0: number): number {\n const q = pendulumNome(theta0);\n return ((16 / 3) * q ** 1.5) / (1 - q);\n}\n\n/** The pendulum's fundamental Fourier coefficient a₀ = 8√q/(1 + q). @internal */\nexport function fundamentalCoefficient(theta0: number): number {\n const q = pendulumNome(theta0);\n return (8 * Math.sqrt(q)) / (1 + q);\n}\n\nconst lead = (eps: number, tOverT0: number): number => (TWO_PI * tOverT0 * eps) / (1 + eps);\n\n/** B(t/T0) at θ0 recovered from ε; `drift` and `waveform` scale its two terms (1, 1 is B itself). */\nfunction positionBound(eps: number, drift = 1, waveform = 1): (tOverT0: number) => number {\n const theta0 = theta0OfPeriodError(eps);\n const floor = waveform * waveformBound(theta0);\n return (tOverT0) => floor + drift * 2 * theta0 * Math.sin(Math.min(lead(eps, tOverT0), Math.PI) / 2);\n}\n\nfunction positionHorizon(eps: number, tolerance: number, T0: number | undefined): number {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || eps < 0) return Number.NaN;\n if (eps === 0) return Infinity;\n const theta0 = theta0OfPeriodError(eps);\n const floor = waveformBound(theta0);\n if (tolerance < floor) return Number.NaN;\n const r = (tolerance - floor) / (2 * theta0);\n if (r >= 1) return Infinity;\n return (2 * Math.asin(r) * T0 * (1 + eps)) / (TWO_PI * eps);\n}\n\n/** The point witness integrates at most this many periods of T0. */\nconst POSITION_POINT_MAX_PERIODS = 512;\n/** Samples per T0 both resolutions report at. */\nconst SAMPLES_PER_PERIOD = 200;\n\n/**\n * |θ(t) − θ_lin(t)| from RK4 of both motions, and B(t) at the same samples,\n * over `periods` of T0; `stepsPerPeriod` must be a multiple of 200. The\n * exact route is {@link exactDominanceSpec}; this one is what W7x registers,\n * so the integrator stays part of what the witness exercises.\n */\nfunction dominanceSamples(theta0: number, periods: number, stepsPerPeriod: number, bound: (t: number) => number) {\n const stride = stepsPerPeriod / SAMPLES_PER_PERIOD;\n const h = 1 / stepsPerPeriod;\n const measured: number[] = [];\n const b: number[] = [];\n let x = theta0;\n let v = 0;\n let y = theta0;\n let u = 0;\n const steps = Math.floor(periods * SAMPLES_PER_PERIOD) * stride;\n for (let i = 1; i <= steps; i++) {\n [x, v] = rk4Step(x, v, h, pendulumAccel);\n [y, u] = rk4Step(y, u, h, linearAccel);\n if (i % stride === 0) {\n measured.push(Math.abs(x - y));\n b.push(bound(i * h));\n }\n }\n return { measured, bound: b };\n}\n\n/** The window a dominance witness covers: up to antiphase (Δφ = π), past which B ≥ 2θ0 holds trivially, capped. */\nfunction dominanceWindow(eps: number): number {\n return Math.min(POSITION_POINT_MAX_PERIODS, (1 + eps) / (2 * eps));\n}\n\n/**\n * The exact route to W7x's measured value: |θ_exact(t) − θ0 cos(2πt)| from the\n * closed forms, at the same 200 samples per T0 as {@link dominanceSamples},\n * against B(t) at θ0 recovered from `eps`. The resolution is ignored, so the\n * runner's coarse-to-fine uncertainty u is exactly 0 here and its rule\n * `bound − measured > u` is `bound > measured`: u is a property of the RK4\n * route, not of the claim. The registered W7x keeps the RK4 route.\n *\n * @internal\n */\nexport function exactDominanceSpec(id: string, eps: number): DominanceWitnessSpec {\n const theta0 = theta0OfPeriodError(eps);\n const periods = dominanceWindow(eps);\n const bound = positionBound(eps);\n const samples = Math.floor(periods * SAMPLES_PER_PERIOD);\n return {\n id,\n kind: 'dominance',\n evaluate: () => {\n const measured: number[] = [];\n const b: number[] = [];\n for (let i = 1; i <= samples; i++) {\n const t = i / SAMPLES_PER_PERIOD;\n measured.push(Math.abs(exactPendulumAngle(theta0, t) - theta0 * Math.cos(TWO_PI * t)));\n b.push(bound(t));\n }\n return { measured, bound: b };\n },\n coarseResolution: 200,\n fineResolution: 800,\n };\n}\n\nfunction dominanceSpec(id: string, eps: number, drift: number, waveform: number): DominanceWitnessSpec {\n const theta0 = theta0OfPeriodError(eps);\n const periods = dominanceWindow(eps);\n return {\n id,\n kind: 'dominance',\n evaluate: (stepsPerPeriod) => dominanceSamples(theta0, periods, stepsPerPeriod, positionBound(eps, drift, waveform)),\n coarseResolution: 200,\n fineResolution: 800,\n };\n}\n\n/** a₀ measured by projecting one RK4 pendulum period onto cos φ (trapezoid, exact for a periodic integrand). */\nfunction measureFundamental(theta0: number, stepsPerPeriod: number): number {\n const T = 1 + pendulumPeriodErrorAt({ theta0 });\n const h = T / stepsPerPeriod;\n let x = theta0;\n let v = 0;\n let sum = theta0;\n for (let i = 1; i < stepsPerPeriod; i++) {\n [x, v] = rk4Step(x, v, h, pendulumAccel);\n sum += x * Math.cos((TWO_PI * i) / stepsPerPeriod);\n }\n return (2 * sum) / stepsPerPeriod;\n}\n\n/** The θ0 at which W7xs checks the Fourier series: a grid across the bridge's domain θ0 ≤ 0.5. @internal */\nexport const FOURIER_SERIES_THETA0S: readonly number[] = [0.01, 0.1, 0.2, 0.3, 0.4, 0.5];\nconst FOURIER_SERIES_TERMS = 20;\nconst FOURIER_SERIES_TOLERANCE = 1e-9;\n\n/** aₙ = 8 q^{n+½}/((2n+1)(1 + q^{2n+1})) from the nome; `'minus'` is the (1 − q^{2n+1}) transcription error the controls use. */\nfunction coefficientFromNome(q: number, n: number, variant: 'plus' | 'minus'): number {\n const odd = 2 * n + 1;\n return (8 * q ** (n + 0.5)) / (odd * (variant === 'plus' ? 1 + q ** odd : 1 - q ** odd));\n}\n\n/** The pendulum's Fourier coefficient aₙ at amplitude θ0 (the closed form, from the nome). @internal */\nexport function fourierCoefficient(theta0: number, n: number, variant: 'plus' | 'minus' = 'plus'): number {\n return coefficientFromNome(pendulumNome(theta0), n, variant);\n}\n\n/**\n * F(φ) = Σ_{n<20} (−1)ⁿ aₙ cos((2n+1)φ). `'minus'` puts (1 − q^{2n+1}) in the\n * denominator of aₙ, a transcription error the control uses.\n */\nfunction fourierSeries(theta0: number, phi: number, variant: 'plus' | 'minus'): number {\n const q = pendulumNome(theta0);\n let s = 0;\n for (let n = 0; n < FOURIER_SERIES_TERMS; n++) {\n const a = coefficientFromNome(q, n, variant);\n s += (n % 2 === 0 ? a : -a) * Math.cos((2 * n + 1) * phi);\n }\n return s;\n}\n\n/** The grid the exact check runs on: amplitudes θ0 = 0.5 j/500, j = 1..500, and phases φ = 2π i/256. @internal */\nexport const FOURIER_SERIES_EXACT_GRID = { amplitudes: 500, phases: 256 } as const;\n/**\n * The exact check's tolerance over the whole grid, in rad. The measured deviation is\n * 2.3e-13, all of it at the smallest amplitude θ0 = 0.001 and on the SERIES\n * side: the nome's K′ = K(cos²(θ0/2)) is read from a complementary parameter\n * that rounds at 1e-16 absolute, 4e-10 relative at m = 2.5e-7, so a₀ is low\n * by 2.3e-10 of θ0 there. The exact solution agrees with an independent AGM\n * sn to the bit at that point.\n * @internal\n */\nexport const FOURIER_SERIES_EXACT_TOLERANCE = 1e-12;\n/** Above θ0 = 0.002 the same check holds at 1e-13 rad (measured 3.8e-14 at θ0 = 0.002, below 1.5e-14 from θ0 = 0.01). @internal */\nexport const FOURIER_SERIES_EXACT_TIGHT = { theta0Min: 0.002, tolerance: 1e-13 } as const;\n\n/**\n * The exact check, or its control: max over the grid of |θ_exact(t) − F(φ)|, t = φT/2π,\n * with θ_exact the elliptic solution (`exactPendulumAngle`) and F the 20-term\n * series, over the amplitudes at or above `theta0Min`. A closed form against\n * a closed form, so no resolution and no convergence ratio: the number is the\n * deviation itself, held to {@link FOURIER_SERIES_EXACT_TOLERANCE} over the\n * whole grid and to {@link FOURIER_SERIES_EXACT_TIGHT} above its floor by the\n * test.\n *\n * @internal\n */\nexport function fourierSeriesExactDeviation(\n variant: 'plus' | 'minus' = 'plus',\n grid: { readonly amplitudes: number; readonly phases: number } = FOURIER_SERIES_EXACT_GRID,\n theta0Min = 0,\n): number {\n let worst = 0;\n for (let j = 1; j <= grid.amplitudes; j++) {\n const theta0 = (0.5 * j) / grid.amplitudes;\n if (theta0 < theta0Min) continue;\n const T = 1 + pendulumPeriodErrorAt({ theta0 });\n const q = pendulumNome(theta0);\n const a = Array.from({ length: FOURIER_SERIES_TERMS }, (_, n) => coefficientFromNome(q, n, variant));\n for (let i = 0; i < grid.phases; i++) {\n const phi = (TWO_PI * i) / grid.phases;\n let s = 0;\n for (let n = 0; n < FOURIER_SERIES_TERMS; n++) s += (n % 2 === 0 ? a[n]! : -a[n]!) * Math.cos((2 * n + 1) * phi);\n worst = Math.max(worst, Math.abs(exactPendulumAngle(theta0, (i * T) / grid.phases) - s));\n }\n }\n return worst;\n}\n\n/**\n * The first `count` coefficients aₙ from the FFT of one exact period sampled\n * at `samples` points, MathTS `rfft`: aₙ = (−1)ⁿ 2 re[2n+1]/N. A second\n * route to the series, independent of the nome. `samples` must exceed\n * 2·count + 1.\n *\n * @internal\n */\nexport function fourierCoefficientsByFft(theta0: number, samples: number, count: number): number[] {\n if (!Number.isInteger(samples) || samples <= 2 * count + 1) {\n throw new RangeError(`fourierCoefficientsByFft: ${samples} samples cannot resolve ${count} odd harmonics`);\n }\n const T = 1 + pendulumPeriodErrorAt({ theta0 });\n const { re } = rfft(Array.from({ length: samples }, (_, i) => exactPendulumAngle(theta0, (i * T) / samples)));\n return Array.from({ length: count }, (_, n) => ((n % 2 === 0 ? 2 : -2) * re[2 * n + 1]!) / samples);\n}\n\n/** max over the grid, and over one period T = T0(1+ε) sampled at every RK4 step, of |θ_RK4(t) − F(2πt/T)|. */\nfunction fourierSeriesDeviation(stepsPerPeriod: number, variant: 'plus' | 'minus'): number {\n let worst = 0;\n for (const theta0 of FOURIER_SERIES_THETA0S) {\n const h = (1 + pendulumPeriodErrorAt({ theta0 })) / stepsPerPeriod;\n let x = theta0;\n let v = 0;\n worst = Math.max(worst, Math.abs(x - fourierSeries(theta0, 0, variant)));\n for (let i = 1; i <= stepsPerPeriod; i++) {\n [x, v] = rk4Step(x, v, h, pendulumAccel);\n worst = Math.max(worst, Math.abs(x - fourierSeries(theta0, (TWO_PI * i) / stepsPerPeriod, variant)));\n }\n }\n return worst;\n}\n\n/**\n * W7xs, or its control: the Fourier series against RK4 of the pendulum, at 200\n * and 800 steps per period, within 1e-9 rad at every step and every grid θ0.\n * @internal\n */\nexport function fourierSeriesCheck(id: string, variant: 'plus' | 'minus' = 'plus'): NumericWitnessSpec {\n return {\n id,\n evaluate: (stepsPerPeriod) => fourierSeriesDeviation(stepsPerPeriod, variant),\n target: 0,\n coarseResolution: 200,\n fineResolution: 800,\n tolerance: FOURIER_SERIES_TOLERANCE,\n };\n}\n\nconst W7X_THETA0 = 0.3;\nconst W7X_EPS = pendulumPeriodErrorAt({ theta0: W7X_THETA0 });\n\nconst W7XA: NumericWitnessSpec = {\n id: 'W7xa',\n evaluate: (stepsPerPeriod) => measureFundamental(W7X_THETA0, stepsPerPeriod),\n target: fundamentalCoefficient(W7X_THETA0),\n coarseResolution: 200,\n fineResolution: 800,\n tolerance: 1e-10,\n};\n\nfunction positionPointCheck(eps: number): ReturnType<ObservableTranslation['pointCheck']> {\n if (!Number.isFinite(eps) || eps <= 0) return { unavailable: `θ0 = 0 at ε = ${eps}: both motions are at rest and the error is 0` };\n const theta0 = theta0OfPeriodError(eps);\n const periods = dominanceWindow(eps);\n const capped = periods === POSITION_POINT_MAX_PERIODS ? `, capped at ${POSITION_POINT_MAX_PERIODS} T0 (antiphase is at ${(1 + eps) / (2 * eps)} T0)` : ' (to antiphase, Δφ = π)';\n return {\n claim:\n `RK4 |θ − θ_lin| ≤ B(t) at every sample, θ0 = ${Number(theta0.toPrecision(8))} (recovered from ε), over t ≤ ${periods} T0${capped}; ` +\n `200 and 800 steps per T0, sampled 200 per T0; the coarse-to-fine difference is the uncertainty`,\n check: dominanceSpec('W7x@point', eps, 1, 1),\n control: dominanceSpec('W7x@point-control', eps, 1, 0),\n controlClaim: 'the same bound without its waveform term W̄, 2θ0 sin(Δφ/2) alone',\n };\n}\n\n/** @internal */\nexport const PENDULUM_POSITION_TRANSLATION: ObservableTranslation = {\n bridgeId: 'ab-pendulum-linear',\n observable: 'position',\n unit: 'rad',\n fromNorm: 'relative period error, normalized by the value of the reduced model',\n errorKind: 'upper-bound',\n definition: 'the pointwise angle error |θ(t) − θ_lin(t)| of the two motions released from rest at θ0',\n derivation:\n 'an UPPER BOUND B(t) = W̄ + 2θ0 sin(min(Δφ(t), π)/2), Δφ = 2π (t/T0) ε/(1+ε) the exact phase lead and ' +\n 'W̄ = (16/3) q^{3/2}/(1−q) ≈ θ0³/96 the waveform term (q the nome of sin(θ0/2); θ0 is recovered from ε). ' +\n 'From the Fourier series θ = Σ (−1)ⁿ aₙ cos((2n+1)φ): |θ − θ0 cos φ| ≤ 2 Σ_{n≥1} aₙ ≤ W̄, and θ0|cos φ − cos φ_lin| ≤ 2θ0|sin(Δφ/2)|. ' +\n 'B increases with ε, so the domain supremum of ε gives the shortest horizon over the domain',\n premises: [\n 'both motions are released from rest at the same θ0 at t = 0',\n 'T0 = 2π √(ℓ/g) is the linear period, in the unit t is given in',\n 'the classical Fourier series of the pendulum (all aₙ > 0, Σ (−1)ⁿ aₙ = θ0) — quoted, not derived here; ' +\n `machine-checked against the elliptic solution θ = 2 asin(k sn(K − ω0t, k²)) over ${FOURIER_SERIES_EXACT_GRID.amplitudes} amplitudes in (0, 0.5] ` +\n `and ${FOURIER_SERIES_EXACT_GRID.phases} phases within ${FOURIER_SERIES_EXACT_TOLERANCE} rad, and within ${FOURIER_SERIES_EXACT_TIGHT.tolerance} rad ` +\n `above θ0 = ${FOURIER_SERIES_EXACT_TIGHT.theta0Min} (tests/atlas/pendulum-exact.test.ts), and against RK4 at θ0 ∈ {${FOURIER_SERIES_THETA0S.join(', ')}} (W7xs)`,\n ],\n parameters: ['T0'],\n timeUnit: 'the unit of T0',\n errorAt: (eps, t, { T0 }) => {\n if (T0 === undefined || !Number.isFinite(T0) || T0 <= 0 || !Number.isFinite(eps) || eps < 0 || !Number.isFinite(t)) return Number.NaN;\n return positionBound(eps)(t / T0);\n },\n horizonFor: (eps, tolerance, { T0 }) => positionHorizon(eps, tolerance, T0),\n floor: (eps) => waveformBound(theta0OfPeriodError(eps)),\n boundary:\n 'inclusive: certified iff t ≤ t*, i.e. B(t) ≤ the tolerance; past t* the BOUND exceeds it and the error may not (undetermined, not inadequate)',\n notCovered: ['the phase (declared separately: --tolerance=phase:EPS)', 'the angular velocity', 'the amplitude'],\n witnesses: [\n {\n id: 'W7x',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-position-translation.test.ts',\n tolerance: `RK4 |θ − θ_lin| ≤ B(t) at every sample to antiphase, θ0 = ${W7X_THETA0}, by more than the coarse-to-fine difference`,\n },\n {\n id: 'W7xa',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-position-translation.test.ts',\n tolerance: `RK4-projected fundamental coefficient at θ0 = ${W7X_THETA0} within 1e-10 of 8√q/(1+q)`,\n },\n {\n id: 'W7xs',\n kind: 'numeric',\n test: 'tests/atlas/pendulum-position-translation.test.ts',\n tolerance:\n `the Fourier series (${FOURIER_SERIES_TERMS} terms) within ${FOURIER_SERIES_TOLERANCE} rad of RK4 at every step of one period, ` +\n `at θ0 ∈ {${FOURIER_SERIES_THETA0S.join(', ')}}`,\n },\n ],\n checks: [dominanceSpec('W7x', W7X_EPS, 1, 1), W7XA, fourierSeriesCheck('W7xs')],\n pointCheck: positionPointCheck,\n};\n"]}
@@ -16,6 +16,4 @@
16
16
  import type { AtlasRejection } from '../types.js';
17
17
  /** The rejected bridges of the oscillator pilot. @internal */
18
18
  export declare const ATLAS_REJECTIONS: readonly AtlasRejection[];
19
- /** Look up a rejection by id, throwing on an unknown one. @internal */
20
- export declare function getAtlasRejection(id: string): AtlasRejection;
21
19
  //# sourceMappingURL=rejections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rejections.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/rejections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EA8BrD,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CAI5D"}
1
+ {"version":3,"file":"rejections.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/rejections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EA8BrD,CAAC"}
@@ -44,11 +44,4 @@ export const ATLAS_REJECTIONS = [
44
44
  ],
45
45
  },
46
46
  ];
47
- /** Look up a rejection by id, throwing on an unknown one. @internal */
48
- export function getAtlasRejection(id) {
49
- const found = ATLAS_REJECTIONS.find((r) => r.id === id);
50
- if (found === undefined)
51
- throw new Error(`unknown atlas rejection id: ${id}`);
52
- return found;
53
- }
54
47
  //# sourceMappingURL=rejections.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rejections.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/rejections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD;QACE,EAAE,EAAE,oBAAoB;QACxB,OAAO,EAAE,mBAAmB;QAC5B,QAAQ,EAAE,CAAC,oBAAoB,CAAC;QAChC,UAAU,EAAE,UAAU;QACtB,MAAM,EACJ,6EAA6E;YAC7E,6EAA6E;YAC7E,6EAA6E;YAC7E,2EAA2E;YAC3E,+EAA+E;YAC/E,gFAAgF;YAChF,4BAA4B;QAC9B,cAAc,EAAE,WAAW;QAC3B,SAAS,EAAE;YACT;gBACE,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,wCAAwC;gBAC9C,SAAS,EAAE,uEAAuE;aACnF;YACD;gBACE,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,wCAAwC;gBAC9C,SAAS,EAAE,8GAA8G;aAC1H;SACF;KACF;CACF,CAAC;AAEF,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC1C,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACxD,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;IAC9E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * The Phase 0 REJECTION record: a claimed bridge the atlas records as refuted,\n * together with the witness that refutes it.\n *\n * `ax-cubic-spring-lc` claims the cubic (Duffing-type) spring\n * `m x″ + k x + β x³ = 0` is exactly equivalent to the LC circuit\n * `L q″ + q/C = 0`. It is not. The cubic spring's variable set\n * {m, k, β, x0} carries exactly ONE dimensionless group, `β x0² / k`, which\n * measures the nonlinearity and has no counterpart on the LC side: the LC\n * variable set is dimensionally independent and admits no group at all. A\n * surviving group with no image cannot be matched by any change of variables,\n * so no exact equivalence exists.\n *\n * @module atlas/oscillators/rejections\n */\n\nimport type { AtlasRejection } from '../types.js';\n\n/** The rejected bridges of the oscillator pilot. @internal */\nexport const ATLAS_REJECTIONS: readonly AtlasRejection[] = [\n {\n id: 'ax-cubic-spring-lc',\n claimed: 'exact-equivalence',\n premises: ['model-cubic-spring'],\n conclusion: 'model-lc',\n reason:\n 'The cubic spring retains one dimensionless group, β x0² / k, that measures ' +\n 'its nonlinearity, and the LC variable set has none (W3). A surviving group ' +\n 'is necessary evidence, not sufficient. The decisive fact is isochrony: the ' +\n 'LC period is the same at every amplitude, the cubic spring period is not ' +\n '(W3b), and a change of variables that rescales time by a constant multiplies ' +\n 'every period by the same factor. So no such change of variables makes the two ' +\n 'models exactly equivalent.',\n survivingGroup: 'β x0² / k',\n witnesses: [\n {\n id: 'W3',\n kind: 'symbolic',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance: 'exact integer π-group exponents; LC verdict dimensionally-independent',\n },\n {\n id: 'W3b',\n kind: 'numeric',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance: 'linear period 2π within 1e-6 at A = 0.5, 1, 2; cubic-spring periods spread by more than 10% at β x0²/k = 0.1',\n },\n ],\n },\n];\n\n/** Look up a rejection by id, throwing on an unknown one. @internal */\nexport function getAtlasRejection(id: string): AtlasRejection {\n const found = ATLAS_REJECTIONS.find((r) => r.id === id);\n if (found === undefined) throw new Error(`unknown atlas rejection id: ${id}`);\n return found;\n}\n"]}
1
+ {"version":3,"file":"rejections.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/rejections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD;QACE,EAAE,EAAE,oBAAoB;QACxB,OAAO,EAAE,mBAAmB;QAC5B,QAAQ,EAAE,CAAC,oBAAoB,CAAC;QAChC,UAAU,EAAE,UAAU;QACtB,MAAM,EACJ,6EAA6E;YAC7E,6EAA6E;YAC7E,6EAA6E;YAC7E,2EAA2E;YAC3E,+EAA+E;YAC/E,gFAAgF;YAChF,4BAA4B;QAC9B,cAAc,EAAE,WAAW;QAC3B,SAAS,EAAE;YACT;gBACE,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,wCAAwC;gBAC9C,SAAS,EAAE,uEAAuE;aACnF;YACD;gBACE,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,wCAAwC;gBAC9C,SAAS,EAAE,8GAA8G;aAC1H;SACF;KACF;CACF,CAAC","sourcesContent":["/**\n * The Phase 0 REJECTION record: a claimed bridge the atlas records as refuted,\n * together with the witness that refutes it.\n *\n * `ax-cubic-spring-lc` claims the cubic (Duffing-type) spring\n * `m x″ + k x + β x³ = 0` is exactly equivalent to the LC circuit\n * `L q″ + q/C = 0`. It is not. The cubic spring's variable set\n * {m, k, β, x0} carries exactly ONE dimensionless group, `β x0² / k`, which\n * measures the nonlinearity and has no counterpart on the LC side: the LC\n * variable set is dimensionally independent and admits no group at all. A\n * surviving group with no image cannot be matched by any change of variables,\n * so no exact equivalence exists.\n *\n * @module atlas/oscillators/rejections\n */\n\nimport type { AtlasRejection } from '../types.js';\n\n/** The rejected bridges of the oscillator pilot. @internal */\nexport const ATLAS_REJECTIONS: readonly AtlasRejection[] = [\n {\n id: 'ax-cubic-spring-lc',\n claimed: 'exact-equivalence',\n premises: ['model-cubic-spring'],\n conclusion: 'model-lc',\n reason:\n 'The cubic spring retains one dimensionless group, β x0² / k, that measures ' +\n 'its nonlinearity, and the LC variable set has none (W3). A surviving group ' +\n 'is necessary evidence, not sufficient. The decisive fact is isochrony: the ' +\n 'LC period is the same at every amplitude, the cubic spring period is not ' +\n '(W3b), and a change of variables that rescales time by a constant multiplies ' +\n 'every period by the same factor. So no such change of variables makes the two ' +\n 'models exactly equivalent.',\n survivingGroup: 'β x0² / k',\n witnesses: [\n {\n id: 'W3',\n kind: 'symbolic',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance: 'exact integer π-group exponents; LC verdict dimensionally-independent',\n },\n {\n id: 'W3b',\n kind: 'numeric',\n test: 'tests/atlas/oscillators-coarse.test.ts',\n tolerance: 'linear period 2π within 1e-6 at A = 0.5, 1, 2; cubic-spring periods spread by more than 10% at β x0²/k = 0.1',\n },\n ],\n },\n];\n"]}