* The SIMULIA Blog is committed to providing high-quality simulation content that is technical and digestible for a broad audience of simulation enthusiasts. And that means connecting SIMULIA experts to our users by giving them a platform to educate and inform. Our newest series will focus on very technical concepts and simulations, delving deep into a particular topic. The following article, about various approaches for Reduced Order Model (ROM) creation in electrical machines, was written by Christian Kremers, Adrian Scott, and Nikolas Weber and was first published in automotive CAECompanion 2021/2022.*

The Finite Element Method (FEM) is a versatile, accurate and widely accepted method to simulate and analyze different aspects of the electromagnetic performance of electrical machines. However, there are also many aspects for which it is more efficient or rather the only possible approach to solve them in a system simulator, where electric circuits and mechanical subsystems can be simulated as one coupled system. This requires a representation of the electrical machine, which behaves in all regards as the FEM model but with a considerable reduction in computational complexity.

The generic term for such a model is reduced order model or short ROM. In the following, several approaches to construct ROMs by means of FEA will be investigated and compared with each other in terms of accuracy, performance, convergence and energy conservation properties. The machine used for this comparison is a 3-phase interior permanent magnet synchronous machine (IPMSM) with a rated peak current *I _{rated}* = 195 A, a rated torque

*T*= 340 Nm and 4 pole pairs. All FEM results have been obtained in 2D using CST Studio Suite® [1] under the assumption of loss less operation. The system simulator used for the comparison was Dymola [2], a system simulator based on the Modelica language.

_{rated}**Approaches to obtain ROMs**

All ROMs have in common that they map the input quantities, namely the currents and the rotor angle, onto the output quantities, magnetic flux linkages and torque. However, the mapping can be based either on phase quantities or alternatively on their respective quantities in the DQ-coordinate frame. The transformation between the two coordinate frames is given by the so called dq0-transformation [3]. No matter what coordinate frame is chosen, first a discretization of the input space (currents and rotor angle) is required to then capture the outputs (flux linkage and torque) as result of FEM analysis. After having simulated the discrete mapping between inputs and outputs, as next step a continuous mapping must be created for use in the system simulator.

In particular both a creation of lookup tables in phase- as well as in DQ-coordinate frame has been performed. To make the mapping continuous, a requirement for system simulation, the lookup tables, being phase- or DQ-ones, have been interpolated both linearly as well as with an Akima spline.

The grid for creating the lookup in terms of phase quantities was generated in the following way: The phase currents I_{u} and I_{v} have both been swept in 21 steps from -1.2 ⋅ *I _{rated}* to 1.2 ⋅

*I*. Assuming a star connection of the 3 phases (see Fig. 1a) the 3

_{rated}^{rd}phase current is given by

*I*= -(

_{w}*I*+

_{u}*I*). For each of the resulting 21 ⋅ 21 = 421 current vectors (

_{v}*I*, -(

_{u}, I_{v}*I*+

_{u}*I*)) the rotor has been rotated in 0.75° steps from 0° to 90° such that 120 positon steps per electrical period have been performed. The FEM outputs for each grid point are (

_{v}*ψ*) where

_{u}, ψ_{v}, ψ_{w}, T*ψ*stands for the flux linkage in the

_{i}*i*-phase and

*T*for the torque. When creating an interpolated lookup table from this data it is advantageous to reduce the degree of freedom by the transition of the circuit representation shown in Fig. 1a to the one in Fig. 1b. This transition does not change both line voltages

*V*and phase currents

_{ij}*I*. Therefore the outer behavior of the machine is not altered at all but one should keep in mind that there is no longer any way to obtain the phase voltages.

_{i}The grid in DQ-coordinate frame is generated with the same 120 position steps as above but with 21 current steps both in *I _{d}* and

*I*from -1.2 ⋅

_{q}*I*to 1.2 ⋅

_{rated}*I*. The FEA analysis is driven with the phase currents obtained by transforming (

_{rated}*I*) into phase currents by the dq0 transformation. The output of the FEA is as above (

_{d}, I_{q}*ψ*) but instead of using this data as is, the same dq0-transformation which transforms the currents is used to transform the flux linkages as well. However, the 0-component of the flux linkage does not vanish since it is not perfect balanced anymore. But using the transition from Fig. 1, one can remove the impact of the 0-component and therefore the output data for the lookup is made of (

_{u}, ψ_{v}, ψ_{w}, T*ψ*).

_{d}, ψ_{q}, TTo interpolate the lookup tables we have used NDTable from the SDF library shipped with Dymola. Linear and Akima spline interpolation used here are directly available in NDTable.

One additional approach for creating a machine’s ROM is the one shipped with CST Studio Suite®. The grid calculated by FEM analysis is exactly the same as in the DQ-case described above. However, the idea is not to interpolate fluxes and torque independently but instead interpolating a vector-valued function * f(I_{d}, I_{q}, θ*) =

*(ψ*) in such a way that energy-conservation is satisfied by construction. CST Studio Suite® encapsulates this type of ROM into a functional mockup unit (FMU) [4], which can be directly imported into Dymola.

_{d}, ψ_{q},T**Results**

The schematic of the common test case for the different implementations of ROMs is shown in Fig. 2a. A speed profile (Fig. 2b) is applied on the shaft of the machine and a load resistance of per phase is attached. Now the underlying ROM of the machine itself is replaced with ROMs of the different flavours described above.

The resulting torques and interlinked flux linkages *ψ _{u}* –

*ψ*≔

_{w}*ψ*are shown in Fig. 3. The reason to look at

_{uw}*ψ*as a relevant quantity is justified by Fig. 1b which shows the electric part of the machines schematic implemented in all of the different ROM approaches as well as the FEM reference (solid red).

_{uw}One sees in Fig 3a, which shows the complete timeline, that all approaches yield results quite similar to each other. So all of them seem to work reasonable well. However, if one looks at the magnified cutout Fig. 3b and 3c for torque and *ψ _{uw}* respectively, one can observe small differences in magnitude (in the order of 0.7% with respect to the FEM result) and, especially in the case of the interpolations based on phase quantities (black and orange dashed-dotted curves), somewhat distorted curve shapes for the torque. The distortion is more pronounced in the case of linear interpolation as expected. However, when the interpolation is performed in the DQ-coordinate frame both linear and spline interpolation give rather similar torques. A difference in the compared flux linkage quantity

*ψ*can hardly been seen even when magnified.

_{uw}Interesting is also a comparison of the execution times for the different ROM approaches.

Approach | abs. runtime [s] | rel. runtime [%] |

Phase, linear | 1.44 | 50 |

Phase, Akima | 7.32 | 254 |

DQ, linear | 0.814 | 28 |

DQ, Akima | 5.61 | 195 |

FMU | 2.88 | 100 |

FEM | 14000 | 486111 |

All system analyses have been performed with the variable step size DASSL integration method (default method in Dymola) with an accuracy set to 10^{-8} and an output step size of 10* μs*. The FEM analysis was performed with constant step size forward Euler method with the step size of 10 *μs*. Last but not least the various methods can be distinguished by their energy conserving behavior. To compare this the total energy given by *∫ _{0}^{t}(P_{gap} (t’) – P_{m}(t’)) dt*‘, where

*P*=

_{gap}*I*⋅

_{u}*(dψ*+

_{uw})/dt*I*⋅

_{v}*(dψ*is the instantaneous power in the magnetic field and

_{vw})/dt*P*=

_{m}*T⋅ ω*the mechanical power, is shown in Fig. 4. Energy conservation holds if (i) in the region of constant speed (green ellipse in Fig. 4) the average of total energy over a period stays constant and (ii) the total energy comes back to its initial value when the speed approaches 0. Looking at the results reveal that only the FMU approach and the FEM results are strictly energy conserving. All the flux, torque interpolation approaches in contrast violate this fundamental physical property in the order of 5 to 10%.

**Conclusion**

Various approaches for ROM creation for PMSM’s were described and compared with each other with regard to accuracy, execution speed and energy conservation. It was demonstrated that the violation of energy conservation resulting from look-up table based methods is not negligible even if the results show only small deviation compared with FEM. To fulfil energy conservation one has to incorporate this property in the interpolation of the vector-valued function** f**(I_{d,}, I_{q}, θ) = (ψ_{d,}, ψ_{q}, T).

**Literature**

[1] https://www.3ds.com/products-services/simulia/products/cst-studio-suite

[2] https://www.3ds.com/products-services/catia/products/dymola

[3] Gieras, J. F.: “Permanent Magnet Motor Technology”, CRC Press, 2009

*SIMULIA offers an advanced simulation product portfolio, including Abaqus, Isight, fe-safe, **Tosca**, **Simpoe-Mold**, **SIMPACK**, **CST Studio Suite**, **XFlow**, **PowerFLOW** and more. The **SIMULIA Community** is the place to find the latest resources for SIMULIA software and to collaborate with other users. The key that unlocks the door of innovative thinking and knowledge building, the SIMULIA Community provides you with the tools you need to expand your knowledge, whenever and wherever.*