universal-physics-tensor 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/bin/upt.mjs +13 -1
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +371 -228
- package/data/bridge-catalog.schema.json +45 -7
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +15 -7
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +25 -24
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +25 -24
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.d.ts +3 -3
- package/dist/cases/brownian-sphere.d.ts.map +1 -1
- package/dist/cases/brownian-sphere.js +6 -5
- package/dist/cases/brownian-sphere.js.map +1 -1
- package/dist/cases/damped-resonator.d.ts.map +1 -1
- package/dist/cases/damped-resonator.js +6 -9
- package/dist/cases/damped-resonator.js.map +1 -1
- package/dist/cases/kepler-rv.d.ts +1 -1
- package/dist/cases/kepler-rv.d.ts.map +1 -1
- package/dist/cases/kepler-rv.js +3 -2
- package/dist/cases/kepler-rv.js.map +1 -1
- package/dist/cases/lumped-cooling.d.ts +8 -3
- package/dist/cases/lumped-cooling.d.ts.map +1 -1
- package/dist/cases/lumped-cooling.js +21 -23
- package/dist/cases/lumped-cooling.js.map +1 -1
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/resistor-noise.js +4 -4
- package/dist/cases/resistor-noise.js.map +1 -1
- package/dist/cases/skin-depth.d.ts +0 -4
- package/dist/cases/skin-depth.d.ts.map +1 -1
- package/dist/cases/skin-depth.js +3 -7
- package/dist/cases/skin-depth.js.map +1 -1
- package/dist/cli/args.d.ts +23 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +8 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +8 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +6 -2
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +65 -37
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +2 -1
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +1 -0
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +75 -5
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +18 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +20 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +0 -7
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +7 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +34 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +28 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +1 -1
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +9 -36
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/discovery.d.ts +56 -0
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +114 -60
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +2 -11
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +16 -0
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +15 -20
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +4 -3
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +4 -3
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +4 -2
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +20 -9
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +17 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +5 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +6 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +27 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +53 -30
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +24 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +10 -4
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +255 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +7 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +6 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +9 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +236 -181
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +17 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +32 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +41 -10
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +100 -55
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +23 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +2 -1
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +2 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +30 -30
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +47 -30
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +0 -17
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +8 -8
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.js +2 -2
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +8 -10
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dimension constants the oscillator pilot needs
|
|
3
|
-
* files declare MODULE-LOCAL and do not export.
|
|
2
|
+
* Dimension constants the oscillator pilot needs.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
16
|
-
export
|
|
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
|
|
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
|
|
3
|
-
* files declare MODULE-LOCAL and do not export.
|
|
2
|
+
* Dimension constants the oscillator pilot needs.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
16
|
-
export
|
|
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
|
|
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
|
|
7
|
-
* `solveODESystem`
|
|
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,
|
|
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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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
|
|
7
|
-
* `solveODESystem`
|
|
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 {
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
109
|
-
|
|
110
|
-
|
|
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":"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AC,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,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;IAC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AC,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;
|
|
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 {
|
|
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,
|
|
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,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,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,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,6E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C,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)
|
|
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
|
|
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)
|
|
39
|
-
* K
|
|
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;
|
|
1
|
+
{"version":3,"file":"pendulum-motion.d.ts","sourceRoot":"","sources":["../../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
|
+
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 =
|
|
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)
|
|
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
|
|
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
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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)
|
|
113
|
-
* K
|
|
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
|
-
|
|
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;AAE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,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE;YAAE,MAAM;QACpC,IAAI,qBAAqB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG;YAAE,EAAE,GAAG,GAAG,CAAC;;YACtD,EAAE,GAAG,GAAG,CAAC;IAChB,CAAC;IACD,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,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"]}
|
|
1
|
+
{"version":3,"file":"pendulum-motion.js","sourceRoot":"","sources":["../../../src/atlas/oscillators/pendulum-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAClC,+BA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,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,CAAS;IAC1D,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,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"]}
|