测量平差矩阵计算器 — 像卡西欧计算器一样流畅的矩阵运算体验
| Module | 模块 | Description | 描述 |
|---|---|
| Matrix Manager 矩阵管理 | 10 named slots (A–J), memory tracking (500MB limit), TXT import, template generation, crash recovery via auto-save 10个命名槽位(A–J)、500MB内存监控、TXT导入、模板生成、崩溃自动恢复 |
| Expression Calculator 矩阵运算 | Free-form expression input: A*inv(P)*T(A). Supports + - * inv() T() det() rank(). Hover preview of matrix contents. Chain results into new matrices.自由表达式输入,支持连续运算和函数调用,悬浮预览矩阵内容,结果链式存储 |
| Parametric Adjustment 间接平差 | V = AX − L → X̂ = (AᵀPA)⁻¹AᵀPL Outputs: X, V, L̂, σ₀, Qxx, parameter σ, error ellipse (φ/E/F) |
| Conditional Adjustment 条件平差 | AV + W = 0 → AQAᵀ·K + W = 0 Outputs: K, V, σ₀, Qvv, correction σ |
| Conditional w/ Parameters 附有参数的条件平差 | AV + BδX̂ + W = 0 → [AQAᵀ B; Bᵀ 0]·[K; δX̂] = [−W; 0] Outputs: K, δX̂, V, σ₀, Qxx, parameter σ |
| Operation | Syntax | Example |
|---|---|---|
| Add | + |
A + B |
| Subtract | - |
A - B |
| Multiply | * |
A * B |
| Inverse | inv(X) |
inv(A) |
| Transpose | T(X) |
T(A) |
| Determinant | det(X) |
det(A) |
| Rank | rank(X) |
rank(A) |
| Group | ( ) |
(A + B) * inv(C) |
Example: A * inv(P) * T(A) → computes A × P⁻¹ × Aᵀ
git clone https://github.com/Lazyend05/AdjustMatrix.git
cd AdjustMatrix
pip install -r requirements.txt
python main.pyDownload AdjustMatrix.exe from Releases. Double-click to run. No Python required. (~68 MB, bundles numpy + scipy)
下载 AdjustMatrix.exe,双击运行。无需安装 Python。
- Matrix Manager tab: Click
生成to create a template, edit values, click保存 - Expression tab: Type e.g.
A * inv(P) * T(A), pressEnter - Adjustment tabs: Enter design matrix / observation vector / weight matrix, click
计算 - All results auto-saved to
cache_*/folder for crash recovery
# Decimal | 小数
1.0 2.5 -3.0
4.2 0.0 1.5
# Fraction | 分数 (exact rational parsing)
1/3 2/7 0
1/2 1 0
# Import from TXT | 从TXT导入
Click [导入txt] to load from file
Error equation: V = AX − L
Normal equation: AᵀPA · X̂ = AᵀPL
Solution: X̂ = (AᵀPA)⁻¹ AᵀPL
σ₀² = VᵀPV / (n − t)
Outputs: parameter estimates, residuals, adjusted observations, cofactor matrix, error ellipse
Condition: AV + W = 0
Normal: AQAᵀ · K + W = 0 (Q = P⁻¹)
Corrections: V = QAᵀK
σ₀² = VᵀPV / r
Condition: AV + BδX̂ + W = 0
System: [AQAᵀ B ] [ K ] [ −W ]
[ Bᵀ 0 ] [δX̂] = [ 0 ]
σ₀² = VᵀPV / (c − u) (c = conditions, u = parameters)
Qxx = (Bᵀ Naa⁻¹ B)⁻¹
AdjustMatrix/
├── main.py # Entry point | 入口
├── core.py # MatrixStore, parser, utilities | 核心逻辑
├── gui.py # Tkinter GUI | 图形界面
├── requirements.txt # numpy, scipy
├── test_adjustment.py # Unit tests for all 3 adjustment models | 自检测试
├── dist/
│ └── AdjustMatrix.exe # Standalone executable | 免安装版
└── cache_*/ # Auto-saved matrices & results | 自动缓存
| Component | Library |
|---|---|
| Matrix ops | NumPy, SciPy |
| GUI | Tkinter (stdlib) |
| Expr parser | Regex + safe eval |
| Packaging | PyInstaller |
| Exact input | fractions.Fraction |
If you find this useful, please ⭐ star this repo!
MIT — free to use, modify, and distribute.