Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python License Platform

🔢 AdjustMatrix

Surveying Adjustment Matrix Calculator

测量平差矩阵计算器 — 像卡西欧计算器一样流畅的矩阵运算体验


✨ Features | 功能

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 σ

🧮 Expression Syntax | 表达式语法

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ᵀ


📥 Installation | 安装

From Source | 源码运行

git clone https://github.com/Lazyend05/AdjustMatrix.git
cd AdjustMatrix
pip install -r requirements.txt
python main.py

Pre-built EXE | 免安装版

Download AdjustMatrix.exe from Releases. Double-click to run. No Python required. (~68 MB, bundles numpy + scipy)

下载 AdjustMatrix.exe,双击运行。无需安装 Python。


🚀 Quick Start | 快速上手

  1. Matrix Manager tab: Click 生成 to create a template, edit values, click 保存
  2. Expression tab: Type e.g. A * inv(P) * T(A), press Enter
  3. Adjustment tabs: Enter design matrix / observation vector / weight matrix, click 计算
  4. All results auto-saved to cache_*/ folder for crash recovery

Input Formats | 输入格式

# 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

📐 Adjustment Math | 平差数学

Indirect | 间接平差

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

Conditional | 条件平差

Condition:        AV + W = 0
Normal:           AQAᵀ · K + W = 0   (Q = P⁻¹)
Corrections:      V = QAᵀK
σ₀² = VᵀPV / r

Conditional w/ Parameters | 附有参数的条件平差

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)⁻¹

📁 Project Structure | 项目结构

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 | 自动缓存

🛠 Tech Stack | 技术栈

Component Library
Matrix ops NumPy, SciPy
GUI Tkinter (stdlib)
Expr parser Regex + safe eval
Packaging PyInstaller
Exact input fractions.Fraction

🌟 Star History

If you find this useful, please ⭐ star this repo!

Star History Chart


📝 License

MIT — free to use, modify, and distribute.

About

Surveying Adjustment Matrix Calculator | 测量平差矩阵计算器

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages