motulator-gradnet: Gradient-Network Magnetic Models for motulator#
This package trains gradient networks (GradNets) that model the current and flux linkage maps of synchronous machines, including spatial harmonics, from measured or finite-element data [Li et al., 2026]. A GradNet is the gradient of a scalar state function, the magnetic energy or co-energy, so the map is a conservative vector field by construction [Chaudhari et al., 2025], and the monotonicity of the flux-linkage–current map is ensured. The networks are defined and trained with PyTorch. A trained network is saved as a NumPy function, which the magnetic maps of motulator evaluate in the machine models and control systems without PyTorch. The package also compares the trained maps with the data.
This documentation covers the training. The magnetic maps and the machine models are described in the documentation of motulator, which also has simulation examples using the trained maps.
Getting Started
Examples
Reference