private void measureData(FEMM femm) { Stator3Phase stator = Motor.Stator as Stator3Phase; PM_ACAnalysisResults Results = this.Results as PM_ACAnalysisResults; //select block double r = (stator.xD + stator.xE) / 2; foreach (Stator3Phase.Coil sci in stator.coils) { int i = stator.coils.IndexOf(sci); //angle go clockwise from 3 o'clock (=0 degree in decarter), shift +pi/Q (to match rotor) int nn = stator.Q / (2 * Motor.Rotor.p); double aa = -2 * Math.PI * i / stator.Q + (nn % 2 == 0 ? Math.PI / stator.Q : 0); double x = r * Math.Cos(aa); double y = r * Math.Sin(aa); if (aa > -Motor.Rotor.alpha || aa < -2 * Math.PI + Motor.Rotor.alpha) { femm.mo_selectblock(x, y); } } double r2 = (stator.xF2 + stator.RGap) / 2; femm.mo_selectblock(r2, 0); // measure data double lossMagnetic = femm.mo_blockintegral(FEMM.BlockIntegralType.Losses_Hysteresis); double lossResistive = femm.mo_blockintegral(FEMM.BlockIntegralType.Losses_Resistive); Results.coefficient_lossMagnetic = lossMagnetic / (Current * Current * Freq * Freq); Results.coefficient_lossResistive = lossResistive / (Current * Current);//=3/2*R Results.freq = Freq; Results.current = Current; }