# A PINN-Based Nonlinear PMSM Electromagnetic Model Using Differential Inductance Theory
## 3 Nonlinear Electromagnetic Modeling of PMSM
### The PINN Surrogate Model Based on Physical Priors of PMSM  
Since the differential inductance of the PMSM is unknown, the FEA dataset needs to be used to provide the output constraints. In this paper, the flux linkage is chosen as the output of the network. The flux linkage \(\bar{\Psi}_{dq0\_AA}\Big{(}\hat{\mathbf{i}}_{dq0},\theta_{e}\Big{)}\) is a quadratic function on the scalar \(\big{(}i_{d},i_{q},i_{0},\theta_{e}\big{)}\) which is dimensionally reduced by Fourier series decomposition to \(\mathbf{A}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}\) and \(\mathbf{B}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}\) a series of ternary functions, and the Fourier coefficients are independent of each other, so PINNs can be built separately, which can realize the parallel training and computation while reducing the number of inputs and guaranteeing the characteristics of the frequency domain. Let \(\mathbf{A}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}\), \(\mathbf{B}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}\) corresponding to the PINN input-output functions are, respectively, \(NN_{\text{A}}^{(n)}\Big{(}i_{dq0}\Big{)}\), \(NN_{\text{B}}^{(n)}\Big{(}i_{dq0}\Big{)}\), then the network predicted values \(\hat{\mathbf{A}}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}\), \(\mathbf{B}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}\), respectively:  
\[ \begin{cases}\hat{\mathbf{A}}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0} \Big{)}=NN_{\text{A}}^{(n)}\Big{(}i_{dq0}\Big{)}\\ \hat{\mathbf{B}}_{\text{f}}^{(n)}\Big{(}\hat{\mathbf{i}}_{dq0}\Big{)}=NN_{ \text{B}}^{(n)}\Big{(}i_{dq0}\Big{)}\end{cases}  \tag{35}\]  
Consider the structure of any network \(NN_{\text{A}}^{(n)}\Big{(}i_{dq0}\Big{)}\), each consisting of an input, a fully connected layer and a physical layer. The inputs of the network are:  
\[\mathbf{a}^{[0]}=\hat{\mathbf{i}}_{dq0}^{T}=\big{[}i_{d},i_{q},i_{0}\big{]} \tag{36}\]  
The forward propagation expression for the fully connected layer is:  
\[ \begin{split}&\mathbf{z}^{[l]}=\mathbf{a}^{[l-1]}\mathbf{W}^{[l]} +\mathbf{b}^{[l]}\\ &\mathbf{a}^{[l]}=\sigma\Big{(}\mathbf{z}^{[l]}\Big{)}\\ & l=1,2\ldots,L\end{split}  \tag{37}\]  
where the superscript \(l\) denotes the \(l\)th layer, \(L\) is the number of hidden layers, \(\mathbf{z}^{[l]}\), \(\mathbf{a}^{[l]}\), \(\mathbf{W}^{[l]}\), \(b^{(l)}\) are the outputs, activation values, weight matrices, and bias vectors of the \(l\)th layer, and \(\sigma\) is the activation function. The fully connected layer is connected to the physical layer. The role of the physical layer is to embed the will physical features of the object into the network  
Figure 2: Armature dq flux linkage surface in the OLAM method. **(a)** d-axis armature flux linkage; **(b)** q-axis armature flux linkage. Points P and Q denote FEA-sampled current points, while points M and N denote calculated excitation current points. The nonlinear relationship between flux linkage and current is treated as a differentiable manifold, and tangent planes provide an optimal first-order approximation of this surface. by means of hard constraints or loss functions. Take the cosine term Fourier coefficients \(\hat{\mathbf{A}}_{t}^{(n)}\Big{(}\mathbf{i}_{dq0}\Big{)}\) as an example. The following constraints exist for the PMSM system:  
* Constraint 1: \(\hat{\mathbf{A}}_{t}^{(n)}\Big{(}\mathbf{i}_{dq0}\Big{)}\) has zero curl: \[\
abla\times\mathbf{A}_{t}^{(n)}=\
abla\times\
abla A_{\text{coe}}^{(n)}=0\] (38)
* Constraint 2: \(\hat{\mathbf{A}}_{t}^{(n)}\Big{(}\mathbf{i}_{dq0}\Big{)}\) and \(A_{\text{coe}}^{(n)}\Big{(}\mathbf{i}_{dq0}\Big{)}\) initial conditions are zero: \[ \begin{cases}\mathbf{A}_{t}^{(n)}(0)=0\\ \mathbf{A}_{\text{coe}}^{(n)}(0)=0\end{cases} \] (39)  
Hard constraints can be constructed based on the above physical information. Assuming that the number of neurons in the first \(L\) hidden layer of the fully connected layer is 6, construct:  
\[\mathbf{L}_{\text{NN}}=