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
@@ -1,32 +1,20 @@
1
1
  /**
2
- * Dimension constants the oscillator pilot needs that the canonical entry
3
- * files declare MODULE-LOCAL and do not export.
2
+ * Dimension constants the oscillator pilot needs.
4
3
  *
5
- * They are redefined here with the same `dim(...)` arguments, quoted from
6
- * source in design note §10 Q2. `tests/atlas/models.test.ts` asserts the
7
- * values, so a future divergence in an entry file fails a test.
4
+ * Capacitance, inductance, resistance and the spring constant are the named
5
+ * shapes of `src/dimensional/types.ts`, re-exported here so the family's
6
+ * modules keep one import site; `tests/atlas/models.test.ts` asserts they are
7
+ * those objects, not copies. `DAMPING` and `CUBIC_STIFFNESS` are this family's
8
+ * own and are defined here.
8
9
  *
9
10
  * `FREQUENCY`, `MASS`, `LENGTH`, `VELOCITY` and `ACCELERATION` are importable
10
- * from `src/dimensional/types.ts` and are NOT redefined here.
11
+ * from `src/dimensional/types.ts` and are NOT re-exported here.
11
12
  *
12
13
  * @module atlas/oscillators/dimensions
13
14
  */
14
15
  import type { Dimension } from '../../dimensional/types.js';
15
- /** farad, `L^-2 M^-1 T^4 I^2` — `src/canonical/entries/electromagnetism.ts:42`. @internal */
16
- export declare const CAPACITANCE: Dimension;
17
- /** henry, `L^2 M T^-2 I^-2` — `src/canonical/entries/electromagnetism.ts:43`. @internal */
18
- export declare const INDUCTANCE: Dimension;
19
- /** ohm, `L^2 M T^-3 I^-2` — `src/canonical/entries/electromagnetism.ts:40`. @internal */
20
- export declare const RESISTANCE: Dimension;
21
- /**
22
- * `M T^-2` — defined TWICE, identically, at
23
- * `src/canonical/entries/mechanics.ts:35` and
24
- * `src/canonical/entries/fluids-waves.ts:48`. One definition here; the test
25
- * asserts agreement with both.
26
- *
27
- * @internal
28
- */
29
- export declare const SPRING_CONSTANT: Dimension;
16
+ /** Farad, henry, ohm and newton per metre: the named shapes of `dimensional/types.ts`. @internal */
17
+ export { CAPACITANCE, INDUCTANCE, RESISTANCE, SPRING_CONSTANT } from '../../dimensional/types.js';
30
18
  /** `M T^-1` — the `b` of `m x'' + b x' + k x = 0`. @internal */
31
19
  export declare const DAMPING: Dimension;
32
20
  /** `M L^-2 T^-2` — the `β` of `m x'' + k x + β x³ = 0`. @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,6FAA6F;AAC7F,eAAO,MAAM,WAAW,EAAE,SAA6B,CAAC;AAExD,2FAA2F;AAC3F,eAAO,MAAM,UAAU,EAAE,SAA6B,CAAC;AAEvD,yFAAyF;AACzF,eAAO,MAAM,UAAU,EAAE,SAA6B,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAAyB,CAAC;AAExD,gEAAgE;AAChE,eAAO,MAAM,OAAO,EAAE,SAAyB,CAAC;AAEhD,qEAAqE;AACrE,eAAO,MAAM,eAAe,EAAE,SAA0B,CAAC"}
1
+ {"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,oGAAoG;AACpG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElG,gEAAgE;AAChE,eAAO,MAAM,OAAO,EAAE,SAAyB,CAAC;AAEhD,qEAAqE;AACrE,eAAO,MAAM,eAAe,EAAE,SAA0B,CAAC"}
@@ -1,32 +1,20 @@
1
1
  /**
2
- * Dimension constants the oscillator pilot needs that the canonical entry
3
- * files declare MODULE-LOCAL and do not export.
2
+ * Dimension constants the oscillator pilot needs.
4
3
  *
5
- * They are redefined here with the same `dim(...)` arguments, quoted from
6
- * source in design note §10 Q2. `tests/atlas/models.test.ts` asserts the
7
- * values, so a future divergence in an entry file fails a test.
4
+ * Capacitance, inductance, resistance and the spring constant are the named
5
+ * shapes of `src/dimensional/types.ts`, re-exported here so the family's
6
+ * modules keep one import site; `tests/atlas/models.test.ts` asserts they are
7
+ * those objects, not copies. `DAMPING` and `CUBIC_STIFFNESS` are this family's
8
+ * own and are defined here.
8
9
  *
9
10
  * `FREQUENCY`, `MASS`, `LENGTH`, `VELOCITY` and `ACCELERATION` are importable
10
- * from `src/dimensional/types.ts` and are NOT redefined here.
11
+ * from `src/dimensional/types.ts` and are NOT re-exported here.
11
12
  *
12
13
  * @module atlas/oscillators/dimensions
13
14
  */
14
15
  import { dim } from '../../dimensional/ast-builders.js';
15
- /** farad, `L^-2 M^-1 T^4 I^2` — `src/canonical/entries/electromagnetism.ts:42`. @internal */
16
- export const CAPACITANCE = dim(-2, -1, 4, 2);
17
- /** henry, `L^2 M T^-2 I^-2` — `src/canonical/entries/electromagnetism.ts:43`. @internal */
18
- export const INDUCTANCE = dim(2, 1, -2, -2);
19
- /** ohm, `L^2 M T^-3 I^-2` — `src/canonical/entries/electromagnetism.ts:40`. @internal */
20
- export const RESISTANCE = dim(2, 1, -3, -2);
21
- /**
22
- * `M T^-2` — defined TWICE, identically, at
23
- * `src/canonical/entries/mechanics.ts:35` and
24
- * `src/canonical/entries/fluids-waves.ts:48`. One definition here; the test
25
- * asserts agreement with both.
26
- *
27
- * @internal
28
- */
29
- export const SPRING_CONSTANT = dim(0, 1, -2);
16
+ /** Farad, henry, ohm and newton per metre: the named shapes of `dimensional/types.ts`. @internal */
17
+ export { CAPACITANCE, INDUCTANCE, RESISTANCE, SPRING_CONSTANT } from '../../dimensional/types.js';
30
18
  /** `M T^-1` — the `b` of `m x'' + b x' + k x = 0`. @internal */
31
19
  export const DAMPING = dim(0, 1, -1);
32
20
  /** `M L^-2 T^-2` — the `β` of `m x'' + k x + β x³ = 0`. @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"dimensions.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAGxD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,WAAW,GAAc,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvD,yFAAyF;AACzF,MAAM,CAAC,MAAM,UAAU,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAExD,gEAAgE;AAChE,MAAM,CAAC,MAAM,OAAO,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEhD,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAc,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Dimension constants the oscillator pilot needs that the canonical entry\n * files declare MODULE-LOCAL and do not export.\n *\n * They are redefined here with the same `dim(...)` arguments, quoted from\n * source in design note §10 Q2. `tests/atlas/models.test.ts` asserts the\n * values, so a future divergence in an entry file fails a test.\n *\n * `FREQUENCY`, `MASS`, `LENGTH`, `VELOCITY` and `ACCELERATION` are importable\n * from `src/dimensional/types.ts` and are NOT redefined here.\n *\n * @module atlas/oscillators/dimensions\n */\n\nimport { dim } from '../../dimensional/ast-builders.js';\nimport type { Dimension } from '../../dimensional/types.js';\n\n/** farad, `L^-2 M^-1 T^4 I^2` — `src/canonical/entries/electromagnetism.ts:42`. @internal */\nexport const CAPACITANCE: Dimension = dim(-2, -1, 4, 2);\n\n/** henry, `L^2 M T^-2 I^-2` — `src/canonical/entries/electromagnetism.ts:43`. @internal */\nexport const INDUCTANCE: Dimension = dim(2, 1, -2, -2);\n\n/** ohm, `L^2 M T^-3 I^-2` — `src/canonical/entries/electromagnetism.ts:40`. @internal */\nexport const RESISTANCE: Dimension = dim(2, 1, -3, -2);\n\n/**\n * `M T^-2` — defined TWICE, identically, at\n * `src/canonical/entries/mechanics.ts:35` and\n * `src/canonical/entries/fluids-waves.ts:48`. One definition here; the test\n * asserts agreement with both.\n *\n * @internal\n */\nexport const SPRING_CONSTANT: Dimension = dim(0, 1, -2);\n\n/** `M T^-1` — the `b` of `m x'' + b x' + k x = 0`. @internal */\nexport const DAMPING: Dimension = dim(0, 1, -1);\n\n/** `M L^-2 T^-2` — the `β` of `m x'' + k x + β x³ = 0`. @internal */\nexport const CUBIC_STIFFNESS: Dimension = dim(-2, 1, -2);\n"]}
1
+ {"version":3,"file":"dimensions.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AAGxD,oGAAoG;AACpG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElG,gEAAgE;AAChE,MAAM,CAAC,MAAM,OAAO,GAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEhD,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAc,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Dimension constants the oscillator pilot needs.\n *\n * Capacitance, inductance, resistance and the spring constant are the named\n * shapes of `src/dimensional/types.ts`, re-exported here so the family's\n * modules keep one import site; `tests/atlas/models.test.ts` asserts they are\n * those objects, not copies. `DAMPING` and `CUBIC_STIFFNESS` are this family's\n * own and are defined here.\n *\n * `FREQUENCY`, `MASS`, `LENGTH`, `VELOCITY` and `ACCELERATION` are importable\n * from `src/dimensional/types.ts` and are NOT re-exported here.\n *\n * @module atlas/oscillators/dimensions\n */\n\nimport { dim } from '../../dimensional/ast-builders.js';\nimport type { Dimension } from '../../dimensional/types.js';\n\n/** Farad, henry, ohm and newton per metre: the named shapes of `dimensional/types.ts`. @internal */\nexport { CAPACITANCE, INDUCTANCE, RESISTANCE, SPRING_CONSTANT } from '../../dimensional/types.js';\n\n/** `M T^-1` — the `b` of `m x'' + b x' + k x = 0`. @internal */\nexport const DAMPING: Dimension = dim(0, 1, -1);\n\n/** `M L^-2 T^-2` — the `β` of `m x'' + k x + β x³ = 0`. @internal */\nexport const CUBIC_STIFFNESS: Dimension = dim(-2, 1, -2);\n"]}
@@ -3,8 +3,8 @@
3
3
  * bridges that had none: W7 (`ab-pendulum-linear`), W8b (`ab-damped-massless`)
4
4
  * and W9 (`ab-chain-wave`).
5
5
  *
6
- * Each one INTEGRATES the premise model's own equation with MathTS
7
- * `solveODESystem` and `dt`, and reads the
6
+ * Each one INTEGRATES the premise model's own equation with `rk4Trajectory`
7
+ * (MathTS `solveODESystem` with `dt`, every state kept) and reads the
8
8
  * claimed quantity off the motion. None evaluates the closed form its record
9
9
  * states, so a test comparing the measurement with that closed form compares
10
10
  * two methods, not one method with itself.
@@ -1 +1 @@
1
- {"version":3,"file":"limit-witnesses.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/limit-witnesses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;GAKG;AACH,eAAO,MAAM,UAAU;aAAK,MAAM,EAAE,GAAG;aAAE,cAAc,EAAE,KAAM;CAAW,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,GAAE,MAAkC,GAAG,MAAM,CAKrH;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;aAAK,CAAC,EAAE,IAAI;aAAE,CAAC,EAAE,CAAC;aAAE,CAAC,EAAE,CAAC;aAAE,EAAE,EAAE,CAAC;aAAE,EAAE,EAAE,CAAC;aAAE,IAAI,EAAE,EAAE;aAAE,YAAY,EAAE,EAAE;CAAW,CAAC;AAEtG;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,EAAE,MAAM,EACT,OAAO,GAAE;IAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAgB,GAChK,MAAM,CAmBR;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;aAAK,MAAM,EAAE,EAAE;aAAE,KAAK,EAAE,CAAC;aAAE,CAAC,EAAE,CAAC;aAAE,CAAC,EAAE,CAAC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,MAAM,CAcR;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;aAAK,MAAM,EAAE,EAAE;aAAE,KAAK,EAAE,CAAC;aAAE,CAAC,EAAE,CAAC;aAAE,CAAC,EAAE,CAAC;aAAE,gBAAgB,EAAE,IAAI;CAAW,CAAC;AAEhG;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAAe,GAC1H,MAAM,CAsDR"}
@@ -3,8 +3,8 @@
3
3
  * bridges that had none: W7 (`ab-pendulum-linear`), W8b (`ab-damped-massless`)
4
4
  * and W9 (`ab-chain-wave`).
5
5
  *
6
- * Each one INTEGRATES the premise model's own equation with MathTS
7
- * `solveODESystem` and `dt`, and reads the
6
+ * Each one INTEGRATES the premise model's own equation with `rk4Trajectory`
7
+ * (MathTS `solveODESystem` with `dt`, every state kept) and reads the
8
8
  * claimed quantity off the motion. None evaluates the closed form its record
9
9
  * states, so a test comparing the measurement with that closed form compares
10
10
  * two methods, not one method with itself.
@@ -12,7 +12,7 @@
12
12
  * @module atlas/oscillators/limit-witnesses
13
13
  * @internal
14
14
  */
15
- import { solveODESystem } from '@danielsimonjr/mathts-functions';
15
+ import { rk4Trajectory } from '../../numerical/rk4-trajectory.js';
16
16
  import { quarterPeriod } from './norm-transport-witness.js';
17
17
  /**
18
18
  * W7: the pendulum θ'' = −ω0² sin θ at ω0 = 1, released from rest; the
@@ -59,10 +59,10 @@ export function measureMasslessOffset(m, fixture = W8B_FIXTURE) {
59
59
  const h = m / stepsPerMass;
60
60
  const layerSteps = Math.ceil((5 * stepsPerMass) / b);
61
61
  const steps = Math.ceil(tEnd / h);
62
- const sol = solveODESystem((_t, y) => [y[1], -(b * y[1] + k * y[0]) / m], [x0, v0], [0, steps * h], { dt: h });
62
+ const states = rk4Trajectory((_t, y) => [y[1], -(b * y[1] + k * y[0]) / m], [x0, v0], 0, steps * h, steps);
63
63
  let sup = 0;
64
64
  for (let i = layerSteps; i <= steps; i++) {
65
- const x = sol.y[i]?.[0];
65
+ const x = states[i]?.[0];
66
66
  if (x === undefined)
67
67
  return Number.NaN;
68
68
  sup = Math.max(sup, Math.abs(x - x0 * Math.exp((-k / b) * i * h)));
@@ -98,21 +98,24 @@ export function measureChainDispersionError(masses, fixture = W9_FIXTURE) {
98
98
  return out;
99
99
  };
100
100
  const h = 1 / stepsPerUnitTime;
101
- let state = [
101
+ const start = [
102
102
  ...Float64Array.from({ length: N }, (_, n) => Math.cos((2 * Math.PI * n) / N)),
103
103
  ...new Array(N).fill(0),
104
104
  ];
105
105
  // Twice the lattice quarter period π/(4√(κ/m) sin(π/N)): the crossing is inside.
106
106
  const maxSteps = Math.ceil(((2 * Math.PI) / (4 * Math.sqrt(w) * Math.sin(Math.PI / N))) * stepsPerUnitTime);
107
+ // One continuous run; the system ignores t, so the states are those of a
108
+ // step-by-step loop, and the first crossing of u_0 is read off them.
109
+ const states = rk4Trajectory((_t, y) => {
110
+ const pos = Float64Array.from(y.slice(0, N));
111
+ const vel = y.slice(N);
112
+ const a = accel(pos);
113
+ return [...vel, ...a];
114
+ }, start, 0, maxSteps * h, maxSteps);
107
115
  for (let i = 0; i < maxSteps; i++) {
108
- const sol = solveODESystem((_t, y) => {
109
- const pos = Float64Array.from(y.slice(0, N));
110
- const vel = y.slice(N);
111
- const a = accel(pos);
112
- return [...vel, ...a];
113
- }, state, [0, h], { dt: h });
114
- const next = sol.y[sol.y.length - 1];
115
- if (next === undefined)
116
+ const state = states[i];
117
+ const next = states[i + 1];
118
+ if (state === undefined || next === undefined)
116
119
  return Number.NaN;
117
120
  const u0 = state[0];
118
121
  const nu0 = next[0];
@@ -130,7 +133,6 @@ export function measureChainDispersionError(masses, fixture = W9_FIXTURE) {
130
133
  const q = (2 * Math.PI) / (N * a);
131
134
  return 1 - omega / (c * q);
132
135
  }
133
- state = next.slice();
134
136
  }
135
137
  return Number.NaN;
136
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"limit-witnesses.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/limit-witnesses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,EAAW,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAc,EAAE,cAAc,GAAW,UAAU,CAAC,cAAc;IAC3G,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC;IACzD,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC;IACpG,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAA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,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YACrH,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The measurements behind the in-process witnesses of the three oscillator\n * bridges that had none: W7 (`ab-pendulum-linear`), W8b (`ab-damped-massless`)\n * and W9 (`ab-chain-wave`).\n *\n * Each one INTEGRATES the premise model's own equation with MathTS\n * `solveODESystem` and `dt`, and reads the\n * claimed quantity off the motion. None evaluates the closed form its record\n * states, so a test comparing the measurement with that closed form compares\n * two methods, not one method with itself.\n *\n * @module atlas/oscillators/limit-witnesses\n * @internal\n */\n\nimport { solveODESystem } from '@danielsimonjr/mathts-functions';\nimport { quarterPeriod } from './norm-transport-witness.js';\n\n/**\n * W7: the pendulum θ'' = −ω0² sin θ at ω0 = 1, released from rest; the\n * amplitude is `theta0 / resolution`, so refinement moves into the θ0 → 0 limit.\n *\n * @internal\n */\nexport const W7_FIXTURE = { theta0: 0.4, stepsPerPeriod: 16_384 } as const;\n\n/**\n * T/T0 of the pendulum released from rest at `theta0`, measured by RK4 with\n * `stepsPerPeriod` steps per linear period T0 = 2π (ω0 = 1).\n *\n * @returns NaN unless 0 < theta0 < π.\n * @internal\n */\nexport function measurePendulumPeriodRatio(theta0: number, stepsPerPeriod: number = W7_FIXTURE.stepsPerPeriod): number {\n if (!(theta0 > 0 && theta0 < Math.PI)) return Number.NaN;\n const T0 = 2 * Math.PI;\n const quarter = quarterPeriod((x) => -Math.sin(x), theta0, T0 / stepsPerPeriod, 2 * stepsPerPeriod);\n return (4 * quarter) / T0;\n}\n\n/**\n * W8b: the damped spring m x'' + b x' + k x = 0 at the record's witness\n * normalisation b = k = x0 = 1, with v0 = 5 (the edge of |v0| ≤ 5). The mass is\n * `m / resolution`. The RK4 step is m/20, so the fast rate b/m is resolved at\n * every mass, and 5m/b is a whole number of steps.\n *\n * @internal\n */\nexport const W8B_FIXTURE = { m: 0.02, b: 1, k: 1, x0: 1, v0: 5, tEnd: 10, stepsPerMass: 20 } as const;\n\n/**\n * sup |x(t) − x0 e^(−kt/b)| over the RK4 grid on t ∈ [5m/b, tEnd], x from the\n * full second-order model: the norm of `ab-damped-massless`'s bound. The\n * window stops at `tEnd`; both motions there are below x0·e^(−k·tEnd/b).\n *\n * @returns NaN unless m, b and k are positive and finite.\n * @internal\n */\nexport function measureMasslessOffset(\n m: number,\n fixture: { readonly b: number; readonly k: number; readonly x0: number; readonly v0: number; readonly tEnd: number; readonly stepsPerMass: number } = W8B_FIXTURE,\n): number {\n const { b, k, x0, v0, tEnd, stepsPerMass } = fixture;\n if (![m, b, k].every((v) => Number.isFinite(v) && v > 0)) return Number.NaN;\n const h = m / stepsPerMass;\n const layerSteps = Math.ceil((5 * stepsPerMass) / b);\n const steps = Math.ceil(tEnd / h);\n const sol = solveODESystem(\n (_t, y) => [y[1]!, -(b * y[1]! + k * y[0]!) / m],\n [x0, v0],\n [0, steps * h],\n { dt: h },\n );\n let sup = 0;\n for (let i = layerSteps; i <= steps; i++) {\n const x = sol.y[i]?.[0];\n if (x === undefined) return Number.NaN;\n sup = Math.max(sup, Math.abs(x - x0 * Math.exp((-k / b) * i * h)));\n }\n return sup;\n}\n\n/**\n * W9: a ring of `masses · resolution` masses, m u_n'' = κ(u_{n+1} − 2u_n + u_{n−1}),\n * started at rest in its longest mode u_n = cos(2π n/N). Refinement doubles N, so\n * qa = 2π/N halves.\n *\n * @internal\n */\nexport const W9_FIXTURE = { masses: 16, kappa: 1, m: 1, a: 1, stepsPerUnitTime: 1000 } as const;\n\n/**\n * 1 − ω/(c q) on a ring of `masses` masses in its longest mode, with ω measured\n * from the first zero of u_0(t) = cos ωt (RK4, cubic Hermite and Newton on the\n * bracketing step) and c = a √(κ/m), q = 2π/(N a).\n *\n * @returns NaN for fewer than 3 masses or no crossing.\n * @internal\n */\nexport function measureChainDispersionError(\n masses: number,\n fixture: { readonly kappa: number; readonly m: number; readonly a: number; readonly stepsPerUnitTime: number } = W9_FIXTURE,\n): number {\n const N = masses;\n if (!Number.isInteger(N) || N < 3) return Number.NaN;\n const { kappa, m, a, stepsPerUnitTime } = fixture;\n const w = kappa / m;\n const accel = (u: Float64Array): Float64Array => {\n const out = new Float64Array(N);\n for (let n = 0; n < N; n++) out[n] = w * (u[(n + 1) % N]! - 2 * u[n]! + u[(n - 1 + N) % N]!);\n return out;\n };\n const h = 1 / stepsPerUnitTime;\n let state = [\n ...Float64Array.from({ length: N }, (_, n) => Math.cos((2 * Math.PI * n) / N)),\n ...new Array<number>(N).fill(0),\n ];\n // Twice the lattice quarter period π/(4√(κ/m) sin(π/N)): the crossing is inside.\n const maxSteps = Math.ceil(((2 * Math.PI) / (4 * Math.sqrt(w) * Math.sin(Math.PI / N))) * stepsPerUnitTime);\n for (let i = 0; i < maxSteps; i++) {\n const sol = solveODESystem(\n (_t, y) => {\n const pos = Float64Array.from(y.slice(0, N));\n const vel = y.slice(N);\n const a = accel(pos);\n return [...vel, ...a];\n },\n state,\n [0, h],\n { dt: h },\n );\n const next = sol.y[sol.y.length - 1];\n if (next === undefined) return Number.NaN;\n const u0 = state[0]!;\n const nu0 = next[0]!;\n const v0 = state[N]!;\n const nv0 = next[N]!;\n if (u0 > 0 && nu0 <= 0) {\n const [p0, m0, p1, m1] = [u0, v0 * h, nu0, nv0 * h];\n const p = (s: number): number =>\n (2 * s ** 3 - 3 * s ** 2 + 1) * p0 + (s ** 3 - 2 * s ** 2 + s) * m0 + (-2 * s ** 3 + 3 * s ** 2) * p1 + (s ** 3 - s ** 2) * m1;\n const dp = (s: number): number =>\n (6 * s ** 2 - 6 * s) * p0 + (3 * s ** 2 - 4 * s + 1) * m0 + (-6 * s ** 2 + 6 * s) * p1 + (3 * s ** 2 - 2 * s) * m1;\n let s = p0 / (p0 - p1);\n for (let j = 0; j < 8; j++) s -= p(s) / dp(s);\n const omega = Math.PI / (2 * (i + s) * h);\n const c = a * Math.sqrt(w);\n const q = (2 * Math.PI) / (N * a);\n return 1 - omega / (c * q);\n }\n state = next.slice();\n }\n return Number.NaN;\n}\n"]}
1
+ {"version":3,"file":"limit-witnesses.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/limit-witnesses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAA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AC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1C,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The measurements behind the in-process witnesses of the three oscillator\n * bridges that had none: W7 (`ab-pendulum-linear`), W8b (`ab-damped-massless`)\n * and W9 (`ab-chain-wave`).\n *\n * Each one INTEGRATES the premise model's own equation with `rk4Trajectory`\n * (MathTS `solveODESystem` with `dt`, every state kept) and reads the\n * claimed quantity off the motion. None evaluates the closed form its record\n * states, so a test comparing the measurement with that closed form compares\n * two methods, not one method with itself.\n *\n * @module atlas/oscillators/limit-witnesses\n * @internal\n */\n\nimport { rk4Trajectory } from '../../numerical/rk4-trajectory.js';\nimport { quarterPeriod } from './norm-transport-witness.js';\n\n/**\n * W7: the pendulum θ'' = −ω0² sin θ at ω0 = 1, released from rest; the\n * amplitude is `theta0 / resolution`, so refinement moves into the θ0 → 0 limit.\n *\n * @internal\n */\nexport const W7_FIXTURE = { theta0: 0.4, stepsPerPeriod: 16_384 } as const;\n\n/**\n * T/T0 of the pendulum released from rest at `theta0`, measured by RK4 with\n * `stepsPerPeriod` steps per linear period T0 = 2π (ω0 = 1).\n *\n * @returns NaN unless 0 < theta0 < π.\n * @internal\n */\nexport function measurePendulumPeriodRatio(theta0: number, stepsPerPeriod: number = W7_FIXTURE.stepsPerPeriod): number {\n if (!(theta0 > 0 && theta0 < Math.PI)) return Number.NaN;\n const T0 = 2 * Math.PI;\n const quarter = quarterPeriod((x) => -Math.sin(x), theta0, T0 / stepsPerPeriod, 2 * stepsPerPeriod);\n return (4 * quarter) / T0;\n}\n\n/**\n * W8b: the damped spring m x'' + b x' + k x = 0 at the record's witness\n * normalisation b = k = x0 = 1, with v0 = 5 (the edge of |v0| ≤ 5). The mass is\n * `m / resolution`. The RK4 step is m/20, so the fast rate b/m is resolved at\n * every mass, and 5m/b is a whole number of steps.\n *\n * @internal\n */\nexport const W8B_FIXTURE = { m: 0.02, b: 1, k: 1, x0: 1, v0: 5, tEnd: 10, stepsPerMass: 20 } as const;\n\n/**\n * sup |x(t) − x0 e^(−kt/b)| over the RK4 grid on t ∈ [5m/b, tEnd], x from the\n * full second-order model: the norm of `ab-damped-massless`'s bound. The\n * window stops at `tEnd`; both motions there are below x0·e^(−k·tEnd/b).\n *\n * @returns NaN unless m, b and k are positive and finite.\n * @internal\n */\nexport function measureMasslessOffset(\n m: number,\n fixture: { readonly b: number; readonly k: number; readonly x0: number; readonly v0: number; readonly tEnd: number; readonly stepsPerMass: number } = W8B_FIXTURE,\n): number {\n const { b, k, x0, v0, tEnd, stepsPerMass } = fixture;\n if (![m, b, k].every((v) => Number.isFinite(v) && v > 0)) return Number.NaN;\n const h = m / stepsPerMass;\n const layerSteps = Math.ceil((5 * stepsPerMass) / b);\n const steps = Math.ceil(tEnd / h);\n const states = rk4Trajectory((_t, y) => [y[1]!, -(b * y[1]! + k * y[0]!) / m], [x0, v0], 0, steps * h, steps);\n let sup = 0;\n for (let i = layerSteps; i <= steps; i++) {\n const x = states[i]?.[0];\n if (x === undefined) return Number.NaN;\n sup = Math.max(sup, Math.abs(x - x0 * Math.exp((-k / b) * i * h)));\n }\n return sup;\n}\n\n/**\n * W9: a ring of `masses · resolution` masses, m u_n'' = κ(u_{n+1} − 2u_n + u_{n−1}),\n * started at rest in its longest mode u_n = cos(2π n/N). Refinement doubles N, so\n * qa = 2π/N halves.\n *\n * @internal\n */\nexport const W9_FIXTURE = { masses: 16, kappa: 1, m: 1, a: 1, stepsPerUnitTime: 1000 } as const;\n\n/**\n * 1 − ω/(c q) on a ring of `masses` masses in its longest mode, with ω measured\n * from the first zero of u_0(t) = cos ωt (RK4, cubic Hermite and Newton on the\n * bracketing step) and c = a √(κ/m), q = 2π/(N a).\n *\n * @returns NaN for fewer than 3 masses or no crossing.\n * @internal\n */\nexport function measureChainDispersionError(\n masses: number,\n fixture: { readonly kappa: number; readonly m: number; readonly a: number; readonly stepsPerUnitTime: number } = W9_FIXTURE,\n): number {\n const N = masses;\n if (!Number.isInteger(N) || N < 3) return Number.NaN;\n const { kappa, m, a, stepsPerUnitTime } = fixture;\n const w = kappa / m;\n const accel = (u: Float64Array): Float64Array => {\n const out = new Float64Array(N);\n for (let n = 0; n < N; n++) out[n] = w * (u[(n + 1) % N]! - 2 * u[n]! + u[(n - 1 + N) % N]!);\n return out;\n };\n const h = 1 / stepsPerUnitTime;\n const start = [\n ...Float64Array.from({ length: N }, (_, n) => Math.cos((2 * Math.PI * n) / N)),\n ...new Array<number>(N).fill(0),\n ];\n // Twice the lattice quarter period π/(4√(κ/m) sin(π/N)): the crossing is inside.\n const maxSteps = Math.ceil(((2 * Math.PI) / (4 * Math.sqrt(w) * Math.sin(Math.PI / N))) * stepsPerUnitTime);\n // One continuous run; the system ignores t, so the states are those of a\n // step-by-step loop, and the first crossing of u_0 is read off them.\n const states = rk4Trajectory(\n (_t, y) => {\n const pos = Float64Array.from(y.slice(0, N));\n const vel = y.slice(N);\n const a = accel(pos);\n return [...vel, ...a];\n },\n start,\n 0,\n maxSteps * h,\n maxSteps,\n );\n for (let i = 0; i < maxSteps; i++) {\n const state = states[i];\n const next = states[i + 1];\n if (state === undefined || next === undefined) return Number.NaN;\n const u0 = state[0]!;\n const nu0 = next[0]!;\n const v0 = state[N]!;\n const nv0 = next[N]!;\n if (u0 > 0 && nu0 <= 0) {\n const [p0, m0, p1, m1] = [u0, v0 * h, nu0, nv0 * h];\n const p = (s: number): number =>\n (2 * s ** 3 - 3 * s ** 2 + 1) * p0 + (s ** 3 - 2 * s ** 2 + s) * m0 + (-2 * s ** 3 + 3 * s ** 2) * p1 + (s ** 3 - s ** 2) * m1;\n const dp = (s: number): number =>\n (6 * s ** 2 - 6 * s) * p0 + (3 * s ** 2 - 4 * s + 1) * m0 + (-6 * s ** 2 + 6 * s) * p1 + (3 * s ** 2 - 2 * s) * m1;\n let s = p0 / (p0 - p1);\n for (let j = 0; j < 8; j++) s -= p(s) / dp(s);\n const omega = Math.PI / (2 * (i + s) * h);\n const c = a * Math.sqrt(w);\n const q = (2 * Math.PI) / (N * a);\n return 1 - omega / (c * q);\n }\n }\n return Number.NaN;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA6B9C,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAmH7C,CAAC;AAIF,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAIpD"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAyB9C,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAmH7C,CAAC;AAIF,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAIpD"}
@@ -19,18 +19,14 @@
19
19
  * @module atlas/oscillators/models
20
20
  */
21
21
  import { ACCELERATION, LENGTH, MASS, VELOCITY, } from '../../dimensional/types.js';
22
- import { deriveRegimeGroups } from '../regime.js';
22
+ import { makeRegime } from '../regime.js';
23
23
  import { CAPACITANCE, CUBIC_STIFFNESS, DAMPING, INDUCTANCE, RESISTANCE, SPRING_CONSTANT, } from './dimensions.js';
24
24
  const FAMILY = 'oscillators';
25
25
  function model(spec) {
26
26
  return {
27
27
  ...spec,
28
28
  family: FAMILY,
29
- regime: {
30
- family: FAMILY,
31
- inequalities: [],
32
- groupDefinitions: deriveRegimeGroups(FAMILY, spec.parameters, spec.dimensionlessInputs),
33
- },
29
+ regime: makeRegime(FAMILY, spec.parameters, spec.dimensionlessInputs, []),
34
30
  };
35
31
  }
36
32
  /** The nine Phase 0 oscillator models, in design-note §3 order. @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,QAAQ,GACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EACL,WAAW,EACX,eAAe,EACf,OAAO,EACP,UAAU,EACV,UAAU,EACV,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAG,aAAa,CAAC;AAE7B,SAAS,KAAK,CACZ,IAEC;IAED,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,MAAM;QACd,MAAM,EAAE;YACN,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,EAAE;YAChB,gBAAgB,EAAE,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,CAAC;SACxF;KACF,CAAC;AACJ,CAAC;AAED,6EAA6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AAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3F,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * The nine oscillator models of design note §3.\n *\n * Each model's `regime` carries the π-groups `deriveRegimeGroups` produces\n * from its own parameters and dimensionless inputs. `inequalities` is EMPTY\n * on every model: Phase 0 states its inequalities on the BRIDGES (which carry\n * the regime of validity), and the design note fixes no per-model inequality.\n * An invented one would be a fabricated constraint, so none is written.\n *\n * The Phase 3 fields `boundaryData`, `initialData` and `symmetryGroup`\n * (`../model.ts`) are ABSENT on all nine for the same reason `inequalities`\n * is empty: no source records them for these ODE models, and an absent field\n * says \"not recorded\" where a present empty one would claim \"there are none\".\n *\n * `canonicalRefs` are restricted to ids that exist in `CANONICAL_EQUATIONS`;\n * `tests/atlas/models.test.ts` resolves every one of them, and a new one needs\n * a numeric check in `tests/atlas/canonical-links.test.ts`.\n *\n * @module atlas/oscillators/models\n */\n\nimport {\n ACCELERATION,\n LENGTH,\n MASS,\n VELOCITY,\n} from '../../dimensional/types.js';\nimport { deriveRegimeGroups } from '../regime.js';\nimport type { AtlasModel } from '../model.js';\nimport type { DimensionalVariable } from '../../dimensional/buckingham.js';\nimport {\n CAPACITANCE,\n CUBIC_STIFFNESS,\n DAMPING,\n INDUCTANCE,\n RESISTANCE,\n SPRING_CONSTANT,\n} from './dimensions.js';\n\nconst FAMILY = 'oscillators';\n\nfunction model(\n spec: Omit<AtlasModel, 'family' | 'regime'> & {\n readonly parameters: readonly DimensionalVariable[];\n },\n): AtlasModel {\n return {\n ...spec,\n family: FAMILY,\n regime: {\n family: FAMILY,\n inequalities: [],\n groupDefinitions: deriveRegimeGroups(FAMILY, spec.parameters, spec.dimensionlessInputs),\n },\n };\n}\n\n/** The nine Phase 0 oscillator models, in design-note §3 order. @internal */\nexport const ATLAS_MODELS: readonly AtlasModel[] = [\n model({\n id: 'model-spring',\n stateSpace: '(x, x′) ∈ ℝ²',\n dynamics: 'm x″ + k x = 0',\n observables: ['x', 'x′', 'energy'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [\n 'CE-simple-harmonic-frequency',\n 'CE-spring-potential-energy',\n 'CE-oscillator-energy',\n ],\n }),\n model({\n id: 'model-lc',\n stateSpace: '(q, q′) ∈ ℝ²',\n dynamics: 'L q″ + q/C = 0',\n observables: ['q', 'q′', 'energy'],\n parameters: [\n { name: 'L', dim: INDUCTANCE },\n { name: 'C', dim: CAPACITANCE },\n ],\n dimensionlessInputs: [],\n canonicalRefs: ['CE-lc-resonance', 'CE-capacitor-energy'],\n }),\n model({\n id: 'model-damped-spring',\n stateSpace: '(x, x′) ∈ ℝ²',\n dynamics: 'm x″ + b x′ + k x = 0',\n observables: ['x', 'x′'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'b', dim: DAMPING },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n model({\n id: 'model-rlc',\n stateSpace: '(q, q′) ∈ ℝ²',\n dynamics: 'L q″ + R q′ + q/C = 0',\n observables: ['q', 'q′'],\n parameters: [\n { name: 'L', dim: INDUCTANCE },\n { name: 'R', dim: RESISTANCE },\n { name: 'C', dim: CAPACITANCE },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n model({\n id: 'model-pendulum',\n stateSpace: '(θ, θ′) ∈ S¹ × ℝ',\n dynamics: 'θ″ + (g/ℓ) sin θ = 0',\n observables: ['theta', 'theta′', 'period'],\n parameters: [\n { name: 'g', dim: ACCELERATION },\n { name: 'ell', dim: LENGTH },\n ],\n dimensionlessInputs: ['theta0'],\n canonicalRefs: ['CE-pendulum-period'],\n }),\n model({\n id: 'model-chain',\n stateSpace: '(u_n, u_n′) ∈ ℝ^N × ℝ^N',\n dynamics: 'm u_n″ = κ(u_{n+1} − 2u_n + u_{n−1})',\n observables: ['u_n', 'u_n′', 'dispersion'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'kappa', dim: SPRING_CONSTANT },\n { name: 'a', dim: LENGTH },\n ],\n dimensionlessInputs: ['qa'],\n canonicalRefs: [],\n }),\n model({\n id: 'model-wave-1d',\n stateSpace: 'u(x, t), a field on ℝ × ℝ',\n dynamics: 'u_tt = c² u_xx',\n observables: ['u', 'u_t', 'dispersion'],\n parameters: [{ name: 'c', dim: VELOCITY }],\n dimensionlessInputs: [],\n canonicalRefs: ['CE-wave-speed'],\n }),\n model({\n id: 'model-cubic-spring',\n stateSpace: '(x, x′) ∈ ℝ²',\n dynamics: 'm x″ + k x + β x³ = 0',\n observables: ['x', 'x′', 'amplitude-dependent period'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'k', dim: SPRING_CONSTANT },\n { name: 'beta', dim: CUBIC_STIFFNESS },\n { name: 'x0', dim: LENGTH },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n model({\n id: 'model-first-order',\n stateSpace: 'x ∈ ℝ',\n dynamics: 'b x′ + k x = 0',\n observables: ['x'],\n parameters: [\n { name: 'b', dim: DAMPING },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n];\n\nconst BY_ID: ReadonlyMap<string, AtlasModel> = new Map(ATLAS_MODELS.map((m) => [m.id, m]));\n\n/** Look up a model by id, throwing on an unknown one. @internal */\nexport function getAtlasModel(id: string): AtlasModel {\n const found = BY_ID.get(id);\n if (found === undefined) throw new Error(`unknown atlas model id: ${id}`);\n return found;\n}\n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AE,eAAe,EAAE;YACnC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE;YACtC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE;SAC5B;QACD,mBAAmB,EAAE,EAAE;QACvB,aAAa,EAAE,EAAE;KAClB,CAAC;IACF,KAAK,CAAC;QACJ,EAAE,EAAE,mBAAmB;QACvB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,gBAAgB;QAC1B,WAAW,EAAE,CAAC,GAAG,CAAC;QAClB,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE;YAC3B,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE;SACpC;QACD,mBAAmB,EAAE,EAAE;QACvB,aAAa,EAAE,EAAE;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,KAAK,GAAoC,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3F,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,KAAK,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * The nine oscillator models of design note §3.\n *\n * Each model's `regime` carries the π-groups `deriveRegimeGroups` produces\n * from its own parameters and dimensionless inputs. `inequalities` is EMPTY\n * on every model: Phase 0 states its inequalities on the BRIDGES (which carry\n * the regime of validity), and the design note fixes no per-model inequality.\n * An invented one would be a fabricated constraint, so none is written.\n *\n * The Phase 3 fields `boundaryData`, `initialData` and `symmetryGroup`\n * (`../model.ts`) are ABSENT on all nine for the same reason `inequalities`\n * is empty: no source records them for these ODE models, and an absent field\n * says \"not recorded\" where a present empty one would claim \"there are none\".\n *\n * `canonicalRefs` are restricted to ids that exist in `CANONICAL_EQUATIONS`;\n * `tests/atlas/models.test.ts` resolves every one of them, and a new one needs\n * a numeric check in `tests/atlas/canonical-links.test.ts`.\n *\n * @module atlas/oscillators/models\n */\n\nimport {\n ACCELERATION,\n LENGTH,\n MASS,\n VELOCITY,\n} from '../../dimensional/types.js';\nimport { makeRegime } from '../regime.js';\nimport type { AtlasModel } from '../model.js';\nimport type { DimensionalVariable } from '../../dimensional/buckingham.js';\nimport {\n CAPACITANCE,\n CUBIC_STIFFNESS,\n DAMPING,\n INDUCTANCE,\n RESISTANCE,\n SPRING_CONSTANT,\n} from './dimensions.js';\n\nconst FAMILY = 'oscillators';\n\nfunction model(\n spec: Omit<AtlasModel, 'family' | 'regime'> & {\n readonly parameters: readonly DimensionalVariable[];\n },\n): AtlasModel {\n return {\n ...spec,\n family: FAMILY,\n regime: makeRegime(FAMILY, spec.parameters, spec.dimensionlessInputs, []),\n };\n}\n\n/** The nine Phase 0 oscillator models, in design-note §3 order. @internal */\nexport const ATLAS_MODELS: readonly AtlasModel[] = [\n model({\n id: 'model-spring',\n stateSpace: '(x, x′) ∈ ℝ²',\n dynamics: 'm x″ + k x = 0',\n observables: ['x', 'x′', 'energy'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [\n 'CE-simple-harmonic-frequency',\n 'CE-spring-potential-energy',\n 'CE-oscillator-energy',\n ],\n }),\n model({\n id: 'model-lc',\n stateSpace: '(q, q′) ∈ ℝ²',\n dynamics: 'L q″ + q/C = 0',\n observables: ['q', 'q′', 'energy'],\n parameters: [\n { name: 'L', dim: INDUCTANCE },\n { name: 'C', dim: CAPACITANCE },\n ],\n dimensionlessInputs: [],\n canonicalRefs: ['CE-lc-resonance', 'CE-capacitor-energy'],\n }),\n model({\n id: 'model-damped-spring',\n stateSpace: '(x, x′) ∈ ℝ²',\n dynamics: 'm x″ + b x′ + k x = 0',\n observables: ['x', 'x′'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'b', dim: DAMPING },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n model({\n id: 'model-rlc',\n stateSpace: '(q, q′) ∈ ℝ²',\n dynamics: 'L q″ + R q′ + q/C = 0',\n observables: ['q', 'q′'],\n parameters: [\n { name: 'L', dim: INDUCTANCE },\n { name: 'R', dim: RESISTANCE },\n { name: 'C', dim: CAPACITANCE },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n model({\n id: 'model-pendulum',\n stateSpace: '(θ, θ′) ∈ S¹ × ℝ',\n dynamics: 'θ″ + (g/ℓ) sin θ = 0',\n observables: ['theta', 'theta′', 'period'],\n parameters: [\n { name: 'g', dim: ACCELERATION },\n { name: 'ell', dim: LENGTH },\n ],\n dimensionlessInputs: ['theta0'],\n canonicalRefs: ['CE-pendulum-period'],\n }),\n model({\n id: 'model-chain',\n stateSpace: '(u_n, u_n′) ∈ ℝ^N × ℝ^N',\n dynamics: 'm u_n″ = κ(u_{n+1} − 2u_n + u_{n−1})',\n observables: ['u_n', 'u_n′', 'dispersion'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'kappa', dim: SPRING_CONSTANT },\n { name: 'a', dim: LENGTH },\n ],\n dimensionlessInputs: ['qa'],\n canonicalRefs: [],\n }),\n model({\n id: 'model-wave-1d',\n stateSpace: 'u(x, t), a field on ℝ × ℝ',\n dynamics: 'u_tt = c² u_xx',\n observables: ['u', 'u_t', 'dispersion'],\n parameters: [{ name: 'c', dim: VELOCITY }],\n dimensionlessInputs: [],\n canonicalRefs: ['CE-wave-speed'],\n }),\n model({\n id: 'model-cubic-spring',\n stateSpace: '(x, x′) ∈ ℝ²',\n dynamics: 'm x″ + k x + β x³ = 0',\n observables: ['x', 'x′', 'amplitude-dependent period'],\n parameters: [\n { name: 'm', dim: MASS },\n { name: 'k', dim: SPRING_CONSTANT },\n { name: 'beta', dim: CUBIC_STIFFNESS },\n { name: 'x0', dim: LENGTH },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n model({\n id: 'model-first-order',\n stateSpace: 'x ∈ ℝ',\n dynamics: 'b x′ + k x = 0',\n observables: ['x'],\n parameters: [\n { name: 'b', dim: DAMPING },\n { name: 'k', dim: SPRING_CONSTANT },\n ],\n dimensionlessInputs: [],\n canonicalRefs: [],\n }),\n];\n\nconst BY_ID: ReadonlyMap<string, AtlasModel> = new Map(ATLAS_MODELS.map((m) => [m.id, m]));\n\n/** Look up a model by id, throwing on an unknown one. @internal */\nexport function getAtlasModel(id: string): AtlasModel {\n const found = BY_ID.get(id);\n if (found === undefined) throw new Error(`unknown atlas model id: ${id}`);\n return found;\n}\n"]}
@@ -9,6 +9,8 @@
9
9
  * @module atlas/oscillators/pendulum-motion
10
10
  * @internal
11
11
  */
12
+ /** 2π: one period of the angle variable, the T0 = 1 time unit's ω0. @internal */
13
+ export declare const TWO_PI: number;
12
14
  /** ω0² at T0 = 1. @internal */
13
15
  export declare const W2: number;
14
16
  /** @internal */
@@ -16,8 +18,8 @@ export declare const pendulumAccel: (x: number) => number;
16
18
  /** @internal */
17
19
  export declare const linearAccel: (x: number) => number;
18
20
  /**
19
- * One fixed step of x″ = accel(x). MathTS `solveODESystem` with `dt` is the
20
- * classical RK4 step.
21
+ * One fixed step of x″ = accel(x): `integrateRK4` (MathTS `solveODESystem`
22
+ * with `dt`, the classical RK4 step) over one step of length `h`.
21
23
  *
22
24
  * @internal
23
25
  */
@@ -27,17 +29,38 @@ export declare function crossingTimes(accel: (x: number) => number, theta0: numb
27
29
  /** The phase at `t`, interpolated through the anchors (0, 0) and (c_k, π/2 + kπ). @internal */
28
30
  export declare function phaseAt(crossings: readonly number[], t: number): number;
29
31
  /**
30
- * θ0 in [0, π) whose exact relative period error is `eps`, by bisection on the
31
- * strictly increasing `pendulumPeriodErrorAt`.
32
+ * θ0 in [0, π) whose exact relative period error is `eps`, by MathTS
33
+ * `findRoot` (Brent) on the strictly increasing `pendulumPeriodErrorAt`.
34
+ *
35
+ * The residual is solved as `err/eps − 1`, of order 1, so `findRoot`'s one
36
+ * `tol` (it stops on the residual AND on the bracket width) cannot stop on a
37
+ * residual that is small only because `eps` is. The upper end is just below
38
+ * π, where the error is finite; at π it is `Infinity`, which Brent's
39
+ * interpolation cannot take.
32
40
  *
33
41
  * @returns NaN for a negative or non-finite `eps`.
34
42
  * @internal
35
43
  */
36
44
  export declare function theta0OfPeriodError(eps: number): number;
37
45
  /**
38
- * The nome q = exp(−π K′/K) of the modulus k = sin(θ0/2), with
39
- * K′/K = AGM(1, cos(θ0/2)) / AGM(1, sin(θ0/2)).
46
+ * The nome q = exp(−π K′/K) of the modulus k = sin(θ0/2): K = K(m) and
47
+ * K′ = K(1 − m) at the parameter m = k², both MathTS `ellipticK` (whose
48
+ * route is the AGM, so K′/K = AGM(1, cos(θ0/2)) / AGM(1, sin(θ0/2))).
40
49
  * @internal
41
50
  */
42
51
  export declare function pendulumNome(theta0: number): number;
52
+ /**
53
+ * The exact pendulum released from rest at `theta0`, in units of T0 = 1
54
+ * (ω0 = 2π): θ(t) = 2 asin(k sn(K − ω0 t, m)), with k = sin(θ0/2), the
55
+ * parameter m = k², and K = K(m) the quarter period in the sn argument, read
56
+ * from `pendulumPeriodErrorAt` as (π/2)(1 + ε) so one `ellipticK` read
57
+ * serves both. At t = 0, sn K = 1 and θ = θ0; the period is T = 4K/ω0 =
58
+ * (1 + ε) T0. MathTS `jacobiSN` is a plain number function of (u, m). A
59
+ * closed form, independent of every integrator: `tests/atlas/pendulum-exact.test.ts`
60
+ * checks it against the cn·dn identities (θ″ = −2ω0² k sn u dn u, sin θ =
61
+ * 2k sn u dn u) and against RK4.
62
+ *
63
+ * @internal
64
+ */
65
+ export declare function exactPendulumAngle(theta0: number, t: number): number;
43
66
  //# sourceMappingURL=pendulum-motion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pendulum-motion.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/pendulum-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,+BAA+B;AAC/B,eAAO,MAAM,EAAE,QAAqB,CAAC;AACrC,gBAAgB;AAChB,eAAO,MAAM,aAAa,MAAO,MAAM,KAAG,MAA2B,CAAC;AACtE,gBAAgB;AAChB,eAAO,MAAM,WAAW,MAAO,MAAM,KAAG,MAAiB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAIvG;AA4BD,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAY7H;AAED,+FAA+F;AAC/F,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAYvD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAInD"}
1
+ {"version":3,"file":"pendulum-motion.d.ts","sourceRoot":"","sources":["../../../src/atlas/oscillators/pendulum-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,iFAAiF;AACjF,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,+BAA+B;AAC/B,eAAO,MAAM,EAAE,QAAc,CAAC;AAC9B,gBAAgB;AAChB,eAAO,MAAM,aAAa,MAAO,MAAM,KAAG,MAA2B,CAAC;AACtE,gBAAgB;AAChB,eAAO,MAAM,WAAW,MAAO,MAAM,KAAG,MAAiB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAGvG;AAqBD,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAY7H;AAED,+FAA+F;AAC/F,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKpE"}
@@ -9,50 +9,46 @@
9
9
  * @module atlas/oscillators/pendulum-motion
10
10
  * @internal
11
11
  */
12
- import { solveODESystem } from '@danielsimonjr/mathts-functions';
13
- import { agm, pendulumPeriodErrorAt } from './bridges-limits.js';
12
+ import { ellipticK, findRoot, jacobiSN } from '@danielsimonjr/mathts-functions';
13
+ import { numberFrom } from '../../core/mathts-read.js';
14
+ import { integrateRK4 } from '../../numerical/null-ray-integrator.js';
15
+ import { pendulumPeriodErrorAt } from './bridges-limits.js';
16
+ /** 2π: one period of the angle variable, the T0 = 1 time unit's ω0. @internal */
17
+ export const TWO_PI = 2 * Math.PI;
14
18
  /** ω0² at T0 = 1. @internal */
15
- export const W2 = (2 * Math.PI) ** 2;
19
+ export const W2 = TWO_PI ** 2;
16
20
  /** @internal */
17
21
  export const pendulumAccel = (x) => -W2 * Math.sin(x);
18
22
  /** @internal */
19
23
  export const linearAccel = (x) => -W2 * x;
20
24
  /**
21
- * One fixed step of x″ = accel(x). MathTS `solveODESystem` with `dt` is the
22
- * classical RK4 step.
25
+ * One fixed step of x″ = accel(x): `integrateRK4` (MathTS `solveODESystem`
26
+ * with `dt`, the classical RK4 step) over one step of length `h`.
23
27
  *
24
28
  * @internal
25
29
  */
26
30
  export function rk4Step(x, v, h, accel) {
27
- const sol = solveODESystem((_t, y) => [y[1], accel(y[0])], [x, v], [0, h], { dt: h });
28
- const end = sol.y[sol.y.length - 1] ?? [x, v];
31
+ const end = integrateRK4((_t, y) => [y[1], accel(y[0])], [x, v], 0, h, 1);
29
32
  return [end[0], end[1]];
30
33
  }
31
34
  /**
32
35
  * The root in (0, h] of x(τ), the position one partial RK4 step of length τ
33
- * from (x, v), by the secant method from the bracket (0, x) and (h, nx).
36
+ * from (x, v), by MathTS `findRoot` (Brent) on the bracket (0, x), (h, nx).
34
37
  *
35
38
  * The crossing is then located to the integrator's own truncation error,
36
39
  * rather than to the O(h³) error of a straight line between the two steps.
37
40
  * That truncation error is nearly the same for the pendulum and the linear
38
41
  * oscillator at small θ0, so it cancels in their phase difference; the
39
- * interpolation error does not.
42
+ * interpolation error does not. `findRoot` evaluates both ends, and a step
43
+ * of length 0 is the start itself (`solveODESystem` cannot take `dt = 0`).
44
+ * Its `tol` stops on the residual (an angle) and on the bracket width (a
45
+ * time in T0), both at 1e-12, below the integrator's error either way.
40
46
  */
41
47
  function refineCrossing(x, v, nx, h, accel) {
42
- let a = 0;
43
- let fa = x;
44
- let b = h;
45
- let fb = nx;
46
- for (let k = 0; k < 50 && fb !== 0 && fb !== fa; k++) {
47
- const c = b - (fb * (b - a)) / (fb - fa);
48
- if (!(c >= -h && c <= 2 * h) || c === b)
49
- break;
50
- a = b;
51
- fa = fb;
52
- b = c;
53
- fb = rk4Step(x, v, c, accel)[0];
54
- }
55
- return b;
48
+ if (nx === 0)
49
+ return h;
50
+ const position = (tau) => (tau === 0 ? x : tau === h ? nx : rk4Step(x, v, tau, accel)[0]);
51
+ return findRoot(position, 0, h, { tol: 1e-12, maxIter: 200 });
56
52
  }
57
53
  /** Zero-crossing times of a release from rest at `theta0`, over `periods` of T0 = 1. @internal */
58
54
  export function crossingTimes(accel, theta0, stepsPerPeriod, periods) {
@@ -84,8 +80,14 @@ export function phaseAt(crossings, t) {
84
80
  return Number.NaN;
85
81
  }
86
82
  /**
87
- * θ0 in [0, π) whose exact relative period error is `eps`, by bisection on the
88
- * strictly increasing `pendulumPeriodErrorAt`.
83
+ * θ0 in [0, π) whose exact relative period error is `eps`, by MathTS
84
+ * `findRoot` (Brent) on the strictly increasing `pendulumPeriodErrorAt`.
85
+ *
86
+ * The residual is solved as `err/eps − 1`, of order 1, so `findRoot`'s one
87
+ * `tol` (it stops on the residual AND on the bracket width) cannot stop on a
88
+ * residual that is small only because `eps` is. The upper end is just below
89
+ * π, where the error is finite; at π it is `Infinity`, which Brent's
90
+ * interpolation cannot take.
89
91
  *
90
92
  * @returns NaN for a negative or non-finite `eps`.
91
93
  * @internal
@@ -95,28 +97,46 @@ export function theta0OfPeriodError(eps) {
95
97
  return Number.NaN;
96
98
  if (eps === 0)
97
99
  return 0;
98
- let lo = 0;
99
- let hi = Math.PI;
100
- for (let i = 0; i < 200 && hi - lo > 0; i++) {
101
- const mid = (lo + hi) / 2;
102
- if (mid === lo || mid === hi)
103
- break;
104
- if (pendulumPeriodErrorAt({ theta0: mid }) < eps)
105
- lo = mid;
106
- else
107
- hi = mid;
108
- }
109
- return (lo + hi) / 2;
100
+ const hi = Math.PI * (1 - Number.EPSILON);
101
+ if (pendulumPeriodErrorAt({ theta0: hi }) <= eps)
102
+ return hi;
103
+ return findRoot((theta0) => pendulumPeriodErrorAt({ theta0 }) / eps - 1, 0, hi, {
104
+ tol: 4 * Number.EPSILON,
105
+ maxIter: 200,
106
+ });
110
107
  }
111
108
  /**
112
- * The nome q = exp(−π K′/K) of the modulus k = sin(θ0/2), with
113
- * K′/K = AGM(1, cos(θ0/2)) / AGM(1, sin(θ0/2)).
109
+ * The nome q = exp(−π K′/K) of the modulus k = sin(θ0/2): K = K(m) and
110
+ * K′ = K(1 − m) at the parameter m = k², both MathTS `ellipticK` (whose
111
+ * route is the AGM, so K′/K = AGM(1, cos(θ0/2)) / AGM(1, sin(θ0/2))).
114
112
  * @internal
115
113
  */
116
114
  export function pendulumNome(theta0) {
117
115
  const k = Math.sin(Math.abs(theta0) / 2);
118
116
  if (k === 0)
119
117
  return 0;
120
- return Math.exp((-Math.PI * agm(1, Math.cos(theta0 / 2))) / agm(1, k));
118
+ const K = numberFrom('ellipticK', ellipticK(k * k));
119
+ const Kp = numberFrom('ellipticK', ellipticK(Math.cos(theta0 / 2) ** 2));
120
+ return Math.exp((-Math.PI * Kp) / K);
121
+ }
122
+ /**
123
+ * The exact pendulum released from rest at `theta0`, in units of T0 = 1
124
+ * (ω0 = 2π): θ(t) = 2 asin(k sn(K − ω0 t, m)), with k = sin(θ0/2), the
125
+ * parameter m = k², and K = K(m) the quarter period in the sn argument, read
126
+ * from `pendulumPeriodErrorAt` as (π/2)(1 + ε) so one `ellipticK` read
127
+ * serves both. At t = 0, sn K = 1 and θ = θ0; the period is T = 4K/ω0 =
128
+ * (1 + ε) T0. MathTS `jacobiSN` is a plain number function of (u, m). A
129
+ * closed form, independent of every integrator: `tests/atlas/pendulum-exact.test.ts`
130
+ * checks it against the cn·dn identities (θ″ = −2ω0² k sn u dn u, sin θ =
131
+ * 2k sn u dn u) and against RK4.
132
+ *
133
+ * @internal
134
+ */
135
+ export function exactPendulumAngle(theta0, t) {
136
+ const k = Math.sin(theta0 / 2);
137
+ if (k === 0)
138
+ return 0;
139
+ const K = (Math.PI / 2) * (1 + pendulumPeriodErrorAt({ theta0 }));
140
+ return 2 * Math.asin(k * jacobiSN(K - TWO_PI * t, k * k));
121
141
  }
122
142
  //# sourceMappingURL=pendulum-motion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pendulum-motion.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/pendulum-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACrC,gBAAgB;AAChB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtE,gBAAgB;AAChB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAA4B;IACnF,MAAM,GAAG,GAAG,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACxF,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GA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AAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC","sourcesContent":["/**\n * The pendulum and its linear oscillator, integrated and read off, for the\n * witnesses of `ab-pendulum-linear`'s declared translations. Time is in units\n * of T0 (ω0 = 2π); both motions are released from rest at θ0.\n *\n * Also the closed forms those translations are built from: θ0 recovered from\n * the bound's ε, and the nome q of the pendulum's elliptic modulus.\n *\n * @module atlas/oscillators/pendulum-motion\n * @internal\n */\n\nimport { solveODESystem } from '@danielsimonjr/mathts-functions';\nimport { agm, pendulumPeriodErrorAt } from './bridges-limits.js';\n\n/** ω0² at T0 = 1. @internal */\nexport const W2 = (2 * Math.PI) ** 2;\n/** @internal */\nexport const pendulumAccel = (x: number): number => -W2 * Math.sin(x);\n/** @internal */\nexport const linearAccel = (x: number): number => -W2 * x;\n\n/**\n * One fixed step of x″ = accel(x). MathTS `solveODESystem` with `dt` is the\n * classical RK4 step.\n *\n * @internal\n */\nexport function rk4Step(x: number, v: number, h: number, accel: (x: number) => number): [number, number] {\n const sol = solveODESystem((_t, y) => [y[1]!, accel(y[0]!)], [x, v], [0, h], { dt: h });\n const end = sol.y[sol.y.length - 1] ?? [x, v];\n return [end[0]!, end[1]!];\n}\n\n/**\n * The root in (0, h] of x(τ), the position one partial RK4 step of length τ\n * from (x, v), by the secant method from the bracket (0, x) and (h, nx).\n *\n * The crossing is then located to the integrator's own truncation error,\n * rather than to the O(h³) error of a straight line between the two steps.\n * That truncation error is nearly the same for the pendulum and the linear\n * oscillator at small θ0, so it cancels in their phase difference; the\n * interpolation error does not.\n */\nfunction refineCrossing(x: number, v: number, nx: number, h: number, accel: (x: number) => number): number {\n let a = 0;\n let fa = x;\n let b = h;\n let fb = nx;\n for (let k = 0; k < 50 && fb !== 0 && fb !== fa; k++) {\n const c = b - (fb * (b - a)) / (fb - fa);\n if (!(c >= -h && c <= 2 * h) || c === b) break;\n a = b;\n fa = fb;\n b = c;\n fb = rk4Step(x, v, c, accel)[0];\n }\n return b;\n}\n\n/** Zero-crossing times of a release from rest at `theta0`, over `periods` of T0 = 1. @internal */\nexport function crossingTimes(accel: (x: number) => number, theta0: number, stepsPerPeriod: number, periods: number): number[] {\n const h = 1 / stepsPerPeriod;\n const out: number[] = [];\n let x = theta0;\n let v = 0;\n for (let i = 0; i < stepsPerPeriod * periods; i++) {\n const [nx, nv] = rk4Step(x, v, h, accel);\n if (nx === 0 || x > 0 !== nx > 0) out.push(i * h + refineCrossing(x, v, nx, h, accel));\n x = nx;\n v = nv;\n }\n return out;\n}\n\n/** The phase at `t`, interpolated through the anchors (0, 0) and (c_k, π/2 + kπ). @internal */\nexport function phaseAt(crossings: readonly number[], t: number): number {\n let prevT = 0;\n let prevPhase = 0;\n for (let k = 0; k < crossings.length; k++) {\n const c = crossings[k]!;\n const phase = Math.PI / 2 + k * Math.PI;\n if (t <= c) return prevPhase + ((phase - prevPhase) * (t - prevT)) / (c - prevT);\n prevT = c;\n prevPhase = phase;\n }\n return Number.NaN;\n}\n\n/**\n * θ0 in [0, π) whose exact relative period error is `eps`, by bisection on the\n * strictly increasing `pendulumPeriodErrorAt`.\n *\n * @returns NaN for a negative or non-finite `eps`.\n * @internal\n */\nexport function theta0OfPeriodError(eps: number): number {\n if (!Number.isFinite(eps) || eps < 0) return Number.NaN;\n if (eps === 0) return 0;\n let lo = 0;\n let hi = Math.PI;\n for (let i = 0; i < 200 && hi - lo > 0; i++) {\n const mid = (lo + hi) / 2;\n if (mid === lo || mid === hi) break;\n if (pendulumPeriodErrorAt({ theta0: mid }) < eps) lo = mid;\n else hi = mid;\n }\n return (lo + hi) / 2;\n}\n\n/**\n * The nome q = exp(−π K′/K) of the modulus k = sin(θ0/2), with\n * K′/K = AGM(1, cos(θ0/2)) / AGM(1, sin(θ0/2)).\n * @internal\n */\nexport function pendulumNome(theta0: number): number {\n const k = Math.sin(Math.abs(theta0) / 2);\n if (k === 0) return 0;\n return Math.exp((-Math.PI * agm(1, Math.cos(theta0 / 2))) / agm(1, k));\n}\n"]}
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AAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * The pendulum and its linear oscillator, integrated and read off, for the\n * witnesses of `ab-pendulum-linear`'s declared translations. Time is in units\n * of T0 (ω0 = 2π); both motions are released from rest at θ0.\n *\n * Also the closed forms those translations are built from: θ0 recovered from\n * the bound's ε, and the nome q of the pendulum's elliptic modulus.\n *\n * @module atlas/oscillators/pendulum-motion\n * @internal\n */\n\nimport { ellipticK, findRoot, jacobiSN } from '@danielsimonjr/mathts-functions';\nimport { numberFrom } from '../../core/mathts-read.js';\nimport { integrateRK4 } from '../../numerical/null-ray-integrator.js';\nimport { pendulumPeriodErrorAt } from './bridges-limits.js';\n\n/** 2π: one period of the angle variable, the T0 = 1 time unit's ω0. @internal */\nexport const TWO_PI = 2 * Math.PI;\n/** ω0² at T0 = 1. @internal */\nexport const W2 = TWO_PI ** 2;\n/** @internal */\nexport const pendulumAccel = (x: number): number => -W2 * Math.sin(x);\n/** @internal */\nexport const linearAccel = (x: number): number => -W2 * x;\n\n/**\n * One fixed step of x″ = accel(x): `integrateRK4` (MathTS `solveODESystem`\n * with `dt`, the classical RK4 step) over one step of length `h`.\n *\n * @internal\n */\nexport function rk4Step(x: number, v: number, h: number, accel: (x: number) => number): [number, number] {\n const end = integrateRK4((_t, y) => [y[1]!, accel(y[0]!)], [x, v], 0, h, 1);\n return [end[0]!, end[1]!];\n}\n\n/**\n * The root in (0, h] of x(τ), the position one partial RK4 step of length τ\n * from (x, v), by MathTS `findRoot` (Brent) on the bracket (0, x), (h, nx).\n *\n * The crossing is then located to the integrator's own truncation error,\n * rather than to the O(h³) error of a straight line between the two steps.\n * That truncation error is nearly the same for the pendulum and the linear\n * oscillator at small θ0, so it cancels in their phase difference; the\n * interpolation error does not. `findRoot` evaluates both ends, and a step\n * of length 0 is the start itself (`solveODESystem` cannot take `dt = 0`).\n * Its `tol` stops on the residual (an angle) and on the bracket width (a\n * time in T0), both at 1e-12, below the integrator's error either way.\n */\nfunction refineCrossing(x: number, v: number, nx: number, h: number, accel: (x: number) => number): number {\n if (nx === 0) return h;\n const position = (tau: number): number => (tau === 0 ? x : tau === h ? nx : rk4Step(x, v, tau, accel)[0]);\n return findRoot(position, 0, h, { tol: 1e-12, maxIter: 200 });\n}\n\n/** Zero-crossing times of a release from rest at `theta0`, over `periods` of T0 = 1. @internal */\nexport function crossingTimes(accel: (x: number) => number, theta0: number, stepsPerPeriod: number, periods: number): number[] {\n const h = 1 / stepsPerPeriod;\n const out: number[] = [];\n let x = theta0;\n let v = 0;\n for (let i = 0; i < stepsPerPeriod * periods; i++) {\n const [nx, nv] = rk4Step(x, v, h, accel);\n if (nx === 0 || x > 0 !== nx > 0) out.push(i * h + refineCrossing(x, v, nx, h, accel));\n x = nx;\n v = nv;\n }\n return out;\n}\n\n/** The phase at `t`, interpolated through the anchors (0, 0) and (c_k, π/2 + kπ). @internal */\nexport function phaseAt(crossings: readonly number[], t: number): number {\n let prevT = 0;\n let prevPhase = 0;\n for (let k = 0; k < crossings.length; k++) {\n const c = crossings[k]!;\n const phase = Math.PI / 2 + k * Math.PI;\n if (t <= c) return prevPhase + ((phase - prevPhase) * (t - prevT)) / (c - prevT);\n prevT = c;\n prevPhase = phase;\n }\n return Number.NaN;\n}\n\n/**\n * θ0 in [0, π) whose exact relative period error is `eps`, by MathTS\n * `findRoot` (Brent) on the strictly increasing `pendulumPeriodErrorAt`.\n *\n * The residual is solved as `err/eps − 1`, of order 1, so `findRoot`'s one\n * `tol` (it stops on the residual AND on the bracket width) cannot stop on a\n * residual that is small only because `eps` is. The upper end is just below\n * π, where the error is finite; at π it is `Infinity`, which Brent's\n * interpolation cannot take.\n *\n * @returns NaN for a negative or non-finite `eps`.\n * @internal\n */\nexport function theta0OfPeriodError(eps: number): number {\n if (!Number.isFinite(eps) || eps < 0) return Number.NaN;\n if (eps === 0) return 0;\n const hi = Math.PI * (1 - Number.EPSILON);\n if (pendulumPeriodErrorAt({ theta0: hi }) <= eps) return hi;\n return findRoot((theta0) => pendulumPeriodErrorAt({ theta0 }) / eps - 1, 0, hi, {\n tol: 4 * Number.EPSILON,\n maxIter: 200,\n });\n}\n\n/**\n * The nome q = exp(−π K′/K) of the modulus k = sin(θ0/2): K = K(m) and\n * K′ = K(1 − m) at the parameter m = k², both MathTS `ellipticK` (whose\n * route is the AGM, so K′/K = AGM(1, cos(θ0/2)) / AGM(1, sin(θ0/2))).\n * @internal\n */\nexport function pendulumNome(theta0: number): number {\n const k = Math.sin(Math.abs(theta0) / 2);\n if (k === 0) return 0;\n const K = numberFrom('ellipticK', ellipticK(k * k));\n const Kp = numberFrom('ellipticK', ellipticK(Math.cos(theta0 / 2) ** 2));\n return Math.exp((-Math.PI * Kp) / K);\n}\n\n/**\n * The exact pendulum released from rest at `theta0`, in units of T0 = 1\n * (ω0 = 2π): θ(t) = 2 asin(k sn(K − ω0 t, m)), with k = sin(θ0/2), the\n * parameter m = k², and K = K(m) the quarter period in the sn argument, read\n * from `pendulumPeriodErrorAt` as (π/2)(1 + ε) so one `ellipticK` read\n * serves both. At t = 0, sn K = 1 and θ = θ0; the period is T = 4K/ω0 =\n * (1 + ε) T0. MathTS `jacobiSN` is a plain number function of (u, m). A\n * closed form, independent of every integrator: `tests/atlas/pendulum-exact.test.ts`\n * checks it against the cn·dn identities (θ″ = −2ω0² k sn u dn u, sin θ =\n * 2k sn u dn u) and against RK4.\n *\n * @internal\n */\nexport function exactPendulumAngle(theta0: number, t: number): number {\n const k = Math.sin(theta0 / 2);\n if (k === 0) return 0;\n const K = (Math.PI / 2) * (1 + pendulumPeriodErrorAt({ theta0 }));\n return 2 * Math.asin(k * jacobiSN(K - TWO_PI * t, k * k));\n}\n"]}