Official PyTorch implementation and reproducibility package for:
High-Precision Standstill Flux Linkage Identification for Synchronous Reluctance Motors Based on Gradient Projection and Implicit Inductance Modeling
The repository provides the compact implicit-secant-inductance network, the multi-physics loss implementation, pairwise PCGrad, processed standstill hysteresis-injection datasets, simulation error datasets, external benchmark caches, representative checkpoints, and scripts used for the main experiments.
The manuscript is under review. A DOI, volume, issue, and page range have not been assigned.
The proposed model combines:
- an implicit secant-inductance architecture that enforces zero-flux and current-parity properties by construction;
- data fitting with Maxwell reciprocity and discrete d/q voltage-equation residuals;
- pairwise Projecting Conflicting Gradients (PCGrad) across the nonzero weighted objectives;
- complete-cycle standstill data windows and early stopping based on the learning-rate threshold.
The common paper setting is:
| Item | Value |
|---|---|
| Hidden layers | [6, 4] |
| Batch size | 128 |
| Maximum epochs | 1000 |
| Initial learning rate | 1e-2 |
| Early-stop learning rate | 1e-5 |
| MSE weight | 1.0 |
| Reciprocity weight | 0.5 |
| PDE weight | 0.1 |
| PCGrad mode | pairwise |
Included:
- processed experimental training CSV files used in the paper;
filtered_gt_cache.npz, the constant-speed external benchmark used only for evaluation;- processed simulation error datasets and
simulation_gt_cache.npz; - representative seed-21 checkpoints for the principal and plotted models;
- final numerical tables and selected SVG figures;
- scripts for the main multi-seed, ablation, dataset, error-propagation, and architecture studies.
Not included:
- original hardware acquisition records;
- the separate torque/rotor-angle diagnostic record;
- DSP control source code or compiled artifacts;
- Simulink models and generated files;
- manuscript drafts, reviewer correspondence, and internal revision reports;
- all repeated-run checkpoints and epoch-by-epoch logs.
See docs/DATA.md for the exact data boundary.
Python 3.11 is the reference environment. CPU and CUDA execution are both supported.
git clone https://github.com/KrisCCeng/SynRM-PINN.git
cd SynRM-PINN
python -m venv .venvWindows PowerShell:
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txtLinux/macOS:
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txtPyTorch selects CUDA when an available CUDA build and GPU are detected; otherwise the code runs on CPU.
python scripts/validate_release.py
python -m unittest discover -s testsThe validator checks benchmark shapes, processed CSV schemas and finite values, representative checkpoint metadata, and the absence of restricted hardware or Simulink assets.
python evaluate.py --config configs/evaluate_pretrained.yamlThis evaluates the ANN, SCN, proposed PINN, analytical flux-current model, and direct third-order polynomial model on the same external 40 x 40 benchmark. Metrics and plots are written under:
outputs/pretrained/D130-Q100-D110Q200-2C/evaluation_results/
python train.py --config configs/pinn.yaml
python evaluate.py --config configs/pinn.yamlpython train.py --config configs/smoke.yaml
python evaluate.py --config configs/smoke.yaml --no-generate_plots --no-include_baselinesThe smoke configuration runs only three epochs and is not a paper result.
The commands below generate YAML files under outputs/generated_configs/,
models/logs under outputs/runs/, and regenerated summaries under
results/generated/. These generated directories are intentionally ignored by
Git.
# Main experimental benchmark, initial scans, ablations, and seed-21 checks
python scripts/run_experimental_studies.py --phase all
# Three-seed independent physics-weight sensitivity
python scripts/run_independent_weight_multiseed.py
# Three-seed 3 x 3 local interaction study
python scripts/run_local_weight_robustness.py
# Three-seed complete-cycle, voltage-replacement, and multi-window comparisons
python scripts/run_dataset_multiseed.py
# Simulation error propagation and clean-data architecture checks
python scripts/run_simulation_error_propagation.py
# Five paired seeds on C2_medium and experimental data for five architectures
python scripts/run_practical_network_size_multiseed.py
# Representative benchmark error maps from released checkpoints
python scripts/generate_representative_error_heatmaps.pyThe complete matrix contains many training runs. It is not necessary to rerun
the matrix to inspect the reported values; final tables and figures are already
provided in results/. See
docs/REPRODUCIBILITY.md for the experiment-to-file
mapping and expected compute behavior.
SynRM-PINN/
|-- configs/ # Final, pretrained-evaluation, and smoke YAML files
|-- data/
| |-- processed/ # Processed experimental datasets and benchmark
| `-- simulation/ # Processed simulation error datasets and benchmark
|-- docs/ # Data and reproducibility documentation
|-- outputs/
| `-- pretrained/ # Representative checkpoints only
|-- results/ # Final tables and selected vector figures
|-- scripts/ # Validation and experiment runners
|-- src/ # Models, losses, PCGrad, data loading, visualization
|-- tests/ # Focused PCGrad behavior tests
|-- train.py
`-- evaluate.py
On the external constant-speed benchmark, the proposed [6,4] PINN obtains a
three-seed average MAE of 0.01248 +/- 0.00254 Wb. This benchmark is excluded
from gradient training and is used only for evaluation. Numerical tables are
listed in results/README.md.
The paper has not yet received its final bibliographic metadata. Until then, use the following provisional entry and update the journal fields after publication:
@article{Ye2026SynRMPINN,
title = {High-Precision Standstill Flux Linkage Identification for
Synchronous Reluctance Motors Based on Gradient Projection and
Implicit Inductance Modeling},
author = {Ye, Cheng and Jia, Yankai and Song, Yusheng and Guo, Changxing and
Shen, Chuanwen},
journal = {Manuscript under review},
year = {2026},
note = {Code and processed data: https://github.com/KrisCCeng/SynRM-PINN}
}- Source code: MIT License.
- Released data and numerical result tables: CC BY 4.0.
Please cite both the associated paper and this repository when reusing the processed datasets.