Example #1
0
        protected override void analyze()
        {
            FEMM femm = FEMM.DefaultFEMM;

            // open original femm file
            femm.open(Path_OriginalFEMFile);

            // modify current, freq
            femm.mi_probdef(Freq, FEMM.UnitsType.millimeters, FEMM.ProblemType.planar, 1e-8, Motor.GeneralParams.MotorLength, 7, FEMM.ACSolverType.Succ_Approx);
            string ia = string.Format("{0}", Current);
            string ib = string.Format("{0}+I*{1}", Current * Math.Cos(-2 * Math.PI / 3), Current * Math.Sin(-2 * Math.PI / 3));
            string ic = string.Format("{0}+I*{1}", Current * Math.Cos(2 * Math.PI / 3), Current * Math.Sin(2 * Math.PI / 3));

            femm.mi_modifycircuitCurrent("A", ia);
            femm.mi_modifycircuitCurrent("B", ib);
            femm.mi_modifycircuitCurrent("C", ic);

            // save as new file and analyze
            femm.mi_saveas(WorkingFEMFile);

            femm.mi_analyze(true);

            femm.mi_close();

            femm.open(WorkingANSFile);

            measureData(femm);

            femm.mo_close();
        }
Example #2
0
        /// <summary>
        /// Set current amps
        /// </summary>
        /// <param name="currents"></param>
        /// <param name="femm"></param>
        public override void SetStatorCurrentsInFEMM(IDictionary <String, double> currents, FEMM femm)
        {
            if (currents == null)
            {
                return;
            }
            // edit some transient params (usually stator currents) ?
            var tkeys = currents.Keys;

            foreach (String key in tkeys)
            {
                femm.mi_modifycircuitCurrent(key, currents[key]);
            }
        }