Dimensional analysis of a formula: MathS.Dimensions.Of and DimensionlessGroups
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Review the design points in the issue, then inspect the proposed implementation in Functions/Dimensions/* and Convenience/MathS.Dimensions.cs, along with Tests/UnitTests/Convenience/DimensionsTest.cs. Run the listed unit tests and compare their coverage with the stated consistency, inconsistency, and undetermined cases; the issue says a pull request will follow once the design is accepted.
索引モデルが issue の本文から書いたものです。
説明
What it is. Given the dimension of each variable (a map Variable → Dimension over the seven SI base dimensions, with rational exponents), say whether a formula is physically meaningful, what dimension it has, and where it stops making sense; and give the Buckingham π groups of a set of variables.
var (L, T) = (Dimension.Length, Dimension.Time);
var dims = new Dictionary<Entity.Variable, Dimension> { ["g"] = L / T.Pow(2), ["h"] = L, ["t"] = T };
MathS.Dimensions.Of("sqrt(2 g h)", dims); // Consistent: L T^-1
MathS.Dimensions.Of("h + g t", dims); // Inconsistent at h + g * t: h has dimension L and g * t has dimension L T^-1, ...
// pipe: rho M L^-3, v L T^-1, d L, mu M L^-1 T^-1
MathS.Dimensions.DimensionlessGroups(new Entity.Variable[] { "rho", "v", "d", "mu" }, pipe); // [ mu / (rho * v * d) ]
Why here. Units libraries (UnitsNet) check values; nothing in .NET checks a formula. The walk needs every node type, which the kernel has.
Design points to agree on.
- The dimension map is passed, not attached to variables, so nothing about printing, parsing or simplification changes, and the type layer of #1237 / #1019 is not pre-empted.
- Three-valued:
Consistent,Inconsistent(with the subexpression and a reason),Undetermined(undeclared variable, unread node, dimensional base to a symbolic power). Never a guess. - Nothing is simplified first:
sin(x) - sin(x)withxa length is inconsistent. - A literal
0oroofits any dimension where added or compared (v = 0). - Exponents of a dimensional base must be rational;
L^piis inconsistent.
Packaging (Packaging.md §4). No clause fires: no dependency, no floor raise, no data, composes the kernel; not on any default path, so (B) does not apply. → kernel. A UnitsNet bridge would be (D) and separate; not part of this.
Implementation, for judging the design against working code. Branch feat/dimensional-analysis, one commit on master 87a0eff: Functions/Dimensions/*, Convenience/MathS.Dimensions.cs, Tests/UnitTests/Convenience/DimensionsTest.cs (38 cases), +54 lines of PublicApi.txt. UnitTests 18335 passed / 13 skipped, FSharpWrapperUnitTests 134 passed. No existing answer moves, so no BREAKING-CHANGES entry. The pull request will follow Accepted.
Worked use, together with the shader-source feature (#2293). A water wave from ω² = g k tanh(k h): the check gives ω the dimension T⁻¹ and rejects the shallow-water typo ω = √(g k h) inside the phase; the π groups are k A, k h and g k t².
Milestone: 2.7.0 (additive).
- 主要言語
- C#
- スター
- 831
- フォーク
- 79
- 平均マージ
- 1時間 12分
- マージ済み PR(30日)
- 518
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ASC-Community/AngouriMath のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ASC-Community/AngouriMath#2220 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Opinions wanted
難易度 4/5 1週間以上 初心者へのやさしさ 15/100
ASC-Community/AngouriMath#2319 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
ASC-Community/AngouriMath#2298 ·
メンテナーはふだん 1 日以内に返信
-
The kernel under WebAssembly: 1.26 MB Brotli over the bare runtime, and 0.2 s to the first Simplifyオープン
難易度 3/5 半日 初心者へのやさしさ 48/100
ASC-Community/AngouriMath#2296 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ASC-Community/AngouriMath#2293 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
ASC-Community/AngouriMath の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 3 日以内に返信
-
enhancement P3 performance
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
thomhurst/TUnit#7380 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
documentation trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PCL-Community/PCL-CE#3767 ·
メンテナーはふだん 1 日以内に返信