新增test_mql结果对齐工具

This commit is contained in:
huojiarong committed 2026-07-15 09:40:07 +00:00
1 parent 796433c275
commit 1f47171d07
3 files changed
+373 -3

No files matched your search

+11 -3
View File
@@ -55,6 +55,14 @@
- `tests/test_amesim_results.py`
- 保护 `test_mql_.results` 的时间轴、变量数量、Data_Path 映射和典型样本值。
- `PythonModels/reporting/test_mql_comparison.py`
- 提供 `test_mql` 专用的 AMESim/Python 时序对齐工具。
- 按 AMESim `Data_Path` 做时间插值、最大绝对误差、平均绝对误差、最大相对误差和终值误差统计。
- 可导出 `test_mql_amesim_baseline.csv` 和 `test_mql_amesim_comparison.csv`,供后续组件方程校验使用。
- `tests/test_test_mql_comparison.py`
- 保护 AMESim 原始序列零误差对齐、粗时间步插值、偏移误差统计、缺失变量报错和 CSV 输出。
## 物性约定
AMESim 模型中 `test_mql` 使用氦气,Python 侧当前通过 `HELIUM_PR` 使用 Peng-Robinson 状态方程计算气体压缩因子和密度。当前物性层先覆盖状态方程相关量,完整焓/内能偏差函数后续在接气室能量方程时再补。
@@ -101,12 +109,12 @@ AMESim 模型中 `test_mql` 使用氦气,Python 侧当前通过 `HELIUM_PR`
## 验证方式
```bash
python3 -m py_compile PythonModels/components/amesim_pneumatic.py PythonModels/core/peng_robinson.py PythonModels/reporting/amesim_results.py PythonModels/systems/test_mql.py PythonModels/systems/test_mql_config.py PythonModels/scripts/run_test_mql.py
python3 -m py_compile PythonModels/components/amesim_pneumatic.py PythonModels/core/peng_robinson.py PythonModels/reporting/amesim_results.py PythonModels/reporting/test_mql_comparison.py PythonModels/systems/test_mql.py PythonModels/systems/test_mql_config.py PythonModels/scripts/run_test_mql.py
python3 -m PythonModels.scripts.run_test_mql
python3 -m unittest discover -s tests -t .
```
当前测试覆盖的是结构、配置解析、气动原语和 AMESim 结果读取,不代表已经完成 AMESim 物理结果复刻。
当前测试覆盖的是结构、配置解析、气动原语、AMESim 结果读取和 AMESim/Python 时序对齐工具,不代表已经完成 AMESim 物理结果复刻。
## 后续方向
@@ -114,6 +122,6 @@ python3 -m unittest discover -s tests -t .
1. `PNGD00`:气体属性。
2. `PNCH023 / PNCH012`:固定气室和变容气室。
3. `PNOR001 / PNVO001`:固定孔口和可变孔口。
3. `PNOR001 / PNVO001`:固定孔口和可变孔口。每完成一项后用 `test_mql_comparison.py` 按 `Data_Path` 对齐 AMESim 结果。
4. `PNL0001 / PNL0002 / PNL0003 / PNL00R`:管路阻容连接。
5. `PNRP17 / MECMAS21 / LSTP00A / LMECHN1`:气动活塞、机械负载和端止动。